ATSUnicodeTypes.pas 47 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533
  1. {
  2. File: QD/ATSUnicodeTypes.h
  3. Contains: ATSUI types and constants.
  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 ATSUnicodeTypes;
  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,MacMemory,ATSLayoutTypes,Fonts,QuickdrawTypes,SFNTTypes,SFNTLayoutTypes,ATSTypes,TextCommon;
  202. {$endc} {not MACOSALLINCLUDE}
  203. {$ifc TARGET_OS_MAC}
  204. { See also ATSLayoutTypes.h for more ATSUI-related types and constants }
  205. { ---------------------------------------------------------------------------- }
  206. { ATSUI types and related constants }
  207. { ---------------------------------------------------------------------------- }
  208. {$ALIGN MAC68K}
  209. {
  210. * ATSUTextLayout
  211. *
  212. * Discussion:
  213. * Text layout objects are the heart of ATSUI. These opaque objects
  214. * associate Unicode text with style runs, store information about
  215. * softbreaks, line and layout controls, and other information about
  216. * the text. Text drawing is done by passing a valid layout object
  217. * and a range of text to draw to the function ATSUDrawText, after
  218. * initial setup work on the layout has been done. See the
  219. * definitions of the functions ATSUCreateTextLayout and
  220. * ATSUCreateTextLayoutWithTextPtr for more information about
  221. * creating layouts.
  222. }
  223. type
  224. ATSUTextLayout = ^OpaqueATSUTextLayout; { an opaque type }
  225. OpaqueATSUTextLayout = record end;
  226. {
  227. * ATSUStyle
  228. *
  229. * Discussion:
  230. * Style objects retain information about text such as font, point
  231. * size, color and other attributes. Styles are associated with text
  232. * through a layout object. See the definitions of the functions
  233. * ATSUSetRunStyle and ATSUCreateTextLayoutWithTextPtr for more
  234. * information about assigning styles to runs of text in a layout
  235. * object. See the definitions of the functions ATSUCreateStyle and
  236. * ATSUSetAttributes for more information on creating and
  237. * manipulating styles.
  238. }
  239. type
  240. ATSUStyle = ^OpaqueATSUStyle; { an opaque type }
  241. OpaqueATSUStyle = record end;
  242. ATSUStylePtr = ^ATSUStyle;
  243. {
  244. * ATSUFontFallbacks
  245. *
  246. * Discussion:
  247. * ATSUFontFallbacks objects are used to store the desired font
  248. * fallback mode, list, and associated cache information. See the
  249. * definitions of ATSUFontFallbackMethod and ATSUSetObjFontFallbacks
  250. * for more information about setting up font fallbacks.
  251. }
  252. type
  253. ATSUFontFallbacks = ^OpaqueATSUFontFallbacks; { an opaque type }
  254. OpaqueATSUFontFallbacks = record end;
  255. {
  256. * ATSUTextMeasurement
  257. *
  258. * Discussion:
  259. * ATSUTextMeasurement is specific to ATSUI in that measurement
  260. * quantities are in fractional Fixed format instead of shorts used
  261. * in QuickDraw Text. This provides exact outline metrics and line
  262. * specifications such as line width, ascent, descent, and so on.
  263. * See FixMath.h for conversion functions for Fixed numbers.
  264. }
  265. type
  266. ATSUTextMeasurement = Fixed;
  267. ATSUTextMeasurementPtr = ^ATSUTextMeasurement;
  268. {
  269. * ATSUFontID
  270. *
  271. * Discussion:
  272. * ATSUFontID indicates a particular font family and face.
  273. * ATSUFontID's are not guaranteed to remain constant across
  274. * sessions. Clients should use the font's unique name to get a font
  275. * token to store in documents which is guaranteed to remain
  276. * constant across sessions.
  277. }
  278. type
  279. ATSUFontID = FMFont;
  280. ATSUFontIDPtr = ^ATSUFontID;
  281. {
  282. * ATSUFontFeatureType
  283. *
  284. * Discussion:
  285. * Used to identify a font feature type for a particular font. See
  286. * the definitions of the functions ATSUGetAllFontFeatures and
  287. * ATSUGetFontFeature for more information about font features.
  288. }
  289. type
  290. ATSUFontFeatureType = UInt16;
  291. ATSUFontFeatureTypePtr = ^ATSUFontFeatureType;
  292. {
  293. * ATSUFontFeatureSelector
  294. *
  295. * Discussion:
  296. * Used to identify a font feature selector for a particular font.
  297. * See the definitions of the functions ATSUGetAllFontFeatures and
  298. * ATSUGetFontFeature for more information about font features.
  299. }
  300. type
  301. ATSUFontFeatureSelector = UInt16;
  302. ATSUFontFeatureSelectorPtr = ^ATSUFontFeatureSelector;
  303. {
  304. * ATSUFontVariationAxis
  305. *
  306. * Discussion:
  307. * Used to identify a font variation axis for a particular font. See
  308. * the definitions of the functions ATSUGetAllFontVariations and
  309. * ATSUGetFontVariation for more information about font variations.
  310. }
  311. type
  312. ATSUFontVariationAxis = FourCharCode;
  313. ATSUFontVariationAxisPtr = ^ATSUFontVariationAxis;
  314. {
  315. * ATSUFontVariationValue
  316. *
  317. * Discussion:
  318. * Used to identify a font variation value for a particular font.
  319. * See the definitions of the functions ATSUGetAllFontVariations and
  320. * ATSUGetFontVariation for more information about font variations.
  321. }
  322. type
  323. ATSUFontVariationValue = Fixed;
  324. ATSUFontVariationValuePtr = ^ATSUFontVariationValue;
  325. {
  326. * ATSUAttributeTag
  327. *
  328. * Summary:
  329. * Constants used for style attributes, line controls, and layout
  330. * controls.
  331. *
  332. * Discussion:
  333. * The following constants are used to change settings in text
  334. * layout and style objects. Use the functions ATSUSetLineControls,
  335. * ATSUSetLayoutControls, and ATSUSetAttributes to set these values
  336. * in lines, layouts, and styles, respectively. Apple reserves tag
  337. * values 0 to 65535 (0 to 0x0000FFFF). ATSUI clients may create
  338. * their own tags with any other value.
  339. }
  340. type
  341. ATSUAttributeTag = UInt32;
  342. ATSUAttributeTagPtr = ^ATSUAttributeTag;
  343. const
  344. {
  345. * (Type: ATSUTextMeasurement) (Default value: 0) Must not be less
  346. * than zero. May be set as a line or layout control.
  347. }
  348. kATSULineWidthTag = 1;
  349. {
  350. * (Type: Fixed) (Default value: 0) Angle is specified in degrees in
  351. * right-handed coordinate system. May be set as a line control.
  352. }
  353. kATSULineRotationTag = 2;
  354. {
  355. * (Type: Boolean) (Default value: GetSysDirection()) Must be 0 or 1.
  356. * See below for convenience constants. May be set as a layout
  357. * control.
  358. }
  359. kATSULineDirectionTag = 3;
  360. {
  361. * (Type: Fract) (Default value: kATSUNoJustification) May be set as
  362. * a line or layout control.
  363. }
  364. kATSULineJustificationFactorTag = 4;
  365. {
  366. * (Type: Fract) (Default value: kATSUStartAlignment) May be set as a
  367. * line or layout control.
  368. }
  369. kATSULineFlushFactorTag = 5;
  370. {
  371. * (Type: BslnBaselineRecord) (Default value: all zeros) Calculated
  372. * from other style attributes (e.g., font and point size). May be
  373. * set as a line or layout control.
  374. }
  375. kATSULineBaselineValuesTag = 6;
  376. {
  377. * (Type: ATSLineLayoutOptions) (Default value: all zeros) See
  378. * ATSLayoutTypes.h for a definition of the ATSLineLayoutOptions type
  379. * and a list of possible values. May be set as a line or layout
  380. * control.
  381. }
  382. kATSULineLayoutOptionsTag = 7;
  383. {
  384. * (Type: ATSUTextMeasurement) (Default value: determined by font(s))
  385. * Must not be less than zero. Starting in Mac OS X 10.2, you can
  386. * retrieve this value as a line or layout control, even if you have
  387. * not explicitly set it. This makes it easy to calculate line
  388. * height. May be set as a line or layout control.
  389. }
  390. kATSULineAscentTag = 8;
  391. {
  392. * (Type: ATSUTextMeasurement) (Default value: determined by font(s))
  393. * Must not be less than zero. Starting in Mac OS X, you can retrieve
  394. * this value as a line or layout control, even if you have not
  395. * explicitly set it. This makes it easy to calculate line height.
  396. * May be set as a line or layout control.
  397. }
  398. kATSULineDescentTag = 9;
  399. {
  400. * (Type: RegionCode) (Default value: kTextRegionDontCare) See
  401. * Script.h for possible values. May be set as a line or layout
  402. * control.
  403. }
  404. kATSULineLangRegionTag = 10;
  405. {
  406. * (Type: TextBreakLocatorRef) (Default value: NULL) See
  407. * UnicodeUtilities.h for more information on creating a
  408. * TextBreakLocator. May be set as a line or layout control.
  409. }
  410. kATSULineTextLocatorTag = 11;
  411. {
  412. * (Type: ATSULineTruncation) (Default value: kATSUTruncateNone) See
  413. * the definition of ATSULineTruncation for possible values. May be
  414. * set as a line or layout control.
  415. }
  416. kATSULineTruncationTag = 12;
  417. {
  418. * (Type: ATSUFontFallbacks) (Default value: current global fallback
  419. * state) The current global fallback state is determined using the
  420. * ATSUSetFontFallbacks function. The use of this function is not
  421. * recommended. Instead, use the functions ATSUCreateFontFallbacks
  422. * and ATSUSetObjFontFallbacks to create a ATSUFontFallbacks object,
  423. * and then use the kATSULineFontFallbacksTag attribute to set the
  424. * font fallbacks object as a layout control. See the definition of
  425. * ATSUFontFallbacks for more information. May be set as a layout
  426. * control.
  427. }
  428. kATSULineFontFallbacksTag = 13;
  429. {
  430. * (Type: CFStringRef) (Default value: user setting in System
  431. * Preferences) Indicates current setting for the decimal separator.
  432. * This affects the behavior of decimal tabs. May be set as a line or
  433. * layout control.
  434. }
  435. kATSULineDecimalTabCharacterTag = 14;
  436. {
  437. * (Type: ATSULayoutOperationOverrideSpecifier) (Default value: NULL)
  438. * See ATSLayoutTypes.h for a definition of the
  439. * ATSULayoutOperationOverrideSpecifier structure. May be set as a
  440. * layout control.
  441. }
  442. kATSULayoutOperationOverrideTag = 15;
  443. {
  444. * (Type: CGColorRef) (Default value: user setting in System
  445. * Preferences) Indicates current setting for the highlight color.
  446. * May be set as a line or layout control.
  447. }
  448. kATSULineHighlightCGColorTag = 17;
  449. {
  450. * This is just for convenience. It is the upper limit of the line
  451. * and layout tags.
  452. }
  453. kATSUMaxLineTag = 18;
  454. {
  455. * This tag is obsolete. Please use kATSULineLangRegionTag instead.
  456. }
  457. kATSULineLanguageTag = 10;
  458. {
  459. * (Type: CGContextRef) (Default value: NULL) Use this tag to produce
  460. * Quartz rendering with ATSUI. See the definitions of the functions
  461. * QDBeginCGContext and QDEndCGContext in Quickdraw.h for more
  462. * information about creating a CGContext from a graphics port. May
  463. * be set as a layout control.
  464. }
  465. kATSUCGContextTag = 32767;
  466. {
  467. * (Type: Boolean) (Default value: false) For compatability purposes
  468. * only. Choosing typographic styles from font families is preferred.
  469. * Note this tag will produce a synthetic style for fonts that do not
  470. * have a typographic style. May be set as a style attribute.
  471. }
  472. kATSUQDBoldfaceTag = 256;
  473. {
  474. * (Type: Boolean) (Default value: false) For compatability purposes
  475. * only. Choosing typographic styles from font families is preferred.
  476. * Note this tag will produce a synthetic style for fonts that do not
  477. * have a typographic style. May be set as a style attribute.
  478. }
  479. kATSUQDItalicTag = 257;
  480. {
  481. * (Type: Boolean) (Default value: false) For compatability purposes
  482. * only. May be set as a style attribute.
  483. }
  484. kATSUQDUnderlineTag = 258;
  485. {
  486. * (Type: Boolean) (Default value: false) For compatability purposes
  487. * only. May be set as a style attribute.
  488. }
  489. kATSUQDCondensedTag = 259;
  490. {
  491. * (Type: Boolean) (Default value: false) For compatability purposes
  492. * only. May be set as a style attribute.
  493. }
  494. kATSUQDExtendedTag = 260;
  495. {
  496. * (Type: ATSUFontID) (Default value: LMGetApFontID() or if not
  497. * valid, LMGetSysFontFam()) May be set as a style attribute.
  498. }
  499. kATSUFontTag = 261;
  500. {
  501. * (Type: Fixed) (Default value: Long2Fix(LMGetSysFontSize())) May be
  502. * set as a style attribute.
  503. }
  504. kATSUSizeTag = 262;
  505. {
  506. * (Type: RGBColor) (Default value: (0, 0, 0)) May be set as a style
  507. * attribute.
  508. }
  509. kATSUColorTag = 263;
  510. {
  511. * (Type: RegionCode) (Default value:
  512. * GetScriptManagerVariable(smRegionCode)) See Script.h for a list of
  513. * possible values. May be set as a style attribute.
  514. }
  515. kATSULangRegionTag = 264;
  516. {
  517. * (Type: ATSUVerticalCharacterType) (Default value:
  518. * kATSUStronglyHorizontal) See the definition of
  519. * ATSUVerticalCharacterType for a list of possible values. May be
  520. * set as a style attribute.
  521. }
  522. kATSUVerticalCharacterTag = 265;
  523. {
  524. * (Type: ATSUTextMeasurement) (Default value: kATSUseGlyphAdvance)
  525. * Must not be less than zero. May be set as a style attribute.
  526. }
  527. kATSUImposeWidthTag = 266;
  528. {
  529. * (Type: Fixed) (Default value: 0) May be set as a style attribute.
  530. }
  531. kATSUBeforeWithStreamShiftTag = 267;
  532. {
  533. * (Type: Fixed) (Default value: 0) May be set as a style attribute.
  534. }
  535. kATSUAfterWithStreamShiftTag = 268;
  536. {
  537. * (Type: Fixed) (Default value: 0) May be set as a style attribute.
  538. }
  539. kATSUCrossStreamShiftTag = 269;
  540. {
  541. * (Type: Fixed) (Default value: kATSNoTracking) May be set as a
  542. * style attribute.
  543. }
  544. kATSUTrackingTag = 270;
  545. {
  546. * (Type: Fract) (Default value: 0) May be set as a style attribute.
  547. }
  548. kATSUHangingInhibitFactorTag = 271;
  549. {
  550. * (Type: Fract) (Default value: 0) May be set as a style attribute.
  551. }
  552. kATSUKerningInhibitFactorTag = 272;
  553. {
  554. * (Type: Fixed) (Default value: 0) Must be between -1.0 and 1.0. May
  555. * be set as a style attribute.
  556. }
  557. kATSUDecompositionFactorTag = 273;
  558. {
  559. * (Type: BslnBaselineClass) (Default value: kBSLNRomanBaseline) See
  560. * SFNTLayoutTypes.h for more information. Use the constant
  561. * kBSLNNoBaselineOverride to use intrinsic baselines. May be set as
  562. * a style attribute.
  563. }
  564. kATSUBaselineClassTag = 274;
  565. {
  566. * (Type: ATSJustPriorityWidthDeltaOverrides) (Default value: all
  567. * zeros) See ATSLayoutTypes.h for more information. May be set as a
  568. * style attribute.
  569. }
  570. kATSUPriorityJustOverrideTag = 275;
  571. {
  572. * (Type: Boolean) (Default value: false) When set to true, ligatures
  573. * and compound characters will not have divisable components. May be
  574. * set as a style attribute.
  575. }
  576. kATSUNoLigatureSplitTag = 276;
  577. {
  578. * (Type: Boolean) (Default value: false) When set to true, ATSUI
  579. * will not use a glyph's angularity to determine its boundaries. May
  580. * be set as a style attribute.
  581. }
  582. kATSUNoCaretAngleTag = 277;
  583. {
  584. * (Type: Boolean) (Default value: false) When set to true, ATSUI
  585. * will suppress automatic cross kerning (defined by font). May be
  586. * set as a style attribute.
  587. }
  588. kATSUSuppressCrossKerningTag = 278;
  589. {
  590. * (Type: Boolean) (Default value: false) When set to true, ATSUI
  591. * will suppress glyphs' automatic optical positional alignment. May
  592. * be set as a style attribute.
  593. }
  594. kATSUNoOpticalAlignmentTag = 279;
  595. {
  596. * (Type: Boolean) (Default value: false) When set to true, ATSUI
  597. * will force glyphs to hang beyond the line boundaries. May be set
  598. * as a style attribute.
  599. }
  600. kATSUForceHangingTag = 280;
  601. {
  602. * (Type: Boolean) (Default value: false) When set to true, ATSUI
  603. * will not perform post-compensation justification if needed. May be
  604. * set as a style attribute.
  605. }
  606. kATSUNoSpecialJustificationTag = 281;
  607. {
  608. * (Type: TextBreakLocatorRef) (Default value: NULL) See
  609. * UnicodeUtilities.h for more information about creating a
  610. * TextBreakLocator. May be set as a style attribute.
  611. }
  612. kATSUStyleTextLocatorTag = 282;
  613. {
  614. * (Type: ATSStyleRenderingOptions) (Default value:
  615. * kATSStyleNoOptions) See ATSLayoutTypes.h for a definition of
  616. * ATSStyleRenderingOptions and a list of possible values. May be set
  617. * as a style attribute.
  618. }
  619. kATSUStyleRenderingOptionsTag = 283;
  620. {
  621. * (Type: ATSUTextMeasurement) (Default value: determined by font)
  622. * Must not be less than zero. Starting in Mac OS X 10.2, you can
  623. * retrieve a value for this attribute, even if you have not
  624. * explicitly set it. This can make calculating line height easier.
  625. * May be set as a style attribute.
  626. }
  627. kATSUAscentTag = 284;
  628. {
  629. * (Type: ATSUTextMeasurement) (Default value: determined by font)
  630. * Must not be less than zero. Starting in Mac OS X 10.2, you can
  631. * retrieve a value for this attribute, even if you have not
  632. * explicitly set it. This can make calculating line height easier.
  633. * May be set as a style attribute.
  634. }
  635. kATSUDescentTag = 285;
  636. {
  637. * (Type: ATSUTextMeasurement) (Default value: determined by font)
  638. * Must not be less than zero. Starting in Mac OS X 10.2, you can
  639. * retrieve a value for this attribute, even if you have not
  640. * explicitly set it. This can make calculating line height easier.
  641. * May be set as a style attribute.
  642. }
  643. kATSULeadingTag = 286;
  644. {
  645. * (Type: ATSUGlyphSelector) (Default value: 0) See the definition of
  646. * ATSUGlyphSelector for more information and a list of possible
  647. * values. May be set as a style attribute.
  648. }
  649. kATSUGlyphSelectorTag = 287;
  650. {
  651. * (Type: ATSURGBAlphaColor) (Default value: (0, 0, 0, 1)) See the
  652. * definition of ATSURGBAlphaColor for more information. May be set
  653. * as a style attribute.
  654. }
  655. kATSURGBAlphaColorTag = 288;
  656. {
  657. * (Type: CGAffineTransform) (Default value:
  658. * CGAffineTransformIdentity) See the definition of CGAffineTransform
  659. * in CGAffineTransform.h for more information. May be set as a style
  660. * attribute.
  661. }
  662. kATSUFontMatrixTag = 289;
  663. {
  664. * (Type: ATSUStyleLineCountType) (Default value:
  665. * kATSUStyleSingleLineCount) Used to specify the number of strokes
  666. * to be drawn for an underline. May be set as a style attribute.
  667. }
  668. kATSUStyleUnderlineCountOptionTag = 290;
  669. {
  670. * (Type: CGColorRef) (Default value: NULL) Used to specify the color
  671. * of the strokes to draw for an underlined run of text. If NULL, the
  672. * text color is used. May be set as a style attribute.
  673. }
  674. kATSUStyleUnderlineColorOptionTag = 291;
  675. {
  676. * (Type: Boolean) (Default value: false) Used to specify
  677. * strikethrough style. May be set as a style attribute.
  678. }
  679. kATSUStyleStrikeThroughTag = 292;
  680. {
  681. * (Type: ATSUStyleLineCountType) (Default value:
  682. * kATSUStyleSingleLineCount) Used to specify the number of strokes
  683. * to be drawn for a strikethrough. May be set as a style attribute.
  684. }
  685. kATSUStyleStrikeThroughCountOptionTag = 293;
  686. {
  687. * (Type: CGColorRef) (Default value: NULL) Used to specify the color
  688. * of the strokes to draw for a strikethrough style. If NULL, the
  689. * text color is used. May be set as a style attribute.
  690. }
  691. kATSUStyleStrikeThroughColorOptionTag = 294;
  692. {
  693. * (Type: Boolean) (Default value: false) Used to specify if text
  694. * should be drawn with a drop shadow. Only takes effect if a
  695. * CGContext is used for drawing. May be set as a style attribute.
  696. }
  697. kATSUStyleDropShadowTag = 295;
  698. {
  699. * (Type: float) (Default value: 0.0) Used to specify the amount of
  700. * blur for a dropshadow. May be set as a style attribute.
  701. }
  702. kATSUStyleDropShadowBlurOptionTag = 296;
  703. {
  704. * (Type: CGSize) (Default value: (3.0, -3.0)) Used to specify the
  705. * amount of offset from the text to be used when drawing a
  706. * dropshadow. May be set as a style attribute.
  707. }
  708. kATSUStyleDropShadowOffsetOptionTag = 297;
  709. {
  710. * (Type: CGColorRef) (Default value: NULL) Used to specify the color
  711. * of the dropshadow. May be set as a style attribute.
  712. }
  713. kATSUStyleDropShadowColorOptionTag = 298;
  714. {
  715. * This is just for convenience. It is the upper limit of the style
  716. * tags.
  717. }
  718. kATSUMaxStyleTag = 299;
  719. {
  720. * This tag is obsolete. Please use kATSULangRegionTag instead. This
  721. * is the maximum Apple ATSUI reserved tag value. Client defined
  722. * tags must be larger.
  723. }
  724. kATSULanguageTag = 264;
  725. kATSUMaxATSUITagValue = 65535;
  726. {
  727. * ATSUAttributeValuePtr
  728. *
  729. * Summary:
  730. * Used to provide generic access for storage of attribute values,
  731. * which vary in size.
  732. }
  733. type
  734. ATSUAttributeValuePtr = UnivPtr;
  735. ConstATSUAttributeValuePtr = UnivPtr;
  736. ATSUAttributeValuePtrPtr = ^ATSUAttributeValuePtr;
  737. {
  738. * ATSUAttributeInfo
  739. *
  740. * Discussion:
  741. * ATSUAttributeInfo is used to provide a tag/size pairing. This
  742. * makes it possible to provide the client information about all the
  743. * attributes for a given range of text. This structure is only
  744. * used to return to the client information about a complete set of
  745. * attributes. An array of ATSUAttributeInfos is passed as a
  746. * parameter so that the client can find out what attributes are set
  747. * and what their individual sizes are; with that information, they
  748. * can then query about the values of the attributes they're
  749. * interested in. Because arrays of ATSUAttributeInfos are used as
  750. * parameters to functions, they have to be of a fixed size, hence
  751. * the value is not included in the structure.
  752. }
  753. type
  754. ATSUAttributeInfo = record
  755. fTag: ATSUAttributeTag;
  756. fValueSize: ByteCount;
  757. end;
  758. ATSUAttributeInfoPtr = ^ATSUAttributeInfo;
  759. {
  760. * ATSUCaret
  761. *
  762. * Discussion:
  763. * Contains the complete information needed to render a caret. fX
  764. * and fY is the position of one of the caret's ends relative to the
  765. * origin position of the line the caret belongs. fDeltaX and
  766. * fDeltaY is the position of the caret's other end. Hence, to draw
  767. * a caret, simply call MoveTo(fX, fY) followed by LineTo(fDeltaX,
  768. * fDeltaY) or equivalent. The ATSUCaret will contain the positions
  769. * needed to draw carets on angled lines and reflect angled carets
  770. * and leading/trailing split caret appearances.
  771. }
  772. type
  773. ATSUCaret = record
  774. fX: Fixed;
  775. fY: Fixed;
  776. fDeltaX: Fixed;
  777. fDeltaY: Fixed;
  778. end;
  779. ATSUCaretPtr = ^ATSUCaret;
  780. {
  781. * ATSUCursorMovementType
  782. *
  783. * Discussion:
  784. * Used to indicate how much to move the cursor when using the ATSUI
  785. * cusor movement routines. Note that kATSUByCharacterCluster is
  786. * only available in Mac OS X and in CarbonLib versions 1.3 and
  787. * later.
  788. }
  789. type
  790. ATSUCursorMovementType = UInt16;
  791. const
  792. {
  793. * Cursor movement based on individual characters. The cursor will
  794. * step through individual characters within ligatures.
  795. }
  796. kATSUByCharacter = 0;
  797. {
  798. * Like kATSUByCharacter, but the cursor will treat ligatures as
  799. * single entities.
  800. }
  801. kATSUByTypographicCluster = 1;
  802. {
  803. * Cursor movement by whole words.
  804. }
  805. kATSUByWord = 2;
  806. {
  807. * Cursor movement by clusters based on characters only.
  808. }
  809. kATSUByCharacterCluster = 3;
  810. {
  811. * Obsolete name for kATSUByTypographicCluster; do not use.
  812. }
  813. kATSUByCluster = 1;
  814. {
  815. * ATSULineTruncation
  816. *
  817. * Summary:
  818. * Constants used with the kATSULineTruncationTag layout and line
  819. * control.
  820. *
  821. * Discussion:
  822. * The constants kATSUTruncateNone, kATSUTruncateStart,
  823. * kATSUTruncateEnd, and kATSUTruncateMiddle represent different
  824. * places in the text where glyphs should be replaced with an
  825. * elipsis should the text not fit within the width set by the
  826. * kATSULineWidthTag line and layout control. The constant
  827. * kATSUTruncFeatNoSquishing is special and can be bitwise OR'd with
  828. * any of the other constants. It indicates that ATSUI should not
  829. * perform negative justification to make the text fit. This can be
  830. * desirable for situations such as live resize, to prevent the text
  831. * from "wiggling".
  832. }
  833. type
  834. ATSULineTruncation = UInt32;
  835. const
  836. kATSUTruncateNone = 0;
  837. kATSUTruncateStart = 1;
  838. kATSUTruncateEnd = 2;
  839. kATSUTruncateMiddle = 3;
  840. kATSUTruncateSpecificationMask = $00000007;
  841. kATSUTruncFeatNoSquishing = $00000008;
  842. {
  843. * ATSUStyleLineCountType
  844. *
  845. * Discussion:
  846. * ATSUStyleLineCountType is used to designate how many lines will
  847. * be drawn for a given style type. Currently only the underline
  848. * and strikethrough styles support this type.
  849. }
  850. type
  851. ATSUStyleLineCountType = UInt16;
  852. const
  853. kATSUStyleSingleLineCount = 1;
  854. kATSUStyleDoubleLineCount = 2;
  855. {
  856. * ATSUVerticalCharacterType
  857. *
  858. * Discussion:
  859. * Use these constants along with the kATSUVerticalCharacterTag
  860. * layout control to determine whether the vertical or horizontal
  861. * forms of glyphs should be used. Note that this is independent of
  862. * line rotation.
  863. }
  864. type
  865. ATSUVerticalCharacterType = UInt16;
  866. const
  867. kATSUStronglyHorizontal = 0;
  868. kATSUStronglyVertical = 1;
  869. {
  870. * ATSUStyleComparison
  871. *
  872. * Discussion:
  873. * ATSUStyleComparison is an enumeration with four values, and is
  874. * used by ATSUCompareStyles() to indicate if the first style
  875. * parameter contains as a proper subset, is equal to, or is
  876. * contained by the second style parameter.
  877. }
  878. type
  879. ATSUStyleComparison = UInt16;
  880. const
  881. kATSUStyleUnequal = 0;
  882. kATSUStyleContains = 1;
  883. kATSUStyleEquals = 2;
  884. kATSUStyleContainedBy = 3;
  885. {
  886. * ATSUFontFallbackMethod
  887. *
  888. * Discussion:
  889. * ATSUFontFallbackMethod type defines the method by which ATSUI
  890. * will try to find an appropriate font for a character if the
  891. * assigned font does not contain the needed glyph(s) to represent
  892. * it. This affects ATSUMatchFontsToText and font selection during
  893. * layout and drawing when ATSUSetTransientFontMatching is set ON.
  894. }
  895. type
  896. ATSUFontFallbackMethod = UInt16;
  897. const
  898. {
  899. * When this constant is specified, all fonts on the system are
  900. * searched for substitute glyphs.
  901. }
  902. kATSUDefaultFontFallbacks = 0;
  903. {
  904. * This constant specifies that only the special last resort font be
  905. * used for substitute glyphs.
  906. }
  907. kATSULastResortOnlyFallback = 1;
  908. {
  909. * This constant specifies that a font list you provide should be
  910. * sequentially searched for substitute glyphs before the ATSUI
  911. * searches through all available fonts on the system. You specify
  912. * this list through the iFonts parameter to the
  913. * ATSUSetObjFontFallbacks function.
  914. }
  915. kATSUSequentialFallbacksPreferred = 2;
  916. {
  917. * This constants specifies that only the font list you provide
  918. * should be sequentially searched for substitute glyphs. All other
  919. * fonts on the system are ignored, except for the special last
  920. * resort font. You specify the list of fonts you want ATSUI to use
  921. * by passing it to the iFonts parameter of the
  922. * ATSUSetObjFontFallbacks function.
  923. }
  924. kATSUSequentialFallbacksExclusive = 3;
  925. {
  926. * ATSUTabType
  927. *
  928. * Discussion:
  929. * ATSUTabType type defines the characteristic of ATSUI tabs. A Left
  930. * tab type specifies that the left side of affected text is to be
  931. * maintained flush against the tab stop. A Right tab type
  932. * specifies that the right side of affected text is to be
  933. * maintained flush against the tab stop. A Center tab type
  934. * specifies that the affected text centered about the tab stop. A
  935. * Decimal tab type specifies that the affected text will be aligned
  936. * such that the decimal character will by flush against the tab
  937. * stop. The default decimal character is defined in System
  938. * Preferences. A different decimal character can be defined by
  939. * using the ATSUAttributeTag kATSULineDecimalTabCharacterTag.
  940. }
  941. type
  942. ATSUTabType = UInt16;
  943. const
  944. kATSULeftTab = 0;
  945. kATSUCenterTab = 1;
  946. kATSURightTab = 2;
  947. kATSUDecimalTab = 3;
  948. kATSUNumberTabTypes = 4;
  949. {
  950. * ATSUTab
  951. *
  952. * Discussion:
  953. * ATSUTab specifies the position and type of tab stop to be applied
  954. * to a ATSUTextLayout set through the ATSUI routine ATSUSetTabArray
  955. * and returned through ATSUGetTabArray.
  956. }
  957. type
  958. ATSUTab = record
  959. tabPosition: ATSUTextMeasurement;
  960. tabType: ATSUTabType;
  961. end;
  962. ATSUTabPtr = ^ATSUTab;
  963. {
  964. * ATSURGBAlphaColor
  965. *
  966. * Discussion:
  967. * Use this structure with the kATSURGBAlphaColorTag attribute to
  968. * specify color for your text in an ATSUStyle. All values range
  969. * from 0.0 to 1.0.
  970. }
  971. type
  972. ATSURGBAlphaColor = record
  973. red: Float32;
  974. green: Float32;
  975. blue: Float32;
  976. alpha: Float32;
  977. end;
  978. ATSURGBAlphaColorPtr = ^ATSURGBAlphaColor;
  979. {
  980. * GlyphCollection
  981. *
  982. * Discussion:
  983. * GlyphCollection types represent the specific character
  984. * collection. If the value is zero, kGlyphCollectionGID, then this
  985. * indicates that the glyph value represents the actual glyphID of a
  986. * specific font. Adobe collections are based on CID, rather than
  987. * glyph ID.
  988. }
  989. type
  990. GlyphCollection = UInt16;
  991. const
  992. kGlyphCollectionGID = 0;
  993. kGlyphCollectionAdobeCNS1 = 1;
  994. kGlyphCollectionAdobeGB1 = 2;
  995. kGlyphCollectionAdobeJapan1 = 3;
  996. kGlyphCollectionAdobeJapan2 = 4;
  997. kGlyphCollectionAdobeKorea1 = 5;
  998. kGlyphCollectionUnspecified = $FF;
  999. {
  1000. * ATSUGlyphSelector
  1001. *
  1002. * Discussion:
  1003. * ATSUGlyphSelector can direct ATSUI to use a specific glyph
  1004. * instead of the one that ATSUI normally derives. The glyph can be
  1005. * specified either as a glyphID (specific to the font used) or CID
  1006. * from a specfic collection defined by the collection entry.
  1007. }
  1008. type
  1009. ATSUGlyphSelector = record
  1010. {
  1011. * A glyph collection constant. See the definition of GlyphCollection
  1012. * for possible values for this field.
  1013. }
  1014. collection: GlyphCollection;
  1015. {
  1016. * The glyph ID of the glyph (when collection is
  1017. * kGlyphCollectionGID). For Adobe glyph collections, this value
  1018. * represents a CID
  1019. }
  1020. glyphID: GlyphID_fix;
  1021. end;
  1022. ATSUGlyphSelectorPtr = ^ATSUGlyphSelector;
  1023. {
  1024. * ATSUGlyphInfo
  1025. *
  1026. * Summary:
  1027. * Structure returned by ATSUGetGlyphInfo
  1028. *
  1029. * Discussion:
  1030. * ATSUGetGlyphInfo will return an array of these structs, one for
  1031. * each glyph in the specified range. You can then make changes to
  1032. * the data before drawing it with ATSUDrawGlyphInfo. These
  1033. * functions are no longer recommended; see ATSUnicodeDirectAccess.h
  1034. * for replacement functions.
  1035. }
  1036. type
  1037. ATSUGlyphInfo = record
  1038. glyphID: GlyphID_fix;
  1039. reserved: UInt16;
  1040. layoutFlags: UInt32;
  1041. charIndex: UniCharArrayOffset;
  1042. style: ATSUStyle;
  1043. deltaY: Float32;
  1044. idealX: Float32;
  1045. screenX: SInt16;
  1046. caretX: SInt16;
  1047. end;
  1048. ATSUGlyphInfoPtr = ^ATSUGlyphInfo;
  1049. {
  1050. * ATSUGlyphInfoArray
  1051. *
  1052. * Summary:
  1053. * Structure returned by ATSUGetGlyphInfo
  1054. *
  1055. * Discussion:
  1056. * This data structure is returned by ATSUGetGlyphInfo. layout is
  1057. * the same layout you pass in to ATSUGetGlyphInfo, numGlyphs is the
  1058. * number of glyphs stored in the array glyphs. See the definition
  1059. * of ATSUGlyphInfo for more information about the data structures
  1060. * contained in the glyphs array. The ATSUGetGlyphInfo function is
  1061. * no longer recommended; see ATSUnicodeDirectAccess.h for
  1062. * replacement functions.
  1063. }
  1064. type
  1065. ATSUGlyphInfoArray = record
  1066. layout: ATSUTextLayout;
  1067. numGlyphs: ItemCount;
  1068. glyphs: array[0..0] of ATSUGlyphInfo;
  1069. end;
  1070. ATSUGlyphInfoArrayPtr = ^ATSUGlyphInfoArray;
  1071. {*******************************************************************************}
  1072. { ATSUI highlighting method constants and typedefs }
  1073. {*******************************************************************************}
  1074. {
  1075. * ATSUHighlightMethod
  1076. *
  1077. * Discussion:
  1078. * Use the constants with the function ATSUSetHighlightingMethod to
  1079. * determine the method of highlighting to use. kInvertHighlighting
  1080. * will cause ATSUI to perform a simple color inversion on the area
  1081. * around the text. Although this method requires the least work, it
  1082. * does not produce the best visual results. kRedrawHighlighting
  1083. * will cause ATSUI to redraw the text whenever highlighting or
  1084. * unhighlighting it. This method produces the best visual results,
  1085. * but it does require you to specify a way for ATSUI to redraw the
  1086. * background behind the text after an unhighlight operation. See
  1087. * the definitions of ATSUUnhighlightData, ATSUBackgroundData,
  1088. * ATSUBackgroundDataType, and RedrawBackgroundProcPtr for more
  1089. * information.
  1090. }
  1091. type
  1092. ATSUHighlightMethod = UInt32;
  1093. const
  1094. kInvertHighlighting = 0;
  1095. kRedrawHighlighting = 1;
  1096. {
  1097. * ATSUBackgroundDataType
  1098. *
  1099. * Discussion:
  1100. * Use these constants for the dataType field in the
  1101. * ATSUUnhighlightData structure. kATSUBackgroundColor refers to a
  1102. * solid color background, while kATSUBackgroundCallback refers to a
  1103. * redrawing callback function. Note that if you specify
  1104. * kATSUBackgroundCallback, you must provide a callback function.
  1105. }
  1106. type
  1107. ATSUBackgroundDataType = UInt32;
  1108. const
  1109. kATSUBackgroundColor = 0;
  1110. kATSUBackgroundCallback = 1;
  1111. {
  1112. * ATSUBackgroundColor
  1113. *
  1114. * Discussion:
  1115. * A background color used by ATSUI to redraw the background after a
  1116. * call to ATSUUnhighlight text when the highlighting method is set
  1117. * to kRedrawHighlighting. See the definitions of ATSUBackgroundData
  1118. * and ATSUUnhighlightData for more information.
  1119. }
  1120. type
  1121. ATSUBackgroundColor = ATSURGBAlphaColor;
  1122. {
  1123. * RedrawBackgroundProcPtr
  1124. *
  1125. * Discussion:
  1126. * RedrawBackgroundProcPtr is a pointer to a client-supplied
  1127. * callback function (e.g. MyRedrawBackgroundProc) for redrawing
  1128. * complex backgrounds (and optionally the text as well) that can be
  1129. * called by ATSUI for highlighting if the client has called
  1130. * ATSUSetHighlightingMethod with kRedrawHighlighting for the
  1131. * iMethod parameter. In order for ATSUI to call the client
  1132. * function, the client must (1) pass a pointer to the client
  1133. * function to NewRedrawBackgroundUPP() in order to obtain a
  1134. * RedrawBackgroundUPP, and (2) pass the RedrawBackgroundUPP in the
  1135. * unhighlightData.backgroundUPP field of the iUnhighlightData
  1136. * parameter for the ATSUSetHighlightingMethod call. When finished,
  1137. * the client should call DisposeRedrawBackgroundUPP with the
  1138. * RedrawBackgroundUPP.
  1139. *
  1140. * Parameters:
  1141. *
  1142. * iLayout:
  1143. * The layout to which the highlighting is being applied. The
  1144. * client function can use this to redraw the text.
  1145. *
  1146. * iTextOffset:
  1147. * The offset of the text that is being highlighted; can be used
  1148. * by the client function to redraaw the text.
  1149. *
  1150. * iTextLength:
  1151. * The length of the text that is being highlighted; can be used
  1152. * by the client function to redraaw the text.
  1153. *
  1154. * iUnhighlightArea:
  1155. * An array of ATSTrapezoids that describes the highlight area.
  1156. * The ATSTrapezoid array is ALWAYS in QD coordinates.
  1157. *
  1158. * iTrapezoidCount:
  1159. * The count of ATSTrapezoids in iUnhighlightArea.
  1160. *
  1161. * Result:
  1162. * A Boolean result indicating whether ATSUI should redraw the text.
  1163. * If the client function redraws the text, it should return false,
  1164. * otherwise it should return true to have ATSUI redraw any text
  1165. * that needs to be redrawn.
  1166. }
  1167. type
  1168. RedrawBackgroundProcPtr = function( iLayout: ATSUTextLayout; iTextOffset: UniCharArrayOffset; iTextLength: UniCharCount; iUnhighlightArea: {variable-size-array} ATSTrapezoidPtr; iTrapezoidCount: ItemCount ): Boolean;
  1169. RedrawBackgroundUPP = RedrawBackgroundProcPtr;
  1170. {
  1171. * NewRedrawBackgroundUPP()
  1172. *
  1173. * Availability:
  1174. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1175. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
  1176. * Non-Carbon CFM: not available
  1177. }
  1178. function NewRedrawBackgroundUPP( userRoutine: RedrawBackgroundProcPtr ): RedrawBackgroundUPP; external name '_NewRedrawBackgroundUPP';
  1179. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
  1180. {
  1181. * DisposeRedrawBackgroundUPP()
  1182. *
  1183. * Availability:
  1184. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1185. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
  1186. * Non-Carbon CFM: not available
  1187. }
  1188. procedure DisposeRedrawBackgroundUPP( userUPP: RedrawBackgroundUPP ); external name '_DisposeRedrawBackgroundUPP';
  1189. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
  1190. {
  1191. * InvokeRedrawBackgroundUPP()
  1192. *
  1193. * Availability:
  1194. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1195. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
  1196. * Non-Carbon CFM: not available
  1197. }
  1198. function InvokeRedrawBackgroundUPP( iLayout: ATSUTextLayout; iTextOffset: UniCharArrayOffset; iTextLength: UniCharCount; iUnhighlightArea: {variable-size-array} ATSTrapezoidPtr; iTrapezoidCount: ItemCount; userUPP: RedrawBackgroundUPP ): Boolean; external name '_InvokeRedrawBackgroundUPP';
  1199. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
  1200. {
  1201. * ATSUBackgroundData
  1202. *
  1203. * Summary:
  1204. * Data describing one of two methods for ATSUI to unhighlight text.
  1205. *
  1206. * Discussion:
  1207. * When you call ATSUUnhighlightText and the highlighting method
  1208. * used is kRedrawHighlighting, ATSUI must redraw the text,
  1209. * including the background, when unhighlighting. The two ways of
  1210. * doing this are by telling ATSUI to (1) use a solid color to
  1211. * repaint the background (2) use a callback function to repaint the
  1212. * background. This union provides that information to ATSUI. See
  1213. * the definitions of ATSUUnhighlightData, RedrawBackgroundProcPtr,
  1214. * and ATSUSetHighlightingMethod for more information.
  1215. }
  1216. type
  1217. ATSUBackgroundData = record
  1218. case SInt16 of
  1219. 1: (
  1220. {
  1221. * Specifies a color for ATSUI to repaint the background.
  1222. }
  1223. backgroundColor: ATSUBackgroundColor;
  1224. );
  1225. 2: (
  1226. {
  1227. * Specifies a Universal Procedure Pointer for ATSUI to call to
  1228. * redraw the background.
  1229. }
  1230. backgroundUPP: RedrawBackgroundUPP;
  1231. );
  1232. end;
  1233. ATSUBackgroundDataPtr = ^ATSUBackgroundData;
  1234. {
  1235. * ATSUUnhighlightData
  1236. *
  1237. * Summary:
  1238. * Struct for defining a method for ATSUI to unhighlight text.
  1239. *
  1240. * Discussion:
  1241. * There are two methods of highlighting available on Mac OS X:
  1242. * invert and redraw. For the invert method, no unhighlight method
  1243. * needs to be specified. ATSUI will simply higlight text by
  1244. * performing a color inversion on the area surrounding the test.
  1245. * However, for best results, the redraw method is perferred. With
  1246. * this method, ATSUI will redraw text with a new background when
  1247. * highlighting, and redraw it again when unhighlighting. When using
  1248. * the redraw method, ATSUI needs to know how to restore the
  1249. * backround when unhighlighting text. That is where the unhighlight
  1250. * data comes in. This struct tells ATSUI how to restore the
  1251. * background after a highlight. There are two methods for
  1252. * specifying this information to ATSUI. One is by specifying a
  1253. * solid color, the other by providing a callback for redrawing part
  1254. * of the background.
  1255. }
  1256. type
  1257. ATSUUnhighlightData = record
  1258. {
  1259. * Determines which method to use for restoring the background after
  1260. * a highlight; solid color (kATSUBackgroundColor), or drawing
  1261. * callback (kATSUBackgroundCallback). See also the definition of
  1262. * ATSUBackgroundDataType.
  1263. }
  1264. dataType: ATSUBackgroundDataType;
  1265. {
  1266. * This union provides the actual data for ATSUI to use when
  1267. * redrawing the background. See the definition of ATSUBackgroundData
  1268. * for more information.
  1269. }
  1270. unhighlightData: ATSUBackgroundData;
  1271. end;
  1272. ATSUUnhighlightDataPtr = ^ATSUUnhighlightData;
  1273. {******************************************************************************}
  1274. { Other ATSUI constants }
  1275. {******************************************************************************}
  1276. {
  1277. * Summary:
  1278. * Line direction types
  1279. *
  1280. * Discussion:
  1281. * These constants are used with the kATSULineDirectionTag control
  1282. * to determine overall line direction.
  1283. }
  1284. const
  1285. {
  1286. * Imposes left-to-right or top-to-bottom dominant direction.
  1287. }
  1288. kATSULeftToRightBaseDirection = 0;
  1289. {
  1290. * Impose right-to-left or bottom-to-top dominant direction.
  1291. }
  1292. kATSURightToLeftBaseDirection = 1;
  1293. const
  1294. kATSUStartAlignment = Fract($00000000);
  1295. kATSUEndAlignment = Fract($40000000);
  1296. kATSUCenterAlignment = Fract($20000000);
  1297. kATSUNoJustification = Fract($00000000);
  1298. kATSUFullJustification = Fract($40000000);
  1299. {
  1300. * Summary:
  1301. * This constant will be returned from ATSUFindFontFromName if no
  1302. * valid font can be found. If you pass this constant to
  1303. * ATSUSetAttributes, it will produce an error.
  1304. }
  1305. const
  1306. kATSUInvalidFontID = 0;
  1307. {
  1308. * Summary:
  1309. * Pass this constant to line breaking functions (i.e.,
  1310. * ATSUBreakLine, ATSUBatchBreakLines) if you have already set a
  1311. * line width as a layout control via the kATSULineWidthTag
  1312. * attribute.
  1313. }
  1314. const
  1315. kATSUUseLineControlWidth = $7FFFFFFF;
  1316. {
  1317. * Summary:
  1318. * Pass this constant to the iSelector parameter of the
  1319. * ATSUGetFontFeatureNameCode function if you wish to obtain the
  1320. * name code for a feature type rather than a feature selector.
  1321. }
  1322. const
  1323. kATSUNoSelector = $0000FFFF;
  1324. {
  1325. * Summary:
  1326. * Text buffer convenience constants.
  1327. *
  1328. * Discussion:
  1329. * These constants refer to the beginning and end of a text buffer.
  1330. * Functions which accept these constants are marked below. Do not
  1331. * pass these constants to functions which do not explicity state
  1332. * they will accept them.
  1333. }
  1334. const
  1335. {
  1336. * Refers to the beginning of a text buffer.
  1337. }
  1338. kATSUFromTextBeginning = $FFFFFFFF;
  1339. {
  1340. * Refers to the end of a text buffer.
  1341. }
  1342. kATSUToTextEnd = $FFFFFFFF;
  1343. {
  1344. * Used for bidi cursor movement between paragraphs.
  1345. }
  1346. kATSUFromPreviousLayout = $FFFFFFFE;
  1347. {
  1348. * Used for bidi cursor movement between paragraphs.
  1349. }
  1350. kATSUFromFollowingLayout = $FFFFFFFD;
  1351. {
  1352. * Summary:
  1353. * Other convenience constants.
  1354. }
  1355. const
  1356. {
  1357. * Pass this constant to functions that require a set of coordinates
  1358. * (i.e., ATSUDrawText, ATSUHighlightText) if you want ATSUI to use
  1359. * the current Quickdraw graphics port pen location.
  1360. }
  1361. kATSUUseGrafPortPenLoc = $FFFFFFFF;
  1362. {
  1363. * Pass this constant to functions such as ATSUClearAttributes and
  1364. * ATSUClearLayoutControls if you wish to clear all settings instead
  1365. * of a specific array of settings.
  1366. }
  1367. kATSUClearAll = $FFFFFFFF;
  1368. {$endc} {TARGET_OS_MAC}
  1369. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  1370. end.
  1371. {$endc} {not MACOSALLINCLUDE}