Fonts.pas 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928
  1. {
  2. File: Fonts.p
  3. Contains: Public interface to the Font Manager.
  4. Version: Technology: Mac OS 9 / Carbon
  5. Release: Universal Interfaces 3.4.2
  6. Copyright: © 1985-2002 by Apple Computer, Inc., all rights reserved
  7. Bugs?: For bug reports, consult the following page on
  8. the World Wide Web:
  9. http://www.freepascal.org/bugs.html
  10. }
  11. {
  12. Modified for use with Free Pascal
  13. Version 200
  14. Please report any bugs to <[email protected]>
  15. }
  16. {$mode macpas}
  17. {$packenum 1}
  18. {$macro on}
  19. {$inline on}
  20. {$CALLING MWPASCAL}
  21. unit Fonts;
  22. interface
  23. {$setc UNIVERSAL_INTERFACES_VERSION := $0342}
  24. {$setc GAP_INTERFACES_VERSION := $0200}
  25. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  26. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  27. {$endc}
  28. {$ifc defined CPUPOWERPC and defined CPUI386}
  29. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  30. {$endc}
  31. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  32. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  33. {$endc}
  34. {$ifc not defined __ppc__ and defined CPUPOWERPC}
  35. {$setc __ppc__ := 1}
  36. {$elsec}
  37. {$setc __ppc__ := 0}
  38. {$endc}
  39. {$ifc not defined __i386__ and defined CPUI386}
  40. {$setc __i386__ := 1}
  41. {$elsec}
  42. {$setc __i386__ := 0}
  43. {$endc}
  44. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  45. {$error Conflicting definitions for __ppc__ and __i386__}
  46. {$endc}
  47. {$ifc defined __ppc__ and __ppc__}
  48. {$setc TARGET_CPU_PPC := TRUE}
  49. {$setc TARGET_CPU_X86 := FALSE}
  50. {$elifc defined __i386__ and __i386__}
  51. {$setc TARGET_CPU_PPC := FALSE}
  52. {$setc TARGET_CPU_X86 := TRUE}
  53. {$elsec}
  54. {$error Neither __ppc__ nor __i386__ is defined.}
  55. {$endc}
  56. {$setc TARGET_CPU_PPC_64 := FALSE}
  57. {$ifc defined FPC_BIG_ENDIAN}
  58. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  59. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  60. {$elifc defined FPC_LITTLE_ENDIAN}
  61. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  62. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  63. {$elsec}
  64. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  65. {$endc}
  66. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  67. {$setc CALL_NOT_IN_CARBON := FALSE}
  68. {$setc OLDROUTINENAMES := FALSE}
  69. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  70. {$setc OPAQUE_UPP_TYPES := TRUE}
  71. {$setc OTCARBONAPPLICATION := TRUE}
  72. {$setc OTKERNEL := FALSE}
  73. {$setc PM_USE_SESSION_APIS := TRUE}
  74. {$setc TARGET_API_MAC_CARBON := TRUE}
  75. {$setc TARGET_API_MAC_OS8 := FALSE}
  76. {$setc TARGET_API_MAC_OSX := TRUE}
  77. {$setc TARGET_CARBON := TRUE}
  78. {$setc TARGET_CPU_68K := FALSE}
  79. {$setc TARGET_CPU_MIPS := FALSE}
  80. {$setc TARGET_CPU_SPARC := FALSE}
  81. {$setc TARGET_OS_MAC := TRUE}
  82. {$setc TARGET_OS_UNIX := FALSE}
  83. {$setc TARGET_OS_WIN32 := FALSE}
  84. {$setc TARGET_RT_MAC_68881 := FALSE}
  85. {$setc TARGET_RT_MAC_CFM := FALSE}
  86. {$setc TARGET_RT_MAC_MACHO := TRUE}
  87. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  88. {$setc TYPE_BOOL := FALSE}
  89. {$setc TYPE_EXTENDED := FALSE}
  90. {$setc TYPE_LONGLONG := TRUE}
  91. uses MacTypes,QuickdrawText,ATSTypes,Files,MacErrors,Quickdraw,TextCommon;
  92. {$ALIGN MAC68K}
  93. const
  94. systemFont = 0;
  95. applFont = 1;
  96. kFMDefaultOptions = 0;
  97. { Activation contexts }
  98. kFMDefaultActivationContext = 0;
  99. kFMGlobalActivationContext = $00000001;
  100. kFMLocalActivationContext = 0;
  101. { Iteration scopes }
  102. kFMDefaultIterationScope = 0;
  103. kFMGlobalIterationScope = $00000001;
  104. kFMLocalIterationScope = 0;
  105. { kPlatformDefaultGuiFontID is used in QuickTime 3.0. }
  106. {$ifc TARGET_OS_MAC}
  107. kPlatformDefaultGuiFontID = 1;
  108. {$elsec}
  109. kPlatformDefaultGuiFontID = -1;
  110. {$endc} {TARGET_OS_MAC}
  111. commandMark = 17;
  112. checkMark = 18;
  113. diamondMark = 19;
  114. appleMark = 20;
  115. propFont = 36864;
  116. prpFntH = 36865;
  117. prpFntW = 36866;
  118. prpFntHW = 36867;
  119. fixedFont = 45056;
  120. fxdFntH = 45057;
  121. fxdFntW = 45058;
  122. fxdFntHW = 45059;
  123. fontWid = 44208;
  124. type
  125. FMInputPtr = ^FMInput;
  126. FMInput = packed record
  127. family: SInt16;
  128. size: SInt16;
  129. face: Style;
  130. needBits: boolean;
  131. device: SInt16;
  132. numer: Point;
  133. denom: Point;
  134. end;
  135. FMOutputPtr = ^FMOutput;
  136. FMOutput = packed record
  137. errNum: SInt16;
  138. fontHandle: Handle;
  139. boldPixels: UInt8;
  140. italicPixels: UInt8;
  141. ulOffset: UInt8;
  142. ulShadow: UInt8;
  143. ulThick: UInt8;
  144. shadowPixels: UInt8;
  145. extra: SInt8;
  146. ascent: UInt8;
  147. descent: UInt8;
  148. widMax: UInt8;
  149. leading: SInt8;
  150. curStyle: SInt8;
  151. numer: Point;
  152. denom: Point;
  153. end;
  154. FMOutPtr = FMOutputPtr;
  155. FMetricRecPtr = ^FMetricRec;
  156. FMetricRec = record
  157. ascent: Fixed; { base line to top }
  158. descent: Fixed; { base line to bottom }
  159. leading: Fixed; { leading between lines }
  160. widMax: Fixed; { maximum character width }
  161. wTabHandle: Handle; { handle to font width table }
  162. end;
  163. FMetricRecHandle = ^FMetricRecPtr;
  164. {$ifc CALL_NOT_IN_CARBON}
  165. {
  166. * InitFonts()
  167. *
  168. * Availability:
  169. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  170. * CarbonLib: not available
  171. * Mac OS X: not available
  172. }
  173. procedure InitFonts; external name '_InitFonts';
  174. {$endc} {CALL_NOT_IN_CARBON}
  175. {
  176. * GetFontName()
  177. *
  178. * Availability:
  179. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  180. * CarbonLib: in CarbonLib 1.0 and later
  181. * Mac OS X: in version 10.0 and later
  182. }
  183. procedure GetFontName(familyID: SInt16; var name: Str255); external name '_GetFontName';
  184. {
  185. * GetFNum()
  186. *
  187. * Availability:
  188. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  189. * CarbonLib: in CarbonLib 1.0 and later
  190. * Mac OS X: in version 10.0 and later
  191. }
  192. procedure GetFNum(const (*var*) name: Str255; var familyID: SInt16); external name '_GetFNum';
  193. {
  194. * RealFont()
  195. *
  196. * Availability:
  197. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  198. * CarbonLib: in CarbonLib 1.0 and later
  199. * Mac OS X: in version 10.0 and later
  200. }
  201. function RealFont(fontNum: SInt16; size: SInt16): boolean; external name '_RealFont';
  202. {$ifc CALL_NOT_IN_CARBON}
  203. {
  204. * SetFontLock()
  205. *
  206. * Availability:
  207. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  208. * CarbonLib: not available
  209. * Mac OS X: not available
  210. }
  211. procedure SetFontLock(lockFlag: boolean); external name '_SetFontLock';
  212. {$endc} {CALL_NOT_IN_CARBON}
  213. {
  214. * FMSwapFont()
  215. *
  216. * Availability:
  217. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  218. * CarbonLib: in CarbonLib 1.0 and later
  219. * Mac OS X: in version 10.0 and later
  220. }
  221. function FMSwapFont(const (*var*) inRec: FMInput): FMOutPtr; external name '_FMSwapFont';
  222. {
  223. * SetFScaleDisable()
  224. *
  225. * Availability:
  226. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  227. * CarbonLib: in CarbonLib 1.0 and later
  228. * Mac OS X: in version 10.0 and later
  229. }
  230. procedure SetFScaleDisable(fscaleDisable: boolean); external name '_SetFScaleDisable';
  231. {
  232. * FontMetrics()
  233. *
  234. * Availability:
  235. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  236. * CarbonLib: in CarbonLib 1.0 and later
  237. * Mac OS X: in version 10.0 and later
  238. }
  239. procedure FontMetrics(theMetrics: FMetricRecPtr); external name '_FontMetrics';
  240. {
  241. * SetFractEnable()
  242. *
  243. * Availability:
  244. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  245. * CarbonLib: in CarbonLib 1.0 and later
  246. * Mac OS X: in version 10.0 and later
  247. }
  248. procedure SetFractEnable(fractEnable: boolean); external name '_SetFractEnable';
  249. {
  250. * GetDefFontSize()
  251. *
  252. * Availability:
  253. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  254. * CarbonLib: in CarbonLib 1.0 and later
  255. * Mac OS X: in version 10.0 and later
  256. }
  257. function GetDefFontSize: SInt16; external name '_GetDefFontSize';
  258. {
  259. * IsOutline()
  260. *
  261. * Availability:
  262. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  263. * CarbonLib: in CarbonLib 1.0 and later
  264. * Mac OS X: in version 10.0 and later
  265. }
  266. function IsOutline(numer: Point; denom: Point): boolean; external name '_IsOutline';
  267. {
  268. * SetOutlinePreferred()
  269. *
  270. * Availability:
  271. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  272. * CarbonLib: in CarbonLib 1.0 and later
  273. * Mac OS X: in version 10.0 and later
  274. }
  275. procedure SetOutlinePreferred(outlinePreferred: boolean); external name '_SetOutlinePreferred';
  276. {
  277. * GetOutlinePreferred()
  278. *
  279. * Availability:
  280. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  281. * CarbonLib: in CarbonLib 1.0 and later
  282. * Mac OS X: in version 10.0 and later
  283. }
  284. function GetOutlinePreferred: boolean; external name '_GetOutlinePreferred';
  285. {
  286. * OutlineMetrics()
  287. *
  288. * Availability:
  289. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  290. * CarbonLib: in CarbonLib 1.0 and later
  291. * Mac OS X: in version 10.0 and later
  292. }
  293. function OutlineMetrics(byteCount: SInt16; textPtr: UnivPtr; numer: Point; denom: Point; var yMax: SInt16; var yMin: SInt16; awArray: FixedPtr; lsbArray: FixedPtr; boundsArray: RectPtr): OSErr; external name '_OutlineMetrics';
  294. {
  295. * SetPreserveGlyph()
  296. *
  297. * Availability:
  298. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  299. * CarbonLib: in CarbonLib 1.0 and later
  300. * Mac OS X: in version 10.0 and later
  301. }
  302. procedure SetPreserveGlyph(preserveGlyph: boolean); external name '_SetPreserveGlyph';
  303. {
  304. * GetPreserveGlyph()
  305. *
  306. * Availability:
  307. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  308. * CarbonLib: in CarbonLib 1.0 and later
  309. * Mac OS X: in version 10.0 and later
  310. }
  311. function GetPreserveGlyph: boolean; external name '_GetPreserveGlyph';
  312. {$ifc CALL_NOT_IN_CARBON}
  313. {
  314. * FlushFonts()
  315. *
  316. * Availability:
  317. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  318. * CarbonLib: not available
  319. * Mac OS X: not available
  320. }
  321. function FlushFonts: OSErr; external name '_FlushFonts';
  322. {$endc} {CALL_NOT_IN_CARBON}
  323. {
  324. * GetSysFont()
  325. *
  326. * Availability:
  327. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  328. * CarbonLib: in CarbonLib 1.0 and later
  329. * Mac OS X: in version 10.0 and later
  330. }
  331. function GetSysFont: SInt16; external name '_GetSysFont';
  332. {
  333. * GetAppFont()
  334. *
  335. * Availability:
  336. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  337. * CarbonLib: in CarbonLib 1.0 and later
  338. * Mac OS X: in version 10.0 and later
  339. }
  340. function GetAppFont: SInt16; external name '_GetAppFont';
  341. {--------------------------------------------------------------------------------------}
  342. { Extended font data functions (available only with Mac OS 8.5 or later) }
  343. {--------------------------------------------------------------------------------------}
  344. {
  345. * SetAntiAliasedTextEnabled()
  346. *
  347. * Availability:
  348. * Non-Carbon CFM: in InterfaceLib 8.6 and later
  349. * CarbonLib: in CarbonLib 1.0 and later
  350. * Mac OS X: in version 10.0 and later
  351. }
  352. function SetAntiAliasedTextEnabled(iEnable: boolean; iMinFontSize: SInt16): OSStatus; external name '_SetAntiAliasedTextEnabled';
  353. {
  354. * IsAntiAliasedTextEnabled()
  355. *
  356. * Availability:
  357. * Non-Carbon CFM: in InterfaceLib 8.6 and later
  358. * CarbonLib: in CarbonLib 1.0 and later
  359. * Mac OS X: in version 10.0 and later
  360. }
  361. function IsAntiAliasedTextEnabled(var oMinFontSize: SInt16): boolean; external name '_IsAntiAliasedTextEnabled';
  362. {
  363. * QDTextBounds()
  364. *
  365. * Availability:
  366. * Non-Carbon CFM: in InterfaceLib 8.6 and later
  367. * CarbonLib: in CarbonLib 1.0 and later
  368. * Mac OS X: in version 10.0 and later
  369. }
  370. procedure QDTextBounds(byteCount: SInt16; textAddr: UnivPtr; var bounds: Rect); external name '_QDTextBounds';
  371. {
  372. * FetchFontInfo()
  373. *
  374. * Availability:
  375. * Non-Carbon CFM: in InterfaceLib 8.6 and later
  376. * CarbonLib: in CarbonLib 1.0 and later
  377. * Mac OS X: in version 10.0 and later
  378. }
  379. function FetchFontInfo(fontID: SInt16; fontSize: SInt16; fontStyle: SInt16; var info: FontInfo): OSErr; external name '_FetchFontInfo';
  380. {--------------------------------------------------------------------------------------}
  381. { Font access and data management functions (available only with Mac OS 9.0 or later) }
  382. {--------------------------------------------------------------------------------------}
  383. { Enumeration }
  384. {
  385. * FMCreateFontFamilyIterator()
  386. *
  387. * Availability:
  388. * Non-Carbon CFM: in FontManager 9.0 and later
  389. * CarbonLib: in CarbonLib 1.0 and later
  390. * Mac OS X: in version 10.0 and later
  391. }
  392. function FMCreateFontFamilyIterator(iFilter: {Const}FMFilterPtr; iRefCon: UnivPtr; iOptions: OptionBits; var ioIterator: FMFontFamilyIterator): OSStatus; external name '_FMCreateFontFamilyIterator';
  393. {
  394. * FMDisposeFontFamilyIterator()
  395. *
  396. * Availability:
  397. * Non-Carbon CFM: in FontManager 9.0 and later
  398. * CarbonLib: in CarbonLib 1.0 and later
  399. * Mac OS X: in version 10.0 and later
  400. }
  401. function FMDisposeFontFamilyIterator(var ioIterator: FMFontFamilyIterator): OSStatus; external name '_FMDisposeFontFamilyIterator';
  402. {
  403. * FMResetFontFamilyIterator()
  404. *
  405. * Availability:
  406. * Non-Carbon CFM: in FontManager 9.0 and later
  407. * CarbonLib: in CarbonLib 1.0 and later
  408. * Mac OS X: in version 10.0 and later
  409. }
  410. function FMResetFontFamilyIterator(iFilter: {Const}FMFilterPtr; iRefCon: UnivPtr; iOptions: OptionBits; var ioIterator: FMFontFamilyIterator): OSStatus; external name '_FMResetFontFamilyIterator';
  411. {
  412. * FMGetNextFontFamily()
  413. *
  414. * Availability:
  415. * Non-Carbon CFM: in FontManager 9.0 and later
  416. * CarbonLib: in CarbonLib 1.0 and later
  417. * Mac OS X: in version 10.0 and later
  418. }
  419. function FMGetNextFontFamily(var ioIterator: FMFontFamilyIterator; var oFontFamily: FMFontFamily): OSStatus; external name '_FMGetNextFontFamily';
  420. {
  421. * FMCreateFontIterator()
  422. *
  423. * Availability:
  424. * Non-Carbon CFM: in FontManager 9.0 and later
  425. * CarbonLib: in CarbonLib 1.0 and later
  426. * Mac OS X: in version 10.0 and later
  427. }
  428. function FMCreateFontIterator(iFilter: {Const}FMFilterPtr; iRefCon: UnivPtr; iOptions: OptionBits; var ioIterator: FMFontIterator): OSStatus; external name '_FMCreateFontIterator';
  429. {
  430. * FMDisposeFontIterator()
  431. *
  432. * Availability:
  433. * Non-Carbon CFM: in FontManager 9.0 and later
  434. * CarbonLib: in CarbonLib 1.0 and later
  435. * Mac OS X: in version 10.0 and later
  436. }
  437. function FMDisposeFontIterator(var ioIterator: FMFontIterator): OSStatus; external name '_FMDisposeFontIterator';
  438. {
  439. * FMResetFontIterator()
  440. *
  441. * Availability:
  442. * Non-Carbon CFM: in FontManager 9.0 and later
  443. * CarbonLib: in CarbonLib 1.0 and later
  444. * Mac OS X: in version 10.0 and later
  445. }
  446. function FMResetFontIterator(iFilter: {Const}FMFilterPtr; iRefCon: UnivPtr; iOptions: OptionBits; var ioIterator: FMFontIterator): OSStatus; external name '_FMResetFontIterator';
  447. {
  448. * FMGetNextFont()
  449. *
  450. * Availability:
  451. * Non-Carbon CFM: in FontManager 9.0 and later
  452. * CarbonLib: in CarbonLib 1.0 and later
  453. * Mac OS X: in version 10.0 and later
  454. }
  455. function FMGetNextFont(var ioIterator: FMFontIterator; var oFont: FMFont): OSStatus; external name '_FMGetNextFont';
  456. { Font families }
  457. {
  458. * FMCreateFontFamilyInstanceIterator()
  459. *
  460. * Availability:
  461. * Non-Carbon CFM: in FontManager 9.0 and later
  462. * CarbonLib: in CarbonLib 1.0 and later
  463. * Mac OS X: in version 10.0 and later
  464. }
  465. function FMCreateFontFamilyInstanceIterator(iFontFamily: FMFontFamily; var ioIterator: FMFontFamilyInstanceIterator): OSStatus; external name '_FMCreateFontFamilyInstanceIterator';
  466. {
  467. * FMDisposeFontFamilyInstanceIterator()
  468. *
  469. * Availability:
  470. * Non-Carbon CFM: in FontManager 9.0 and later
  471. * CarbonLib: in CarbonLib 1.0 and later
  472. * Mac OS X: in version 10.0 and later
  473. }
  474. function FMDisposeFontFamilyInstanceIterator(var ioIterator: FMFontFamilyInstanceIterator): OSStatus; external name '_FMDisposeFontFamilyInstanceIterator';
  475. {
  476. * FMResetFontFamilyInstanceIterator()
  477. *
  478. * Availability:
  479. * Non-Carbon CFM: in FontManager 9.0 and later
  480. * CarbonLib: in CarbonLib 1.0 and later
  481. * Mac OS X: in version 10.0 and later
  482. }
  483. function FMResetFontFamilyInstanceIterator(iFontFamily: FMFontFamily; var ioIterator: FMFontFamilyInstanceIterator): OSStatus; external name '_FMResetFontFamilyInstanceIterator';
  484. {
  485. * FMGetNextFontFamilyInstance()
  486. *
  487. * Availability:
  488. * Non-Carbon CFM: in FontManager 9.0 and later
  489. * CarbonLib: in CarbonLib 1.0 and later
  490. * Mac OS X: in version 10.0 and later
  491. }
  492. function FMGetNextFontFamilyInstance(var ioIterator: FMFontFamilyInstanceIterator; var oFont: FMFont; oStyle: FMFontStylePtr; oSize: FMFontSizePtr): OSStatus; external name '_FMGetNextFontFamilyInstance';
  493. {
  494. * FMGetFontFamilyFromName()
  495. *
  496. * Availability:
  497. * Non-Carbon CFM: in FontManager 9.0 and later
  498. * CarbonLib: in CarbonLib 1.0 and later
  499. * Mac OS X: in version 10.0 and later
  500. }
  501. function FMGetFontFamilyFromName(const (*var*) iName: Str255): FMFontFamily; external name '_FMGetFontFamilyFromName';
  502. {
  503. * FMGetFontFamilyName()
  504. *
  505. * Availability:
  506. * Non-Carbon CFM: in FontManager 9.0 and later
  507. * CarbonLib: in CarbonLib 1.0 and later
  508. * Mac OS X: in version 10.0 and later
  509. }
  510. function FMGetFontFamilyName(iFontFamily: FMFontFamily; var oName: Str255): OSStatus; external name '_FMGetFontFamilyName';
  511. {
  512. * FMGetFontFamilyTextEncoding()
  513. *
  514. * Availability:
  515. * Non-Carbon CFM: in FontManager 9.0 and later
  516. * CarbonLib: in CarbonLib 1.0 and later
  517. * Mac OS X: in version 10.0 and later
  518. }
  519. function FMGetFontFamilyTextEncoding(iFontFamily: FMFontFamily; var oTextEncoding: TextEncoding): OSStatus; external name '_FMGetFontFamilyTextEncoding';
  520. {
  521. * FMGetFontFamilyGeneration()
  522. *
  523. * Availability:
  524. * Non-Carbon CFM: in FontManager 9.0 and later
  525. * CarbonLib: in CarbonLib 1.0 and later
  526. * Mac OS X: in version 10.0 and later
  527. }
  528. function FMGetFontFamilyGeneration(iFontFamily: FMFontFamily; var oGeneration: FMGeneration): OSStatus; external name '_FMGetFontFamilyGeneration';
  529. { Fonts }
  530. {
  531. * FMGetFontFormat()
  532. *
  533. * Availability:
  534. * Non-Carbon CFM: in FontManager 9.0 and later
  535. * CarbonLib: in CarbonLib 1.0 and later
  536. * Mac OS X: in version 10.0 and later
  537. }
  538. function FMGetFontFormat(iFont: FMFont; var oFormat: FourCharCode): OSStatus; external name '_FMGetFontFormat';
  539. {
  540. * FMGetFontTableDirectory()
  541. *
  542. * Availability:
  543. * Non-Carbon CFM: in FontManager 9.0 and later
  544. * CarbonLib: in CarbonLib 1.0 and later
  545. * Mac OS X: in version 10.0 and later
  546. }
  547. function FMGetFontTableDirectory(iFont: FMFont; iLength: ByteCount; iBuffer: UnivPtr; oActualLength: ByteCountPtr): OSStatus; external name '_FMGetFontTableDirectory';
  548. {
  549. * FMGetFontTable()
  550. *
  551. * Availability:
  552. * Non-Carbon CFM: in FontManager 9.0 and later
  553. * CarbonLib: in CarbonLib 1.0 and later
  554. * Mac OS X: in version 10.0 and later
  555. }
  556. function FMGetFontTable(iFont: FMFont; iTag: FourCharCode; iOffset: ByteOffset; iLength: ByteCount; iBuffer: UnivPtr; oActualLength: ByteCountPtr): OSStatus; external name '_FMGetFontTable';
  557. {
  558. * FMGetFontGeneration()
  559. *
  560. * Availability:
  561. * Non-Carbon CFM: in FontManager 9.0 and later
  562. * CarbonLib: in CarbonLib 1.0 and later
  563. * Mac OS X: in version 10.0 and later
  564. }
  565. function FMGetFontGeneration(iFont: FMFont; var oGeneration: FMGeneration): OSStatus; external name '_FMGetFontGeneration';
  566. {
  567. * FMGetFontContainer()
  568. *
  569. * Availability:
  570. * Non-Carbon CFM: in FontManager 9.0 and later
  571. * CarbonLib: in CarbonLib 1.0 and later
  572. * Mac OS X: in version 10.0 and later
  573. }
  574. function FMGetFontContainer(iFont: FMFont; var oFontContainer: FSSpec): OSStatus; external name '_FMGetFontContainer';
  575. { Conversion }
  576. {
  577. * FMGetFontFromFontFamilyInstance()
  578. *
  579. * Availability:
  580. * Non-Carbon CFM: in FontManager 9.0 and later
  581. * CarbonLib: in CarbonLib 1.0 and later
  582. * Mac OS X: in version 10.0 and later
  583. }
  584. function FMGetFontFromFontFamilyInstance(iFontFamily: FMFontFamily; iStyle: FMFontStyle; var oFont: FMFont; oIntrinsicStyle: FMFontStylePtr): OSStatus; external name '_FMGetFontFromFontFamilyInstance';
  585. {
  586. * FMGetFontFamilyInstanceFromFont()
  587. *
  588. * Availability:
  589. * Non-Carbon CFM: in FontManager 9.0 and later
  590. * CarbonLib: in CarbonLib 1.0 and later
  591. * Mac OS X: in version 10.0 and later
  592. }
  593. function FMGetFontFamilyInstanceFromFont(iFont: FMFont; var oFontFamily: FMFontFamily; var oStyle: FMFontStyle): OSStatus; external name '_FMGetFontFamilyInstanceFromFont';
  594. {
  595. * FMGetATSFontRefFromFont()
  596. *
  597. * Availability:
  598. * Non-Carbon CFM: not available
  599. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.1 and later
  600. * Mac OS X: in version 10.1 and later
  601. }
  602. function FMGetATSFontRefFromFont(iFont: FMFont): ATSFontRef; external name '_FMGetATSFontRefFromFont';
  603. {
  604. * FMGetATSFontFamilyRefFromFontFamily()
  605. *
  606. * Availability:
  607. * Non-Carbon CFM: not available
  608. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.1 and later
  609. * Mac OS X: in version 10.1 and later
  610. }
  611. function FMGetATSFontFamilyRefFromFontFamily(iFamily: FMFontFamily): ATSFontFamilyRef; external name '_FMGetATSFontFamilyRefFromFontFamily';
  612. {
  613. * FMGetFontFromATSFontRef()
  614. *
  615. * Availability:
  616. * Non-Carbon CFM: not available
  617. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.1 and later
  618. * Mac OS X: in version 10.1 and later
  619. }
  620. function FMGetFontFromATSFontRef(iFont: ATSFontRef): FMFont; external name '_FMGetFontFromATSFontRef';
  621. {
  622. * FMGetFontFamilyFromATSFontFamilyRef()
  623. *
  624. * Availability:
  625. * Non-Carbon CFM: not available
  626. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.1 and later
  627. * Mac OS X: in version 10.1 and later
  628. }
  629. function FMGetFontFamilyFromATSFontFamilyRef(iFamily: ATSFontFamilyRef): FMFontFamily; external name '_FMGetFontFamilyFromATSFontFamilyRef';
  630. { Activation }
  631. {
  632. * FMActivateFonts()
  633. *
  634. * Availability:
  635. * Non-Carbon CFM: in FontManager 9.0 and later
  636. * CarbonLib: in CarbonLib 1.0 and later
  637. * Mac OS X: in version 10.0 and later
  638. }
  639. function FMActivateFonts(const (*var*) iFontContainer: FSSpec; iFilter: {Const}FMFilterPtr; iRefCon: UnivPtr; iOptions: OptionBits): OSStatus; external name '_FMActivateFonts';
  640. {
  641. * FMDeactivateFonts()
  642. *
  643. * Availability:
  644. * Non-Carbon CFM: in FontManager 9.0 and later
  645. * CarbonLib: in CarbonLib 1.0 and later
  646. * Mac OS X: in version 10.0 and later
  647. }
  648. function FMDeactivateFonts(const (*var*) iFontContainer: FSSpec; iFilter: {Const}FMFilterPtr; iRefCon: UnivPtr; iOptions: OptionBits): OSStatus; external name '_FMDeactivateFonts';
  649. {
  650. * FMGetGeneration()
  651. *
  652. * Availability:
  653. * Non-Carbon CFM: in FontManager 9.0 and later
  654. * CarbonLib: in CarbonLib 1.0 and later
  655. * Mac OS X: in version 10.0 and later
  656. }
  657. function FMGetGeneration: FMGeneration; external name '_FMGetGeneration';
  658. { Container Access }
  659. {
  660. * FMGetFontContainerFromFontFamilyInstance()
  661. *
  662. * Availability:
  663. * Non-Carbon CFM: not available
  664. * CarbonLib: in CarbonLib 1.5 and later
  665. * Mac OS X: in version 10.1 and later
  666. }
  667. function FMGetFontContainerFromFontFamilyInstance(iFontFamily: FMFontFamily; iStyle: FMFontStyle; iFontSize: FMFontSize; var oFontContainer: FSSpec): OSStatus; external name '_FMGetFontContainerFromFontFamilyInstance';
  668. {
  669. * FMGetFontFamilyResource()
  670. *
  671. * Availability:
  672. * Non-Carbon CFM: not available
  673. * CarbonLib: in CarbonLib 1.5 and later
  674. * Mac OS X: in version 10.1 and later
  675. }
  676. function FMGetFontFamilyResource(iFontFamily: FMFontFamily; iFontStyle: FMFontStyle; iFontSize: FMFontSize; iBufferSize: ByteCount; ioBuffer: UnivPtr; oSize: ByteCountPtr): OSStatus; external name '_FMGetFontFamilyResource';
  677. type
  678. FontFamilyID = FMFontFamily;
  679. FontPointSize = FMFontSize;
  680. { -------------------------------------------------------------------------------------- }
  681. { Deprecated constant and type definitions }
  682. { -------------------------------------------------------------------------------------- }
  683. { The font identifier constants are deprecated; use GetFNum or FMGetFontFamilyFromName
  684. to find a font family from a standard QuickDraw name.
  685. }
  686. const
  687. kFMUseGlobalScopeOption = $00000001;
  688. kFontIDNewYork = 2;
  689. kFontIDGeneva = 3;
  690. kFontIDMonaco = 4;
  691. kFontIDVenice = 5;
  692. kFontIDLondon = 6;
  693. kFontIDAthens = 7;
  694. kFontIDSanFrancisco = 8;
  695. kFontIDToronto = 9;
  696. kFontIDCairo = 11;
  697. kFontIDLosAngeles = 12;
  698. kFontIDTimes = 20;
  699. kFontIDHelvetica = 21;
  700. kFontIDCourier = 22;
  701. kFontIDSymbol = 23;
  702. kFontIDMobile = 24;
  703. { The following data structures referenced by the low memory global variables of the
  704. Font Manager are deprecated on Mac OS X and CarbonLib 1.1. The low memory global
  705. variables are not shared between processes and may result in inconsistencies
  706. compared to previous releases of the system software. Changes made to the
  707. information contained in the low memory global variables, including any
  708. indirectly referenced width tables, font family records, and font records, are
  709. not reflected in the global state of the Font Manager and may only be accessed
  710. through the font access and data management functions of the Font Manager or ATS.
  711. }
  712. type
  713. WidEntryPtr = ^WidEntry;
  714. WidEntry = record
  715. widStyle: SInt16; { style entry applies to }
  716. end;
  717. WidTablePtr = ^WidTable;
  718. WidTable = record
  719. numWidths: SInt16; { number of entries - 1 }
  720. end;
  721. AsscEntryPtr = ^AsscEntry;
  722. AsscEntry = record
  723. fontSize: SInt16;
  724. fontStyle: SInt16;
  725. fontID: SInt16; { font resource ID }
  726. end;
  727. FontAssocPtr = ^FontAssoc;
  728. FontAssoc = record
  729. numAssoc: SInt16; { number of entries - 1 }
  730. end;
  731. StyleTablePtr = ^StyleTable;
  732. StyleTable = record
  733. fontClass: SInt16;
  734. offset: SInt32;
  735. reserved: SInt32;
  736. indexes: packed array [0..47] of char;
  737. end;
  738. NameTablePtr = ^NameTable;
  739. NameTable = record
  740. stringCount: SInt16;
  741. baseFontName: Str255;
  742. end;
  743. KernPairPtr = ^KernPair;
  744. KernPair = record
  745. kernFirst: SInt8; { 1st character of kerned pair }
  746. kernSecond: SInt8; { 2nd character of kerned pair }
  747. kernWidth: SInt16; { kerning in 1pt fixed format }
  748. end;
  749. KernEntryPtr = ^KernEntry;
  750. KernEntry = record
  751. kernStyle: SInt16; { style the entry applies to }
  752. kernLength: SInt16; { length of this entry }
  753. end;
  754. KernTablePtr = ^KernTable;
  755. KernTable = record
  756. numKerns: SInt16; { number of kerning entries }
  757. end;
  758. WidthTablePtr = ^WidthTable;
  759. WidthTable = packed record
  760. tabData: array [0..255] of Fixed; { character widths }
  761. tabFont: Handle; { font record used to build table }
  762. sExtra: SInt32; { space extra used for table }
  763. style: SInt32; { extra due to style }
  764. fID: SInt16; { font family ID }
  765. fSize: SInt16; { font size request }
  766. face: SInt16; { style (face) request }
  767. device: SInt16; { device requested }
  768. inNumer: Point; { scale factors requested }
  769. inDenom: Point; { scale factors requested }
  770. aFID: SInt16; { actual font family ID for table }
  771. fHand: Handle; { family record used to build up table }
  772. usedFam: boolean; { used fixed point family widths }
  773. aFace: UInt8; { actual face produced }
  774. vOutput: SInt16; { vertical scale output value }
  775. hOutput: SInt16; { horizontal scale output value }
  776. vFactor: SInt16; { vertical scale output value }
  777. hFactor: SInt16; { horizontal scale output value }
  778. aSize: SInt16; { actual size of actual font used }
  779. tabSize: SInt16; { total size of table }
  780. end;
  781. WidthTableHdl = ^WidthTablePtr;
  782. FamRecPtr = ^FamRec;
  783. FamRec = record
  784. ffFlags: SInt16; { flags for family }
  785. ffFamID: SInt16; { family ID number }
  786. ffFirstChar: SInt16; { ASCII code of 1st character }
  787. ffLastChar: SInt16; { ASCII code of last character }
  788. ffAscent: SInt16; { maximum ascent for 1pt font }
  789. ffDescent: SInt16; { maximum descent for 1pt font }
  790. ffLeading: SInt16; { maximum leading for 1pt font }
  791. ffWidMax: SInt16; { maximum widMax for 1pt font }
  792. ffWTabOff: SInt32; { offset to width table }
  793. ffKernOff: SInt32; { offset to kerning table }
  794. ffStylOff: SInt32; { offset to style mapping table }
  795. ffProperty: array [0..8] of SInt16; { style property info }
  796. ffIntl: array [0..1] of SInt16; { for international use }
  797. ffVersion: SInt16; { version number }
  798. end;
  799. FontRecPtr = ^FontRec;
  800. FontRec = record
  801. fontType: SInt16; { font type }
  802. firstChar: SInt16; { ASCII code of first character }
  803. lastChar: SInt16; { ASCII code of last character }
  804. widMax: SInt16; { maximum character width }
  805. kernMax: SInt16; { negative of maximum character kern }
  806. nDescent: SInt16; { negative of descent }
  807. fRectWidth: SInt16; { width of font rectangle }
  808. fRectHeight: SInt16; { height of font rectangle }
  809. owTLoc: UInt16; { offset to offset/width table }
  810. ascent: SInt16; { ascent }
  811. descent: SInt16; { descent }
  812. leading: SInt16; { leading }
  813. rowWords: SInt16; { row width of bit image / 2 }
  814. end;
  815. FontRecHdl = ^FontRecPtr;
  816. { -------------------------------------------------------------------------------------- }
  817. {$ifc OLDROUTINENAMES}
  818. const
  819. newYork = 2;
  820. geneva = 3;
  821. monaco = 4;
  822. venice = 5;
  823. london = 6;
  824. athens = 7;
  825. sanFran = 8;
  826. toronto = 9;
  827. cairo = 11;
  828. losAngeles = 12;
  829. times = 20;
  830. helvetica = 21;
  831. courier = 22;
  832. symbol = 23;
  833. mobile = 24;
  834. {$endc} {OLDROUTINENAMES}
  835. {--------------------------------------------------------------------------------------}
  836. {$ALIGN MAC68K}
  837. end.