ATSUnicodeFonts.pas 70 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700
  1. {
  2. File: QD/ATSUnicodeFonts.h
  3. Contains: ATSUI font handling functions.
  4. Version: Quickdraw-150~1
  5. Copyright: © 2003 by Apple Computer, Inc., all rights reserved.
  6. Bugs?: For bug reports, consult the following page on
  7. the World Wide Web:
  8. http://www.freepascal.org/bugs.html
  9. }
  10. { Pascal Translation: Peter N Lewis, <[email protected]>, 2004 }
  11. {
  12. Modified for use with Free Pascal
  13. Version 200
  14. Please report any bugs to <[email protected]>
  15. }
  16. {$mode macpas}
  17. {$packenum 1}
  18. {$macro on}
  19. {$inline on}
  20. {$CALLING MWPASCAL}
  21. unit ATSUnicodeFonts;
  22. interface
  23. {$setc UNIVERSAL_INTERFACES_VERSION := $0342}
  24. {$setc GAP_INTERFACES_VERSION := $0200}
  25. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  26. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  27. {$endc}
  28. {$ifc defined CPUPOWERPC and defined CPUI386}
  29. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  30. {$endc}
  31. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  32. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  33. {$endc}
  34. {$ifc not defined __ppc__ and defined CPUPOWERPC}
  35. {$setc __ppc__ := 1}
  36. {$elsec}
  37. {$setc __ppc__ := 0}
  38. {$endc}
  39. {$ifc not defined __i386__ and defined CPUI386}
  40. {$setc __i386__ := 1}
  41. {$elsec}
  42. {$setc __i386__ := 0}
  43. {$endc}
  44. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  45. {$error Conflicting definitions for __ppc__ and __i386__}
  46. {$endc}
  47. {$ifc defined __ppc__ and __ppc__}
  48. {$setc TARGET_CPU_PPC := TRUE}
  49. {$setc TARGET_CPU_X86 := FALSE}
  50. {$elifc defined __i386__ and __i386__}
  51. {$setc TARGET_CPU_PPC := FALSE}
  52. {$setc TARGET_CPU_X86 := TRUE}
  53. {$elsec}
  54. {$error Neither __ppc__ nor __i386__ is defined.}
  55. {$endc}
  56. {$setc TARGET_CPU_PPC_64 := FALSE}
  57. {$ifc defined FPC_BIG_ENDIAN}
  58. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  59. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  60. {$elifc defined FPC_LITTLE_ENDIAN}
  61. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  62. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  63. {$elsec}
  64. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  65. {$endc}
  66. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  67. {$setc CALL_NOT_IN_CARBON := FALSE}
  68. {$setc OLDROUTINENAMES := FALSE}
  69. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  70. {$setc OPAQUE_UPP_TYPES := TRUE}
  71. {$setc OTCARBONAPPLICATION := TRUE}
  72. {$setc OTKERNEL := FALSE}
  73. {$setc PM_USE_SESSION_APIS := TRUE}
  74. {$setc TARGET_API_MAC_CARBON := TRUE}
  75. {$setc TARGET_API_MAC_OS8 := FALSE}
  76. {$setc TARGET_API_MAC_OSX := TRUE}
  77. {$setc TARGET_CARBON := TRUE}
  78. {$setc TARGET_CPU_68K := FALSE}
  79. {$setc TARGET_CPU_MIPS := FALSE}
  80. {$setc TARGET_CPU_SPARC := FALSE}
  81. {$setc TARGET_OS_MAC := TRUE}
  82. {$setc TARGET_OS_UNIX := FALSE}
  83. {$setc TARGET_OS_WIN32 := FALSE}
  84. {$setc TARGET_RT_MAC_68881 := FALSE}
  85. {$setc TARGET_RT_MAC_CFM := FALSE}
  86. {$setc TARGET_RT_MAC_MACHO := TRUE}
  87. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  88. {$setc TYPE_BOOL := FALSE}
  89. {$setc TYPE_EXTENDED := FALSE}
  90. {$setc TYPE_LONGLONG := TRUE}
  91. uses MacTypes,ATSUnicodeTypes,SFNTTypes;
  92. {$ALIGN MAC68K}
  93. { ---------------------------------------------------------------------------- }
  94. { Font features }
  95. { ---------------------------------------------------------------------------- }
  96. {
  97. * ATSUSetFontFeatures()
  98. *
  99. * Summary:
  100. * Sets font features in a style object.
  101. *
  102. * Discussion:
  103. * This function enables you to set multiple font features for a
  104. * style object. Any unset font features retain their font-defined
  105. * default values. To set style attributes and font variations for a
  106. * style object, call the functions ATSUSetAttributes and
  107. * ATSUSetVariations, respectively. The constants that represent
  108. * font feature types are defined in the header file
  109. * SFNTLayoutTypes.h. When you use ATSUI to access and set font
  110. * features, you must use the constants defined in this header file,
  111. * which are described in "Inside Mac OS X: Rendering Unicode Text
  112. * With ATSUI". As feature types can be added at any time, you
  113. * should check Apple's font feature registry website for the most
  114. * up-to-date list of font feature types and selectors:
  115. * http://developer.apple.com/fonts/Registry/index.html.
  116. *
  117. * Parameters:
  118. *
  119. * iStyle:
  120. * The style object for which to set font features.
  121. *
  122. * iFeatureCount:
  123. * The number of font features to set. This value should
  124. * correspond to the number of elements in the iType and iSelector
  125. * arrays.
  126. *
  127. * iType:
  128. * An array of feature types. Each element in the array must
  129. * contain a valid feature type that corresponds to a feature
  130. * selector in the iSelector array. To obtain the valid feature
  131. * types for a font, call the function ATSUGetFontFeatureTypes .
  132. *
  133. * iSelector:
  134. * An array of feature selectors. Each element in the array must
  135. * contain a valid feature selector that corresponds to a feature
  136. * type in the iType array. To obtain the valid feature selectors
  137. * for a font, call the function ATSUGetFontFeatureSelectors .
  138. *
  139. * Result:
  140. * On success, noErr is returned. See MacErrors.h for possible error
  141. * codes.
  142. *
  143. * Availability:
  144. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  145. * CarbonLib: in CarbonLib 1.0 and later
  146. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  147. }
  148. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  149. function ATSUSetFontFeatures( iStyle: ATSUStyle; iFeatureCount: ItemCount; iType: ATSUFontFeatureTypePtr; iSelector: ATSUFontFeatureSelectorPtr ): OSStatus; external name '_ATSUSetFontFeatures';
  150. {
  151. * ATSUGetFontFeature()
  152. *
  153. * Summary:
  154. * Obtains the font feature corresponding to an index into an array
  155. * of font features for a style object.
  156. *
  157. * Discussion:
  158. * You might typically call ATSUGetFontFeature if you need to obtain
  159. * one previously set feature after another within your program's
  160. * processing loop. To obtain all previously set font features for a
  161. * given style object, you can call the function
  162. * ATSUGetAllFontFeatures. Before calling ATSUGetFontFeature, you
  163. * should call the function ATSUGetAllFontFeatures to obtain a count
  164. * of the font features that are set in the style object. You can
  165. * then pass the index for the feature whose setting you want to
  166. * obtain in the iTag and iMaximumValueSize parameters of
  167. * ATSUGetFontFeature.
  168. *
  169. * Parameters:
  170. *
  171. * iStyle:
  172. * The style you wish to obtain font feature information for.
  173. *
  174. * iFeatureIndex:
  175. * An index into the array of font features for the style object.
  176. * This index identifies the font feature to examine. Because this
  177. * index is zero-based, you must pass a value between 0 and one
  178. * less than the value produced in the oActualFeatureCount
  179. * parameter of the function ATSUGetAllFontFeatures.
  180. *
  181. * oFeatureType:
  182. * On return, the value identifies the font feature type
  183. * corresponding to the index passed in the iFeatureIndex
  184. * parameter. You must allocate space for ATSUGetFontFeature to
  185. * store this value.
  186. *
  187. * oFeatureSelector:
  188. * On return, the value identifies the font feature selector that
  189. * corresponds to the feature type produced in the oFeatureType
  190. * parameter. ou must allocate space for ATSUGetFontFeature to
  191. * store this value.
  192. *
  193. * Result:
  194. * On success, noErr is returned. See MacErrors.h for possible error
  195. * codes.
  196. *
  197. * Availability:
  198. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  199. * CarbonLib: in CarbonLib 1.0 and later
  200. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  201. }
  202. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  203. function ATSUGetFontFeature( iStyle: ATSUStyle; iFeatureIndex: ItemCount; oFeatureType: ATSUFontFeatureTypePtr; oFeatureSelector: ATSUFontFeatureSelectorPtr ): OSStatus; external name '_ATSUGetFontFeature';
  204. {
  205. * ATSUGetAllFontFeatures()
  206. *
  207. * Summary:
  208. * Obtains the font features of a style object that are not at
  209. * default settings.
  210. *
  211. * Discussion:
  212. * The ATSUGetAllFontFeatures function obtains all of a style
  213. * object's font features that are not at default settings. Font
  214. * features are grouped into categories called feature types, within
  215. * which individual feature selectors define particular feature
  216. * settings. The arrays produced by ATSUGetAllFontFeatures contain
  217. * constants identifying the object's font types and their
  218. * corresponding font selectors. Typically you use the function
  219. * ATSUGetAllFontFeatures by calling it twice, as follows: (1) Pass
  220. * a reference to the style object to examine in the iStyle
  221. * parameter, a valid pointer to an ItemCount value in the
  222. * oActualFeatureCount parameter, NULL for the oFeatureType and
  223. * oFeatureSelector parameters, and 0 for the iMaximumFeatureCount
  224. * parameter. ATSUGetAllFontFeatures returns the size in the
  225. * oActualFeatureCount parameter to use for the feature type and
  226. * selector arrays. (2) Allocate enough space for arrays of the
  227. * returned size, then call ATSUGetAllFontFeatures again, passing a
  228. * pointer to the arrays in the oFeatureType and oFeatureSelector
  229. * parameters. On return, the arrays contain the font feature types
  230. * and selectors, respectively, for the style object.
  231. *
  232. * Parameters:
  233. *
  234. * iStyle:
  235. * The style for which you wish to obtain font feature information.
  236. *
  237. * iMaximumFeatureCount:
  238. * The maximum number of feature types and selectors to obtain for
  239. * the style object. Typically, this is equivalent to the number
  240. * of ATSUFontFeatureType and ATSUFontFeatureSelector values for
  241. * which you have allocated memory in the oFeatureType and
  242. * oFeatureSelector parameters, respectively. To determine this
  243. * value, see the Discussion.
  244. *
  245. * oFeatureType:
  246. * On return, the array contains constants identifying each type
  247. * of font feature that is at a nondefault setting in the style
  248. * object. If you are uncertain of how much memory to allocate for
  249. * this array, see the Discussion. can be NULL
  250. *
  251. * oFeatureSelector:
  252. * On return, the array contains constants identifying the feature
  253. * selectors that are at nondefault settings in the style object.
  254. * Each selector determines the setting for a corresponding
  255. * feature type produced in the oFeatureType parameter. If you are
  256. * uncertain of how much memory to allocate for this array, see
  257. * the Discussion. can be NULL
  258. *
  259. * oActualFeatureCount:
  260. * On return, the value specifies the actual number of font
  261. * feature types and selectors in the style object. This may be
  262. * greater than the value you specified in the
  263. * iMaximumFeatureCount parameter. can be NULL
  264. *
  265. * Result:
  266. * On success, noErr is returned. See MacErrors.h for possible error
  267. * codes.
  268. *
  269. * Availability:
  270. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  271. * CarbonLib: in CarbonLib 1.0 and later
  272. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  273. }
  274. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  275. function ATSUGetAllFontFeatures( iStyle: ATSUStyle; iMaximumFeatureCount: ItemCount; oFeatureType: ATSUFontFeatureTypePtr; oFeatureSelector: ATSUFontFeatureSelectorPtr; oActualFeatureCount: ItemCountPtr ): OSStatus; external name '_ATSUGetAllFontFeatures';
  276. {
  277. * ATSUClearFontFeatures()
  278. *
  279. * Summary:
  280. * Restores default settings to the specified font features of a
  281. * style object.
  282. *
  283. * Discussion:
  284. * This function removes those font features that are identified by
  285. * the feature selector and type constants in the iSelector and
  286. * iType arrays and replaces them with their font-defined default
  287. * values. Note that if you pass ATSUClearFontFeatures a font
  288. * feature and selector that are already at default settings, the
  289. * function does not return an error. To restore default font
  290. * variations to a style object, call the function
  291. * ATSUClearFontVariations. To restore default style attributes to a
  292. * style object, call ATSUClearAttributes. To restore all default
  293. * settings to a style object (for font features, variations, and
  294. * style attributes), call the function ATSUClearStyle.
  295. *
  296. * Parameters:
  297. *
  298. * iStyle:
  299. * A style whose font features you wish to clear.
  300. *
  301. * iFeatureCount:
  302. * The number of font features to restore to default settings.
  303. * This value should correspond to the number of elements in the
  304. * iType and iSelector arrays. To restore default settings to all
  305. * the font features in the specified style object, pass the
  306. * constant kATSUClearAll in this parameter. In this case, the
  307. * values in the iType and iSelector parameters are ignored.
  308. *
  309. * iType:
  310. * An array of feature types. Each value should identify a font
  311. * feature to restore to its default setting. To obtain all
  312. * previously set font features for a given style object, you can
  313. * call the function ATSUGetAllFontFeatures. You may pass NULL for
  314. * this parameter if you are passing kATSUClearAll for the
  315. * iFeatureCount parameter. can be NULL
  316. *
  317. * iSelector:
  318. * An array of feature selectors. Each element in the array must
  319. * contain a valid feature selector corresponding to a font
  320. * feature you provide in the iType parameter. To obtain all
  321. * previously set feature selectors for a given style object, you
  322. * can call the function ATSUGetAllFontFeatures. You may pass NULL
  323. * for this parameter if you are passing kATSUClearAll for the
  324. * iFeatureCount parameter. can be NULL
  325. *
  326. * Result:
  327. * On success, noErr is returned. See MacErrors.h for possible error
  328. * codes.
  329. *
  330. * Availability:
  331. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  332. * CarbonLib: in CarbonLib 1.0 and later
  333. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  334. }
  335. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  336. function ATSUClearFontFeatures( iStyle: ATSUStyle; iFeatureCount: ItemCount; iType: ATSUFontFeatureTypePtr; iSelector: ATSUFontFeatureSelectorPtr ): OSStatus; external name '_ATSUClearFontFeatures';
  337. { ---------------------------------------------------------------------------- }
  338. { Font variations }
  339. { ---------------------------------------------------------------------------- }
  340. {
  341. * ATSUSetVariations()
  342. *
  343. * Summary:
  344. * Sets font variation axes and values in a style object.
  345. *
  346. * Discussion:
  347. * If you supply font variation axes and values to the
  348. * ATSUSetVariations function, you can change the appearance of a
  349. * style object's font accordingly. You may specify any number of
  350. * variation axes and values in a style object. Any of the font's
  351. * variations that you do not set retain their font-defined default
  352. * values. You can also use the ATSUSetVariations function to supply
  353. * your own value within any variation axes defined for the font.
  354. * However, if the font does not support the variation axis you
  355. * specify, your custom variation has no visual effect. By calling
  356. * the function ATSUGetIndFontVariation, you can obtain a variation
  357. * axis and its maximum, minimum, and default values for a font.
  358. *
  359. * Parameters:
  360. *
  361. * iStyle:
  362. * The style object for which to set font variation values.
  363. *
  364. * iVariationCount:
  365. * The number of font variation values to set. This value should
  366. * correspond to the number of elements in the iAxes and iValue
  367. * arrays.
  368. *
  369. * iAxes:
  370. * An array of font variation axes. Each element in the array must
  371. * represent a valid variation axis tag that corresponds to a
  372. * variation value in the iValue array. To obtain a valid
  373. * variation axis tag for a font, you can call the functions
  374. * ATSUGetIndFontVariation or ATSUGetFontInstance.
  375. *
  376. * iValue:
  377. * An array of font variation values. Each element in the array
  378. * must contain a value that is valid for the corresponding
  379. * variation axis in the iAxes parameter. You can obtain a font's
  380. * maximum, minimum, and default values for a given variation axis
  381. * by calling the function ATSUGetIndFontVariation . You can
  382. * obtain the font variation axis values for a font instance by
  383. * calling ATSUGetFontInstance.
  384. *
  385. * Result:
  386. * On success, noErr is returned. See MacErrors.h for possible error
  387. * codes.
  388. *
  389. * Availability:
  390. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  391. * CarbonLib: in CarbonLib 1.0 and later
  392. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  393. }
  394. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  395. function ATSUSetVariations( iStyle: ATSUStyle; iVariationCount: ItemCount; iAxes: ATSUFontVariationAxisPtr; iValue: ATSUFontVariationValuePtr ): OSStatus; external name '_ATSUSetVariations';
  396. {
  397. * ATSUGetFontVariationValue()
  398. *
  399. * Summary:
  400. * Obtains the current value for a single font variation axis in a
  401. * style object.
  402. *
  403. * Discussion:
  404. * This function obtains the setting for a specified font variation
  405. * axis in a style object. You might typically call
  406. * ATSUGetFontVariationValue if you need to obtain one previously
  407. * set variation axis value after another within your program's
  408. * processing loop. To obtain all nondefault font variation axis
  409. * values for a given style object, you can call the function
  410. * ATSUGetAllFontVariations. Before calling
  411. * ATSUGetFontVariationValue, call the function
  412. * ATSUGetAllFontVariations to obtain the font variation axes that
  413. * are set for the style object.
  414. *
  415. * Parameters:
  416. *
  417. * iStyle:
  418. * The style for which you want to obtain a variation value.
  419. *
  420. * iFontVariationAxis:
  421. * A tag specifying the style object's variation axis to examine.
  422. * You can obtain a list of variation axis tags that are set to
  423. * non-default values in a particular style object from the
  424. * function ATSUGetAllFontVariations.
  425. *
  426. * oFontVariationValue:
  427. * On return, ATSUGetFontVariationValue produces the currently set
  428. * value for the style object's specified variation axis. If this
  429. * value has not been set, ATSUGetFontVariationValue produces the
  430. * font-defined default value.
  431. *
  432. * Result:
  433. * On success, noErr is returned. See MacErrors.h for possible error
  434. * codes.
  435. *
  436. * Availability:
  437. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  438. * CarbonLib: in CarbonLib 1.0 and later
  439. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  440. }
  441. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  442. function ATSUGetFontVariationValue( iStyle: ATSUStyle; iFontVariationAxis: ATSUFontVariationAxis; oFontVariationValue: ATSUFontVariationValuePtr ): OSStatus; external name '_ATSUGetFontVariationValue';
  443. {
  444. * ATSUGetAllFontVariations()
  445. *
  446. * Summary:
  447. * Obtains a style object's font variation values that are not at
  448. * default settings.
  449. *
  450. * Discussion:
  451. * This function obtains all of a style object's font variation axes
  452. * that are not at default settings, as well as the current values
  453. * for the axes. Typically you use the function
  454. * ATSUGetAllFontVariations by calling it twice, as follows: (1)
  455. * Pass a reference to the style object to examine in the iStyle
  456. * parameter, a pointer to an ItemCount value in the
  457. * oActualVariationCount parameter, NULL for the oVariationAxes and
  458. * oFontVariationValues parameters, and 0 for the iVariationCount
  459. * parameter. ATSUGetAllFontVariations returns the size to use for
  460. * the variation axes and value arrays in the oActualVariationCount
  461. * parameter. (2) Allocate enough space for arrays of the returned
  462. * size, then call ATSUGetAllFontVariations again, passing a pointer
  463. * to the arrays in the oVariationAxes and oFontVariationValues
  464. * parameters. On return, the arrays contain the font variation axes
  465. * and their corresponding values, respectively, for the style
  466. * object.
  467. *
  468. * Parameters:
  469. *
  470. * iStyle:
  471. * A style for which you wish to obtain information about current
  472. * variation settings.
  473. *
  474. * iVariationCount:
  475. * The maximum number of font variation values to obtain for the
  476. * style object. Typically, this is equivalent to the number of
  477. * ATSUFontVariationAxis and ATSUFontVariationValue values for
  478. * which you have allocated memory in the oVariationAxes and
  479. * oFontVariationValues parameters, respectively. To determine
  480. * this value, see the Discussion.
  481. *
  482. * oVariationAxes:
  483. * On return, the array contains the current font variation values
  484. * for the font variation axes produced in the oVariationAxes
  485. * array. If you are uncertain of how much memory to allocate for
  486. * this array, see the Discussion. can be NULL
  487. *
  488. * oFontVariationValues:
  489. * On return, the value specifies the actual number of nondefault
  490. * font variation values in the style object. This may be greater
  491. * than the value you passed in the iVariationCount parameter. If
  492. * you are uncertain of how much memory to allocate for this
  493. * array, see the Discussion. can be NULL
  494. *
  495. * oActualVariationCount:
  496. * On return, the value specifies the actual number of nondefault
  497. * font variation values in the style object. This may be greater
  498. * than the value you passed in the iVariationCount parameter.
  499. * can be NULL
  500. *
  501. * Result:
  502. * On success, noErr is returned. See MacErrors.h for possible error
  503. * codes.
  504. *
  505. * Availability:
  506. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  507. * CarbonLib: in CarbonLib 1.0 and later
  508. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  509. }
  510. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  511. function ATSUGetAllFontVariations( iStyle: ATSUStyle; iVariationCount: ItemCount; oVariationAxes: ATSUFontVariationAxisPtr; oFontVariationValues: ATSUFontVariationValuePtr; oActualVariationCount: ItemCountPtr ): OSStatus; external name '_ATSUGetAllFontVariations';
  512. {
  513. * ATSUClearFontVariations()
  514. *
  515. * Summary:
  516. * Restores default values to the specified font variation axes of a
  517. * style object.
  518. *
  519. * Discussion:
  520. * The ATSUClearFontVariations function removes those font variation
  521. * axis values identified by variation axis tags in the iAxis array
  522. * and replaces them with their font-defined default values. You can
  523. * remove unset font variation values from a style object without a
  524. * function error. To restore default font features to a style
  525. * object, call the function ATSUClearFontFeatures. To restore
  526. * default style attributes, call ATSUClearAttributes. To restore
  527. * all default settings to a style object (for font features,
  528. * variations, and style attributes), call the function
  529. * ATSUClearStyle.
  530. *
  531. * Parameters:
  532. *
  533. * iStyle:
  534. * The style in which you wish to clear font variation settings.
  535. *
  536. * iAxisCount:
  537. * The number of font variation axes to restore to default
  538. * settings. This value should correspond to the number of
  539. * elements in the iAxis array. To restore default values to all
  540. * the font variation axes in the style object, pass the constant
  541. * kATSUClearAll in this parameter. If you pass kATSUClearAll the
  542. * value in the iAxis parameter is ignored.
  543. *
  544. * iAxis:
  545. * An array of font variation axes. Each element in the array must
  546. * contain a valid tag that corresponds to a font variation axis
  547. * to restore to its default setting. You can obtain variation
  548. * axis tags for a style object from the function
  549. * ATSUGetAllFontVariations. You may pass NULL for this parameter
  550. * if you are passing kATSUClearAll for the iAxisCount parameter. can be NULL
  551. *
  552. * Result:
  553. * On success, noErr is returned. See MacErrors.h for possible error
  554. * codes.
  555. *
  556. * Availability:
  557. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  558. * CarbonLib: in CarbonLib 1.0 and later
  559. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  560. }
  561. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  562. function ATSUClearFontVariations( iStyle: ATSUStyle; iAxisCount: ItemCount; iAxis: ATSUFontVariationAxisPtr ): OSStatus; external name '_ATSUClearFontVariations';
  563. { ---------------------------------------------------------------------------- }
  564. { Font ID's }
  565. { ---------------------------------------------------------------------------- }
  566. {
  567. * ATSUFontCount()
  568. *
  569. * Summary:
  570. * Obtains the number of ATSUI-compatible fonts installed on a
  571. * user's system.
  572. *
  573. * Discussion:
  574. * The ATSUFontCount function obtains the number of fonts on a
  575. * user's system that are compatible with ATSUI. Incompatible fonts
  576. * include those that cannot be used to represent Unicode, the
  577. * missing-character glyph font, and fonts whose names begin with a
  578. * period or a percent sign. You can use the count produced in the
  579. * oFontCount parameter to determine the amount of memory to
  580. * allocate for the oFontIDs array in the function ATSUGetFontIDs.
  581. * It is important to note that the set of installed
  582. * ATSUI-compatible fonts may change while your application is
  583. * running. In Mac OS X, the set of installed fonts may change at
  584. * any time. Although in Mac OS 9, fonts cannot be removed from the
  585. * Fonts folder while an application other than the Finder is
  586. * running, they can be removed from other locations, and it is
  587. * possible for fonts to be added. Additionally, just because the
  588. * number of fonts stays the same between two successive calls to
  589. * ATSUFontCount , this does not mean that the font lists are the
  590. * same. It is possible for a font to be added and another removed
  591. * between two successive calls to ATSUFontCount , leaving the total
  592. * number unchanged.
  593. *
  594. * Parameters:
  595. *
  596. * oFontCount:
  597. * On return, the number of ATSUI-compatible fonts installed on a
  598. * user's system.
  599. *
  600. * Result:
  601. * On success, noErr is returned. See MacErrors.h for possible error
  602. * codes.
  603. *
  604. * Availability:
  605. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  606. * CarbonLib: in CarbonLib 1.0 and later
  607. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  608. }
  609. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  610. function ATSUFontCount( var oFontCount: ItemCount ): OSStatus; external name '_ATSUFontCount';
  611. {
  612. * ATSUGetFontIDs()
  613. *
  614. * Summary:
  615. * Obtains a list of all the ATSUI-compatible fonts installed on the
  616. * user's system.
  617. *
  618. * Discussion:
  619. * Use the function ATSUFontCount to determine how much memory to
  620. * allocate before calling this function. Also see the discussion
  621. * for the ATSUFontCount function.
  622. *
  623. * Parameters:
  624. *
  625. * oFontIDs:
  626. * On return, the array contains unique identifiers for each of
  627. * the ATSUI-compatible fonts installed on the user's system. You
  628. * should allocate enough memory to contain an array the size of
  629. * the count produced by the function ATSUFontCount.
  630. *
  631. * iArraySize:
  632. * The maximum number of fonts to obtain. Typically, this is
  633. * equivalent to the number of ATSUFontID values for which you
  634. * have allocated memory in the oFontIDs parameter.
  635. *
  636. * oFontCount:
  637. * On return, the value specifies the actual number of
  638. * ATSUI-compatible fonts installed on the user's system. This may
  639. * be greater than the value you specified in the iArraySize
  640. * parameter. can be NULL
  641. *
  642. * Result:
  643. * On success, noErr is returned. See MacErrors.h for possible error
  644. * codes.
  645. *
  646. * Availability:
  647. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  648. * CarbonLib: in CarbonLib 1.0 and later
  649. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  650. }
  651. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  652. function ATSUGetFontIDs( oFontIDs: ATSUFontIDPtr; iArraySize: ItemCount; oFontCount: ItemCountPtr ): OSStatus; external name '_ATSUGetFontIDs';
  653. {
  654. * ATSUFONDtoFontID()
  655. *
  656. * Summary:
  657. * Finds the ATSUI font ID that corresponds to a font family number,
  658. * if one exists.
  659. *
  660. * Discussion:
  661. * This function is not recommended. Instead, use the function
  662. * FMGetFontFromFontFamilyInstance (see Fonts.h). FMFont values are
  663. * equivalent to ATSUFontID values.
  664. *
  665. * Availability:
  666. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  667. * CarbonLib: in CarbonLib 1.0 and later
  668. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  669. }
  670. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  671. function ATSUFONDtoFontID( iFONDNumber: SInt16; iFONDStyle: Style; var oFontID: ATSUFontID ): OSStatus; external name '_ATSUFONDtoFontID';
  672. {
  673. * ATSUFontIDtoFOND()
  674. *
  675. * Summary:
  676. * Finds the font family number and style that correspond to an
  677. * ATSUI font ID, if these exist.
  678. *
  679. * Discussion:
  680. * This function is not recommended. Instead, use the function
  681. * FMGetFontFamilyInstanceFromFont (see Fonts.h). FMFont values are
  682. * equivalent to ATSUFontID values.
  683. *
  684. * Availability:
  685. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  686. * CarbonLib: in CarbonLib 1.0 and later
  687. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  688. }
  689. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  690. function ATSUFontIDtoFOND( iFontID: ATSUFontID; var oFONDNumber: SInt16; var oFONDStyle: Style ): OSStatus; external name '_ATSUFontIDtoFOND';
  691. { ---------------------------------------------------------------------------- }
  692. { Font names }
  693. { ---------------------------------------------------------------------------- }
  694. {
  695. * ATSUCountFontNames()
  696. *
  697. * Summary:
  698. * Obtains the number of font names that correspond to a given ATSUI
  699. * font ID.
  700. *
  701. * Discussion:
  702. * This function obtains the number of font names defined in a font
  703. * name table for a given ATSUI font ID. This number includes
  704. * repetitions of the same name in different platforms, languages,
  705. * and scripts; names of font features, variations, tracking
  706. * settings, and instances for the font; and font names identified
  707. * by name code constants. You can pass an index value based on this
  708. * count to the function ATSUGetIndFontName to obtain a name string,
  709. * name code, platform, script, and language for a given ATSUI font
  710. * ID.
  711. *
  712. * Parameters:
  713. *
  714. * iFontID:
  715. * The font for which you wish to obtain the font name count.
  716. *
  717. * oFontNameCount:
  718. * On return, the value specifies the number of entries in the
  719. * font name table corresponding to the given ATSUI font ID.
  720. *
  721. * Result:
  722. * On success, noErr is returned. See MacErrors.h for possible error
  723. * codes.
  724. *
  725. * Availability:
  726. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  727. * CarbonLib: in CarbonLib 1.0 and later
  728. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  729. }
  730. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  731. function ATSUCountFontNames( iFontID: ATSUFontID; var oFontNameCount: ItemCount ): OSStatus; external name '_ATSUCountFontNames';
  732. {
  733. * ATSUGetIndFontName()
  734. *
  735. * Summary:
  736. * Obtains a name string, name code, platform, script, and language
  737. * for the font that matches an ATSUI font ID and name table index
  738. * value.
  739. *
  740. * Discussion:
  741. * Typically you use the ATSUGetIndFontName function by calling it
  742. * twice, as follows: (1) Pass valid values for the iFontID,
  743. * iFontNameIndex, and oActualNameLength parameters, 0 for the
  744. * iMaximumNameLength parameter, and NULL for the other parameters.
  745. * ATSUGetIndFontName returns the length of the font name string in
  746. * the oActualNameLength parameter. (2) Allocate enough space for a
  747. * buffer of the returned size, then call the function again,
  748. * passing a valid pointer to the buffer in the oName parameter. On
  749. * return, the buffer contains the font name string. To find a name
  750. * string and index value for the first font in a name table that
  751. * matches an ATSUI font ID and the specified font parameters, call
  752. * the function ATSUFindFontName. To obtain an ATSUI font ID for the
  753. * first font in a name table that matches the specified name
  754. * string, name code, platform, script, and/or language, call the
  755. * function ATSUFindFontFromName.
  756. *
  757. * Parameters:
  758. *
  759. * iFontID:
  760. * The font for which to obtain information. Note that because
  761. * Apple Type Services assigns ATSUFontID values systemwide at
  762. * runtime, font IDs can change across system restarts.
  763. *
  764. * iFontNameIndex:
  765. * An index to the font for which to obtain information. Because
  766. * this index must be 0-based, you should pass a value between 0
  767. * and one less than the count produced by the function
  768. * ATSUCountFontNames.
  769. *
  770. * iMaximumNameLength:
  771. * The maximum length of the font name string to obtain.
  772. * Typically, this is equivalent to the size of the buffer that
  773. * you have allocated in the oName parameter. To determine this
  774. * length, see the Discussion.
  775. *
  776. * oName:
  777. * On return, the buffer contains the name string of the font
  778. * matching the ATSUI font ID and name table index value being
  779. * passed. If the buffer you allocate is not large enough to
  780. * contain the name string, ATSUGetIndFontName produces a partial
  781. * string. If you are unsure how much memory to allocate for this
  782. * parameter, see the Discussion.
  783. *
  784. * oActualNameLength:
  785. * On return, the value specifies the actual length of the
  786. * complete name string. This may be greater than the value passed
  787. * in the iMaximumNameLength parameter. You should check this
  788. * value to ensure that you have allocated sufficient memory and
  789. * therefore obtained the complete name string for the font. can be NULL
  790. *
  791. * oFontNameCode:
  792. * On return, a value specifying the type of name returned (i.e.,
  793. * full name, postscript name) of the font. See SFNTTypes.h for a
  794. * list of possible values. can be NULL
  795. *
  796. * oFontNamePlatform:
  797. * On return, a value specifying the encoding of the font. See
  798. * SFNTTypes.h for a list of possible values. can be NULL
  799. *
  800. * oFontNameScript:
  801. * On return, a value specifying the script of the font. See
  802. * SFNTTypes.h for a list of possible values. can be NULL
  803. *
  804. * oFontNameLanguage:
  805. * On return, a value specifying the language of the font. See
  806. * SFNTTypes.h for a list of possible values. can be NULL
  807. *
  808. * Result:
  809. * On success, noErr is returned. See MacErrors.h for possible error
  810. * codes.
  811. *
  812. * Availability:
  813. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  814. * CarbonLib: in CarbonLib 1.0 and later
  815. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  816. }
  817. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  818. function ATSUGetIndFontName( iFontID: ATSUFontID; iFontNameIndex: ItemCount; iMaximumNameLength: ByteCount; oName: Ptr; oActualNameLength: ByteCountPtr; oFontNameCode: FontNameCodePtr; oFontNamePlatform: FontPlatformCodePtr; oFontNameScript: FontScriptCodePtr; oFontNameLanguage: FontLanguageCodePtr ): OSStatus; external name '_ATSUGetIndFontName';
  819. {
  820. * ATSUFindFontName()
  821. *
  822. * Summary:
  823. * Obtains a name string and index value for the first font in a
  824. * name table that matches the specified ATSUI font ID, name code,
  825. * platform, script, and/or language.
  826. *
  827. * Discussion:
  828. * Typically you use the ATSUFindFontName function by calling it
  829. * twice, as follows: (1) Pass NULL for the oName and oFontNameIndex
  830. * parameters, 0 for the iMaximumNameLength parameter, and valid
  831. * values for the other parameters. ATSUFindFontName returns the
  832. * length of the font name string in the oActualNameLength
  833. * parameter. (2) Allocate enough space for a buffer of the returned
  834. * size, then call the function again, passing a valid pointer to
  835. * the buffer in the oName parameter. On return, the buffer contains
  836. * the font name string. To obtain an ATSUI font ID for the first
  837. * font in a name table that matches the specified name string, name
  838. * code, platform, script, and/or language, call the function
  839. * ATSUFindFontFromName. To obtain the font name string, name code,
  840. * platform, script, and language for the font that matches an ATSUI
  841. * font ID and name table index, call the function
  842. * ATSUGetIndFontName. Although they will each accept NULL on input
  843. * individually, you must pass a vaild pointer to at least one of
  844. * the three parameters oName, oActualNameLength, or oFontNameIndex,
  845. * or ATSUFindFontName will return paramErr.
  846. *
  847. * Parameters:
  848. *
  849. * iFontID:
  850. * The font for which to obtain a name string. Note that because
  851. * Apple Type Services assigns ATSUFontID values systemwide at
  852. * runtime, font IDs can change across system restarts.
  853. *
  854. * iFontNameCode:
  855. * A constant specifying the FontNameCode value of the font for
  856. * which to obtain a name string. See the SFNTTypes.h header file
  857. * for a definition of the FontNameCode type and a list of
  858. * possible values.
  859. *
  860. * iFontNamePlatform:
  861. * A constant specifying the encoding of the font. See SFNTTypes.h
  862. * for possible values to pass for this parameter. If you pass the
  863. * kFontNoPlatformCode constant, ATSUFindFontName produces the
  864. * first font in the name table matching the other specified
  865. * parameters.
  866. *
  867. * iFontNameScript:
  868. * A constant specifying the script of the font. See SFNTTypes.h
  869. * for possible values to pass for this parameter. If you pass the
  870. * kFontNoScriptCode constant, ATSUFindFontName produces the first
  871. * font in the name table matching the other specified parameters.
  872. *
  873. * iFontNameLanguage:
  874. * A constant specifying the language of the font you are
  875. * searching for. See SFNTLayoutTypes.h for possible values to
  876. * pass for this parameter.
  877. *
  878. * iMaximumNameLength:
  879. * The maximum size of string you want ATSUFindFontName to return.
  880. * Typically, this value is equal to the size of the buffer you
  881. * have allocated for the oName parameter. To determine this
  882. * length, see the Discussion.
  883. *
  884. * oName:
  885. * On return, the name string of the first font in the font name
  886. * table matching your specified parameters. If the buffer you
  887. * allocate is not large enough, ATSUFindFontName produces a
  888. * partial string. If you are unsure how much space to allocate
  889. * for this parameter, see the Discussion. can be NULL
  890. *
  891. * oActualNameLength:
  892. * On return, specifies the actual length of the complete name
  893. * string. This may be greater than the value passed in the
  894. * iMaximumNameLength parameter. You should check this value to
  895. * ensure that you have allocated sufficient memory and therefore
  896. * obtained the complete name string for the font. can be NULL
  897. *
  898. * oFontNameIndex:
  899. * On return, the value provides a 0-based index to the font name
  900. * in the font name table. can be NULL
  901. *
  902. * Result:
  903. * On success, noErr is returned. See MacErrors.h for possible error
  904. * codes.
  905. *
  906. * Availability:
  907. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  908. * CarbonLib: in CarbonLib 1.0 and later
  909. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  910. }
  911. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  912. function ATSUFindFontName( iFontID: ATSUFontID; iFontNameCode: FontNameCode; iFontNamePlatform: FontPlatformCode; iFontNameScript: FontScriptCode; iFontNameLanguage: FontLanguageCode; iMaximumNameLength: ByteCount; oName: Ptr; oActualNameLength: ByteCountPtr; oFontNameIndex: ItemCountPtr ): OSStatus; external name '_ATSUFindFontName';
  913. {
  914. * ATSUFindFontFromName()
  915. *
  916. * Summary:
  917. * Obtains an ATSUI font ID for the first font in a name table that
  918. * matches the specified name string, name code, platform, script,
  919. * and/or language.
  920. *
  921. * Discussion:
  922. * Because ATSUI cannot guarantee the uniqueness of names among
  923. * installed fonts, ATSUFindFontFromName does not necessarily find
  924. * the only font that matches these parameters. As a result, you may
  925. * want to create a more sophisticated name-matching algorithm or
  926. * guarantee the uniqueness of names among installed fonts.
  927. *
  928. * Parameters:
  929. *
  930. * iName:
  931. * A pointer to a buffer containing the name string of the font
  932. * for which to obtain an ATSUI font ID.
  933. *
  934. * iNameLength:
  935. * The length, in bytes, of the name string provided in the iName
  936. * parameter.
  937. *
  938. * iFontNameCode:
  939. * A constant specifying the type of name to search for (i.e.,
  940. * full name, postcript name). See SFNTTypes.h for a list possible
  941. * values to pass for this parameter.
  942. *
  943. * iFontNamePlatform:
  944. * A constant specifying the encoding of the font you are
  945. * searching for. See SFNTTypes.h for possible values to pass for
  946. * this parameter. Pass kFontNoPlatformCode if you do not want to
  947. * limit your search to a particular encoding.
  948. *
  949. * iFontNameScript:
  950. * A constant specifying the script of the font you are searching
  951. * for. See SFNTTypes.h for possible values to pass for this
  952. * parameter. Pass kFontNoScriptCode if you do not want to limit
  953. * your search to a particular script.
  954. *
  955. * iFontNameLanguage:
  956. * A constant specifying the language of the font you are
  957. * searching for. See SFNTTypes.h for possible values to pass for
  958. * this parameter. Pass kFontNoLanguageCode if you do not want to
  959. * limit your search to a particular language.
  960. *
  961. * oFontID:
  962. * On return, the value provides a unique identifier for the
  963. * specified font. If no installed font matches the specified
  964. * parameters, kATSUInvalidFontID is returned for this parameter.
  965. *
  966. * Result:
  967. * On success, noErr is returned. If the font cannot be found,
  968. * kATSUInvalidFontErr is returned. See MacErrors.h for other
  969. * possible error codes.
  970. *
  971. * Availability:
  972. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  973. * CarbonLib: in CarbonLib 1.0 and later
  974. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  975. }
  976. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  977. function ATSUFindFontFromName( iName: Ptr; iNameLength: ByteCount; iFontNameCode: FontNameCode; iFontNamePlatform: FontPlatformCode; iFontNameScript: FontScriptCode; iFontNameLanguage: FontLanguageCode; var oFontID: ATSUFontID ): OSStatus; external name '_ATSUFindFontFromName';
  978. { ---------------------------------------------------------------------------- }
  979. { Font features }
  980. { ---------------------------------------------------------------------------- }
  981. {
  982. * ATSUCountFontFeatureTypes()
  983. *
  984. * Summary:
  985. * Obtains the number of available feature types in a font.
  986. *
  987. * Discussion:
  988. * This function function obtains the total number of feature types
  989. * defined for a font. You can use the count produced by
  990. * ATSUCountFontFeatureTypes to determine how much memory to
  991. * allocate for the oTypes array in the function
  992. * ATSUGetFontFeatureTypes.
  993. *
  994. * Parameters:
  995. *
  996. * iFontID:
  997. * The font for which to obtain a count of feature types.
  998. *
  999. * oTypeCount:
  1000. * On return, the actual number of feature types defined for the
  1001. * font.
  1002. *
  1003. * Result:
  1004. * On success, noErr is returned. See MacErrors.h for possible error
  1005. * codes.
  1006. *
  1007. * Availability:
  1008. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1009. * CarbonLib: in CarbonLib 1.0 and later
  1010. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  1011. }
  1012. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  1013. function ATSUCountFontFeatureTypes( iFontID: ATSUFontID; var oTypeCount: ItemCount ): OSStatus; external name '_ATSUCountFontFeatureTypes';
  1014. {
  1015. * ATSUCountFontFeatureSelectors()
  1016. *
  1017. * Summary:
  1018. * Obtains the number of available feature selectors for a given
  1019. * feature type in a font.
  1020. *
  1021. * Discussion:
  1022. * This function obtains the total number of feature selectors
  1023. * defined for a given feature type in the font. You can use the
  1024. * count produced by ATSUCountFontFeatureSelectors to determine how
  1025. * much memory to allocate for the oSelectors array in the function
  1026. * ATSUGetFontFeatureSelectors.
  1027. *
  1028. * Parameters:
  1029. *
  1030. * iFontID:
  1031. * The font for which to obtain feature selector information.
  1032. *
  1033. * iType:
  1034. * A value specifying one of the font's supported feature types.
  1035. * To obtain the available feature types for a font, call the
  1036. * function ATSUGetFontFeatureTypes.
  1037. *
  1038. * oSelectorCount:
  1039. * On return, specifies the actual number of feature selectors
  1040. * defined for the feature type by the font.
  1041. *
  1042. * Result:
  1043. * On success, noErr is returned. See MacErrors.h for possible error
  1044. * codes.
  1045. *
  1046. * Availability:
  1047. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1048. * CarbonLib: in CarbonLib 1.0 and later
  1049. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  1050. }
  1051. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  1052. function ATSUCountFontFeatureSelectors( iFontID: ATSUFontID; iType: ATSUFontFeatureType; var oSelectorCount: ItemCount ): OSStatus; external name '_ATSUCountFontFeatureSelectors';
  1053. {
  1054. * ATSUGetFontFeatureTypes()
  1055. *
  1056. * Summary:
  1057. * Obtains the available feature types of a font.
  1058. *
  1059. * Discussion:
  1060. * A given font may not support all possible feature types and
  1061. * selectors. If you select features that are not available in a
  1062. * font, you won't see a change in the glyph's appearance. To
  1063. * determine the available features of a font, you can call the
  1064. * functions ATSUGetFontFeatureTypes and
  1065. * ATSUGetFontFeatureSelectors. The ATSUGetFontFeatureTypes function
  1066. * reads the font data table for the specified font and obtains its
  1067. * supported feature types. You can then use this information both
  1068. * to present the user a list of font features from which to select
  1069. * and to call such functions as ATSUSetFontFeatures with more
  1070. * accuracy.
  1071. *
  1072. * Parameters:
  1073. *
  1074. * iFontID:
  1075. * The font for which to obtain information about feature types.
  1076. *
  1077. * iMaximumTypes:
  1078. * The maximum number of feature types to obtain for the font.
  1079. * Typically, this is equivalent to the number of elements in the
  1080. * oTypes array.
  1081. *
  1082. * oTypes:
  1083. * A pointer to memory you have allocated for an array of
  1084. * ATSUFontFeatureType values. You can call the function
  1085. * ATSUCountFontFeatureTypes to obtain the number of available
  1086. * feature types for a given font and thus determine the amount of
  1087. * memory to allocate. On return, the array contains constants
  1088. * identifying each type of feature that is defined for the font.
  1089. * The constants that represent font feature types are defined in
  1090. * the header file SFNTLayoutTypes.h and are described in the
  1091. * official ATSUI documentation, available on the Apple developer
  1092. * website. can be NULL
  1093. *
  1094. * oActualTypeCount:
  1095. * On return, the actual number of feature types defined in the
  1096. * font. This may be greater than the value you specify in the
  1097. * iMaximumTypes parameter. can be NULL
  1098. *
  1099. * Result:
  1100. * On success, noErr is returned. See MacErrors.h for possible error
  1101. * codes.
  1102. *
  1103. * Availability:
  1104. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1105. * CarbonLib: in CarbonLib 1.0 and later
  1106. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  1107. }
  1108. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  1109. function ATSUGetFontFeatureTypes( iFontID: ATSUFontID; iMaximumTypes: ItemCount; oTypes: ATSUFontFeatureTypePtr; oActualTypeCount: ItemCountPtr ): OSStatus; external name '_ATSUGetFontFeatureTypes';
  1110. {
  1111. * ATSUGetFontFeatureSelectors()
  1112. *
  1113. * Summary:
  1114. * Obtains the available feature selectors for a given feature type
  1115. * in a font.
  1116. *
  1117. * Discussion:
  1118. * A given font may not support all possible feature types and
  1119. * selectors. If you select features that are not available in a
  1120. * font, you won't see a change in the glyph's appearance. To
  1121. * determine the available features of a font, you can call the
  1122. * functions ATSUGetFontFeatureTypes and
  1123. * ATSUGetFontFeatureSelectors. The ATSUGetFontFeatureSelectors
  1124. * function reads the font data table for the specified font and
  1125. * obtains its supported feature selectors for the given feature
  1126. * types. You can then use this information both to present the user
  1127. * a list of font features from which to select and to call such
  1128. * functions as ATSUSetFontFeatures with more accuracy.
  1129. *
  1130. * Parameters:
  1131. *
  1132. * iFontID:
  1133. * The font for which to obtain feature selectors.
  1134. *
  1135. * iType:
  1136. * An ATSUFontFeatureType value specifying one of the font's
  1137. * supported feature types. To obtain the available feature types
  1138. * for a font, call the function ATSUGetFontFeatureTypes.
  1139. *
  1140. * iMaximumSelectors:
  1141. * An ItemCount value specifying the maximum number of feature
  1142. * selectors to obtain for the font's specified feature type.
  1143. * Typically, this is equivalent to the number of elements in the
  1144. * oSelectors array.
  1145. *
  1146. * oSelectors:
  1147. * A pointer to memory you have allocated for an array of
  1148. * ATSUFontFeatureSelector values. You can call the function
  1149. * ATSUCountFontFeatureSelectors to obtain the number of available
  1150. * feature selectors for a given font feature type and thus
  1151. * determine the amount of memory to allocate. On return, the
  1152. * array contains constants identifying each available feature
  1153. * selector for the given feature type. The constants that
  1154. * represent font feature selectors are defined in the header file
  1155. * SFNTLayoutTypes.h and are described in the official ATSUI
  1156. * documentation, available on the Apple developer website. can be NULL
  1157. *
  1158. * oSelectorIsOnByDefault:
  1159. * A pointer to memory you have allocated for an array of Boolean
  1160. * values. The number of elements in this array should correspond
  1161. * to the number of elements in the oSelectors array. On return,
  1162. * the array contains Boolean values indicating whether the
  1163. * corresponding feature selector in the oSelectors array is on or
  1164. * off. If true, the feature selector is on by default; if false,
  1165. * off. can be NULL
  1166. *
  1167. * oActualSelectorCount:
  1168. * On return, the value specifies the actual number of feature
  1169. * selectors defined for the given feature type. This value may be
  1170. * greater than the value you specify in the iMaximumSelectors
  1171. * parameter. can be NULL
  1172. *
  1173. * oIsMutuallyExclusive:
  1174. * On return, the value indicates whether the feature selectors
  1175. * for the given feature type are exclusive or nonexclusive. If a
  1176. * feature type is exclusive you can choose only one of its
  1177. * available feature selectors at a time, such as whether to
  1178. * display numbers as proportional or fixed-width. If a feature
  1179. * type is nonexclusive, you can enable any number of feature
  1180. * selectors at once. If true , the feature type is exclusive and
  1181. * only one selector can be used at a time. can be NULL
  1182. *
  1183. * Result:
  1184. * On success, noErr is returned. See MacErrors.h for possible error
  1185. * codes.
  1186. *
  1187. * Availability:
  1188. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1189. * CarbonLib: in CarbonLib 1.0 and later
  1190. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  1191. }
  1192. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  1193. function ATSUGetFontFeatureSelectors( iFontID: ATSUFontID; iType: ATSUFontFeatureType; iMaximumSelectors: ItemCount; oSelectors: ATSUFontFeatureSelectorPtr; oSelectorIsOnByDefault: BooleanPtr; oActualSelectorCount: ItemCountPtr; oIsMutuallyExclusive: BooleanPtr ): OSStatus; external name '_ATSUGetFontFeatureSelectors';
  1194. {
  1195. * ATSUGetFontFeatureNameCode()
  1196. *
  1197. * Summary:
  1198. * btains the name code for a font's feature type or selector that
  1199. * matches an ASTUI font ID, feature type, and feature selector.
  1200. *
  1201. * Discussion:
  1202. * This function obtains the name code for a font's feature type or
  1203. * selector that matches an ASTUI font ID, feature type and feature
  1204. * selector values. By default, ATSUGetFontFeatureNameCode function
  1205. * obtains the name code of a feature selector. To determine the
  1206. * name code of a feature type, pass the constant kATSUNoSelector in
  1207. * the iSelector parameter. You can use the function
  1208. * ATSUFindFontName to obtain the localized name string for the name
  1209. * code produced by ATSUGetFontFeatureNameCode.
  1210. *
  1211. * Parameters:
  1212. *
  1213. * iFontID:
  1214. * The font for which to obtain the name code for a feature type
  1215. * or selector.
  1216. *
  1217. * iType:
  1218. * A constant identifying a valid feature type. To obtain the
  1219. * valid feature types for a font, call the function
  1220. * ATSUGetFontFeatureTypes.
  1221. *
  1222. * iSelector:
  1223. * A constant identifying a valid feature selector that
  1224. * corresponds to the feature type passed in the iType parameter.
  1225. * If you pass the constant kATSUNoSelector, the name code
  1226. * produced by ATSUGetFontFeatureNameCode is that of the feature
  1227. * type, not the feature selector. To obtain the valid feature
  1228. * selectors for a font, call the function
  1229. * ATSUGetFontFeatureSelectors.
  1230. *
  1231. * oNameCode:
  1232. * On return, the value contains the name code for the font
  1233. * feature selector or type. See the SFNTTypes.h header file for a
  1234. * definition of the FontNameCode type and a list of possible
  1235. * values.
  1236. *
  1237. * Result:
  1238. * On success, noErr is returned. See MacErrors.h for possible error
  1239. * codes.
  1240. *
  1241. * Availability:
  1242. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1243. * CarbonLib: in CarbonLib 1.0 and later
  1244. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  1245. }
  1246. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  1247. function ATSUGetFontFeatureNameCode( iFontID: ATSUFontID; iType: ATSUFontFeatureType; iSelector: ATSUFontFeatureSelector; var oNameCode: FontNameCode ): OSStatus; external name '_ATSUGetFontFeatureNameCode';
  1248. { ---------------------------------------------------------------------------- }
  1249. { Font tracking value & names }
  1250. { ---------------------------------------------------------------------------- }
  1251. {
  1252. * ATSUCountFontTracking()
  1253. *
  1254. * Summary:
  1255. * Obtains the number of entries in the font tracking table that
  1256. * correspond to a given ATSUI font ID and glyph orientation.
  1257. *
  1258. * Discussion:
  1259. * This function obtains the number of font tracking entries defined
  1260. * in a font tracking table for a given ATSUI font ID and glyph
  1261. * orientation. You can pass an index value based on this count to
  1262. * the function ATSUGetIndFontTracking to obtain the name code and
  1263. * tracking value of a font tracking.
  1264. *
  1265. * Parameters:
  1266. *
  1267. * iFontID:
  1268. * The font for which to obtain tracking table information.
  1269. *
  1270. * iCharacterOrientation:
  1271. * A constant identifying the glyph orientation of the font
  1272. * tracking entries. See the definition of
  1273. * ATSUVerticalCharacterType for a list of possible values.
  1274. *
  1275. * oTrackingCount:
  1276. * On return, the number of entries in the font tracking table
  1277. * corresponding to the given ATSUI font ID and glyph orientation.
  1278. *
  1279. * Result:
  1280. * On success, noErr is returned. See MacErrors.h for possible error
  1281. * codes.
  1282. *
  1283. * Availability:
  1284. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1285. * CarbonLib: in CarbonLib 1.0 and later
  1286. * Non-Carbon CFM: in ATSUnicodeLib 8.6 and later
  1287. }
  1288. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  1289. function ATSUCountFontTracking( iFontID: ATSUFontID; iCharacterOrientation: ATSUVerticalCharacterType; var oTrackingCount: ItemCount ): OSStatus; external name '_ATSUCountFontTracking';
  1290. {
  1291. * ATSUGetIndFontTracking()
  1292. *
  1293. * Summary:
  1294. * Obtains the name code and tracking value for the font tracking
  1295. * that matches an ASTUI font ID, glyph orientation, and tracking
  1296. * table index.
  1297. *
  1298. * Discussion:
  1299. * You can call the ATSUGetIndFontTracking function to obtain the
  1300. * name code and tracking value that matches the specified ATSUI
  1301. * font ID, glyph orientation, and tracking table index value. This
  1302. * information allows you to manipulate tracking settings for a
  1303. * style using this font via the kATSUTrackingTag attribute. You can
  1304. * use the function ATSUFindFontName to obtain the localized name
  1305. * string for the name code produced by ATSUGetIndFontTracking.
  1306. *
  1307. * Parameters:
  1308. *
  1309. * iFontID:
  1310. * The font for which to obtain tracking information.
  1311. *
  1312. * iCharacterOrientation:
  1313. * A constant identifying the glyph orientation of the font
  1314. * tracking entries. See the definition of
  1315. * ATSUVerticalCharacterType for a list of possible values.
  1316. *
  1317. * iTrackIndex:
  1318. * An index to the font tracking for which to obtain information.
  1319. * Because this index must be 0-based, you should pass a value
  1320. * between 0 and one less than the count produced by the function
  1321. * ATSUCountFontTracking.
  1322. *
  1323. * oFontTrackingValue:
  1324. * On return, the value contains the font tracking value.
  1325. *
  1326. * oNameCode:
  1327. * On return, the value contains the name code for the font
  1328. * tracking. See the SFNTTypes.h header file for a definition of
  1329. * the FontNameCode type and a list of possible values.
  1330. *
  1331. * Result:
  1332. * On success, noErr is returned. See MacErrors.h for possible error
  1333. * codes.
  1334. *
  1335. * Availability:
  1336. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1337. * CarbonLib: in CarbonLib 1.0 and later
  1338. * Non-Carbon CFM: in ATSUnicodeLib 8.6 and later
  1339. }
  1340. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  1341. function ATSUGetIndFontTracking( iFontID: ATSUFontID; iCharacterOrientation: ATSUVerticalCharacterType; iTrackIndex: ItemCount; var oFontTrackingValue: Fixed; var oNameCode: FontNameCode ): OSStatus; external name '_ATSUGetIndFontTracking';
  1342. { ---------------------------------------------------------------------------- }
  1343. { Font variations }
  1344. { ---------------------------------------------------------------------------- }
  1345. {
  1346. * ATSUCountFontVariations()
  1347. *
  1348. * Summary:
  1349. * Obtains the number of defined variation axes in a font.
  1350. *
  1351. * Discussion:
  1352. * This function function obtains the total number of variation axes
  1353. * defined for a font. You can use the count produced by
  1354. * ATSUCountFontVariations to get information about a specific font
  1355. * variation axis from the function ATSUGetIndFontVariation.
  1356. *
  1357. * Parameters:
  1358. *
  1359. * iFontID:
  1360. * The font for which to obtain a count of variation axes.
  1361. *
  1362. * oVariationCount:
  1363. * On return, a count of the number of variation axes defined for
  1364. * the font.
  1365. *
  1366. * Result:
  1367. * On success, noErr is returned. See MacErrors.h for possible error
  1368. * codes.
  1369. *
  1370. * Availability:
  1371. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1372. * CarbonLib: in CarbonLib 1.0 and later
  1373. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  1374. }
  1375. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  1376. function ATSUCountFontVariations( iFontID: ATSUFontID; var oVariationCount: ItemCount ): OSStatus; external name '_ATSUCountFontVariations';
  1377. {
  1378. * ATSUGetIndFontVariation()
  1379. *
  1380. * Summary:
  1381. * Obtains a variation axis and its value range for a font.
  1382. *
  1383. * Discussion:
  1384. * By calling this function, you can obtain a variation axis and its
  1385. * maximum, minimum, and default values for a font. If you supply
  1386. * font variation axes and values to the function ATSUSetVariations,
  1387. * you can change the appearance of a style object's font
  1388. * accordingly. Note that while you may pass NULL for any of the
  1389. * output parameters, at least one must be non-NULL or paramErr will
  1390. * be returned.
  1391. *
  1392. * Parameters:
  1393. *
  1394. * iFontID:
  1395. * A font for which to obtain variation information for.
  1396. *
  1397. * iVariationIndex:
  1398. * A value specifying an index into the array of variation axes
  1399. * for the font. This index identifies the font variation axis to
  1400. * examine. Because this index is zero-based, you must pass a
  1401. * value between 0 and one less than the value produced in the
  1402. * oVariationCount parameter of the function
  1403. * ATSUCountFontVariations.
  1404. *
  1405. * oATSUFontVariationAxis:
  1406. * On return, a four-character code identifying the font variation
  1407. * axis corresponding to the specified index. can be NULL
  1408. *
  1409. * oMinimumValue:
  1410. * On return, the variation axis minimum. can be NULL
  1411. *
  1412. * oMaximumValue:
  1413. * On return, the variation axis maximum. can be NULL
  1414. *
  1415. * oDefaultValue:
  1416. * On return, the variation axis default. can be NULL
  1417. *
  1418. * Result:
  1419. * On success, noErr is returned. See MacErrors.h for possible error
  1420. * codes.
  1421. *
  1422. * Availability:
  1423. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1424. * CarbonLib: in CarbonLib 1.0 and later
  1425. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  1426. }
  1427. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  1428. function ATSUGetIndFontVariation( iFontID: ATSUFontID; iVariationIndex: ItemCount; oATSUFontVariationAxis: ATSUFontVariationAxisPtr; oMinimumValue: ATSUFontVariationValuePtr; oMaximumValue: ATSUFontVariationValuePtr; oDefaultValue: ATSUFontVariationValuePtr ): OSStatus; external name '_ATSUGetIndFontVariation';
  1429. {
  1430. * ATSUGetFontVariationNameCode()
  1431. *
  1432. * Summary:
  1433. * Obtains the name code for the font variation that matches an
  1434. * ASTUI font ID and font variation axis.
  1435. *
  1436. * Discussion:
  1437. * This function function obtains the name code for the font
  1438. * variation that matches an ASTUI font ID and font variation axis
  1439. * tag. You can use the function ATSUFindFontName to obtain the
  1440. * localized name string for the name code produced by
  1441. * ATSUGetFontVariationNameCode.
  1442. *
  1443. * Parameters:
  1444. *
  1445. * iFontID:
  1446. * The font for which to obtain a font variation name code.
  1447. *
  1448. * iAxis:
  1449. * An ATSUFontVariationAxis value representing a valid variation
  1450. * axis tag. To obtain a valid variation axis tag for a font, you
  1451. * can call the functions ATSUGetIndFontVariation or
  1452. * ATSUGetFontInstance.
  1453. *
  1454. * oNameCode:
  1455. * On return, the value contains the name code for the font
  1456. * variation. See the SFNTTypes.h header file for a definition of
  1457. * the FontNameCode type and a list of possible values.
  1458. *
  1459. * Result:
  1460. * On success, noErr is returned. See MacErrors.h for possible error
  1461. * codes.
  1462. *
  1463. * Availability:
  1464. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1465. * CarbonLib: in CarbonLib 1.0 and later
  1466. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  1467. }
  1468. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  1469. function ATSUGetFontVariationNameCode( iFontID: ATSUFontID; iAxis: ATSUFontVariationAxis; var oNameCode: FontNameCode ): OSStatus; external name '_ATSUGetFontVariationNameCode';
  1470. { ---------------------------------------------------------------------------- }
  1471. { Font Instances }
  1472. { ---------------------------------------------------------------------------- }
  1473. {
  1474. * ATSUCountFontInstances()
  1475. *
  1476. * Summary:
  1477. * Obtains the number of defined font instances in a font.
  1478. *
  1479. * Discussion:
  1480. * This function obtains the total number of font instances defined
  1481. * in a font. You can use an index value derived from this count to
  1482. * get information about a specific font instance by calling the
  1483. * function ATSUGetFontInstance.
  1484. *
  1485. * Parameters:
  1486. *
  1487. * iFontID:
  1488. * The font for which to obtain a count of defined instances.
  1489. *
  1490. * oInstances:
  1491. * On return, the value specifies the number of font instances
  1492. * defined for the font.
  1493. *
  1494. * Result:
  1495. * On success, noErr is returned. See MacErrors.h for possible error
  1496. * codes.
  1497. *
  1498. * Availability:
  1499. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1500. * CarbonLib: in CarbonLib 1.0 and later
  1501. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  1502. }
  1503. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  1504. function ATSUCountFontInstances( iFontID: ATSUFontID; var oInstances: ItemCount ): OSStatus; external name '_ATSUCountFontInstances';
  1505. {
  1506. * ATSUGetFontInstance()
  1507. *
  1508. * Summary:
  1509. * Obtains the font variation axis values for a font instance.
  1510. *
  1511. * Discussion:
  1512. * with a minimum value of 0.0, a default of 0.5, and a maximum of
  1513. * 1.0. Additionally, the variation axis 'wdth' is also defined for
  1514. * the font, with a similar value range. The type designer can then
  1515. * choose to declare a font instance for a set of specific values
  1516. * within these axes, such as ÒDemiboldÓ for a value of 0.8 for the
  1517. * 'wght' axis and 0.5 for the 'wdth' axis. By calling the function
  1518. * ATSUGetFontInstance , you can obtain the variation axis values
  1519. * for a given index into an array of font instances. Typically you
  1520. * use the function ATSUGetFontInstance by calling it twice, as
  1521. * follows: (1) Pass the ID of the font to examine in the iFont
  1522. * parameter, a valid pointer to an ItemCount value in the
  1523. * oActualVariationCount parameter, NULL for the oAxes and oValues
  1524. * parameters, and 0 for the other parameters. ATSUGetFontInstance
  1525. * returns the size to use for the oAxes and oValues arrays in the
  1526. * oActualVariationCount parameter. (2) Allocate enough space for
  1527. * arrays of the returned size, then call the ATSUGetFontInstance
  1528. * again, passing pointers to the arrays in the oAxes and oValues
  1529. * parameters. On return, the arrays contain the font variation axes
  1530. * and their corresponding values, respectively, for the font
  1531. * instance.
  1532. *
  1533. * Parameters:
  1534. *
  1535. * iFontID:
  1536. * The font for which to obtain instance information.
  1537. *
  1538. * iFontInstanceIndex:
  1539. * An index into an array of instances for the font. This index
  1540. * identifies the font instance to examine. Because this index is
  1541. * zero-based, you must pass a value between 0 and one less than
  1542. * the value produced in the oInstances parameter of the function
  1543. * ATSUCountFontInstances.
  1544. *
  1545. * iMaximumVariations:
  1546. * The maximum number of font variation axes to obtain for the
  1547. * font instance. Typically, this is equivalent to the number of
  1548. * ATSUFontVariationAxis and ATSUFontVariationValue values for
  1549. * which you have allocated memory in the oAxes and oValues
  1550. * parameters, respectively. To determine this value, see the
  1551. * Discussion.
  1552. *
  1553. * oAxes:
  1554. * On return, the array contains tags identifying the font
  1555. * variation axes that constitute the font instance. If you are
  1556. * uncertain of how much memory to allocate for this array, see
  1557. * the Discussion. can be NULL
  1558. *
  1559. * oValues:
  1560. * On return, the array contains the defined values for the font
  1561. * variation axes produced in the oAxes array. If you are
  1562. * uncertain of how much memory to allocate for this array, see
  1563. * the Discussion. can be NULL
  1564. *
  1565. * oActualVariationCount:
  1566. * On return, the actual number of font variation axes that
  1567. * constitute the font instance. This may be greater than the
  1568. * value you passed in the iMaximumVariations parameter.
  1569. *
  1570. * Result:
  1571. * On success, noErr is returned. See MacErrors.h for possible error
  1572. * codes.
  1573. *
  1574. * Availability:
  1575. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1576. * CarbonLib: in CarbonLib 1.0 and later
  1577. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  1578. }
  1579. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  1580. function ATSUGetFontInstance( iFontID: ATSUFontID; iFontInstanceIndex: ItemCount; iMaximumVariations: ItemCount; oAxes: ATSUFontVariationAxisPtr; oValues: ATSUFontVariationValuePtr; var oActualVariationCount: ItemCount ): OSStatus; external name '_ATSUGetFontInstance';
  1581. {
  1582. * ATSUGetFontInstanceNameCode()
  1583. *
  1584. * Summary:
  1585. * Obtains the name code for the font instance that matches an ASTUI
  1586. * font ID and font instance index value.
  1587. *
  1588. * Discussion:
  1589. * A font instance consists of a named set of values for each
  1590. * variation axis in a font. The ATSUGetFontInstanceNameCode
  1591. * function obtains the name code for the font instance that matches
  1592. * an ASTUI font ID and font instance index value. You can use the
  1593. * function ATSUFindFontName to obtain the localized name string for
  1594. * the name code produced by ATSUGetFontInstanceNameCode. You can
  1595. * obtain the font variation axis values for a font instance by
  1596. * calling the function ATSUGetFontInstance.
  1597. *
  1598. * Parameters:
  1599. *
  1600. * iFontID:
  1601. * The font for which to obtain a font instance name code.
  1602. *
  1603. * iInstanceIndex:
  1604. * An index to the font instance for which to obtain a name code.
  1605. * Because this index must be 0-based, you should pass a value
  1606. * between 0 and one less than the count produced by the function
  1607. * ATSUCountFontInstances.
  1608. *
  1609. * oNameCode:
  1610. * On return, the name code for the font instance. See the
  1611. * SFNTTypes.h header file for a definition of the FontNameCode
  1612. * type and a list of possible values.
  1613. *
  1614. * Result:
  1615. * On success, noErr is returned. See MacErrors.h for possible error
  1616. * codes.
  1617. *
  1618. * Availability:
  1619. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1620. * CarbonLib: in CarbonLib 1.0 and later
  1621. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  1622. }
  1623. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  1624. function ATSUGetFontInstanceNameCode( iFontID: ATSUFontID; iInstanceIndex: ItemCount; var oNameCode: FontNameCode ): OSStatus; external name '_ATSUGetFontInstanceNameCode';
  1625. end.