ATSUnicodeObjects.pas 116 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866
  1. {
  2. File: QD/ATSUnicodeObjects.h
  3. Contains: ATSUI object manipulation functions.
  4. Version: Quickdraw-150~1
  5. Copyright: © 2003 by Apple Computer, Inc., all rights reserved.
  6. Bugs?: For bug reports, consult the following page on
  7. the World Wide Web:
  8. http://www.freepascal.org/bugs.html
  9. }
  10. { Pascal Translation: Peter N Lewis, <[email protected]>, 2004 }
  11. {
  12. Modified for use with Free Pascal
  13. Version 200
  14. Please report any bugs to <[email protected]>
  15. }
  16. {$mode macpas}
  17. {$packenum 1}
  18. {$macro on}
  19. {$inline on}
  20. {$CALLING MWPASCAL}
  21. unit ATSUnicodeObjects;
  22. interface
  23. {$setc UNIVERSAL_INTERFACES_VERSION := $0342}
  24. {$setc GAP_INTERFACES_VERSION := $0200}
  25. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  26. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  27. {$endc}
  28. {$ifc defined CPUPOWERPC and defined CPUI386}
  29. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  30. {$endc}
  31. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  32. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  33. {$endc}
  34. {$ifc not defined __ppc__ and defined CPUPOWERPC}
  35. {$setc __ppc__ := 1}
  36. {$elsec}
  37. {$setc __ppc__ := 0}
  38. {$endc}
  39. {$ifc not defined __i386__ and defined CPUI386}
  40. {$setc __i386__ := 1}
  41. {$elsec}
  42. {$setc __i386__ := 0}
  43. {$endc}
  44. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  45. {$error Conflicting definitions for __ppc__ and __i386__}
  46. {$endc}
  47. {$ifc defined __ppc__ and __ppc__}
  48. {$setc TARGET_CPU_PPC := TRUE}
  49. {$setc TARGET_CPU_X86 := FALSE}
  50. {$elifc defined __i386__ and __i386__}
  51. {$setc TARGET_CPU_PPC := FALSE}
  52. {$setc TARGET_CPU_X86 := TRUE}
  53. {$elsec}
  54. {$error Neither __ppc__ nor __i386__ is defined.}
  55. {$endc}
  56. {$setc TARGET_CPU_PPC_64 := FALSE}
  57. {$ifc defined FPC_BIG_ENDIAN}
  58. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  59. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  60. {$elifc defined FPC_LITTLE_ENDIAN}
  61. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  62. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  63. {$elsec}
  64. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  65. {$endc}
  66. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  67. {$setc CALL_NOT_IN_CARBON := FALSE}
  68. {$setc OLDROUTINENAMES := FALSE}
  69. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  70. {$setc OPAQUE_UPP_TYPES := TRUE}
  71. {$setc OTCARBONAPPLICATION := TRUE}
  72. {$setc OTKERNEL := FALSE}
  73. {$setc PM_USE_SESSION_APIS := TRUE}
  74. {$setc TARGET_API_MAC_CARBON := TRUE}
  75. {$setc TARGET_API_MAC_OS8 := FALSE}
  76. {$setc TARGET_API_MAC_OSX := TRUE}
  77. {$setc TARGET_CARBON := TRUE}
  78. {$setc TARGET_CPU_68K := FALSE}
  79. {$setc TARGET_CPU_MIPS := FALSE}
  80. {$setc TARGET_CPU_SPARC := FALSE}
  81. {$setc TARGET_OS_MAC := TRUE}
  82. {$setc TARGET_OS_UNIX := FALSE}
  83. {$setc TARGET_OS_WIN32 := FALSE}
  84. {$setc TARGET_RT_MAC_68881 := FALSE}
  85. {$setc TARGET_RT_MAC_CFM := FALSE}
  86. {$setc TARGET_RT_MAC_MACHO := TRUE}
  87. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  88. {$setc TYPE_BOOL := FALSE}
  89. {$setc TYPE_EXTENDED := FALSE}
  90. {$setc TYPE_LONGLONG := TRUE}
  91. uses MacTypes,ATSUnicodeTypes,TextCommon,SFNTLayoutTypes;
  92. {$ALIGN MAC68K}
  93. { ---------------------------------------------------------------------------- }
  94. { ATSUI basic style functions }
  95. { ---------------------------------------------------------------------------- }
  96. {
  97. * ATSUCreateStyle()
  98. *
  99. * Summary:
  100. * Creates an ATSUStyle object with default settings.
  101. *
  102. * Discussion:
  103. * ATSUStyle objects created by this function have a default set of
  104. * values for all attributes. The attributes include settings such
  105. * as font, point size, color and so on. You can change the
  106. * attributes of a style object by calling the function
  107. * ATSUSetAttributes. You can also change font features and
  108. * variations set in an ATSUStyle by calling the functions
  109. * ATSUSetFontFeatures and ATSUSetVariations, respectively.
  110. * ATSUStyle objects are used by associating them with a run of
  111. * characters in an ATSUTextLayout object. You can do this by
  112. * calling functions such as ATSUSetRunStyle or
  113. * ATSUCreateTextLayoutWithTextPtr. You are responsible for freeing
  114. * memory assoicated with an ATSUStyle object by calling
  115. * ATSUDisposeStyle.
  116. *
  117. * Parameters:
  118. *
  119. * oStyle:
  120. * On return, a reference to an ATSUStyle object with default
  121. * settings.
  122. *
  123. * Result:
  124. * On success, noErr is returned. See MacErrors.h for possible error
  125. * codes.
  126. *
  127. * Availability:
  128. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  129. * CarbonLib: in CarbonLib 1.0 and later
  130. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  131. }
  132. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  133. function ATSUCreateStyle( var oStyle: ATSUStyle ): OSStatus; external name '_ATSUCreateStyle';
  134. {
  135. * ATSUCreateAndCopyStyle()
  136. *
  137. * Summary:
  138. * Creates a new ATSUStyle object with the same attributes, font
  139. * features, and font variation settings as the input style.
  140. *
  141. * Discussion:
  142. * All attributes, font features, and font variation settings of the
  143. * input ATSUStyle object are copied over to a newly created
  144. * ATSUStyle object. Note that reference constants are not copied.
  145. * You are responsible for freeing memory assoicated with the
  146. * returned ATSUStyle object by calling ATSUDisposeStyle.
  147. *
  148. * Parameters:
  149. *
  150. * iStyle:
  151. * The ATSUStyle object you want to copy.
  152. *
  153. * oStyle:
  154. * On return, a newly created ATSUStyle object. This will be an
  155. * exact copy of iStyle, except for the reference constant (if
  156. * set).
  157. *
  158. * Result:
  159. * On success, noErr is returned. See MacErrors.h for possible error
  160. * codes.
  161. *
  162. * Availability:
  163. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  164. * CarbonLib: in CarbonLib 1.0 and later
  165. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  166. }
  167. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  168. function ATSUCreateAndCopyStyle( iStyle: ATSUStyle; var oStyle: ATSUStyle ): OSStatus; external name '_ATSUCreateAndCopyStyle';
  169. {
  170. * ATSUDisposeStyle()
  171. *
  172. * Summary:
  173. * Disposes of the memory associated with a style object.
  174. *
  175. * Discussion:
  176. * The ATSUDisposeStyle function frees the memory associated with
  177. * the specified style object and its internal structures, including
  178. * style run attributes. It does not dispose of the memory pointed
  179. * to by application-defined style run attributes or reference
  180. * constants. You are responsible for doing so. You should call this
  181. * function after calling the function ATSUDisposeTextLayout to
  182. * dispose of any text layout objects associated with the style
  183. * object. For best performance, once you create a style object, you
  184. * should keep it and use it as often as needed. You should dispose
  185. * of the style object only when it is no longer needed in your
  186. * application.
  187. *
  188. * Parameters:
  189. *
  190. * iStyle:
  191. * The style you want to dispose of.
  192. *
  193. * Result:
  194. * On success, noErr is returned. See MacErrors.h for possible error
  195. * codes.
  196. *
  197. * Availability:
  198. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  199. * CarbonLib: in CarbonLib 1.0 and later
  200. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  201. }
  202. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  203. function ATSUDisposeStyle( iStyle: ATSUStyle ): OSStatus; external name '_ATSUDisposeStyle';
  204. {
  205. * ATSUSetStyleRefCon()
  206. *
  207. * Summary:
  208. * Sets a reference constant for an ATSUStyle object.
  209. *
  210. * Discussion:
  211. * Reference constants are any 32-bit value you wish to associate
  212. * with an object. It can be a pointer to application-specific data,
  213. * a SInt16 value, or anything you like. If you copy or clear a
  214. * style object that contains a reference constant, the reference
  215. * constant is neither copied nor removed. To obtain the reference
  216. * constant for a particular ATSUStyle object after it has been set,
  217. * use the function ATSUGetStyleRefCon.
  218. *
  219. * Parameters:
  220. *
  221. * iStyle:
  222. * An ATSUStyle object you want to set the reference constant for.
  223. *
  224. * iRefCon:
  225. * Any arbitrary 32-bit value containing or referring to
  226. * application-specific data.
  227. *
  228. * Result:
  229. * On success, noErr is returned. See MacErrors.h for possible error
  230. * codes.
  231. *
  232. * Availability:
  233. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  234. * CarbonLib: in CarbonLib 1.0 and later
  235. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  236. }
  237. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  238. function ATSUSetStyleRefCon( iStyle: ATSUStyle; iRefCon: UInt32 ): OSStatus; external name '_ATSUSetStyleRefCon';
  239. {
  240. * ATSUGetStyleRefCon()
  241. *
  242. * Summary:
  243. * Returns the reference constant for an ATSUStyle object.
  244. *
  245. * Discussion:
  246. * Together with ATSUSetStyleRefCon, this function provides a
  247. * mechanism for keeping application-specific data associated with
  248. * ATSUStyle objects. Note that if an ATSUStyle object is copied or
  249. * cleared, its associated reference constant, if any, is not copied
  250. * or cleared.
  251. *
  252. * Parameters:
  253. *
  254. * iStyle:
  255. * The style object for which to obtain application-specific data.
  256. *
  257. * oRefCon:
  258. * On return, the reference constant for iStyle.
  259. *
  260. * Result:
  261. * On success, noErr is returned. If no reference constant is set in
  262. * iStyle, paramErr is returned. See MacErrors.h for other possible
  263. * error codes.
  264. *
  265. * Availability:
  266. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  267. * CarbonLib: in CarbonLib 1.0 and later
  268. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  269. }
  270. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  271. function ATSUGetStyleRefCon( iStyle: ATSUStyle; var oRefCon: UInt32 ): OSStatus; external name '_ATSUGetStyleRefCon';
  272. { ---------------------------------------------------------------------------- }
  273. { ATSUI style comparison }
  274. { ---------------------------------------------------------------------------- }
  275. {
  276. * ATSUCompareStyles()
  277. *
  278. * Summary:
  279. * Compares two ATSUStyleObjects.
  280. *
  281. * Discussion:
  282. * The ATSUCompareStyles function compares the contents of two style
  283. * objects, including their style attributes, font features, and
  284. * font variations. It does not consider reference constants or
  285. * application-defined style attributes in the comparison. Note that
  286. * order is important, as the ATSUStyleComparison constants that can
  287. * be returned indicate "contains" vs. "contained by" based on which
  288. * style is considered first in the comparsion.
  289. *
  290. * Parameters:
  291. *
  292. * iFirstStyle:
  293. * The first style to be compared.
  294. *
  295. * iSecondStyle:
  296. * The second style to be compared.
  297. *
  298. * oComparison:
  299. * On return, the value contains the results of the comparison and
  300. * indicates whether the two style objects are the same,
  301. * different, or if one is a subset of the other. See the
  302. * definition of the ATSUStyleComparison type for more information
  303. * on possible values returned for this parameter.
  304. *
  305. * Result:
  306. * On success, noErr is returned. See MacErrors.h for possible error
  307. * codes.
  308. *
  309. * Availability:
  310. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  311. * CarbonLib: in CarbonLib 1.0 and later
  312. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  313. }
  314. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  315. function ATSUCompareStyles( iFirstStyle: ATSUStyle; iSecondStyle: ATSUStyle; var oComparison: ATSUStyleComparison ): OSStatus; external name '_ATSUCompareStyles';
  316. { ---------------------------------------------------------------------------- }
  317. { ATSUI style attribute manipulation }
  318. { ---------------------------------------------------------------------------- }
  319. {
  320. * ATSUCopyAttributes()
  321. *
  322. * Summary:
  323. * Copies attributes from one style to another.
  324. *
  325. * Discussion:
  326. * There are three types of settings in a style: attributes, font
  327. * features, and font variations. This function copies only the
  328. * first. To copy all three types of settings, use the function
  329. * ATSUCreateAndCopyStyle. Also note that this function does not
  330. * copy reference constants.
  331. *
  332. * Parameters:
  333. *
  334. * iSourceStyle:
  335. * The style whose attributes you are copying from.
  336. *
  337. * iDestinationStyle:
  338. * The style whose attributes you are copying to.
  339. *
  340. * Result:
  341. * On success, noErr is returned. See MacErrors.h for possible error
  342. * codes.
  343. *
  344. * Availability:
  345. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  346. * CarbonLib: in CarbonLib 1.0 and later
  347. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  348. }
  349. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  350. function ATSUCopyAttributes( iSourceStyle: ATSUStyle; iDestinationStyle: ATSUStyle ): OSStatus; external name '_ATSUCopyAttributes';
  351. {
  352. * ATSUOverwriteAttributes()
  353. *
  354. * Summary:
  355. * Copies to a destination style object the nondefault style
  356. * attribute settings of a source style object.
  357. *
  358. * Discussion:
  359. * The ATSUOverwriteAttributes function copies all nondefault style
  360. * attribute values from a source style object to a destination
  361. * style object. The source object's nondefault values are applied
  362. * to the destination object whether or not the destination object
  363. * also has nondefault values for the copied attributes. All other
  364. * settings in the destination style object are left unchanged.
  365. * ATSUOverwriteAttributes does not copy the contents of memory
  366. * referenced by pointers within custom style attributes or within
  367. * reference constants. You are responsible for ensuring that this
  368. * memory remains valid until both the source and destination style
  369. * objects are disposed of. To create a style object that contains
  370. * all the contents of another style object, call the function
  371. * ATSUCreateAndCopyStyle. To copy all the style attributes
  372. * (including any default settings) of a style object into an
  373. * existing style object, call the function ATSUCopyAttributes. To
  374. * copy style attributes that are set in the source but not in the
  375. * destination style object, call the function
  376. * ATSUUnderwriteAttributes.
  377. *
  378. * Parameters:
  379. *
  380. * iSourceStyle:
  381. * An ATSUStyle value specifying the style object from which to
  382. * copy nondefault style attributes.
  383. *
  384. * iDestinationStyle:
  385. * An ATSUStyle value specifying the style object containing the
  386. * style attributes to be overwritten.
  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
  394. * CarbonLib: in CarbonLib 1.0 and later
  395. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  396. }
  397. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  398. function ATSUOverwriteAttributes( iSourceStyle: ATSUStyle; iDestinationStyle: ATSUStyle ): OSStatus; external name '_ATSUOverwriteAttributes';
  399. {
  400. * ATSUUnderwriteAttributes()
  401. *
  402. * Summary:
  403. * Copies to a destination style object only those nondefault style
  404. * attribute settings of a source style object that are at default
  405. * settings in the destination object.
  406. *
  407. * Discussion:
  408. * The ATSUUnderwriteAttributes function copies to a destination
  409. * style object only those nondefault style attribute values of a
  410. * source style object that are not currently set in a destination
  411. * style object. Note that the corresponding value in the
  412. * destination object must not be set in order for a copied value to
  413. * be applied. All other quantities in the destination style object
  414. * are left unchanged. ATSUUnderwriteAttributes does not copy the
  415. * contents of memory referenced by pointers within custom style
  416. * attributes or within reference constants. You are responsible for
  417. * ensuring that this memory remains valid until both the source and
  418. * destination style objects are disposed of. To create a style
  419. * object that contains all the contents of another style object,
  420. * call the function ATSUCreateAndCopyStyle. To copy all the style
  421. * attributes (including any default settings) of a style object
  422. * into an existing style object, call the function
  423. * ATSUCopyAttributes. To copy style attributes that are set in the
  424. * source whether or not they are set in the destination style
  425. * object, call the function ATSUOverwriteAttributes.
  426. *
  427. * Parameters:
  428. *
  429. * iSourceStyle:
  430. * An ATSUStyle value specifying the style object from which to
  431. * copy nondefault style attributes.
  432. *
  433. * iDestinationStyle:
  434. * An ATSUStyle value specifying the style object containing style
  435. * attribute values to be set.
  436. *
  437. * Result:
  438. * On success, noErr is returned. See MacErrors.h for possible error
  439. * codes.
  440. *
  441. * Availability:
  442. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  443. * CarbonLib: in CarbonLib 1.0 and later
  444. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  445. }
  446. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  447. function ATSUUnderwriteAttributes( iSourceStyle: ATSUStyle; iDestinationStyle: ATSUStyle ): OSStatus; external name '_ATSUUnderwriteAttributes';
  448. { ---------------------------------------------------------------------------- }
  449. { Empty ATSUI styles }
  450. { ---------------------------------------------------------------------------- }
  451. {
  452. * ATSUClearStyle()
  453. *
  454. * Summary:
  455. * Restores default values to a style object.
  456. *
  457. * Discussion:
  458. * Clears a style object of all style attributes (including any
  459. * application-defined attributes), font features, and font
  460. * variations and returns these values to their default settings. To
  461. * clear attributes, font features, or font variations individually,
  462. * use the functions ATSUClearAttributes, ATSUClearFontVariations,
  463. * or ATSUClearFontFeatures, respectively. Note that ATSUClearStyle
  464. * does not affect Reference constants.
  465. *
  466. * Parameters:
  467. *
  468. * iStyle:
  469. * The style to be cleared.
  470. *
  471. * Result:
  472. * On success, noErr is returned. See MacErrors.h for possible error
  473. * codes.
  474. *
  475. * Availability:
  476. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  477. * CarbonLib: in CarbonLib 1.0 and later
  478. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  479. }
  480. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  481. function ATSUClearStyle( iStyle: ATSUStyle ): OSStatus; external name '_ATSUClearStyle';
  482. {
  483. * ATSUStyleIsEmpty()
  484. *
  485. * Summary:
  486. * Indicates whether a style object contains only default values.
  487. *
  488. * Discussion:
  489. * You can call the ATSUStyleIsEmpty function to determine whether a
  490. * style object contains only default values for style attributes,
  491. * font features, and font variations. ATSUStyleIsEmpty does not
  492. * consider reference constants in its evaluation.
  493. *
  494. * Parameters:
  495. *
  496. * iStyle:
  497. * An ATSUStyle value specifying the style object to examine.
  498. *
  499. * oIsClear:
  500. * On return, the value is set to true if the style object
  501. * contains only default values for style attributes, font
  502. * features, and font variations. If false , the style object
  503. * contains one or more nondefault values for style attributes,
  504. * font features, or font variations. Reference constants do not
  505. * affect this result.
  506. *
  507. * Result:
  508. * On success, noErr is returned. See MacErrors.h for possible error
  509. * codes.
  510. *
  511. * Availability:
  512. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  513. * CarbonLib: in CarbonLib 1.0 and later
  514. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  515. }
  516. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  517. function ATSUStyleIsEmpty( iStyle: ATSUStyle; var oIsClear: Boolean ): OSStatus; external name '_ATSUStyleIsEmpty';
  518. { ---------------------------------------------------------------------------- }
  519. { ATSUI style attribute getters and setters }
  520. { ---------------------------------------------------------------------------- }
  521. {
  522. * ATSUCalculateBaselineDeltas()
  523. *
  524. * Summary:
  525. * Obtains the optimal baseline positions for glyphs in a style run.
  526. *
  527. * Discussion:
  528. * Depending on the writing system, a baseline may be above, below,
  529. * or through the centers of glyphs. In general, a style run has a
  530. * default baseline, to which all glyphs are visually aligned when
  531. * the text is laid out. For example, in a run of Roman text, the
  532. * default baseline is the Roman baseline, upon which glyphs sit
  533. * (except for descenders, which extend below the baseline). You can
  534. * call the ATSUCalculateBaselineDeltas function to obtain the
  535. * distances from a specified baseline type to that of other
  536. * baseline types for a given style object.
  537. * ATSUCalculateBaselineDeltas takes into account font and text size
  538. * when performing these calculations. ATSUI uses these distances to
  539. * determine the cross-stream shifting to apply when aligning glyphs
  540. * in a style run. You can use the resulting array to set or obtain
  541. * the optimal baseline positions of glyphs in a style run. You can
  542. * also set various baseline values to create special effects such
  543. * as drop capitals. The functions ATSUSetLineControls and
  544. * ATSUSetLayoutControls allow you to set baseline offset values at
  545. * the line or layout level, respectively, using the
  546. * kATSULineBaselineValuesTag control attribute tag.
  547. *
  548. * Parameters:
  549. *
  550. * iStyle:
  551. * An ATSUStyle value specifying the style object to examine.
  552. *
  553. * iBaselineClass:
  554. * A BslnBaselineClass constant identifying the primary baseline
  555. * from which to measure other baselines. See SFNTLayoutTypes.h
  556. * for an enumeration of possible values. Pass the constant
  557. * kBSLNNoBaselineOverride to use the standard baseline value from
  558. * the current font.
  559. *
  560. * oBaselineDeltas:
  561. * On return, an array that contains baseline offsets, specifying
  562. * distances measured in points, from the default baseline to each
  563. * of the other baseline types in the style object. Positive
  564. * values indicate baselines above the default baseline and
  565. * negative values indicate baselines below it. See
  566. * SFNTLayoutTypes.h for a description of the BslnBaselineRecord
  567. * type.
  568. *
  569. * Result:
  570. * On success, noErr is returned. See MacErrors.h for possible error
  571. * codes.
  572. *
  573. * Availability:
  574. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  575. * CarbonLib: in CarbonLib 1.0 and later
  576. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  577. }
  578. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  579. function ATSUCalculateBaselineDeltas( iStyle: ATSUStyle; iBaselineClass: BslnBaselineClass; oBaselineDeltas: BslnBaselineRecord ): OSStatus; external name '_ATSUCalculateBaselineDeltas';
  580. {
  581. * ATSUSetAttributes()
  582. *
  583. * Summary:
  584. * Sets style attribute values in a style object.
  585. *
  586. * Discussion:
  587. * Style attributes are a collection of values and settings that
  588. * specify information about a style such as font, point size, and
  589. * color. To specify a style attribute, ATSUI uses a "triple"
  590. * consisting of (1) an attribute tag, (2) a value for that tag, and
  591. * (3) the size of the value. For a list of possible tags and their
  592. * default values, see the ATSUI documentation, or the definition of
  593. * ATSUAttributeTag elsewhere in this header file. When you call
  594. * ATSUSetAttributes, any style attributes that you do not set
  595. * retain their previous values. To set font features and font
  596. * variations, call the functions ATSUSetFontFeatures and
  597. * ATSUSetVariations, respectively.
  598. *
  599. * Parameters:
  600. *
  601. * iStyle:
  602. * A style in which to set attributes.
  603. *
  604. * iAttributeCount:
  605. * An ItemCount value specifying the number of attributes to set.
  606. * This value should correspond to the number of elements in the
  607. * iTag, iValueSize, and iValue arrays.
  608. *
  609. * iTag:
  610. * An array of attribute tags. The number of elements in this
  611. * array must not be less than iAttributeCount. Each element in
  612. * the array must contain a valid style attribute tag (see the
  613. * definition of ATSUAttributeTag for possible values).
  614. *
  615. * iValueSize:
  616. * An array of ByteCount values. The number of elements in this
  617. * array must not be less than iAttributeCount. Each ByteCount
  618. * value corresoponds to the size of an element referred to by a
  619. * pointer in the iValue array.
  620. *
  621. * iValue:
  622. * An array of pointers of type ATSUAttributeValuePtr. Each
  623. * pointer referrs to a value that corresponds to a tag specified
  624. * by the iTag array. The size of the data referred to is
  625. * determined by a corresponding element in the iValueSize array.
  626. * The number of elements in this array must not be less than
  627. * iAttributeCount.
  628. *
  629. * Result:
  630. * On success, noErr is returned. See MacErrors.h for possible error
  631. * codes.
  632. *
  633. * Availability:
  634. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  635. * CarbonLib: in CarbonLib 1.0 and later
  636. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  637. }
  638. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  639. function ATSUSetAttributes( iStyle: ATSUStyle; iAttributeCount: ItemCount; iTag: ATSUAttributeTagPtr; iValueSize: ByteCountPtr; iValue: ATSUAttributeValuePtrPtr ): OSStatus; external name '_ATSUSetAttributes';
  640. {
  641. * ATSUGetAttribute()
  642. *
  643. * Summary:
  644. * Obtains a single attribute value for a style object.
  645. *
  646. * Discussion:
  647. * The ATSUGetAttribute function obtains the value of a specified
  648. * style attribute for a given style object. Before calling
  649. * ATSUGetAttribute, you should call the function
  650. * ATSUGetAllAttributes to obtain an array of nondefault style
  651. * attribute tags and value sizes for the style object. You can then
  652. * pass ATSUGetAttribute the tag and value size for the attribute
  653. * value to obtain. This function may return kATSUNotSetErr for some
  654. * attributes that have not been set to a non-default via a call to
  655. * ATSUSetAttributes.
  656. *
  657. * Parameters:
  658. *
  659. * iStyle:
  660. * The style object you with to retrieve an attribute value from.
  661. *
  662. * iTag:
  663. * The tag you wish to obtain the value of.
  664. *
  665. * iExpectedValueSize:
  666. * The size of the buffer pointed to by oValue.
  667. *
  668. * oValue:
  669. * On input, a buffer you have allocated to retain the value of
  670. * the specified attribute. On return, the value of the requested
  671. * attribute will be placed here. You may pass NULL for this
  672. * parameter. can be NULL
  673. *
  674. * oActualValueSize:
  675. * On return, the actual number of bytes written to oValue is
  676. * placed here. You may pass NULL for this parameter. can be NULL
  677. *
  678. * Result:
  679. * On success, noErr is returned. See MacErrors.h for possible error
  680. * codes.
  681. *
  682. * Availability:
  683. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  684. * CarbonLib: in CarbonLib 1.0 and later
  685. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  686. }
  687. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  688. function ATSUGetAttribute( iStyle: ATSUStyle; iTag: ATSUAttributeTag; iExpectedValueSize: ByteCount; oValue: ATSUAttributeValuePtr; oActualValueSize: ByteCountPtr ): OSStatus; external name '_ATSUGetAttribute';
  689. {
  690. * ATSUGetAllAttributes()
  691. *
  692. * Summary:
  693. * Obtains an array of style attribute tags and value sizes for a
  694. * style object.
  695. *
  696. * Discussion:
  697. * This function returns information as to which attributes have had
  698. * non-default values set in a particular ATSUStyle object. It will
  699. * also return the size in bytes of the values of these attributes.
  700. * Using this information, you can then call ATSUGetAttribute to
  701. * obtain the value of a given attribute. Typically you use the
  702. * function ATSUGetAllAttributes by calling it twice, as follows:
  703. * (1) Pass a reference to the style object to examine in the iStyle
  704. * parameter, a valid pointer to an ItemCount value in the
  705. * oTagValuePairCount parameter, NULL for the oAttributeInfoArray
  706. * parameter, and 0 for the iTagValuePairArraySize parameter.
  707. * ATSUGetAllAttributes returns the size of the tag and value-size
  708. * arrays in the oTagValuePairCount parameter. (2) Allocate enough
  709. * space for an array of the returned size, then call the
  710. * ATSUGetAllAttributes function again, passing a valid pointer in
  711. * the oAttributeInfoArray parameter. On return, the pointer refers
  712. * to an array of the style attribute tag and value-size pairs
  713. * contained in the style object.
  714. *
  715. * Parameters:
  716. *
  717. * iStyle:
  718. * The style object you wish to retrieve a list of attribute tags
  719. * from.
  720. *
  721. * oAttributeInfoArray:
  722. * On return, an array of ATSUAttributeInfo structures. Each
  723. * structure contains information about an attribute in iStyle
  724. * that has a non-default value. You must allocate space for this
  725. * array. If you are unsure how much space to allocate, you may
  726. * pass NULL for this parameter and use the oTagValuePairCount
  727. * parameter to determine how much space to allocate. can be NULL
  728. *
  729. * iTagValuePairArraySize:
  730. * The size of the array you allocated and are passing in for the
  731. * oAttributeInfoArray parameter.
  732. *
  733. * oTagValuePairCount:
  734. * On return, the number of attributes whose information was
  735. * stored in the oAttributeInfoArray parameter. can be NULL
  736. *
  737. * Result:
  738. * On success, noErr is returned. See MacErrors.h for possible error
  739. * codes.
  740. *
  741. * Availability:
  742. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  743. * CarbonLib: in CarbonLib 1.0 and later
  744. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  745. }
  746. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  747. function ATSUGetAllAttributes( iStyle: ATSUStyle; oAttributeInfoArray: ATSUAttributeInfoPtr; iTagValuePairArraySize: ItemCount; oTagValuePairCount: ItemCountPtr ): OSStatus; external name '_ATSUGetAllAttributes';
  748. {
  749. * ATSUClearAttributes()
  750. *
  751. * Summary:
  752. * Restores default values to the specified style attributes of a
  753. * style object.
  754. *
  755. * Discussion:
  756. * Removes those style attribute values identified by the tag
  757. * constants in the iTag array and replaces them with the default
  758. * values. For a list of possible tags and their default values, see
  759. * the ATSUI documentation, or the definition of ATSUAttributeTag
  760. * elsewhere in this header file. If you specify that any currently
  761. * unset attribute values be removed, ATSUClearAttributes does not
  762. * return an error. Note this function only deals with attributes.
  763. * To remove all previously set style attributes as well as font
  764. * features and font variations from a style object, call the
  765. * function ATSUClearStyle.
  766. *
  767. * Parameters:
  768. *
  769. * iStyle:
  770. * A style whose attributes you want to clear.
  771. *
  772. * iTagCount:
  773. * The number of tags you are passing in via the iTag parameter.
  774. * Pass kATSUClearAll to clear all attributes.
  775. *
  776. * iTag:
  777. * An array of ATSUAttributeTag indicating which attributes to
  778. * clear. You may pass NULL for this parameter if you are passing
  779. * kATSUClearAll for the iTagCount parameter. can be NULL
  780. *
  781. * Result:
  782. * On success, noErr is returned. See MacErrors.h for possible error
  783. * codes.
  784. *
  785. * Availability:
  786. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  787. * CarbonLib: in CarbonLib 1.0 and later
  788. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  789. }
  790. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  791. function ATSUClearAttributes( iStyle: ATSUStyle; iTagCount: ItemCount; iTag: ATSUAttributeTagPtr ): OSStatus; external name '_ATSUClearAttributes';
  792. { ---------------------------------------------------------------------------- }
  793. { ATSUI basic text layout functions }
  794. { ---------------------------------------------------------------------------- }
  795. {
  796. * ATSUCreateTextLayout()
  797. *
  798. * Summary:
  799. * Creates an opaque text layout object containing only default text
  800. * layout attributes.
  801. *
  802. * Discussion:
  803. * This function creates a empty text layout object that has no
  804. * styles or text buffer associated with it. Most ATSUI functions
  805. * that operate on text layout objects require that the objects be
  806. * associated with style information and text. To associate style
  807. * objects and text with an empty text layout object, you can call
  808. * the functions ATSUSetRunStyle and ATSUSetTextPointerLocation .
  809. * Or, to create a text layout object and associate style objects
  810. * and text with it at the same time, you can call the function
  811. * ATSUCreateTextLayoutWithTextPtr. To provide nondefault line or
  812. * layout attributes for a text layout object, you can call the
  813. * functions ATSUSetLineControls or ATSUSetLayoutControls . After
  814. * setting text attributes, call ATSUDrawText to draw the text. Text
  815. * layout objects are readily reusable and should be cached for
  816. * later use, if possible. You can reuse a text layout object even
  817. * if the text associated with it is altered. Call the functions
  818. * ATSUSetTextPointerLocation, ATSUTextDeleted, or ATSUTextInserted
  819. * to manage the altered text.
  820. *
  821. * Parameters:
  822. *
  823. * oTextLayout:
  824. * On return, the value refers to an empty text layout object.
  825. *
  826. * Result:
  827. * On success, noErr is returned. See MacErrors.h for possible error
  828. * codes.
  829. *
  830. * Availability:
  831. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  832. * CarbonLib: in CarbonLib 1.0 and later
  833. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  834. }
  835. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  836. function ATSUCreateTextLayout( var oTextLayout: ATSUTextLayout ): OSStatus; external name '_ATSUCreateTextLayout';
  837. {
  838. * ATSUCreateAndCopyTextLayout()
  839. *
  840. * Summary:
  841. * Creates a copy of a text layout object.
  842. *
  843. * Discussion:
  844. * This function creates a copy of the source text layout object's
  845. * style runs (including references to the associated text buffer
  846. * and style objects), line attributes, layout attributes, and
  847. * layout caches. ATSUCreateAndCopyTextLayout does not copy
  848. * reference constants. To create a text layout object without
  849. * copying a source object, you can the function
  850. * ATSUCreateTextLayout or the function
  851. * ATSUCreateTextLayoutWithTextPtr.
  852. *
  853. * Parameters:
  854. *
  855. * iTextLayout:
  856. * The layout to be copied.
  857. *
  858. * oTextLayout:
  859. * On return, a reference to a layout object which is a copy of
  860. * iTextLayout.
  861. *
  862. * Result:
  863. * On success, noErr is returned. See MacErrors.h for possible error
  864. * codes.
  865. *
  866. * Availability:
  867. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  868. * CarbonLib: in CarbonLib 1.0 and later
  869. * Non-Carbon CFM: in ATSUnicodeLib 8.6 and later
  870. }
  871. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  872. function ATSUCreateAndCopyTextLayout( iTextLayout: ATSUTextLayout; var oTextLayout: ATSUTextLayout ): OSStatus; external name '_ATSUCreateAndCopyTextLayout';
  873. {
  874. * ATSUCreateTextLayoutWithTextPtr()
  875. *
  876. * Summary:
  877. * Creates an opaque text layout object containing default text
  878. * layout attributes as well as associated text and text styles.
  879. *
  880. * Discussion:
  881. * This function creates a text layout object and associates the
  882. * specified text buffer and style runs with it. All layout
  883. * attributes are set to their default values. To provide nondefault
  884. * line or layout attributes for a text layout object, you can call
  885. * the functions ATSUSetLineControls or ATSUSetLayoutControls. After
  886. * setting text attributes, call ATSUDrawText to draw the text.
  887. * Because the only way that ATSUI interacts with text is via the
  888. * memory references you associate with a text layout object, you
  889. * are responsible for keeping these references updated through use
  890. * of the functions ATSUTextInserted, ATSUTextDeleted,
  891. * ATSUTextMoved, and ATSUSetTextPointerLocation. Note that, because
  892. * ATSUI objects retain state information, doing superfluous calling
  893. * can degrade performance. For example, you could call
  894. * ATSUSetTextPointerLocation rather than ATSUTextInserted when the
  895. * user inserts text, but there would be a performance penalty, as
  896. * all the layout caches are flushed when you call
  897. * ATSUSetTextPointerLocation , rather than just the affected ones.
  898. * Text layout objects are readily reusable and should themselves be
  899. * cached for later use, if possible. Text objects are thread-safe
  900. * starting with ATSUI version 2.4.
  901. *
  902. * Parameters:
  903. *
  904. * iText:
  905. * A text buffer containing UTF-16Ðencoded text. ATSUI associates
  906. * this buffer with the new text layout object and analyzes the
  907. * complete text of the buffer when obtaining the layout context
  908. * for the current text range. Thus, for paragraph-format text, if
  909. * you specify a buffer containing less than a complete paragraph,
  910. * some of ATSUI's layout results are not guaranteed to be
  911. * accurate. For example, with a buffer of less than a full
  912. * paragraph, ATSUI can neither reliably obtain the context for
  913. * bidirectional processing nor reliably generate accent
  914. * attachments and ligature formations for Roman text.
  915. *
  916. * iTextOffset:
  917. * The offset from the beginning of the text buffer to the first
  918. * character of the range to include in the layout. To indicate
  919. * that the specified text range starts at the beginning of the
  920. * text buffer, you can pass the constant kATSUFromTextBeginning.
  921. * To specify the entire text buffer, pass kATSUFromTextBeginning
  922. * in this parameter and kATSUToTextEnd in the iTextLength
  923. * parameter. For best results, use one layout for each paragraph
  924. * within the text buffer.
  925. *
  926. * iTextLength:
  927. * The length of the text range. Note that the sum of iTextOffset
  928. * and iTextLength must be less than or equal to the value of the
  929. * iTextTotalLength parameter. If you want the range of text to
  930. * extend to the end of the text buffer, you can pass the constant
  931. * kATSUToTextEnd. For best results, use one layout for each
  932. * paragraph within the text buffer.
  933. *
  934. * iTextTotalLength:
  935. * The length of the entire text buffer referred to by iText. This
  936. * value should be greater than or equal to the range of text
  937. * defined by the iTextLength parameter.
  938. *
  939. * iNumberOfRuns:
  940. * The number of text style runs you want to define within the
  941. * overall text range. The number of style objects and style run
  942. * lengths passed in the iStyles and iRunLengths parameters,
  943. * respectively, should be equal to the number of runs specified
  944. * here.
  945. *
  946. * iRunLengths:
  947. * An array providing ATSUI with the lengths of each of the text's
  948. * style runs. You can pass kATSUToTextEnd for the last style run
  949. * length if you want the style run to extend to the end of the
  950. * text range. If the sum of the style run lengths is less than
  951. * the total length of the text range, the remaining characters
  952. * are assigned to the last style run.
  953. *
  954. * iStyles:
  955. * An array of styles, each corresponding to a style run defined
  956. * in iRunLengths. The same ATSUStyle object may be referred to
  957. * more than once in this array. The number of elements in this
  958. * array must be equal to the value specified by the iNumberOfRuns
  959. * parameter.
  960. *
  961. * oTextLayout:
  962. * A valid pointer to an ATSUTextLayout value. On return, the
  963. * value refers to the newly created text layout object.
  964. *
  965. * Result:
  966. * On success, noErr is returned. See MacErrors.h for possible error
  967. * codes.
  968. *
  969. * Availability:
  970. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  971. * CarbonLib: in CarbonLib 1.0 and later
  972. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  973. }
  974. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  975. function ATSUCreateTextLayoutWithTextPtr( iText: ConstUniCharArrayPtr; iTextOffset: UniCharArrayOffset; iTextLength: UniCharCount; iTextTotalLength: UniCharCount; iNumberOfRuns: ItemCount; iRunLengths: UniCharCountPtr; iStyles: ATSUStylePtr; var oTextLayout: ATSUTextLayout ): OSStatus; external name '_ATSUCreateTextLayoutWithTextPtr';
  976. {
  977. * ATSUClearLayoutCache()
  978. *
  979. * Summary:
  980. * Clears the layout cache of a line or an entire text layout object.
  981. *
  982. * Discussion:
  983. * The layout cache contains all the layout information ATSUI
  984. * calculates and needs to draw a range of text in a text layout
  985. * object. This includes caret positions, the memory locations of
  986. * glyphs, and other information needed to lay out the glyphs. ATSUI
  987. * uses information in the layout cache to avoid laying out the text
  988. * again, thereby improving performance. When you clear the layout
  989. * cache of a line or block of text, ATSUI takes longer to redraw a
  990. * line, since it must perform the calculations that support glyph
  991. * layout again. You should call the function ATSUClearLayoutCache
  992. * when you need to decrease the amount of memory your application
  993. * uses. This function reclaims memory at the cost of optimal
  994. * performance. By default, the ATSUClearLayoutCache function
  995. * removes the layout cache of a single line. To clear the layout
  996. * cache for multiple lines, you should call ATSUClearLayoutCache
  997. * for each line. To clear the layout cache of an entire text layout
  998. * object, pass the constant kATSUFromTextBeginning in the
  999. * iLineStart parameter. Note that ATSUClearLayoutCache does not
  1000. * produce a function error if lines do not have a layout cache. The
  1001. * ATSUClearLayoutCache function flushes the layout cache but does
  1002. * not alter previously set text layout attributes, soft line break
  1003. * positions, or the text memory location. If you do not want to
  1004. * retain these values, you should dispose of the text layout object
  1005. * by calling the ATSUDisposeTextLayout function.
  1006. *
  1007. * Parameters:
  1008. *
  1009. * iTextLayout:
  1010. * The layout for which to clear the layout caches.
  1011. *
  1012. * iLineStart:
  1013. * The offset from the beginning of the text buffer to the
  1014. * beginning of the line for which to discard the layout cache. If
  1015. * the range of text spans multiple lines, you should call
  1016. * ATSUClearLayoutCache for each line, passing the offset
  1017. * corresponding to the beginning of the new line to draw with
  1018. * each call. To clear the layout cache of the entire text layout
  1019. * object, you can pass the constant kATSUFromTextBeginning.
  1020. *
  1021. * Result:
  1022. * On success, noErr is returned. See MacErrors.h for possible error
  1023. * codes.
  1024. *
  1025. * Availability:
  1026. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1027. * CarbonLib: in CarbonLib 1.0 and later
  1028. * Non-Carbon CFM: in ATSUnicodeLib 8.6 and later
  1029. }
  1030. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  1031. function ATSUClearLayoutCache( iTextLayout: ATSUTextLayout; iLineStart: UniCharArrayOffset ): OSStatus; external name '_ATSUClearLayoutCache';
  1032. {
  1033. * ATSUDisposeTextLayout()
  1034. *
  1035. * Summary:
  1036. * Disposes of the memory associated with a text layout object.
  1037. *
  1038. * Discussion:
  1039. * This function frees the memory associated with the specified text
  1040. * layout object and its internal structures, including line and
  1041. * layout control attributes, style runs, and soft line breaks.
  1042. * ATSUDisposeTextLayout does not dispose of any memory that may be
  1043. * allocated for the text buffer, style objects, or reference
  1044. * constants associated with the text layout object. You are
  1045. * responsible for doing so. For best performance, text layout
  1046. * objects are readily reusable and should be cached for later use,
  1047. * if possible. You can reuse a text layout object even if the text
  1048. * associated with it is altered. Call the functions
  1049. * ATSUSetTextPointerLocation, ATSUTextDeleted, or ATSUTextInserted
  1050. * to manage the altered text, rather than disposing of the text
  1051. * layout object and creating a new one.
  1052. *
  1053. * Parameters:
  1054. *
  1055. * iTextLayout:
  1056. * The layout object to dispose of.
  1057. *
  1058. * Result:
  1059. * On success, noErr is returned. See MacErrors.h for possible error
  1060. * codes.
  1061. *
  1062. * Availability:
  1063. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1064. * CarbonLib: in CarbonLib 1.0 and later
  1065. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  1066. }
  1067. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  1068. function ATSUDisposeTextLayout( iTextLayout: ATSUTextLayout ): OSStatus; external name '_ATSUDisposeTextLayout';
  1069. {
  1070. * ATSUSetTextLayoutRefCon()
  1071. *
  1072. * Summary:
  1073. * Sets application-specific data for a text layout object.
  1074. *
  1075. * Discussion:
  1076. * This function associates a reference constant (that is,
  1077. * application-specific data) with a text layout object. You might
  1078. * typically use ATSUSetTextLayoutRefCon to track user preferences
  1079. * that can effect layout, for example. If you copy or clear a text
  1080. * layout object containing a reference constant, the reference
  1081. * constant is not copied or removed. When you dispose of a text
  1082. * layout object that contains a reference constant, you are
  1083. * responsible for freeing any memory allocated for the reference
  1084. * constant. Calling the function ATSUDisposeTextLayout does not do
  1085. * so.
  1086. *
  1087. * Parameters:
  1088. *
  1089. * iTextLayout:
  1090. * A layout for which you wish to set a reference constant.
  1091. *
  1092. * iRefCon:
  1093. * Any arbitrary 32-bit value you wish to store in association
  1094. * with iTextLayout.
  1095. *
  1096. * Result:
  1097. * On success, noErr is returned. See MacErrors.h for possible error
  1098. * codes.
  1099. *
  1100. * Availability:
  1101. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1102. * CarbonLib: in CarbonLib 1.0 and later
  1103. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  1104. }
  1105. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  1106. function ATSUSetTextLayoutRefCon( iTextLayout: ATSUTextLayout; iRefCon: UInt32 ): OSStatus; external name '_ATSUSetTextLayoutRefCon';
  1107. {
  1108. * ATSUGetTextLayoutRefCon()
  1109. *
  1110. * Summary:
  1111. * Obtains application-specific data for a text layout object.
  1112. *
  1113. * Discussion:
  1114. * This function obtains a reference constant (that is,
  1115. * application-specific data) associated with a text layout object.
  1116. * To associate a reference constant with a text layout object, call
  1117. * the function ATSUSetTextLayoutRefCon.
  1118. *
  1119. * Parameters:
  1120. *
  1121. * iTextLayout:
  1122. * A layout for which you wish to retreive the reference constant.
  1123. *
  1124. * oRefCon:
  1125. * On return, the reference constant associated with iTextLayout.
  1126. *
  1127. * Result:
  1128. * On success, noErr is returned. See MacErrors.h for possible error
  1129. * codes.
  1130. *
  1131. * Availability:
  1132. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1133. * CarbonLib: in CarbonLib 1.0 and later
  1134. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  1135. }
  1136. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  1137. function ATSUGetTextLayoutRefCon( iTextLayout: ATSUTextLayout; var oRefCon: UInt32 ): OSStatus; external name '_ATSUGetTextLayoutRefCon';
  1138. { ---------------------------------------------------------------------------- }
  1139. { ATSUI text buffer manipulation }
  1140. { ---------------------------------------------------------------------------- }
  1141. {
  1142. * ATSUSetTextPointerLocation()
  1143. *
  1144. * Summary:
  1145. * Associates a text buffer with a text layout object or updates
  1146. * previously associated text.
  1147. *
  1148. * Discussion:
  1149. * For ATSUI to render your text, you must associate the text with
  1150. * both a text layout object and style information. Some functions,
  1151. * such as ATSUCreateTextLayoutWithTextPtr, create a text layout
  1152. * object and associate text with it concurrently. However, if you
  1153. * use the function ATSUCreateTextLayout to create a text layout
  1154. * object, you must assign text to the object prior to attempting
  1155. * most ATSUI operations. You can use the function
  1156. * ATSUSetTextPointerLocation to associate text with a layout
  1157. * object. When you call this function, you are both assigning a
  1158. * text buffer to a text layout object and specifying the current
  1159. * text subrange within the buffer to include in the layout. If
  1160. * there is already text associated with a text layout object,
  1161. * calling ATSUSetTextPointerLocation overrides the previously
  1162. * associated text, as well as clearing the object's layout caches.
  1163. * You would typically only call this function for a text layout
  1164. * object with existing associated text if either (a) both the
  1165. * buffer itself is relocated and a subrange of the buffer's text is
  1166. * deleted or inserted or (b) when associating an entirely different
  1167. * buffer with a text layout object. Note that, because ATSUI
  1168. * objects retain state, doing superfluous calling can degrade
  1169. * performance. For example, you could call
  1170. * ATSUSetTextPointerLocation rather than ATSUTextInserted when the
  1171. * user simply inserts a subrange of text within a text buffer, but
  1172. * there would be a performance penalty, as all the layout caches
  1173. * are flushed by ATSUSetTextPointerLocation, rather than just the
  1174. * affected ones. Similarly, you should not call
  1175. * ATSUSetTextPointerLocation, when an entire text buffer associated
  1176. * with a text layout object is relocated, but no other changes have
  1177. * occurred that would affect the buffer's current subrange.
  1178. * Instead, you should call ATSUTextMoved, which is a more focused
  1179. * function and therefore more efficient. After associating text
  1180. * with a text layout object, use ATSUSetRunStyle to associate style
  1181. * information with the text. You can then call the function
  1182. * ATSUDrawText to display the text or a subrange of the text.
  1183. *
  1184. * Parameters:
  1185. *
  1186. * iTextLayout:
  1187. * The layout object for which you wish to associate a text buffer.
  1188. *
  1189. * iText:
  1190. * A pointer to a buffer of Unicode text in UTF-16 format. This is
  1191. * the text that will be associated with iTextLayout.
  1192. *
  1193. * iTextOffset:
  1194. * The starting offset of the subrange of the text buffer you wish
  1195. * to associate with iTextLayout. To indicate that the specified
  1196. * text range starts at the beginning of the text buffer, you can
  1197. * pass the constant kATSUFromTextBeginning . To specify the
  1198. * entire text buffer, pass kATSUFromTextBeginning in this
  1199. * parameter and kATSUToTextEnd in the iTextLength parameter.
  1200. *
  1201. * iTextLength:
  1202. * The length of the subrage of the text buffer you wish to
  1203. * associate with iTextLayout. Note that the sum of iTextOffset
  1204. * and iTextLength must be less than or equal to the value of the
  1205. * iTextTotalLength parameter. If you want the range of text to
  1206. * extend to the end of the text buffer, you can pass the constant
  1207. * kATSUToTextEnd.
  1208. *
  1209. * iTextTotalLength:
  1210. * The length of the entire text buffer. This value should be
  1211. * greater than or equal to the range of text defined by the
  1212. * iTextLength parameter.
  1213. *
  1214. * Result:
  1215. * On success, noErr is returned. See MacErrors.h for possible error
  1216. * codes.
  1217. *
  1218. * Availability:
  1219. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1220. * CarbonLib: in CarbonLib 1.0 and later
  1221. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  1222. }
  1223. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  1224. function ATSUSetTextPointerLocation( iTextLayout: ATSUTextLayout; iText: ConstUniCharArrayPtr; iTextOffset: UniCharArrayOffset; iTextLength: UniCharCount; iTextTotalLength: UniCharCount ): OSStatus; external name '_ATSUSetTextPointerLocation';
  1225. {
  1226. * ATSUGetTextLocation()
  1227. *
  1228. * Summary:
  1229. * Returns information about the Unicode text buffer associated with
  1230. * a layout.
  1231. *
  1232. * Discussion:
  1233. * For a given layout, ATSUGetTextLocation will return information
  1234. * about the Unicode text buffer associated with it, including its
  1235. * memory location, its size, and whether it is stored in a handle.
  1236. * Note that since a layout may refer to a subrange within a text
  1237. * buffer, parameters defining this subrange are included. oOffset
  1238. * and oTextLength give information about the subrange, while oText
  1239. * and oTextTotalLength give information about the entire text
  1240. * buffer. You may pass NULL for any parameters you are not
  1241. * interested in. Only iTextLayout is required.
  1242. *
  1243. * Parameters:
  1244. *
  1245. * iTextLayout:
  1246. * A text layout whose text buffer you want information regarding.
  1247. *
  1248. * oText:
  1249. * A pointer to data of any type. On return, the pointer is set to
  1250. * either a pointer or a handle that refers to the text buffer for
  1251. * the specified text layout object. can be NULL
  1252. *
  1253. * oTextIsStoredInHandle:
  1254. * On return, the value is set to true if the text buffer referred
  1255. * to by the oText parameter is accessed by a handle; if false, a
  1256. * pointer. can be NULL
  1257. *
  1258. * oOffset:
  1259. * On return, the offset from the beginning of the text buffer to
  1260. * the first character of the layout's current text range. can be NULL
  1261. *
  1262. * oTextLength:
  1263. * On return, the value specifies the length of the layout's
  1264. * current text range. can be NULL
  1265. *
  1266. * oTextTotalLength:
  1267. * On return, the total length of the text buffer. Note this is
  1268. * not necessarily the same as the length of the layout's current
  1269. * range. (A layout may refer to only a subrange within a text
  1270. * buffer.) can be NULL
  1271. *
  1272. * Result:
  1273. * On success, noErr is returned. See MacErrors.h for possible error
  1274. * codes.
  1275. *
  1276. * Availability:
  1277. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1278. * CarbonLib: in CarbonLib 1.0 and later
  1279. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  1280. }
  1281. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  1282. function ATSUGetTextLocation( iTextLayout: ATSUTextLayout; oText: PtrPtr; oTextIsStoredInHandle: BooleanPtr; oOffset: UniCharArrayOffsetPtr; oTextLength: UniCharCountPtr; oTextTotalLength: UniCharCountPtr ): OSStatus; external name '_ATSUGetTextLocation';
  1283. {
  1284. * ATSUTextDeleted()
  1285. *
  1286. * Summary:
  1287. * Informs ATSUI of the location and length of a text deletion.
  1288. *
  1289. * Discussion:
  1290. * When you call the ATSUTextDeleted function to inform ATSUI of a
  1291. * text deletion, it shortens the style run(s) containing the
  1292. * deleted text by the amount of the deletion. If a style run
  1293. * corresponds entirely to a range of deleted text, that style run
  1294. * is removed. If the deletion point is between two style runs, the
  1295. * first style run is shortened (or removed). The ATSUTextDeleted
  1296. * function also shortens the total length of the text buffer
  1297. * containing the deleted text by the amount of the deletion. That
  1298. * is, it shifts the memory location of the text following the
  1299. * deleted text by iDeletedRangeLength .ATSUTextDeleted also removes
  1300. * any soft line breaks that fall within the deleted text and
  1301. * updates affected drawing caches. The ATSUTextDeleted function
  1302. * does not change the actual memory location of the affected text.
  1303. * You are responsible for deleting the corresponding text is from
  1304. * the text buffer. You are also responsible for calling the
  1305. * function ATSUDisposeStyle to dispose of the memory associated
  1306. * with any style runs that have been removed. Note that calling the
  1307. * function ATSUTextDeleted automatically removes previously-set
  1308. * soft line breaks if the line breaks are within the range of text
  1309. * that is deleted.
  1310. *
  1311. * Parameters:
  1312. *
  1313. * iTextLayout:
  1314. * The text layout containing the deleted text.
  1315. *
  1316. * iDeletedRangeStart:
  1317. * The starting location of the deleted text. To specify a
  1318. * deletion point at the beginning of the text buffer, you can
  1319. * pass the constant kATSUFromTextBeginning. To specify that the
  1320. * entire text buffer has been deleted, pass
  1321. * kATSUFromTextBeginning in this parameter and kATSUToTextEnd in
  1322. * the iDeletedRangeLength parameter.
  1323. *
  1324. * iDeletedRangeLength:
  1325. * The length of the deleted text. To specify a deletion length
  1326. * extending to the end of the text buffer, you can pass the
  1327. * constant kATSUToTextEnd.
  1328. *
  1329. * Result:
  1330. * On success, noErr is returned. See MacErrors.h for possible error
  1331. * codes.
  1332. *
  1333. * Availability:
  1334. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1335. * CarbonLib: in CarbonLib 1.0 and later
  1336. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  1337. }
  1338. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  1339. function ATSUTextDeleted( iTextLayout: ATSUTextLayout; iDeletedRangeStart: UniCharArrayOffset; iDeletedRangeLength: UniCharCount ): OSStatus; external name '_ATSUTextDeleted';
  1340. {
  1341. * ATSUTextInserted()
  1342. *
  1343. * Summary:
  1344. * Informs ATSUI of the location and length of a text insertion.
  1345. *
  1346. * Discussion:
  1347. * When you call the ATSUTextInserted function to inform ATSUI of a
  1348. * text insertion, it extends the style run containing the insertion
  1349. * point by the amount of the inserted text. If the insertion point
  1350. * is between two style runs, the first style run is extended to
  1351. * include the new text. The ATSUTextInserted function also extends
  1352. * the total length of the text buffer containing the inserted text
  1353. * by the amount of the inserted text. That is, it shifts the memory
  1354. * location of the text following the inserted text by
  1355. * iInsertionLength. ATSUTextInserted then updates drawing caches.
  1356. * Note that the ATSUTextInserted function does not change the
  1357. * actual memory location of the inserted text. You are responsible
  1358. * for placing the inserted text into the text buffer at the
  1359. * appropriate location. The ATSUTextInserted function does not
  1360. * insert style runs or line breaks; to do so, call the functions
  1361. * ATSUSetRunStyle and ATSUSetSoftLineBreak, respectively. Break
  1362. * line operations should be redone after you call ATSUTextInserted.
  1363. *
  1364. * Parameters:
  1365. *
  1366. * iTextLayout:
  1367. * The text layout in which the text insertion is taking place.
  1368. *
  1369. * iInsertionLocation:
  1370. * The offset corresponding to the beginning of the inserted text.
  1371. *
  1372. * iInsertionLength:
  1373. * The length of the inserted text.
  1374. *
  1375. * Result:
  1376. * On success, noErr is returned. See MacErrors.h for possible error
  1377. * codes.
  1378. *
  1379. * Availability:
  1380. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1381. * CarbonLib: in CarbonLib 1.0 and later
  1382. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  1383. }
  1384. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  1385. function ATSUTextInserted( iTextLayout: ATSUTextLayout; iInsertionLocation: UniCharArrayOffset; iInsertionLength: UniCharCount ): OSStatus; external name '_ATSUTextInserted';
  1386. {
  1387. * ATSUTextMoved()
  1388. *
  1389. * Summary:
  1390. * Informs ATSUI of the new memory location of relocated text.
  1391. *
  1392. * Discussion:
  1393. * You should call the ATSUTextMoved function when a range of text
  1394. * consisting of less than an entire text buffer has been moved. The
  1395. * ATSUTextMoved function informs ATSUI of the new memory location
  1396. * of the text. You are responsible for moving the text. The text
  1397. * buffer should remain otherwise unchanged.
  1398. *
  1399. * Parameters:
  1400. *
  1401. * iTextLayout:
  1402. * The text layout containing the moved text.
  1403. *
  1404. * iNewLocation:
  1405. * The new memory location of the moved text.
  1406. *
  1407. * Result:
  1408. * On success, noErr is returned. See MacErrors.h for possible error
  1409. * codes.
  1410. *
  1411. * Availability:
  1412. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1413. * CarbonLib: in CarbonLib 1.0 and later
  1414. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  1415. }
  1416. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  1417. function ATSUTextMoved( iTextLayout: ATSUTextLayout; iNewLocation: ConstUniCharArrayPtr ): OSStatus; external name '_ATSUTextMoved';
  1418. { ---------------------------------------------------------------------------- }
  1419. { ATSUI layout controls }
  1420. { ---------------------------------------------------------------------------- }
  1421. {
  1422. * ATSUCopyLayoutControls()
  1423. *
  1424. * Summary:
  1425. * Copies all layout control attribute settings from a source text
  1426. * layout object to a destination text layout object.
  1427. *
  1428. * Discussion:
  1429. * This function copies all layout control attribute values to a
  1430. * destination text layout object from a source text layout object,
  1431. * including any default (unset) values in the source object. For a
  1432. * list of tags and their default values, see the definition of
  1433. * ATSUAttributeTag. Reference constants and the contents of memory
  1434. * referenced by pointers within custom layout attributes are not
  1435. * copied. You are responsible for ensuring that this memory remains
  1436. * valid until both the source and destination text layout objects
  1437. * are disposed. To copy line control attribute values from one text
  1438. * layout object to another, call the function ATSUCopyLineControls.
  1439. *
  1440. * Parameters:
  1441. *
  1442. * iSourceTextLayout:
  1443. * The text layout to copy layout controls from.
  1444. *
  1445. * iDestTextLayout:
  1446. * The text layout to copy layout controls to.
  1447. *
  1448. * Result:
  1449. * On success, noErr is returned. See MacErrors.h for possible error
  1450. * codes.
  1451. *
  1452. * Availability:
  1453. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1454. * CarbonLib: in CarbonLib 1.0 and later
  1455. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  1456. }
  1457. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  1458. function ATSUCopyLayoutControls( iSourceTextLayout: ATSUTextLayout; iDestTextLayout: ATSUTextLayout ): OSStatus; external name '_ATSUCopyLayoutControls';
  1459. {
  1460. * ATSUSetLayoutControls()
  1461. *
  1462. * Summary:
  1463. * Sets layout control attribute values in a text layout object.
  1464. *
  1465. * Discussion:
  1466. * When you use ATSUI to image your text, you can control the text's
  1467. * display and formatting at a number of different levels: layout,
  1468. * line, and run. The level affected by this function is the layout
  1469. * level, which is that of the entire text range associated with
  1470. * your text layout object. Attributes at this level affect the
  1471. * width of the text area from margin to margin, the alignment of
  1472. * the text, its justification, rotation, and direction, as well as
  1473. * other layout options. See ATSUSetLineControls for information
  1474. * about controling text and the line level. Similar to style
  1475. * attributes, you use a "triple" to specify a line or layout
  1476. * control attribute. That is, (1) an attribute tag, (2) the size
  1477. * (in bytes) of the attribute value, and (3) the value of the
  1478. * attribute it sets. Attribute tags are constants supplied by
  1479. * ATSUI. Attribute values may be a scalar, a structure, or a
  1480. * pointer. And as with style attributes, you can also create a
  1481. * custom attribute for a line or layout attribute for which ATSUI
  1482. * does not provide a tag. For a list of layout control tags defined
  1483. * by ATSUI and their default values, see the definition of
  1484. * ATSUAttributeTag.
  1485. *
  1486. * Parameters:
  1487. *
  1488. * iTextLayout:
  1489. * The text layout in which to set layout-level controls.
  1490. *
  1491. * iAttributeCount:
  1492. * The number of attributes to set. This value should correspond
  1493. * to the number of elements in the iTag, iValueSize, and iValue
  1494. * arrays.
  1495. *
  1496. * iTag:
  1497. * An array of attribute tags to set. For a list of layout control
  1498. * tags defined by ATSUI and their default values, see the
  1499. * definition of ATSUAttributeTag.
  1500. *
  1501. * iValueSize:
  1502. * An array of values indicating the sizes of the values pointed
  1503. * to by the elements in the iValue array.
  1504. *
  1505. * iValue:
  1506. * An array of attribute value pointers. Each value in the array
  1507. * must correspond to a tag in the iTag array and be a legal value
  1508. * for that tag.
  1509. *
  1510. * Result:
  1511. * On success, noErr is returned. See MacErrors.h for possible error
  1512. * codes.
  1513. *
  1514. * Availability:
  1515. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1516. * CarbonLib: in CarbonLib 1.0 and later
  1517. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  1518. }
  1519. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  1520. function ATSUSetLayoutControls( iTextLayout: ATSUTextLayout; iAttributeCount: ItemCount; iTag: ATSUAttributeTagPtr; iValueSize: ByteCountPtr; iValue: ATSUAttributeValuePtrPtr ): OSStatus; external name '_ATSUSetLayoutControls';
  1521. {
  1522. * ATSUGetLayoutControl()
  1523. *
  1524. * Summary:
  1525. * Obtains a single layout control attribute value for a text layout
  1526. * object.
  1527. *
  1528. * Discussion:
  1529. * Before calling ATSUGetLayoutControl, you should call the function
  1530. * ATSUGetAllLayoutControls to obtain an array of nondefault layout
  1531. * control attribute tags and value sizes for the text layout
  1532. * object. You can then pass the tag and value size for the
  1533. * attribute value to obtain to ATSUGetLayoutControl. Typically you
  1534. * use the function ATSUGetLayoutControl by calling it twice, as
  1535. * follows: (1) Pass a reference to the text layout object to
  1536. * examine in the iTextLayout parameter, NULL for the oValue
  1537. * parameter, 0 for the iExpectedValueSize parameter.
  1538. * ATSUGetLayoutControl returns the actual size of the attribute
  1539. * value in the oActualValueSize parameter. (2) Allocate enough
  1540. * space for an array of the returned size, then call the
  1541. * ATSUGetLayoutControl function again, passing a valid pointer in
  1542. * the oValue parameter. On return, the pointer refers to the actual
  1543. * attribute value contained in the text layout object. For a list
  1544. * of layout control tags defined by ATSUI and their default values,
  1545. * see the definition of ATSUAttributeTag.
  1546. *
  1547. * Parameters:
  1548. *
  1549. * iTextLayout:
  1550. * The text layout for which you wish to obtain a single layout
  1551. * control value.
  1552. *
  1553. * iTag:
  1554. * An attribute tag specifying the layout control value you wish
  1555. * to obtain. For a list of layout control tags defined by ATSUI
  1556. * and their default values, see the definition of
  1557. * ATSUAttributeTag.
  1558. *
  1559. * iExpectedValueSize:
  1560. * The size in bytes of the buffer you have allocated for the
  1561. * oValue parameter.
  1562. *
  1563. * oValue:
  1564. * On return, the value assocaited with the layout tag specified
  1565. * by the iTag parameter. can be NULL
  1566. *
  1567. * oActualValueSize:
  1568. * On return, the value contains the actual size (in bytes) of the
  1569. * attribute value. You should examine this parameter if you are
  1570. * unsure of the size of the attribute value being obtained, as in
  1571. * the case of custom layout control attributes. can be NULL
  1572. *
  1573. * Result:
  1574. * On success, noErr is returned. See MacErrors.h for possible error
  1575. * codes.
  1576. *
  1577. * Availability:
  1578. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1579. * CarbonLib: in CarbonLib 1.0 and later
  1580. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  1581. }
  1582. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  1583. function ATSUGetLayoutControl( iTextLayout: ATSUTextLayout; iTag: ATSUAttributeTag; iExpectedValueSize: ByteCount; oValue: ATSUAttributeValuePtr; oActualValueSize: ByteCountPtr ): OSStatus; external name '_ATSUGetLayoutControl';
  1584. {
  1585. * ATSUGetAllLayoutControls()
  1586. *
  1587. * Summary:
  1588. * Obtains an array of non-default layout control attribute tags and
  1589. * value sizes for a text layout object.
  1590. *
  1591. * Discussion:
  1592. * This function function obtains all nondefault layout control
  1593. * attribute tags and their values sizes for a text layout object.
  1594. * You can pass a tag and value size pair obtained from
  1595. * ATSUGetAllLayoutControls to the function ATSUGetLayoutControl to
  1596. * determine the corresponding attribute value. Typically you use
  1597. * the function ATSUGetAllLayoutControls by calling it twice, as
  1598. * follows: (1) Pass a reference to the text layout object to
  1599. * examine in the iTextLayout parameter, NULL for the
  1600. * oAttributeInfoArray parameter, a pointer to an ItemCount value in
  1601. * the oTagValuePairCount parameter, and 0 for the
  1602. * iTagValuePairArraySize parameter. ATSUGetAllLayoutControls
  1603. * returns the size of the tag and value size arrays in the
  1604. * oTagValuePairCount parameter. (2) Allocate enough space for an
  1605. * array of the returned size, then call the
  1606. * ATSUGetAllLayoutControls function again, passing a valid pointer
  1607. * in the oAttributeInfoArray parameter. On return, the pointer
  1608. * refers to an array of the layout control attribute tag and value
  1609. * size pairs contained in the text layout object.
  1610. *
  1611. * Parameters:
  1612. *
  1613. * iTextLayout:
  1614. * The layout for which you wish to obtain the set of non-default
  1615. * layout tags.
  1616. *
  1617. * oAttributeInfoArray:
  1618. * On return, this array contains pairs of tags and value sizes
  1619. * for the object's layout control attributes that are not at
  1620. * default values. If you are uncertain of how much memory to
  1621. * allocate for this parameter, see the Discussion.
  1622. *
  1623. * iTagValuePairArraySize:
  1624. * A value specifying the maximum number of tag and value size
  1625. * pairs to obtain for the text layout object. Typically, this is
  1626. * equivalent to the number of ATSUAttributeInfo structures for
  1627. * which you have allocated memory in the oAttributeInfoArray
  1628. * parameter. To determine this value, see the Discussion.
  1629. *
  1630. * oTagValuePairCount:
  1631. * On return, the value specifies the actual number of
  1632. * ATSUAttributeInfo structures in the text layout object. This
  1633. * may be greater than the value you specified in the
  1634. * iTagValuePairArraySize parameter.
  1635. *
  1636. * Result:
  1637. * On success, noErr is returned. See MacErrors.h for possible error
  1638. * codes.
  1639. *
  1640. * Availability:
  1641. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1642. * CarbonLib: in CarbonLib 1.0 and later
  1643. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  1644. }
  1645. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  1646. function ATSUGetAllLayoutControls( iTextLayout: ATSUTextLayout; oAttributeInfoArray: ATSUAttributeInfoPtr; iTagValuePairArraySize: ItemCount; var oTagValuePairCount: ItemCount ): OSStatus; external name '_ATSUGetAllLayoutControls';
  1647. {
  1648. * ATSUClearLayoutControls()
  1649. *
  1650. * Summary:
  1651. * Restores default values to the specified layout control
  1652. * attributes of a text layout object.
  1653. *
  1654. * Discussion:
  1655. * This function removes those layout control attribute values
  1656. * identified by the tag constants in the iTag array and replaces
  1657. * them with the default values. If you specify that any currently
  1658. * unset attribute values be removed, the function does not return
  1659. * an error. For a list of layout control tags defined by ATSUI and
  1660. * their default values, see the definition of ATSUAttributeTag.
  1661. *
  1662. * Parameters:
  1663. *
  1664. * iTextLayout:
  1665. * The text layout in which you wish to clear layout controls.
  1666. *
  1667. * iTagCount:
  1668. * The number of tags you wish to clear. This value should
  1669. * correspond to the nuumber of elements in the iTag array. Pass
  1670. * kATSUClearAll for this parameter if you wish to clear all
  1671. * layout controls.
  1672. *
  1673. * iTag:
  1674. * An array of layout control tags to be cleared. For a list of
  1675. * layout control tags defined by ATSUI and their default values,
  1676. * see the definition of ATSUAttributeTag. You may pass NULL for
  1677. * this parameter if you are passing kATSUClearAll for the
  1678. * iTagCount parameter. can be NULL
  1679. *
  1680. * Result:
  1681. * On success, noErr is returned. See MacErrors.h for possible error
  1682. * codes.
  1683. *
  1684. * Availability:
  1685. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1686. * CarbonLib: in CarbonLib 1.0 and later
  1687. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  1688. }
  1689. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  1690. function ATSUClearLayoutControls( iTextLayout: ATSUTextLayout; iTagCount: ItemCount; iTag: ATSUAttributeTagPtr ): OSStatus; external name '_ATSUClearLayoutControls';
  1691. { ---------------------------------------------------------------------------- }
  1692. { ATSUI line controls }
  1693. { ---------------------------------------------------------------------------- }
  1694. {
  1695. * ATSUCopyLineControls()
  1696. *
  1697. * Summary:
  1698. * Copies line control attribute settings from a line in a source
  1699. * text layout object to a line in a destination text layout object.
  1700. *
  1701. * Discussion:
  1702. * This function copies all line control attribute values to a line
  1703. * in a destination text layout object from a line in a source text
  1704. * layout object, including any default (unset) values in the source
  1705. * line. Unset line control attributes are assigned the default
  1706. * values. ATSUCopyLineControls does not copy the contents of memory
  1707. * referenced by pointers within custom line attributes or within
  1708. * reference constants. You are responsible for ensuring that this
  1709. * memory remains valid until the source text layout object is
  1710. * disposed.
  1711. *
  1712. * Parameters:
  1713. *
  1714. * iSourceTextLayout:
  1715. * The text layout object from which to copy line control
  1716. * attributes.
  1717. *
  1718. * iSourceLineStart:
  1719. * The start of the line from which to copy line control
  1720. * attributes.
  1721. *
  1722. * iDestTextLayout:
  1723. * The text layout object for which to set line control
  1724. * attributes. This can be the same text layout object passed in
  1725. * the iSourceTextLayout parameter if you want to copy line
  1726. * control attributes from one line to another within a text
  1727. * layout object.
  1728. *
  1729. * iDestLineStart:
  1730. * The start of the line to which to copy line control attributes.
  1731. *
  1732. * Result:
  1733. * On success, noErr is returned. See MacErrors.h for possible error
  1734. * codes.
  1735. *
  1736. * Availability:
  1737. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1738. * CarbonLib: in CarbonLib 1.0 and later
  1739. * Non-Carbon CFM: in ATSUnicodeLib 8.6 and later
  1740. }
  1741. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  1742. function ATSUCopyLineControls( iSourceTextLayout: ATSUTextLayout; iSourceLineStart: UniCharArrayOffset; iDestTextLayout: ATSUTextLayout; iDestLineStart: UniCharArrayOffset ): OSStatus; external name '_ATSUCopyLineControls';
  1743. {
  1744. * ATSUSetLineControls()
  1745. *
  1746. * Summary:
  1747. * Sets one or more line control values for a specified line in a
  1748. * text layout.
  1749. *
  1750. * Discussion:
  1751. * When you use ATSUI to image your text, you can control the text's
  1752. * display and formatting at a number of different levels: layout,
  1753. * line, and run. The level affected by this function is the line
  1754. * level. These attributes are similar to those that you can apply
  1755. * on a full-layout basis, but each affects only an individual text
  1756. * line. Note that setting line control attributes overrides the
  1757. * corresponding layout-level settings. Also, from a performance
  1758. * standpoint, it is preferable to work from the layout level and
  1759. * not specify such controls line by line unless necessary. Lines
  1760. * are determined by soft breaks that may be set in your layout. You
  1761. * can specify a line by giving a starting offset into the text
  1762. * buffer. Attributes at this level affect the width of the text
  1763. * area from margin to margin, the alignment of the text, its
  1764. * justification, rotation, and direction, as well as other layout
  1765. * options. Similar to style attributes, you use a "triple" to
  1766. * specify a line or layout control attribute. That is, (1) an
  1767. * attribute tag, (2) the size (in bytes) of the attribute value,
  1768. * and (3) the value of the attribute it sets. Attribute tags are
  1769. * constants supplied by ATSUI. Attribute values may be a scalar, a
  1770. * structure, or a pointer. And as with style attributes, you can
  1771. * also create a custom attribute for a line or layout attribute for
  1772. * which ATSUI does not provide a tag. For a list of line control
  1773. * tags defined by ATSUI and their default values, see the
  1774. * definition of ATSUAttributeTag.
  1775. *
  1776. * Parameters:
  1777. *
  1778. * iTextLayout:
  1779. * The layout in which you wish to set line controls.
  1780. *
  1781. * iLineStart:
  1782. * The starting offset of the line for which you wish to set
  1783. * controls.
  1784. *
  1785. * iAttributeCount:
  1786. * The number of attributes to set. This value should correspond
  1787. * to the number of elements in the iTag, iValueSize, and iValue
  1788. * arrays.
  1789. *
  1790. * iTag:
  1791. * An array of attribute tags to set. For a list of line control
  1792. * tags defined by ATSUI and their default values, see the
  1793. * definition of ATSUAttributeTag.
  1794. *
  1795. * iValueSize:
  1796. * An array of values indicating the sizes of the values pointed
  1797. * to by the elements in the iValue array.
  1798. *
  1799. * iValue:
  1800. * An array of attribute value pointers. Each value in the array
  1801. * must correspond to a tag in the iTag array and be a legal value
  1802. * for that tag.
  1803. *
  1804. * Result:
  1805. * On success, noErr is returned. See MacErrors.h for possible error
  1806. * codes.
  1807. *
  1808. * Availability:
  1809. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1810. * CarbonLib: in CarbonLib 1.0 and later
  1811. * Non-Carbon CFM: in ATSUnicodeLib 8.6 and later
  1812. }
  1813. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  1814. function ATSUSetLineControls( iTextLayout: ATSUTextLayout; iLineStart: UniCharArrayOffset; iAttributeCount: ItemCount; iTag: ATSUAttributeTagPtr; iValueSize: ByteCountPtr; iValue: ATSUAttributeValuePtrPtr ): OSStatus; external name '_ATSUSetLineControls';
  1815. {
  1816. * ATSUGetLineControl()
  1817. *
  1818. * Summary:
  1819. * Obtains a single line control attribute value for a line in a
  1820. * text layout object.
  1821. *
  1822. * Discussion:
  1823. * Before calling ATSUGetLineControl, you should call the function
  1824. * ATSUGetAllLineControls to obtain an array of nondefault line
  1825. * control attribute tags and value sizes for the line. You can then
  1826. * pass the tag and value size for the attribute value to obtain to
  1827. * ATSUGetLineControl. Typically you use the function
  1828. * ATSUGetLineControl by calling it twice, as follows: (1) Pass a
  1829. * reference to the text layout object to examine in the iTextLayout
  1830. * parameter, NULL for the oValue parameter, 0 for the
  1831. * iExpectedValueSize parameter. ATSUGetLineControl returns the
  1832. * actual size of the attribute value in the oActualValueSize
  1833. * parameter. (2) Allocate enough space for an array of the returned
  1834. * size, then call the ATSUGetLineControl function again, passing a
  1835. * valid pointer in the oValue parameter. On return, the pointer
  1836. * refers to the actual attribute value contained for the line in
  1837. * the text layout object.
  1838. *
  1839. * Parameters:
  1840. *
  1841. * iTextLayout:
  1842. * The text layout for which to obtain a line control value.
  1843. *
  1844. * iLineStart:
  1845. * The start of the line for which to obtain a line control value.
  1846. *
  1847. * iTag:
  1848. * A tag specifying the line control value to be obtained. For a
  1849. * list of line control tags defined by ATSUI and their default
  1850. * values, see the definition of ATSUAttributeTag.
  1851. *
  1852. * iExpectedValueSize:
  1853. * The expected size (in bytes) of the value to obtain.
  1854. *
  1855. * oValue:
  1856. * On return, the actual attribute value. If you are uncertain of
  1857. * how much memory to allocate, see the Discussion. can be NULL
  1858. *
  1859. * oActualValueSize:
  1860. * On return, the value contains the actual size (in bytes) of the
  1861. * attribute value. You should examine this parameter if you are
  1862. * unsure of the size of the attribute value being obtained, as in
  1863. * the case of custom line control attributes. can be NULL
  1864. *
  1865. * Result:
  1866. * On success, noErr is returned. See MacErrors.h for possible error
  1867. * codes.
  1868. *
  1869. * Availability:
  1870. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1871. * CarbonLib: in CarbonLib 1.0 and later
  1872. * Non-Carbon CFM: in ATSUnicodeLib 8.6 and later
  1873. }
  1874. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  1875. function ATSUGetLineControl( iTextLayout: ATSUTextLayout; iLineStart: UniCharArrayOffset; iTag: ATSUAttributeTag; iExpectedValueSize: ByteCount; oValue: ATSUAttributeValuePtr; oActualValueSize: ByteCountPtr ): OSStatus; external name '_ATSUGetLineControl';
  1876. {
  1877. * ATSUGetAllLineControls()
  1878. *
  1879. * Summary:
  1880. * Obtains an array of line control attribute tags and value sizes
  1881. * for a line in a text layout object.
  1882. *
  1883. * Discussion:
  1884. * This function obtains all nondefault line control attribute tags
  1885. * and their values sizes for a line in a text layout object. You
  1886. * can pass a tag and value size pair obtained from
  1887. * ATSUGetAllLineControls to the function ATSUGetLineControl to
  1888. * determine the corresponding attribute value. Typically you use
  1889. * the function ATSUGetAllLineControls by calling it twice, as
  1890. * follows: (1) Pass a reference to the text layout object to
  1891. * examine in the iTextLayout parameter, the appropriate
  1892. * UniCharArrayOffset value in the iLineStart parameter, NULL for
  1893. * the oAttributeInfoArray parameter, a pointer to an ItemCount
  1894. * value in the oTagValuePairCount parameter, and 0 for the
  1895. * iTagValuePairArraySize parameter. ATSUGetAllLineControls returns
  1896. * the size of the tag and value size arrays in the
  1897. * oTagValuePairCount parameter. (2) Allocate enough space for an
  1898. * array of the returned size, then call the ATSUGetAllLineControls
  1899. * function again, passing a valid pointer in the
  1900. * oAttributeInfoArray parameter. On return, the pointer refers to
  1901. * an array of the line control attribute tag and value size pairs
  1902. * contained in the specified line. To obtain the nondefault layout
  1903. * control attribute tags and value sizes for a text layout object,
  1904. * call the function ATSUGetAllLayoutControls.
  1905. *
  1906. * Parameters:
  1907. *
  1908. * iTextLayout:
  1909. * The layout for which you wish to obtain line control
  1910. * information.
  1911. *
  1912. * iLineStart:
  1913. * The beginning of the line for which you wish to obtain line
  1914. * control information.
  1915. *
  1916. * oAttributeInfoArray:
  1917. * On return, this array contains pairs of tags and value sizes
  1918. * for the object's line control attributes that are not at
  1919. * default values. If you are uncertain of how much memory to
  1920. * allocate for this array, see the Discussion. can be NULL
  1921. *
  1922. * iTagValuePairArraySize:
  1923. * The size of of the array you allocated for the
  1924. * oAttributeInfoArray parameter.
  1925. *
  1926. * oTagValuePairCount:
  1927. * On return, the value specifies the actual number of
  1928. * ATSUAttributeInfo structures in the line. This may be greater
  1929. * than the value you specified in the iTagValuePairArraySize
  1930. * parameter. can be NULL
  1931. *
  1932. * Result:
  1933. * On success, noErr is returned. See MacErrors.h for possible error
  1934. * codes.
  1935. *
  1936. * Availability:
  1937. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1938. * CarbonLib: in CarbonLib 1.0 and later
  1939. * Non-Carbon CFM: in ATSUnicodeLib 8.6 and later
  1940. }
  1941. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  1942. function ATSUGetAllLineControls( iTextLayout: ATSUTextLayout; iLineStart: UniCharArrayOffset; oAttributeInfoArray: ATSUAttributeInfoPtr; iTagValuePairArraySize: ItemCount; oTagValuePairCount: ItemCountPtr ): OSStatus; external name '_ATSUGetAllLineControls';
  1943. {
  1944. * ATSUClearLineControls()
  1945. *
  1946. * Summary:
  1947. * Restores default values to the specified line control attributes
  1948. * of a text layout object.
  1949. *
  1950. * Discussion:
  1951. * This function removes those line control attribute values
  1952. * identified by the tag constants in the iTag array and replaces
  1953. * them with the default values. If you specify that any currently
  1954. * unset attribute values be removed, the function does not return
  1955. * an error. For a list of line control tags defined by ATSUI and
  1956. * their default values, see the definition of ATSUAttributeTag.
  1957. *
  1958. * Parameters:
  1959. *
  1960. * iTextLayout:
  1961. * The text layout in which you wish to clear line controls.
  1962. *
  1963. * iLineStart:
  1964. * The start of the line in which to clear line controls.
  1965. *
  1966. * iTagCount:
  1967. * The number of tags you wish to clear. This value should
  1968. * correspond to the nuumber of elements in the iTag array. Pass
  1969. * kATSUClearAll to clear all line controls.
  1970. *
  1971. * iTag:
  1972. * An array of line control tags to be cleared. For a list of line
  1973. * control tags defined by ATSUI and their default values, see the
  1974. * definition of ATSUAttributeTag. You may pass NULL for this
  1975. * parameter if you are passing kATSUClearAll for the iTagCount
  1976. * parameter. can be NULL
  1977. *
  1978. * Result:
  1979. * On success, noErr is returned. See MacErrors.h for possible error
  1980. * codes.
  1981. *
  1982. * Availability:
  1983. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1984. * CarbonLib: in CarbonLib 1.0 and later
  1985. * Non-Carbon CFM: in ATSUnicodeLib 8.6 and later
  1986. }
  1987. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  1988. function ATSUClearLineControls( iTextLayout: ATSUTextLayout; iLineStart: UniCharArrayOffset; iTagCount: ItemCount; iTag: ATSUAttributeTagPtr ): OSStatus; external name '_ATSUClearLineControls';
  1989. { ---------------------------------------------------------------------------- }
  1990. { ATSUI style run processing }
  1991. { ---------------------------------------------------------------------------- }
  1992. {
  1993. * ATSUSetRunStyle()
  1994. *
  1995. * Summary:
  1996. * Defines a style run by associating style information with a run
  1997. * of text.
  1998. *
  1999. * Discussion:
  2000. * A text run consists of one or more characters that are contiguous
  2001. * in memory. If you associate these characters with a distinct
  2002. * style, you define a style run. You can use the ATSUSetRunStyle
  2003. * function to define a style run, by associating a style object
  2004. * with a run of text in a text layout object. Each text run must be
  2005. * assigned a style object, which may or may not differ from other
  2006. * style objects assigned to other text runs in a given text layout
  2007. * object. After calling ATSUSetRunStyle, you can call the function
  2008. * ATSUDrawText to display the styled text. When you call
  2009. * ATSUDrawText, if you have not previously assigned styles to all
  2010. * the characters you request to be drawn, ATSUI automatically does
  2011. * so. Specifically, ATSUI extends the first style it locates
  2012. * immediately prior (in storage order) to the unstyled characters
  2013. * to include those unassigned characters. If the unstyled
  2014. * characters are at the beginning of the text stream, ATSUI finds
  2015. * the first style run in the stream and extends it backward to the
  2016. * first character. You should call ATSUSetRunStyle whenever you
  2017. * create a new text layout object without any associated styles, as
  2018. * by using the function ATSUCreateTextLayout. You should also call
  2019. * ATSUSetRunStyle to assign a style to a text run in response to a
  2020. * user action, such as when the user selects a run of text and
  2021. * changes the font. You do not need to call ATSUSetRunStyle when
  2022. * you change style attributes or text layout attributes. In such
  2023. * cases, ATSUI automatically updates the layout of the text as
  2024. * appropriate.
  2025. *
  2026. * Parameters:
  2027. *
  2028. * iTextLayout:
  2029. * The layout in which you wish to set the style run.
  2030. *
  2031. * iStyle:
  2032. * The style to be assigned to the run of characters.
  2033. *
  2034. * iRunStart:
  2035. * The start of the run of characters. To specify the beginning of
  2036. * the text buffer, pass kATSUFromTextBeginning for this parameter.
  2037. *
  2038. * iRunLength:
  2039. * The end of the run of characters. To specify a run that
  2040. * continues to the end of the text buffer, pass kATSUToTextEnd
  2041. * for this parameter.
  2042. *
  2043. * Result:
  2044. * On success, noErr is returned. See MacErrors.h for possible error
  2045. * codes.
  2046. *
  2047. * Availability:
  2048. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  2049. * CarbonLib: in CarbonLib 1.0 and later
  2050. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  2051. }
  2052. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  2053. function ATSUSetRunStyle( iTextLayout: ATSUTextLayout; iStyle: ATSUStyle; iRunStart: UniCharArrayOffset; iRunLength: UniCharCount ): OSStatus; external name '_ATSUSetRunStyle';
  2054. {
  2055. * ATSUGetRunStyle()
  2056. *
  2057. * Summary:
  2058. * Obtains style run information for a character offset in a run of
  2059. * text.
  2060. *
  2061. * Discussion:
  2062. * You can use the ATSUGetRunStyle function to obtain the style
  2063. * object assigned to a given text offset. ATSUGetRunStyle also
  2064. * produces the encompassing text range that shares the style object
  2065. * with the offset. Note that the style object contains those
  2066. * previously set style attributes, font features, and font
  2067. * variations that are continuous for the range of text that
  2068. * includes the specified text offset. If you want to obtain all
  2069. * shared style information for a style run, including any unset
  2070. * attributes, call the function ATSUGetContinuousAttributes
  2071. * instead. If only one style run is set in the text layout object,
  2072. * and it does not cover the entire text layout object,
  2073. * ATSUGetRunStyle uses the style run information for the iOffset
  2074. * parameter to set the style run information for the remaining text.
  2075. *
  2076. * Parameters:
  2077. *
  2078. * iTextLayout:
  2079. * The layout for which to obtain style run information.
  2080. *
  2081. * iOffset:
  2082. * The beginning character for which you want to obtain style run
  2083. * information.
  2084. *
  2085. * oStyle:
  2086. * On return, the style object assigned to the range of text
  2087. * containing the character at iOffset. Note that if you pass an
  2088. * offset in the iOffset parameter that is at a style run
  2089. * boundary, ATSUGetRunStyle produces style run information for
  2090. * the following, not preceding, style run.
  2091. *
  2092. * oRunStart:
  2093. * On return, the offset from the beginning of the text buffer to
  2094. * the first character of the style run containing the character
  2095. * at iOffset. Note that the entire style run does not necessarily
  2096. * share the same unset attribute values as the character at
  2097. * iOffset.
  2098. *
  2099. * oRunLength:
  2100. * On return, the length of the style run containing the character
  2101. * at iOffset.
  2102. *
  2103. * Result:
  2104. * On success, noErr is returned. See MacErrors.h for possible error
  2105. * codes.
  2106. *
  2107. * Availability:
  2108. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  2109. * CarbonLib: in CarbonLib 1.0 and later
  2110. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  2111. }
  2112. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  2113. function ATSUGetRunStyle( iTextLayout: ATSUTextLayout; iOffset: UniCharArrayOffset; var oStyle: ATSUStyle; var oRunStart: UniCharArrayOffset; var oRunLength: UniCharCount ): OSStatus; external name '_ATSUGetRunStyle';
  2114. {
  2115. * ATSUGetContinuousAttributes()
  2116. *
  2117. * Summary:
  2118. * Obtains the style attribute values that are continuous over a
  2119. * given text range.
  2120. *
  2121. * Discussion:
  2122. * This function examines the specified text range to obtain the
  2123. * style attribute values (including those at default values) that
  2124. * remain consistent for the entire text range. You should call
  2125. * ATSUGetContinuousAttributes to determine the style information
  2126. * that remains constant over text that has been selected by the
  2127. * user.
  2128. *
  2129. * Parameters:
  2130. *
  2131. * iTextLayout:
  2132. * The layout for which you wish to obtain style run information.
  2133. *
  2134. * iOffset:
  2135. * The starting character for which to examine style run
  2136. * attributes. To specify the beginning of the text buffer, pass
  2137. * kATSUFromTextBeginning for this parameter.
  2138. *
  2139. * iLength:
  2140. * The length of the range of characters to examine. To specify a
  2141. * range that continues to the end of the text buffer, pass
  2142. * kATSUToTextEnd for this parameter.
  2143. *
  2144. * oStyle:
  2145. * On return, a style object containing those attributes which are
  2146. * the same for the entire text range specified by the iOffset and
  2147. * iLength parameters.
  2148. *
  2149. * Result:
  2150. * On success, noErr is returned. See MacErrors.h for possible error
  2151. * codes.
  2152. *
  2153. * Availability:
  2154. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  2155. * CarbonLib: in CarbonLib 1.0 and later
  2156. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  2157. }
  2158. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  2159. function ATSUGetContinuousAttributes( iTextLayout: ATSUTextLayout; iOffset: UniCharArrayOffset; iLength: UniCharCount; oStyle: ATSUStyle ): OSStatus; external name '_ATSUGetContinuousAttributes';
  2160. { ---------------------------------------------------------------------------- }
  2161. { ATSUI tab support }
  2162. { ---------------------------------------------------------------------------- }
  2163. {
  2164. * ATSUSetTabArray()
  2165. *
  2166. * Summary:
  2167. * Sets a tab ruler for a text layout object.
  2168. *
  2169. * Discussion:
  2170. * When a tab ruler is set for a text layout object, ATSUI
  2171. * automatically aligns text such that any tabs characters in the
  2172. * text are laid out to follow the tab ruler's specifications. If
  2173. * you want to use tabs in your text and you also want to use the
  2174. * function ATSUBatchBreakLines, then you must set tabs by calling
  2175. * the function ATSUSetTabArray. See the definition of ATSUTab for
  2176. * more information about setting up a tab ruler.
  2177. *
  2178. * Parameters:
  2179. *
  2180. * iTextLayout:
  2181. * The layout in which to set the tab array.
  2182. *
  2183. * iTabs:
  2184. * An array of tabstops. See the definition of ATSUTab for more
  2185. * inforamation about specifying tabs.
  2186. *
  2187. * iTabCount:
  2188. * The number of tab stops in the iTabs array.
  2189. *
  2190. * Result:
  2191. * On success, noErr is returned. See MacErrors.h for possible error
  2192. * codes.
  2193. *
  2194. * Availability:
  2195. * Mac OS X: in version 10.2 and later in ApplicationServices.framework
  2196. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  2197. * Non-Carbon CFM: not available
  2198. }
  2199. // AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
  2200. function ATSUSetTabArray( iTextLayout: ATSUTextLayout; iTabs: ATSUTabPtr; iTabCount: ItemCount ): OSStatus; external name '_ATSUSetTabArray';
  2201. {
  2202. * ATSUGetTabArray()
  2203. *
  2204. * Summary:
  2205. * Retrieves the tab ruler associated with a text layout object.
  2206. *
  2207. * Discussion:
  2208. * This function can be used to retrieve all the tabs that were
  2209. * previously set for a text layout object, using the function
  2210. * ATSUSetTabArray . All the returned tabs will be in order of
  2211. * position along the line.Typically you use the ATSUGetTabArray
  2212. * function by calling it twice, as follows: (1) Pass NULL for the
  2213. * oTabs parameter, 0 for the iMaxTabCount parameter, and valid
  2214. * values for the other parameters. The ATSUGetTabArray function
  2215. * returns the actual number of tabs in the oTabCount parameter. (2)
  2216. * Allocate enough space for a buffer of the returned size, then
  2217. * call the function again, passing a valid pointer to the buffer in
  2218. * the oTabs parameter. On return, the buffer contains the tab
  2219. * values in order of position along the line from left to right.
  2220. *
  2221. * Parameters:
  2222. *
  2223. * iTextLayout:
  2224. * The text layout for which to retrieve the tab ruler.
  2225. *
  2226. * iMaxTabCount:
  2227. * The size of the array you have allocated for the oTabs
  2228. * parameter. If you are unsure what to pass for this parameter,
  2229. * see the Discussion.
  2230. *
  2231. * oTabs:
  2232. * On return, an array of ATSUTab structures specifying the
  2233. * currently set tab ruler for this layout. can be NULL
  2234. *
  2235. * oTabCount:
  2236. * On return, the number of tabs currently set in this layout.
  2237. * Note that this may be greater than the value you have passed
  2238. * for iMaxTabCount. can be NULL
  2239. *
  2240. * Result:
  2241. * On success, noErr is returned. See MacErrors.h for possible error
  2242. * codes.
  2243. *
  2244. * Availability:
  2245. * Mac OS X: in version 10.2 and later in ApplicationServices.framework
  2246. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  2247. * Non-Carbon CFM: not available
  2248. }
  2249. // AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
  2250. function ATSUGetTabArray( iTextLayout: ATSUTextLayout; iMaxTabCount: ItemCount; oTabs: ATSUTabPtr; oTabCount: ItemCountPtr ): OSStatus; external name '_ATSUGetTabArray';
  2251. { ---------------------------------------------------------------------------- }
  2252. { ATSUI font fallback object functions }
  2253. { ---------------------------------------------------------------------------- }
  2254. {
  2255. * ATSUCreateFontFallbacks()
  2256. *
  2257. * Summary:
  2258. * Creates an opaque object that can be set to contain a font list
  2259. * and a font-search method.
  2260. *
  2261. * Discussion:
  2262. * After using this fucntion to create an ATSUFontFallbacks object,
  2263. * you can then use ATSUSetObjFontFallbacks to set the fallback
  2264. * method for this object, and then use the
  2265. * kATSULineFontFallbacksTag to apply the object to a layout. You
  2266. * may then either call ATSUMatchFontsToText to manually perform
  2267. * font substitution, or call ATSUSetTransientFontMatching to
  2268. * perform automatic font subtitution.
  2269. *
  2270. * Parameters:
  2271. *
  2272. * oFontFallback:
  2273. * On return, a reference to a newly created ATSUFontFallbacks
  2274. * object. You are responsible for freeing this object with
  2275. * ATSUDisposeFontFallbacks.
  2276. *
  2277. * Result:
  2278. * On success, noErr is returned. See MacErrors.h for possible error
  2279. * codes.
  2280. *
  2281. * Availability:
  2282. * Mac OS X: in version 10.1 and later in ApplicationServices.framework
  2283. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.1 and later
  2284. * Non-Carbon CFM: not available
  2285. }
  2286. // AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER
  2287. function ATSUCreateFontFallbacks( var oFontFallback: ATSUFontFallbacks ): OSStatus; external name '_ATSUCreateFontFallbacks';
  2288. {
  2289. * ATSUDisposeFontFallbacks()
  2290. *
  2291. * Summary:
  2292. * Disposes of an ATSUDisposeFontFallbacks object.
  2293. *
  2294. * Discussion:
  2295. * This function will only dispose of the ATSUDisposeFontFallbacks
  2296. * itself. If you have allocated an array of ATSUFontIDs for use
  2297. * with this ATSUFontFallbacks object, you are responsible for
  2298. * freeing it separately.
  2299. *
  2300. * Parameters:
  2301. *
  2302. * iFontFallbacks:
  2303. * The ATSUFontFallbacks object to be disposed of.
  2304. *
  2305. * Result:
  2306. * On success, noErr is returned. See MacErrors.h for possible error
  2307. * codes.
  2308. *
  2309. * Availability:
  2310. * Mac OS X: in version 10.1 and later in ApplicationServices.framework
  2311. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.1 and later
  2312. * Non-Carbon CFM: not available
  2313. }
  2314. // AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER
  2315. function ATSUDisposeFontFallbacks( iFontFallbacks: ATSUFontFallbacks ): OSStatus; external name '_ATSUDisposeFontFallbacks';
  2316. {
  2317. * ATSUSetObjFontFallbacks()
  2318. *
  2319. * Summary:
  2320. * Assigns a font-search method and a font list to a font fallback
  2321. * object.
  2322. *
  2323. * Discussion:
  2324. * This function allows you to define the settings for a font
  2325. * fallback object. These settings determine the method ATSUI uses
  2326. * to perform font fallbacks, as well as the font search list, if
  2327. * one is needed. Not all fallback methods require a search list.
  2328. * See the definition of ATSUFontFallbackMethod for more infomation
  2329. * about the different font fallback methods. Once you have called
  2330. * this function, you typically will want to associate the font
  2331. * fallback object with a text layout using ATSUSetLayoutControls
  2332. * and the kATSULineFontFallbacksTag attribute.
  2333. *
  2334. * Parameters:
  2335. *
  2336. * iFontFallbacks:
  2337. * The fallback object for which you wish to set or change
  2338. * settings.
  2339. *
  2340. * iFontFallbacksCount:
  2341. * The number of fonts contained in the iFonts array. Some font
  2342. * fallbacks methods do not require such a list. In such cases,
  2343. * you may pass zero for this paramter.
  2344. *
  2345. * iFonts:
  2346. * A list of fonts for ATSUI to search through when performing
  2347. * fallbacks. Some font fallbacks methods do not require such a
  2348. * list. In such cases, you may pass NULL for this parameter. can be NUL
  2349. *
  2350. * iFontFallbackMethod:
  2351. * The font fallback method for ATSUI to use. See the definition
  2352. * of ATSUFontFallbackMethod for a list of possible constants to
  2353. * pass in for this paramater. Note that some fallback modes
  2354. * require a list of fonts for ATSUI to search. In such cases, use
  2355. * the iFonts and iFontFallbacksCount parameters to specify this
  2356. * list.
  2357. *
  2358. * Result:
  2359. * On success, noErr is returned. See MacErrors.h for possible error
  2360. * codes.
  2361. *
  2362. * Availability:
  2363. * Mac OS X: in version 10.1 and later in ApplicationServices.framework
  2364. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.1 and later
  2365. * Non-Carbon CFM: not available
  2366. }
  2367. // AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER
  2368. function ATSUSetObjFontFallbacks( iFontFallbacks: ATSUFontFallbacks; iFontFallbacksCount: ItemCount; iFonts: ATSUFontIDPtr; iFontFallbackMethod: ATSUFontFallbackMethod ): OSStatus; external name '_ATSUSetObjFontFallbacks';
  2369. {
  2370. * ATSUGetObjFontFallbacks()
  2371. *
  2372. * Summary:
  2373. * Returns information about the current settings in an
  2374. * ATSUFontFallbacks object.
  2375. *
  2376. * Discussion:
  2377. * Information returned includes the font-search method, and the
  2378. * font search list, if one is set. Note that some font fallback
  2379. * modes do not have a client-specified search list. You must
  2380. * allocate space for this list.
  2381. *
  2382. * Parameters:
  2383. *
  2384. * iFontFallbacks:
  2385. * The font fallback object you want to know the current settings
  2386. * of.
  2387. *
  2388. * iMaxFontFallbacksCount:
  2389. * For this parameter, pass in the size of the array you are
  2390. * passing in for the oFonts parameter.
  2391. *
  2392. * oFonts:
  2393. * On input, a buffer you have allocated for storing the font
  2394. * search list. On return, ATSUGetObjFontFallbacks will populate
  2395. * the list up to iMaxFontFallbacksCount items. can be NUL
  2396. *
  2397. * oFontFallbackMethod:
  2398. * On return, the font fallback method currently set for this
  2399. * object. See the definition of ATSUFontFallbackMethod for more
  2400. * information regarding the different font fallback modes.
  2401. *
  2402. * oActualFallbacksCount:
  2403. * On return, the size of the font search list. You can use this
  2404. * parameter to determine how much space to allocate for the
  2405. * oFonts parameter. can be NUL
  2406. *
  2407. * Result:
  2408. * On success, noErr is returned. See MacErrors.h for possible error
  2409. * codes.
  2410. *
  2411. * Availability:
  2412. * Mac OS X: in version 10.1 and later in ApplicationServices.framework
  2413. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.1 and later
  2414. * Non-Carbon CFM: not available
  2415. }
  2416. // AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER
  2417. function ATSUGetObjFontFallbacks( iFontFallbacks: ATSUFontFallbacks; iMaxFontFallbacksCount: ItemCount; oFonts: ATSUFontIDPtr; var oFontFallbackMethod: ATSUFontFallbackMethod; oActualFallbacksCount: ItemCountPtr ): OSStatus; external name '_ATSUGetObjFontFallbacks';
  2418. { ---------------------------------------------------------------------------- }
  2419. { ATSUI font matching }
  2420. { ---------------------------------------------------------------------------- }
  2421. {
  2422. * ATSUSetFontFallbacks()
  2423. *
  2424. * Summary:
  2425. * Sets font fallback behavior on a global basis.
  2426. *
  2427. * Discussion:
  2428. * Control of font fallback behavior on a global basis is no longer
  2429. * recommended. Object based font fallbacks are preferred. See the
  2430. * functions ATSUCreateFontFallbacks, ATSUDisposeFontFallbacks,
  2431. * ATSUSetObjFontFallbacks, and ATSUGetObjFontFallbacks, as well as
  2432. * the kATSULineFontFallbacksTag attribute for more information
  2433. * about object based font fallbacks.
  2434. *
  2435. * Result:
  2436. * On success, noErr is returned. See MacErrors.h for possible error
  2437. * codes.
  2438. *
  2439. * Availability:
  2440. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  2441. * CarbonLib: in CarbonLib 1.0 and later
  2442. * Non-Carbon CFM: in ATSUnicodeLib 8.6 and later
  2443. }
  2444. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  2445. function ATSUSetFontFallbacks( iFontFallbacksCount: ItemCount; iFontIDs: ATSUFontIDPtr; iFontFallbackMethod: ATSUFontFallbackMethod ): OSStatus; external name '_ATSUSetFontFallbacks';
  2446. {
  2447. * ATSUGetFontFallbacks()
  2448. *
  2449. * Summary:
  2450. * Gets the current global font fallback behavior.
  2451. *
  2452. * Discussion:
  2453. * Control of font fallback behavior on a global basis is no longer
  2454. * recommended. Object based font fallbacks are preferred. See the
  2455. * functions ATSUCreateFontFallbacks, ATSUDisposeFontFallbacks,
  2456. * ATSUSetObjFontFallbacks, and ATSUGetObjFontFallbacks, as well as
  2457. * the kATSULineFontFallbacksTag attribute for more information
  2458. * about object based font fallbacks.
  2459. *
  2460. * Result:
  2461. * On success, noErr is returned. See MacErrors.h for possible error
  2462. * codes.
  2463. *
  2464. * Availability:
  2465. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  2466. * CarbonLib: in CarbonLib 1.0 and later
  2467. * Non-Carbon CFM: in ATSUnicodeLib 8.6 and later
  2468. }
  2469. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  2470. function ATSUGetFontFallbacks( iMaxFontFallbacksCount: ItemCount; oFontIDs: ATSUFontIDPtr; var oFontFallbackMethod: ATSUFontFallbackMethod; var oActualFallbacksCount: ItemCount ): OSStatus; external name '_ATSUGetFontFallbacks';
  2471. {
  2472. * ATSUMatchFontsToText()
  2473. *
  2474. * Summary:
  2475. * Examines a text range for characters that cannot be drawn with
  2476. * the current font and suggests a substitute font, if necessary.
  2477. *
  2478. * Discussion:
  2479. * When you call the ATSUMatchFontsToText function, ATSUI scans the
  2480. * given range of text for characters that cannot be drawn with the
  2481. * currently assigned font. When ATSUI finds such a character, it
  2482. * identifies a substitute font for drawing the character. ATSUI
  2483. * then continues scanning the text range for subsequent characters
  2484. * that cannot be drawn, stopping when it finds a character that can
  2485. * be drawn with the currently assigned font, or finds a character
  2486. * that cannot be drawn with either the currently assigned font or
  2487. * the substitute font, or reaches the end of the text range you
  2488. * have specified. ATSUI's default behavior for finding a substitute
  2489. * font is to recommend the first valid font that it finds when
  2490. * scanning the fonts in the user's system. ATSUI first searches in
  2491. * the standard application fonts for various languages. If that
  2492. * fails, ATSUI searches through the remaining fonts on the system
  2493. * in the order in which the Font Manager returns the fonts. After
  2494. * ATSUI has searched all the fonts in the system, any unmatched
  2495. * text is drawn using the last-resort font. That is, missing glyphs
  2496. * are represented by and empty box to indicate to the user that a
  2497. * valid font for that character is not installed on their system.
  2498. * You can alter ATSUI's default search behavior by calling the
  2499. * function ATSUCreateFontFallbacks and defining your own font
  2500. * fallback settings for the text layout object. Because ATSUI does
  2501. * not necessarily completely scan the text range you specify with
  2502. * each call to ATSUMatchFontsToText, if ATSUI does find any
  2503. * characters that cannot be rendered with their current font, you
  2504. * should call ATSUMatchFontsToText again and update the input range
  2505. * to check that all the subsequent characters in the range can be
  2506. * drawn. For that reason, you should call ATSUMatchFontsToText from
  2507. * within a loop to assure that the entire range of text is checked.
  2508. * Note that calling ATSUMatchFontsToText does not cause the
  2509. * suggested font substitution to be performed. If you want ATSUI to
  2510. * perform font substitution automatically, you can call the
  2511. * function ATSUSetTransientFontMatching.
  2512. *
  2513. * Parameters:
  2514. *
  2515. * iTextLayout:
  2516. * The text layout object to examine.
  2517. *
  2518. * iTextStart:
  2519. * The first character of the range to examine. To start at the
  2520. * beginning of the text buffer, pass the constant
  2521. * kATSUFromTextBeginning.
  2522. *
  2523. * iTextLength:
  2524. * The length of the text range to examine. If you want the range
  2525. * of text to extend to the end of the text buffer, you can pass
  2526. * the constant kATSUToTextEnd.
  2527. *
  2528. * oFontID:
  2529. * On return, the value provides a font ID for the suggested
  2530. * substitute font or kATSUInvalidFontID, if no substitute font is
  2531. * available.
  2532. *
  2533. * oChangedOffset:
  2534. * On return, this value specifies the offset from the beginning
  2535. * of the text buffer to the first character that cannot be drawn
  2536. * with the current font.
  2537. *
  2538. * oChangedLength:
  2539. * On return, this value specifies the length of the text range
  2540. * that cannot be drawn with the current font.
  2541. *
  2542. * Result:
  2543. * The result code noErr indicates that all the characters in the
  2544. * given range can be rendered with their current font(s) and no
  2545. * font substitution is needed. If you receive either of the result
  2546. * codes kATSUFontsMatched or kATSUFontsNotMatched, you should
  2547. * update the input range and call ATSUMatchFontsToText again to
  2548. * ensure that all the characters in the range can be drawn. See
  2549. * MacErrors.h for other possible error codes.
  2550. *
  2551. * Availability:
  2552. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  2553. * CarbonLib: in CarbonLib 1.0 and later
  2554. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  2555. }
  2556. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  2557. function ATSUMatchFontsToText( iTextLayout: ATSUTextLayout; iTextStart: UniCharArrayOffset; iTextLength: UniCharCount; var oFontID: ATSUFontID; var oChangedOffset: UniCharArrayOffset; var oChangedLength: UniCharCount ): OSStatus; external name '_ATSUMatchFontsToText';
  2558. {
  2559. * ATSUSetTransientFontMatching()
  2560. *
  2561. * Summary:
  2562. * Sets the current transient font matching state for a given layout.
  2563. *
  2564. * Discussion:
  2565. * Transient font matching allows ATSUI to automatically substitute
  2566. * glyphs from other fonts if the specified styles do not contain
  2567. * glyphs for all the characters in the text. You can change the
  2568. * behavior of this font substitution by calling the function
  2569. * ATSUCreateFontFallbacks and defining your own font fallback
  2570. * settings for the text layout object.
  2571. *
  2572. * Parameters:
  2573. *
  2574. * iTextLayout:
  2575. * A layout for which to set the current transient font matching
  2576. * state.
  2577. *
  2578. * iTransientFontMatching:
  2579. * A boolean value indicating if the current transient font
  2580. * matching state to set.
  2581. *
  2582. * Result:
  2583. * On success, noErr is returned. See MacErrors.h for possible error
  2584. * codes.
  2585. *
  2586. * Availability:
  2587. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  2588. * CarbonLib: in CarbonLib 1.0 and later
  2589. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  2590. }
  2591. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  2592. function ATSUSetTransientFontMatching( iTextLayout: ATSUTextLayout; iTransientFontMatching: Boolean ): OSStatus; external name '_ATSUSetTransientFontMatching';
  2593. {
  2594. * ATSUGetTransientFontMatching()
  2595. *
  2596. * Summary:
  2597. * Obtains the current transient font matching state for a given
  2598. * layout.
  2599. *
  2600. * Discussion:
  2601. * Transient font matching allows ATSUI to automatically substitute
  2602. * glyphs from other fonts if the specified styles do not contain
  2603. * glyphs for all the characters in the text. You can change the
  2604. * behavior of this font substitution by calling the function
  2605. * ATSUCreateFontFallbacks and defining your own font fallback
  2606. * settings for the text layout object.
  2607. *
  2608. * Parameters:
  2609. *
  2610. * iTextLayout:
  2611. * A layout for which to obtain the current transient font
  2612. * matching state.
  2613. *
  2614. * oTransientFontMatching:
  2615. * On return, a boolean value indicating the current transient
  2616. * font matching state.
  2617. *
  2618. * Result:
  2619. * On success, noErr is returned. See MacErrors.h for possible error
  2620. * codes.
  2621. *
  2622. * Availability:
  2623. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  2624. * CarbonLib: in CarbonLib 1.0 and later
  2625. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  2626. }
  2627. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  2628. function ATSUGetTransientFontMatching( iTextLayout: ATSUTextLayout; var oTransientFontMatching: Boolean ): OSStatus; external name '_ATSUGetTransientFontMatching';
  2629. { Functions listed beyond this point are either deprecated or not recommended }
  2630. { ---------------------------------------------------------------------------- }
  2631. { Handle-based functions }
  2632. { ---------------------------------------------------------------------------- }
  2633. {
  2634. * ATSUCreateTextLayoutWithTextHandle()
  2635. *
  2636. * Discussion:
  2637. * This function is no longer recommended. Please use
  2638. * ATSUCreateTextLayoutWithTextPtr instead.
  2639. *
  2640. * Availability:
  2641. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  2642. * CarbonLib: in CarbonLib 1.0 and later
  2643. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  2644. }
  2645. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  2646. function ATSUCreateTextLayoutWithTextHandle( iText: UniCharArrayHandle; iTextOffset: UniCharArrayOffset; iTextLength: UniCharCount; iTextTotalLength: UniCharCount; iNumberOfRuns: ItemCount; iRunLengths: UniCharCountPtr; iStyles: ATSUStylePtr; var oTextLayout: ATSUTextLayout ): OSStatus; external name '_ATSUCreateTextLayoutWithTextHandle';
  2647. {
  2648. * ATSUSetTextHandleLocation()
  2649. *
  2650. * Discussion:
  2651. * This function is no longer recommended. Please use
  2652. * ATSUSetTextPointerLocation instead.
  2653. *
  2654. * Availability:
  2655. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  2656. * CarbonLib: in CarbonLib 1.0 and later
  2657. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  2658. }
  2659. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  2660. function ATSUSetTextHandleLocation( iTextLayout: ATSUTextLayout; iText: UniCharArrayHandle; iTextOffset: UniCharArrayOffset; iTextLength: UniCharCount; iTextTotalLength: UniCharCount ): OSStatus; external name '_ATSUSetTextHandleLocation';
  2661. { ---------------------------------------------------------------------------- }
  2662. { ATSUI idle processing (deprecated) }
  2663. { ---------------------------------------------------------------------------- }
  2664. {
  2665. * ATSUIdle()
  2666. *
  2667. * Summary:
  2668. * Performs background processing.
  2669. *
  2670. * Discussion:
  2671. * Current versions of ATSUI do not implement background processing
  2672. * for text layout objects. In Mac OS X, the function ATSUIdle does
  2673. * nothing.
  2674. *
  2675. * Availability:
  2676. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  2677. * CarbonLib: in CarbonLib 1.0 and later
  2678. * Non-Carbon CFM: in ATSUnicodeLib 8.5 and later
  2679. }
  2680. // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
  2681. function ATSUIdle( iTextLayout: ATSUTextLayout ): OSStatus; external name '_ATSUIdle';
  2682. { ---------------------------------------------------------------------------- }
  2683. { ATSUI Memory allocation specification functions (not in Carbon) }
  2684. { ---------------------------------------------------------------------------- }
  2685. {
  2686. * ATSUCreateMemorySetting()
  2687. *
  2688. * Discussion:
  2689. * ATSUI memory setting functions are not necessary on Mac OS X.
  2690. *
  2691. * Availability:
  2692. * Mac OS X: not available
  2693. * CarbonLib: not available
  2694. * Non-Carbon CFM: in ATSUnicodeLib 8.6 and later
  2695. }
  2696. {
  2697. * ATSUSetCurrentMemorySetting()
  2698. *
  2699. * Discussion:
  2700. * ATSUI memory setting functions are not necessary on Mac OS X.
  2701. *
  2702. * Availability:
  2703. * Mac OS X: not available
  2704. * CarbonLib: not available
  2705. * Non-Carbon CFM: in ATSUnicodeLib 8.6 and later
  2706. }
  2707. {
  2708. * ATSUGetCurrentMemorySetting()
  2709. *
  2710. * Discussion:
  2711. * ATSUI memory setting functions are not necessary on Mac OS X.
  2712. *
  2713. * Availability:
  2714. * Mac OS X: not available
  2715. * CarbonLib: not available
  2716. * Non-Carbon CFM: in ATSUnicodeLib 8.6 and later
  2717. }
  2718. {
  2719. * ATSUDisposeMemorySetting()
  2720. *
  2721. * Discussion:
  2722. * ATSUI memory setting functions are not necessary on Mac OS X.
  2723. *
  2724. * Availability:
  2725. * Mac OS X: not available
  2726. * CarbonLib: not available
  2727. * Non-Carbon CFM: in ATSUnicodeLib 8.6 and later
  2728. }
  2729. end.