SFNTTypes.pas 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658
  1. {
  2. File: ATS/SFNTTypes.h
  3. Contains: Font file structures.
  4. Version: ATS
  5. Copyright: © 1994-2012 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 Updated: Gorazd Krosl <[email protected]>, October 2009 }
  11. { Pascal Translation Updated: Jonas Maebe, <[email protected]>, October 2012 }
  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 SFNTTypes;
  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. {$setc TARGET_OS_EMBEDDED := FALSE}
  79. {$elifc defined __ppc64__ and __ppc64__}
  80. {$setc TARGET_CPU_PPC := FALSE}
  81. {$setc TARGET_CPU_PPC64 := TRUE}
  82. {$setc TARGET_CPU_X86 := FALSE}
  83. {$setc TARGET_CPU_X86_64 := FALSE}
  84. {$setc TARGET_CPU_ARM := FALSE}
  85. {$setc TARGET_OS_MAC := TRUE}
  86. {$setc TARGET_OS_IPHONE := FALSE}
  87. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  88. {$setc TARGET_OS_EMBEDDED := FALSE}
  89. {$elifc defined __i386__ and __i386__}
  90. {$setc TARGET_CPU_PPC := FALSE}
  91. {$setc TARGET_CPU_PPC64 := FALSE}
  92. {$setc TARGET_CPU_X86 := TRUE}
  93. {$setc TARGET_CPU_X86_64 := FALSE}
  94. {$setc TARGET_CPU_ARM := FALSE}
  95. {$ifc defined(iphonesim)}
  96. {$setc TARGET_OS_MAC := FALSE}
  97. {$setc TARGET_OS_IPHONE := TRUE}
  98. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  99. {$elsec}
  100. {$setc TARGET_OS_MAC := TRUE}
  101. {$setc TARGET_OS_IPHONE := FALSE}
  102. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  103. {$endc}
  104. {$setc TARGET_OS_EMBEDDED := FALSE}
  105. {$elifc defined __x86_64__ and __x86_64__}
  106. {$setc TARGET_CPU_PPC := FALSE}
  107. {$setc TARGET_CPU_PPC64 := FALSE}
  108. {$setc TARGET_CPU_X86 := FALSE}
  109. {$setc TARGET_CPU_X86_64 := TRUE}
  110. {$setc TARGET_CPU_ARM := FALSE}
  111. {$setc TARGET_OS_MAC := TRUE}
  112. {$setc TARGET_OS_IPHONE := FALSE}
  113. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  114. {$setc TARGET_OS_EMBEDDED := FALSE}
  115. {$elifc defined __arm__ and __arm__}
  116. {$setc TARGET_CPU_PPC := FALSE}
  117. {$setc TARGET_CPU_PPC64 := FALSE}
  118. {$setc TARGET_CPU_X86 := FALSE}
  119. {$setc TARGET_CPU_X86_64 := FALSE}
  120. {$setc TARGET_CPU_ARM := TRUE}
  121. { will require compiler define when/if other Apple devices with ARM cpus ship }
  122. {$setc TARGET_OS_MAC := FALSE}
  123. {$setc TARGET_OS_IPHONE := TRUE}
  124. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  125. {$setc TARGET_OS_EMBEDDED := TRUE}
  126. {$elsec}
  127. {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
  128. {$endc}
  129. {$ifc defined __LP64__ and __LP64__ }
  130. {$setc TARGET_CPU_64 := TRUE}
  131. {$elsec}
  132. {$setc TARGET_CPU_64 := FALSE}
  133. {$endc}
  134. {$ifc defined FPC_BIG_ENDIAN}
  135. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  136. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  137. {$elifc defined FPC_LITTLE_ENDIAN}
  138. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  139. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  140. {$elsec}
  141. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  142. {$endc}
  143. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  144. {$setc CALL_NOT_IN_CARBON := FALSE}
  145. {$setc OLDROUTINENAMES := FALSE}
  146. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  147. {$setc OPAQUE_UPP_TYPES := TRUE}
  148. {$setc OTCARBONAPPLICATION := TRUE}
  149. {$setc OTKERNEL := FALSE}
  150. {$setc PM_USE_SESSION_APIS := TRUE}
  151. {$setc TARGET_API_MAC_CARBON := TRUE}
  152. {$setc TARGET_API_MAC_OS8 := FALSE}
  153. {$setc TARGET_API_MAC_OSX := TRUE}
  154. {$setc TARGET_CARBON := TRUE}
  155. {$setc TARGET_CPU_68K := FALSE}
  156. {$setc TARGET_CPU_MIPS := FALSE}
  157. {$setc TARGET_CPU_SPARC := FALSE}
  158. {$setc TARGET_OS_UNIX := FALSE}
  159. {$setc TARGET_OS_WIN32 := FALSE}
  160. {$setc TARGET_RT_MAC_68881 := FALSE}
  161. {$setc TARGET_RT_MAC_CFM := FALSE}
  162. {$setc TARGET_RT_MAC_MACHO := TRUE}
  163. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  164. {$setc TYPE_BOOL := FALSE}
  165. {$setc TYPE_EXTENDED := FALSE}
  166. {$setc TYPE_LONGLONG := TRUE}
  167. uses MacTypes;
  168. {$endc} {not MACOSALLINCLUDE}
  169. {$ifc TARGET_OS_MAC}
  170. {$ALIGN MAC68K}
  171. type
  172. sfntDirectoryEntryPtr = ^sfntDirectoryEntry;
  173. sfntDirectoryEntry = record
  174. tableTag: FourCharCode;
  175. checkSum: UInt32;
  176. offset: UInt32;
  177. length: UInt32;
  178. end;
  179. { The search fields limits numOffsets to 4096. }
  180. sfntDirectoryPtr = ^sfntDirectory;
  181. sfntDirectory = record
  182. format: FourCharCode;
  183. numOffsets: UInt16; { number of tables }
  184. searchRange: UInt16; { (max2 <= numOffsets)*16 }
  185. entrySelector: UInt16; { log2(max2 <= numOffsets) }
  186. rangeShift: UInt16; { numOffsets*16-searchRange}
  187. table: array [0..1-1] of sfntDirectoryEntry; { table[numOffsets] }
  188. end;
  189. const
  190. sizeof_sfntDirectory = 12;
  191. { Cmap - character id to glyph id mapping }
  192. const
  193. cmapFontTableTag = FourCharCode('cmap');
  194. const
  195. kFontUnicodePlatform = 0;
  196. kFontMacintoshPlatform = 1;
  197. kFontReservedPlatform = 2;
  198. kFontMicrosoftPlatform = 3;
  199. kFontCustomPlatform = 4;
  200. const
  201. kFontUnicodeDefaultSemantics = 0;
  202. kFontUnicodeV1_1Semantics = 1;
  203. kFontISO10646_1993Semantics = 2;
  204. kFontUnicodeV2_0BMPOnlySemantics = 3;
  205. kFontUnicodeV2_0FullCoverageSemantics = 4;
  206. kFontUnicodeV4_0VariationSequenceSemantics = 5;
  207. kFontUnicode_FullRepertoire = 6;
  208. const
  209. kFontRomanScript = 0;
  210. kFontJapaneseScript = 1;
  211. kFontTraditionalChineseScript = 2;
  212. kFontChineseScript = kFontTraditionalChineseScript;
  213. kFontKoreanScript = 3;
  214. kFontArabicScript = 4;
  215. kFontHebrewScript = 5;
  216. kFontGreekScript = 6;
  217. kFontCyrillicScript = 7;
  218. kFontRussian = kFontCyrillicScript;
  219. kFontRSymbolScript = 8;
  220. kFontDevanagariScript = 9;
  221. kFontGurmukhiScript = 10;
  222. kFontGujaratiScript = 11;
  223. kFontOriyaScript = 12;
  224. kFontBengaliScript = 13;
  225. kFontTamilScript = 14;
  226. kFontTeluguScript = 15;
  227. kFontKannadaScript = 16;
  228. kFontMalayalamScript = 17;
  229. kFontSinhaleseScript = 18;
  230. kFontBurmeseScript = 19;
  231. kFontKhmerScript = 20;
  232. kFontThaiScript = 21;
  233. kFontLaotianScript = 22;
  234. kFontGeorgianScript = 23;
  235. kFontArmenianScript = 24;
  236. kFontSimpleChineseScript = 25;
  237. kFontTibetanScript = 26;
  238. kFontMongolianScript = 27;
  239. kFontGeezScript = 28;
  240. kFontEthiopicScript = kFontGeezScript;
  241. kFontAmharicScript = kFontGeezScript;
  242. kFontSlavicScript = 29;
  243. kFontEastEuropeanRomanScript = kFontSlavicScript;
  244. kFontVietnameseScript = 30;
  245. kFontExtendedArabicScript = 31;
  246. kFontSindhiScript = kFontExtendedArabicScript;
  247. kFontUninterpretedScript = 32;
  248. const
  249. kFontMicrosoftSymbolScript = 0;
  250. kFontMicrosoftStandardScript = 1;
  251. kFontMicrosoftUCS4Script = 10;
  252. const
  253. kFontCustom8BitScript = 0;
  254. kFontCustom816BitScript = 1;
  255. kFontCustom16BitScript = 2;
  256. { Language codes are zero based everywhere but within a 'cmap' table }
  257. const
  258. kFontEnglishLanguage = 0;
  259. kFontFrenchLanguage = 1;
  260. kFontGermanLanguage = 2;
  261. kFontItalianLanguage = 3;
  262. kFontDutchLanguage = 4;
  263. kFontSwedishLanguage = 5;
  264. kFontSpanishLanguage = 6;
  265. kFontDanishLanguage = 7;
  266. kFontPortugueseLanguage = 8;
  267. kFontNorwegianLanguage = 9;
  268. kFontHebrewLanguage = 10;
  269. kFontJapaneseLanguage = 11;
  270. kFontArabicLanguage = 12;
  271. kFontFinnishLanguage = 13;
  272. kFontGreekLanguage = 14;
  273. kFontIcelandicLanguage = 15;
  274. kFontMalteseLanguage = 16;
  275. kFontTurkishLanguage = 17;
  276. kFontCroatianLanguage = 18;
  277. kFontTradChineseLanguage = 19;
  278. kFontUrduLanguage = 20;
  279. kFontHindiLanguage = 21;
  280. kFontThaiLanguage = 22;
  281. kFontKoreanLanguage = 23;
  282. kFontLithuanianLanguage = 24;
  283. kFontPolishLanguage = 25;
  284. kFontHungarianLanguage = 26;
  285. kFontEstonianLanguage = 27;
  286. kFontLettishLanguage = 28;
  287. kFontLatvianLanguage = kFontLettishLanguage;
  288. kFontSaamiskLanguage = 29;
  289. kFontLappishLanguage = kFontSaamiskLanguage;
  290. kFontFaeroeseLanguage = 30;
  291. kFontFarsiLanguage = 31;
  292. kFontPersianLanguage = kFontFarsiLanguage;
  293. kFontRussianLanguage = 32;
  294. kFontSimpChineseLanguage = 33;
  295. kFontFlemishLanguage = 34;
  296. kFontIrishLanguage = 35;
  297. kFontAlbanianLanguage = 36;
  298. kFontRomanianLanguage = 37;
  299. kFontCzechLanguage = 38;
  300. kFontSlovakLanguage = 39;
  301. kFontSlovenianLanguage = 40;
  302. kFontYiddishLanguage = 41;
  303. kFontSerbianLanguage = 42;
  304. kFontMacedonianLanguage = 43;
  305. kFontBulgarianLanguage = 44;
  306. kFontUkrainianLanguage = 45;
  307. kFontByelorussianLanguage = 46;
  308. kFontUzbekLanguage = 47;
  309. kFontKazakhLanguage = 48;
  310. kFontAzerbaijaniLanguage = 49;
  311. kFontAzerbaijanArLanguage = 50;
  312. kFontArmenianLanguage = 51;
  313. kFontGeorgianLanguage = 52;
  314. kFontMoldavianLanguage = 53;
  315. kFontKirghizLanguage = 54;
  316. kFontTajikiLanguage = 55;
  317. kFontTurkmenLanguage = 56;
  318. kFontMongolianLanguage = 57;
  319. kFontMongolianCyrLanguage = 58;
  320. kFontPashtoLanguage = 59;
  321. kFontKurdishLanguage = 60;
  322. kFontKashmiriLanguage = 61;
  323. kFontSindhiLanguage = 62;
  324. kFontTibetanLanguage = 63;
  325. kFontNepaliLanguage = 64;
  326. kFontSanskritLanguage = 65;
  327. kFontMarathiLanguage = 66;
  328. kFontBengaliLanguage = 67;
  329. kFontAssameseLanguage = 68;
  330. kFontGujaratiLanguage = 69;
  331. kFontPunjabiLanguage = 70;
  332. kFontOriyaLanguage = 71;
  333. kFontMalayalamLanguage = 72;
  334. kFontKannadaLanguage = 73;
  335. kFontTamilLanguage = 74;
  336. kFontTeluguLanguage = 75;
  337. kFontSinhaleseLanguage = 76;
  338. kFontBurmeseLanguage = 77;
  339. kFontKhmerLanguage = 78;
  340. kFontLaoLanguage = 79;
  341. kFontVietnameseLanguage = 80;
  342. kFontIndonesianLanguage = 81;
  343. kFontTagalogLanguage = 82;
  344. kFontMalayRomanLanguage = 83;
  345. kFontMalayArabicLanguage = 84;
  346. kFontAmharicLanguage = 85;
  347. kFontTigrinyaLanguage = 86;
  348. kFontGallaLanguage = 87;
  349. kFontOromoLanguage = kFontGallaLanguage;
  350. kFontSomaliLanguage = 88;
  351. kFontSwahiliLanguage = 89;
  352. kFontRuandaLanguage = 90;
  353. kFontRundiLanguage = 91;
  354. kFontChewaLanguage = 92;
  355. kFontMalagasyLanguage = 93;
  356. kFontEsperantoLanguage = 94;
  357. kFontWelshLanguage = 128;
  358. kFontBasqueLanguage = 129;
  359. kFontCatalanLanguage = 130;
  360. kFontLatinLanguage = 131;
  361. kFontQuechuaLanguage = 132;
  362. kFontGuaraniLanguage = 133;
  363. kFontAymaraLanguage = 134;
  364. kFontTatarLanguage = 135;
  365. kFontUighurLanguage = 136;
  366. kFontDzongkhaLanguage = 137;
  367. kFontJavaneseRomLanguage = 138;
  368. kFontSundaneseRomLanguage = 139;
  369. { The following are special "don't care" values to be used in interfaces }
  370. const
  371. kFontNoPlatformCode = $FFFFFFFF;
  372. kFontNoScriptCode = $FFFFFFFF;
  373. kFontNoLanguageCode = $FFFFFFFF;
  374. type
  375. sfntCMapSubHeaderPtr = ^sfntCMapSubHeader;
  376. sfntCMapSubHeader = record
  377. format: UInt16;
  378. length: UInt16;
  379. languageID: UInt16; { base-1 }
  380. end;
  381. const
  382. sizeof_sfntCMapSubHeader = 6;
  383. type
  384. sfntCMapExtendedSubHeader = record
  385. format: UInt16;
  386. reserved: UInt16;
  387. length: UInt32;
  388. language: UInt32;
  389. end;
  390. const
  391. sizeof_sfntCMapExtendedSubHeader = 12;
  392. type
  393. sfntCMapEncodingPtr = ^sfntCMapEncoding;
  394. sfntCMapEncoding = record
  395. platformID: UInt16; { base-0 }
  396. scriptID: UInt16; { base-0 }
  397. offset: UInt32;
  398. end;
  399. const
  400. sizeof_sfntCMapEncoding = 8;
  401. type
  402. sfntCMapHeaderPtr = ^sfntCMapHeader;
  403. sfntCMapHeader = record
  404. version: UInt16;
  405. numTables: UInt16;
  406. encoding: array[0..0] of sfntCMapEncoding;
  407. end;
  408. const
  409. sizeof_sfntCMapHeader = 4;
  410. { Name table }
  411. const
  412. nameFontTableTag = FourCharCode('name');
  413. const
  414. kFontCopyrightName = 0;
  415. kFontFamilyName = 1;
  416. kFontStyleName = 2;
  417. kFontUniqueName = 3;
  418. kFontFullName = 4;
  419. kFontVersionName = 5;
  420. kFontPostscriptName = 6;
  421. kFontTrademarkName = 7;
  422. kFontManufacturerName = 8;
  423. kFontDesignerName = 9;
  424. kFontDescriptionName = 10;
  425. kFontVendorURLName = 11;
  426. kFontDesignerURLName = 12;
  427. kFontLicenseDescriptionName = 13;
  428. kFontLicenseInfoURLName = 14;
  429. kFontPreferredFamilyName = 16;
  430. kFontPreferredSubfamilyName = 17;
  431. kFontMacCompatibleFullName = 18;
  432. kFontSampleTextName = 19;
  433. kFontPostScriptCIDName = 20;
  434. kFontLastReservedName = 255;
  435. { The following is a special "don't care" value to be used in interfaces }
  436. const
  437. kFontNoNameCode = $FFFFFFFF;
  438. type
  439. sfntNameRecordPtr = ^sfntNameRecord;
  440. sfntNameRecord = record
  441. platformID: UInt16; { base-0 }
  442. scriptID: UInt16; { base-0 }
  443. languageID: UInt16; { base-0 }
  444. nameID: UInt16; { base-0 }
  445. length: UInt16;
  446. offset: UInt16;
  447. end;
  448. const
  449. sizeof_sfntNameRecord = 12;
  450. type
  451. sfntNameHeaderPtr = ^sfntNameHeader;
  452. sfntNameHeader = record
  453. format: UInt16;
  454. count: UInt16;
  455. stringOffset: UInt16;
  456. rec: array [0..1-1] of sfntNameRecord;
  457. end;
  458. const
  459. sizeof_sfntNameHeader = 6;
  460. { Fvar table - font variations }
  461. const
  462. variationFontTableTag = FourCharCode('fvar');
  463. { These define each font variation }
  464. type
  465. sfntVariationAxisPtr = ^sfntVariationAxis;
  466. sfntVariationAxis = record
  467. axisTag: FourCharCode;
  468. minValue: Fixed;
  469. defaultValue: Fixed;
  470. maxValue: Fixed;
  471. flags: SInt16;
  472. nameID: SInt16;
  473. end;
  474. const
  475. sizeof_sfntVariationAxis = 20;
  476. { These are named locations in style-space for the user }
  477. type
  478. sfntInstancePtr = ^sfntInstance;
  479. sfntInstance = record
  480. nameID: SInt16;
  481. flags: SInt16;
  482. coord: array [0..1-1] of Fixed; { [axisCount] }
  483. { room to grow since the header carries a tupleSize field }
  484. end;
  485. const
  486. sizeof_sfntInstance = 4;
  487. type
  488. sfntVariationHeaderPtr = ^sfntVariationHeader;
  489. sfntVariationHeader = record
  490. version: Fixed; { 1.0 Fixed }
  491. offsetToData: UInt16; { to first axis = 16}
  492. countSizePairs: UInt16; { axis+inst = 2 }
  493. axisCount: UInt16;
  494. axisSize: UInt16;
  495. instanceCount: UInt16;
  496. instanceSize: UInt16;
  497. { …other <count,size> pairs }
  498. axis: array [0..1-1] of sfntVariationAxis; { [axisCount] }
  499. instance: array [0..1-1] of sfntInstance; { [instanceCount] …other arrays of data }
  500. end;
  501. const
  502. sizeof_sfntVariationHeader = 16;
  503. { Fdsc table - font descriptor }
  504. const
  505. descriptorFontTableTag = FourCharCode('fdsc');
  506. type
  507. sfntFontDescriptorPtr = ^sfntFontDescriptor;
  508. sfntFontDescriptor = record
  509. name: FourCharCode;
  510. value: Fixed;
  511. end;
  512. sfntDescriptorHeaderPtr = ^sfntDescriptorHeader;
  513. sfntDescriptorHeader = record
  514. version: Fixed; { 1.0 in Fixed }
  515. descriptorCount: SInt32;
  516. descriptor: array [0..1-1] of sfntFontDescriptor;
  517. end;
  518. const
  519. sizeof_sfntDescriptorHeader = 8;
  520. { Feat Table - layout feature table }
  521. const
  522. featureFontTableTag = FourCharCode('feat');
  523. type
  524. sfntFeatureNamePtr = ^sfntFeatureName;
  525. sfntFeatureName = record
  526. featureType: UInt16;
  527. settingCount: UInt16;
  528. offsetToSettings: SInt32;
  529. featureFlags: UInt16;
  530. nameID: UInt16;
  531. end;
  532. sfntFontFeatureSettingPtr = ^sfntFontFeatureSetting;
  533. sfntFontFeatureSetting = record
  534. setting: UInt16;
  535. nameID: UInt16;
  536. end;
  537. sfntFontRunFeaturePtr = ^sfntFontRunFeature;
  538. sfntFontRunFeature = record
  539. featureType: UInt16;
  540. setting: UInt16;
  541. end;
  542. sfntFeatureHeaderPtr = ^sfntFeatureHeader;
  543. sfntFeatureHeader = record
  544. version: SInt32; { 1.0 }
  545. featureNameCount: UInt16;
  546. featureSetCount: UInt16;
  547. reserved: SInt32; { set to 0 }
  548. names: array [0..1-1] of sfntFeatureName;
  549. settings: array [0..1-1] of sfntFontFeatureSetting;
  550. runs: array [0..1-1] of sfntFontRunFeature;
  551. end;
  552. { OS/2 Table }
  553. const
  554. os2FontTableTag = FourCharCode('OS/2');
  555. { Special invalid glyph ID value, useful as a sentinel value, for example }
  556. const
  557. nonGlyphID = 65535;
  558. { Deprecated "don't care" values - use kFontNoPlatformCode, kFontNoScriptCode,
  559. kFontNoLanguageCode, kFontNoName instead
  560. }
  561. kFontNoPlatform = $FFFFFFFF;
  562. kFontNoScript = $FFFFFFFF;
  563. kFontNoLanguage = $FFFFFFFF;
  564. kFontNoName = $FFFFFFFF;
  565. { Data type used to access names from font name table }
  566. type
  567. FontNameCode = UInt32;
  568. FontNameCodePtr = ^FontNameCode;
  569. { Data types for encoding components as used in interfaces }
  570. FontPlatformCode = UInt32;
  571. FontPlatformCodePtr = ^FontPlatformCode;
  572. FontScriptCode = UInt32;
  573. FontScriptCodePtr = ^FontScriptCode;
  574. FontLanguageCode = UInt32;
  575. FontLanguageCodePtr = ^FontLanguageCode;
  576. {
  577. ** FontVariation is used to specify a coordinate along a variation axis. The name
  578. ** identifies the axes to be applied, and value is the setting to be used.
  579. }
  580. FontVariationPtr = ^FontVariation;
  581. FontVariation = record
  582. name: FourCharCode;
  583. value: Fixed;
  584. end;
  585. {$endc} {TARGET_OS_MAC}
  586. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  587. end.
  588. {$endc} {not MACOSALLINCLUDE}