uLib  User mode C/C++ extended API library for Win32 programmers.
TTFFile.h
Go to the documentation of this file.
1 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 // Project: uLib - User mode utility library.
3 // Module: TrueType Font files (partial declaration).
4 // Author: Copyright (c) Love Nystrom
5 // License: NNOSL (BSD descendant, see NNOSL.txt in the base directory).
6 // Ref: ttch02.doc (Microsoft Typography)
7 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8 
9 #ifndef __TTFFile_h_incl__
10 #define __TTFFile_h_incl__
11 
12 #include <uLib/Common.h>
13 
14 //==---------------------------------------------------------------------------
17 //==---------------------------------------------------------------------------
23 //==---------------------------------------------------------------------------
25 
26 #pragma pack( push,2 )
27 
28 typedef struct TTFDirEntry* PTTFDirEntry;
31 {
32  ULONG Tag;
33  ULONG Checksum;
34  ULONG Offset;
35  ULONG Length;
36 };
37 #ifdef __DOXYGEN__
38 typedef struct TTFDirEntry TTFDirEntry;
39 #endif
40 
43 
45 {
46  TTT_CMAP = 0x70616D63,
47  TTT_GLYF = 0x66796C67,
48  TTT_HEAD = 0x64616568,
49  TTT_HHEA = 0x61656868,
50  TTT_HMTX = 0x78746D68,
51  TTT_LOCA = 0x61636F6C,
52  TTT_MAXP = 0x7078616D,
53  TTT_NAME = 0x656D616E,
54  TTT_POST = 0x74736F70,
55  TTT_OS2 = 0x322F534F
56 };
57 
68 
73 
74 #define _TTT_ENTRY(fcc) _byteswap_ulong(ULONG( fcc ))
75 
76 #define TTT_CVT 0x20747663
77 #define TTT_FPGM 0x6D677066
78 #define TTT_KERN 0x6E72656B
79 #define TTT_PREP 0x70657270
80 #define TTT_EBDT _TTT_ENTRY('EBDT')
81 #define TTT_EBLC _TTT_ENTRY('EBLC')
82 #define TTT_EBSC _TTT_ENTRY('EBSC')
83 #define TTT_GASP _TTT_ENTRY('gasp')
84 #define TTT_HDMX _TTT_ENTRY('hdmx')
85 #define TTT_LTSH _TTT_ENTRY('LTSH')
86 #define TTT_PCLT _TTT_ENTRY('PCLT')
87 #define TTT_VDMX _TTT_ENTRY('VDMX')
88 #define TTT_VHEA _TTT_ENTRY('VDMX')
89 #define TTT_VMTX _TTT_ENTRY('vmtx')
90 
92 typedef struct TTFDirectory* PTTFDirectory;
95 {
96  FIXED Version;
97  USHORT NrTables;
98  USHORT Range;
99  USHORT Selector;
100  USHORT Shift;
101 
102  #define N_REQ_TABLES 10
103  // NOTE: There may be additional tables,
104  // so look at NrTables to index correctly.
105 
107 };
108 #ifdef __DOXYGEN__
109 typedef struct TTFDirectory TTFDirectory;
110 #endif
111 
112 //== TTT_NAME == Names ==------------------------------------------------------
113 
114 typedef struct TTFNameRec* PTTFNameRec;
117 {
118  USHORT Platform;
119  USHORT Encoding;
120  USHORT Language;
121  USHORT Id;
122  USHORT Length;
123  USHORT Offset;
124 };
125 #ifdef __DOXYGEN__
126 typedef struct TTFNameRec TTFNameRec;
127 #endif
128 
130 
132 {
137 };
138 
140 
142 {
145 };
146 
148 
150 {
159 };
160 
161 typedef struct TTFNames* PTTFNames;
163 struct TTFNames
164 {
165  USHORT Format;
166  USHORT NrNames;
167  USHORT Offset;
168 
170  // [Variable size] Storage for the actual string data.
171 };
172 #ifdef __DOXYGEN__
173 typedef struct TTFNames TTFNames;
174 #endif
175 
178 #pragma pack( pop )
179 #endif//ndef __TTFFile_h_incl__
180 // EOF
USHORT Selector
Definition: TTFFile.h:99
eMSEncoding
Definition: TTFFile.h:141
eTTTableId
Definition: TTFFile.h:44
USHORT Language
Definition: TTFFile.h:120
TTFNameRec Names[1]
Definition: TTFFile.h:169
USHORT Shift
Definition: TTFFile.h:100
#define N_REQ_TABLES
Definition: TTFFile.h:102
USHORT Offset
Definition: TTFFile.h:123
'OS/2' - OS/2 and Windows specific metrics
Definition: TTFFile.h:55
'head' - Font header
Definition: TTFFile.h:48
'maxp' - Maximum profile
Definition: TTFFile.h:52
ULONG Checksum
Definition: TTFFile.h:33
'loca' - Index to location
Definition: TTFFile.h:51
USHORT Format
Definition: TTFFile.h:165
'hmtx' - Horizontal metrics
Definition: TTFFile.h:50
ULONG Length
Definition: TTFFile.h:35
USHORT Id
Definition: TTFFile.h:121
ULONG Offset
Definition: TTFFile.h:34
eTTFPlatform
Definition: TTFFile.h:131
'post' - PostScript information
Definition: TTFFile.h:54
'name' - Naming table
Definition: TTFFile.h:53
'cmap' - Character to glyph mapping
Definition: TTFFile.h:46
USHORT Length
Definition: TTFFile.h:122
USHORT Platform
Definition: TTFFile.h:118
USHORT Offset
Definition: TTFFile.h:167
USHORT Encoding
Definition: TTFFile.h:119
'hhea' - Horizontal header
Definition: TTFFile.h:49
Common include; Added types, small "ubiquitous" utilities, et c.
USHORT NrNames
Definition: TTFFile.h:166
USHORT NrTables
Definition: TTFFile.h:97
TTFDirEntry Entry[10]
Definition: TTFFile.h:106
FIXED Version
Definition: TTFFile.h:96
eNameTblIndex
Definition: TTFFile.h:149
'glyf' - Glyph data
Definition: TTFFile.h:47
ULONG Tag
Definition: TTFFile.h:32
USHORT Range
Definition: TTFFile.h:98