tttables.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. /* Copyright (C) 2003 Aladdin Enterprises. All rights reserved.
  2. This software is provided AS-IS with no warranty, either express or
  3. implied.
  4. This software is distributed under license and may not be copied,
  5. modified or distributed except as expressly authorized under the terms
  6. of the license contained in the file LICENSE in this distribution.
  7. For more information about licensing, please refer to
  8. http://www.ghostscript.com/licensing/. For information on
  9. commercial licensing, go to http://www.artifex.com/licensing/ or
  10. contact Artifex Software, Inc., 101 Lucas Valley Road #110,
  11. San Rafael, CA 94903, U.S.A., +1(415)492-9861.
  12. */
  13. /* $Id: tttables.h,v 1.2 2003/11/21 20:01:22 giles Exp $ */
  14. /* Changes after FreeType: cut out the TrueType instruction interpreter. */
  15. /*******************************************************************
  16. *
  17. * tttables.h 1.1
  18. *
  19. * TrueType Tables structures and handling (specification).
  20. *
  21. * Copyright 1996-1998 by
  22. * David Turner, Robert Wilhelm, and Werner Lemberg.
  23. *
  24. * This file is part of the FreeType project, and may only be used
  25. * modified and distributed under the terms of the FreeType project
  26. * license, LICENSE.TXT. By continuing to use, modify, or distribute
  27. * this file you indicate that you have read the license and
  28. * understand and accept it fully.
  29. *
  30. ******************************************************************/
  31. #ifndef TTTABLES_H
  32. #define TTTABLES_H
  33. #include "tttypes.h"
  34. #ifdef __cplusplus
  35. extern "C" {
  36. #endif
  37. /***********************************************************************/
  38. /* */
  39. /* TrueType Table Types */
  40. /* */
  41. /***********************************************************************/
  42. /* TrueType Collection Header */
  43. struct _TTTCHeader
  44. {
  45. Long Tag;
  46. TT_Fixed version;
  47. ULong DirCount;
  48. PULong TableDirectory;
  49. };
  50. typedef struct _TTTCHeader TTTCHeader;
  51. typedef TTTCHeader* PTTCHeader;
  52. /* TrueType Table Directory type */
  53. struct _TTableDir
  54. {
  55. TT_Fixed version; /* should be 0x10000 */
  56. UShort numTables; /* number of tables */
  57. UShort searchRange; /* These parameters are only used */
  58. UShort entrySelector; /* for a dichotomy search in the */
  59. UShort rangeShift; /* directory. We ignore them. */
  60. };
  61. typedef struct _TTableDir TTableDir;
  62. typedef TTableDir* PTableDir;
  63. /* The 'TableDir' is followed by 'numTables' TableDirEntries */
  64. struct _TTableDirEntry
  65. {
  66. Long Tag; /* table type */
  67. Long CheckSum; /* table checksum */
  68. Long Offset; /* table file offset */
  69. Long Length; /* table length */
  70. };
  71. typedef struct _TTableDirEntry TTableDirEntry;
  72. typedef TTableDirEntry* PTableDirEntry;
  73. /* 'cmap' tables */
  74. struct _TCMapDir
  75. {
  76. UShort tableVersionNumber;
  77. UShort numCMaps;
  78. };
  79. typedef struct _TCMapDir TCMapDir;
  80. typedef TCMapDir* PCMapDir;
  81. struct _TCMapDirEntry
  82. {
  83. UShort platformID;
  84. UShort platformEncodingID;
  85. Long offset;
  86. };
  87. typedef struct _TCMapDirEntry TCMapDirEntry;
  88. typedef TCMapDirEntry* PCMapDirEntries;
  89. /* 'maxp' Maximum Profiles table */
  90. struct _TMaxProfile
  91. {
  92. TT_Fixed version;
  93. UShort numGlyphs,
  94. maxPoints,
  95. maxContours,
  96. maxCompositePoints,
  97. maxCompositeContours,
  98. maxZones,
  99. maxTwilightPoints,
  100. maxStorage,
  101. maxFunctionDefs,
  102. maxInstructionDefs,
  103. maxStackElements,
  104. maxSizeOfInstructions,
  105. maxComponentElements,
  106. maxComponentDepth;
  107. };
  108. typedef struct _TMaxProfile TMaxProfile;
  109. typedef TMaxProfile* PMaxProfile;
  110. /* table "gasp" */
  111. # define GASP_GRIDFIT 0x01
  112. # define GASP_DOGRAY 0x02
  113. struct _GaspRange
  114. {
  115. UShort maxPPEM;
  116. UShort gaspFlag;
  117. };
  118. typedef struct _GaspRange GaspRange;
  119. struct _TGasp
  120. {
  121. UShort version;
  122. UShort numRanges;
  123. GaspRange* gaspRanges;
  124. };
  125. typedef struct _TGasp TGasp;
  126. /* table "head" - now defined in freetype.h */
  127. /* table "hhea" - now defined in freetype.h */
  128. /* table "HMTX" */
  129. struct _TLongHorMetric
  130. {
  131. UShort advance_Width;
  132. Short lsb;
  133. };
  134. typedef struct _TLongHorMetric TLongHorMetric;
  135. typedef TLongHorMetric* PTableHorMetrics;
  136. /* 'OS/2' table - now defined in freetype.h */
  137. /* "post" table - now defined in freetype.h */
  138. /* 'loca' location table type */
  139. struct _TLoca
  140. {
  141. UShort Size;
  142. PStorage Table;
  143. };
  144. typedef struct _TLoca TLoca;
  145. /* table "name" */
  146. struct _TNameRec
  147. {
  148. UShort platformID;
  149. UShort encodingID;
  150. UShort languageID;
  151. UShort nameID;
  152. UShort stringLength;
  153. UShort stringOffset;
  154. /* this last field is not defined in the spec */
  155. /* but used by the FreeType engine */
  156. PByte string;
  157. };
  158. typedef struct _TNameRec TNameRec;
  159. struct _TName_Table
  160. {
  161. UShort format;
  162. UShort numNameRecords;
  163. UShort storageOffset;
  164. TNameRec* names;
  165. PByte storage;
  166. };
  167. typedef struct _TName_Table TName_Table;
  168. #ifdef __cplusplus
  169. }
  170. #endif
  171. #endif /* TTTABLES_H */
  172. /* END */