2
0

ATSUnicodeObjects.pas 129 KB

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