ATSUnicodeFonts.pas 79 KB

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