00001
00002
00003
00004
00005 #define BYTE unsigned char
00006 #define CHAR signed char
00007 #define USHORT unsigned short
00008 #define SHORT signed short
00009 #define ULONG unsigned int
00010 #define LONG signed int
00011 #define FWORD SHORT
00012 #define UFWORD USHORT
00013
00014 #define ONOROFF 0x01
00015 #define XSHORT 0x02
00016 #define YSHORT 0x04
00017 #define REPEAT 0x08
00018 #define XSAME 0x10
00019 #define YSAME 0x20
00020
00021 #define ARG_1_AND_2_ARE_WORDS 0x0001
00022 #define ARGS_ARE_XY_VALUES 0x0002
00023 #define XY_BOUND_TO_GRID 0x0004
00024 #define WE_HAVE_A_SCALE 0x0008
00025 #define MORE_COMPONENTS 0x0020
00026 #define WE_HAVE_AN_X_AND_Y_SCALE 0x0040
00027 #define WE_HAVE_A_TWO_BY_TWO 0x0080
00028 #define WE_HAVE_INSTRUCTIONS 0x0100
00029 #define USE_MY_METRICS 0x0200
00030
00031 typedef struct short_2 {
00032 SHORT upper;
00033 USHORT lower;
00034 } FIXED ;
00035
00036 typedef struct longhormetric {
00037 UFWORD advanceWidth;
00038 FWORD lsb;
00039 } LONGHORMETRIC;
00040
00041 typedef struct ttf_hhea {
00042 BYTE version[4];
00043 SHORT ascender, descender, lineGap;
00044 USHORT advnaceWidthMax;
00045 SHORT minLSB, minRSB, xMaxExtent;
00046 SHORT caretSlopeRise, caretSlopeRun;
00047 SHORT reserved[5];
00048 SHORT metricDataFormat;
00049 USHORT numberOfHMetrics;
00050 } TTF_HHEA;
00051
00052 typedef struct ttf_dir_entry {
00053 char tag[4];
00054 ULONG checksum;
00055 ULONG offset;
00056 ULONG length;
00057 } TTF_DIR_ENTRY ;
00058
00059 typedef struct ttf_directory {
00060 ULONG sfntVersion;
00061 USHORT numTables;
00062 USHORT searchRange;
00063 USHORT entrySelector;
00064 USHORT rangeShift;
00065 TTF_DIR_ENTRY list;
00066 } TTF_DIRECTORY ;
00067
00068 typedef struct ttf_name_rec {
00069 USHORT platformID;
00070 USHORT encodingID;
00071 USHORT languageID;
00072 USHORT nameID;
00073 USHORT stringLength;
00074 USHORT stringOffset;
00075 } TTF_NAME_REC;
00076
00077 typedef struct ttf_name {
00078 USHORT format;
00079 USHORT numberOfNameRecords;
00080 USHORT offset;
00081 TTF_NAME_REC nameRecords;
00082 } TTF_NAME ;
00083
00084 typedef struct ttf_head {
00085 ULONG version;
00086 ULONG fontRevision;
00087 ULONG checksumAdjust;
00088 ULONG magicNo;
00089 USHORT flags;
00090 USHORT unitsPerEm;
00091 BYTE created[8];
00092 BYTE modified[8];
00093 FWORD xMin, yMin, xMax, yMax;
00094 USHORT macStyle, lowestRecPPEM;
00095 SHORT fontDirection, indexToLocFormat, glyphDataFormat;
00096 } TTF_HEAD ;
00097
00098 typedef struct ttf_kern {
00099 USHORT version, nTables;
00100 } TTF_KERN ;
00101
00102 typedef struct ttf_kern_sub {
00103 USHORT version, length, coverage;
00104 USHORT nPairs, searchRange, entrySelector, rangeShift;
00105 } TTF_KERN_SUB;
00106
00107 typedef struct ttf_kern_entry {
00108 USHORT left, right;
00109 FWORD value;
00110 } TTF_KERN_ENTRY;
00111
00112 typedef struct ttf_cmap_fmt0 {
00113 USHORT format;
00114 USHORT length;
00115 USHORT version;
00116 BYTE glyphIdArray[256];
00117 } TTF_CMAP_FMT0;
00118
00119 typedef struct ttf_cmap_fmt4 {
00120 USHORT format;
00121 USHORT length;
00122 USHORT version;
00123 USHORT segCountX2;
00124 USHORT searchRange;
00125 USHORT entrySelector;
00126 USHORT rangeShift;
00127 } TTF_CMAP_FMT4;
00128
00129 typedef struct ttf_cmap_entry {
00130 USHORT platformID;
00131 USHORT encodingID;
00132 ULONG offset;
00133 } TTF_CMAP_ENTRY;
00134
00135 typedef struct ttf_cmap {
00136 USHORT version;
00137 USHORT numberOfEncodingTables;
00138 TTF_CMAP_ENTRY encodingTable[1];
00139 } TTF_CMAP ;
00140
00141 typedef struct ttf_glyf {
00142 SHORT numberOfContours;
00143 FWORD xMin, yMin, xMax, yMax;
00144 } TTF_GLYF ;
00145
00146 typedef struct ttf_maxp {
00147 ULONG version;
00148 USHORT numGlyphs, maxPoints, maxContours;
00149 USHORT maxCompositePoints, maxCompositeContours;
00150 USHORT maxZones, maxTwilightPoints, maxStorage;
00151 USHORT maxFunctionDefs, maxInstructionsDefs;
00152 USHORT maxSizeOfInstructions, maxComponentElements;
00153 USHORT maxComponentDepth;
00154 } TTF_MAXP ;
00155
00156 typedef struct ttf_post_head {
00157 ULONG formatType;
00158 FIXED italicAngle;
00159 FWORD underlinePosition;
00160 FWORD underlineThickness;
00161 ULONG isFixedPitch;
00162 ULONG minMemType42;
00163 ULONG maxMemType42;
00164 ULONG minMemType1;
00165 ULONG maxMemType1;
00166 USHORT numGlyphs;
00167 USHORT glyphNameIndex;
00168 } TTF_POST_HEAD ;