ATSUnicodeFonts.pas 80 KB

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