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;
30
struct
TTFDirEntry
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
44
enum
eTTTableId
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;
94
struct
TTFDirectory
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
106
TTFDirEntry
Entry
[
N_REQ_TABLES
];
107
};
108
#ifdef __DOXYGEN__
109
typedef
struct
TTFDirectory
TTFDirectory
;
110
#endif
111
112
//== TTT_NAME == Names ==------------------------------------------------------
113
114
typedef
struct
TTFNameRec
* PTTFNameRec;
116
struct
TTFNameRec
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
131
enum
eTTFPlatform
132
{
133
TTNP_APPLE
,
134
TTNP_MAC
,
135
TTNP_ISO
,
136
TTNP_MS
137
};
138
140
141
enum
eMSEncoding
142
{
143
TTNE_MS_UNDEF
,
144
TTNE_MS_UGL
145
};
146
148
149
enum
eNameTblIndex
150
{
151
TTNI_COPYRIGHT
,
152
TTNI_FAMILY
,
153
TTNI_SUBFAMILY
,
154
TTNI_FONTNAME
,
155
TTNI_FULLNAME
,
156
TTNI_VERSION
,
157
TTNI_POSTSCRIPT
,
158
TTNI_TRADEMARK
,
159
};
160
161
typedef
struct
TTFNames
* PTTFNames;
163
struct
TTFNames
164
{
165
USHORT
Format
;
166
USHORT
NrNames
;
167
USHORT
Offset
;
168
169
TTFNameRec
Names
[1];
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
TTFDirectory::Selector
USHORT Selector
Definition:
TTFFile.h:99
TTNI_FONTNAME
Definition:
TTFFile.h:154
eMSEncoding
eMSEncoding
Definition:
TTFFile.h:141
eTTTableId
eTTTableId
Definition:
TTFFile.h:44
TTFNameRec::Language
USHORT Language
Definition:
TTFFile.h:120
TTFNames::Names
TTFNameRec Names[1]
Definition:
TTFFile.h:169
TTFDirectory::Shift
USHORT Shift
Definition:
TTFFile.h:100
N_REQ_TABLES
#define N_REQ_TABLES
Definition:
TTFFile.h:102
TTFNameRec::Offset
USHORT Offset
Definition:
TTFFile.h:123
TTT_OS2
'OS/2' - OS/2 and Windows specific metrics
Definition:
TTFFile.h:55
TTNI_FULLNAME
Definition:
TTFFile.h:155
TTT_HEAD
'head' - Font header
Definition:
TTFFile.h:48
TTNI_VERSION
Definition:
TTFFile.h:156
TTT_MAXP
'maxp' - Maximum profile
Definition:
TTFFile.h:52
TTFDirEntry::Checksum
ULONG Checksum
Definition:
TTFFile.h:33
TTT_LOCA
'loca' - Index to location
Definition:
TTFFile.h:51
TTFNames::Format
USHORT Format
Definition:
TTFFile.h:165
TTT_HMTX
'hmtx' - Horizontal metrics
Definition:
TTFFile.h:50
TTFDirEntry::Length
ULONG Length
Definition:
TTFFile.h:35
TTFNameRec::Id
USHORT Id
Definition:
TTFFile.h:121
TTFDirEntry::Offset
ULONG Offset
Definition:
TTFFile.h:34
eTTFPlatform
eTTFPlatform
Definition:
TTFFile.h:131
TTT_POST
'post' - PostScript information
Definition:
TTFFile.h:54
TTT_NAME
'name' - Naming table
Definition:
TTFFile.h:53
TTT_CMAP
'cmap' - Character to glyph mapping
Definition:
TTFFile.h:46
TTNI_SUBFAMILY
Definition:
TTFFile.h:153
TTNI_FAMILY
Definition:
TTFFile.h:152
TTFNameRec::Length
USHORT Length
Definition:
TTFFile.h:122
TTFNameRec::Platform
USHORT Platform
Definition:
TTFFile.h:118
TTFNames::Offset
USHORT Offset
Definition:
TTFFile.h:167
TTNI_COPYRIGHT
Definition:
TTFFile.h:151
TTNI_TRADEMARK
Definition:
TTFFile.h:158
TTNI_POSTSCRIPT
Definition:
TTFFile.h:157
TTNP_APPLE
Definition:
TTFFile.h:133
TTFNameRec::Encoding
USHORT Encoding
Definition:
TTFFile.h:119
TTT_HHEA
'hhea' - Horizontal header
Definition:
TTFFile.h:49
TTNP_MS
Definition:
TTFFile.h:136
TTNP_ISO
Definition:
TTFFile.h:135
Common.h
Common include; Added types, small "ubiquitous" utilities, et c.
TTFNames::NrNames
USHORT NrNames
Definition:
TTFFile.h:166
TTNE_MS_UNDEF
Definition:
TTFFile.h:143
TTFDirEntry
Definition:
TTFFile.h:30
TTFDirectory
Definition:
TTFFile.h:94
TTFNameRec
Definition:
TTFFile.h:116
TTFNames
Definition:
TTFFile.h:163
TTFDirectory::NrTables
USHORT NrTables
Definition:
TTFFile.h:97
TTNE_MS_UGL
Definition:
TTFFile.h:144
TTFDirectory::Entry
TTFDirEntry Entry[10]
Definition:
TTFFile.h:106
TTFDirectory::Version
FIXED Version
Definition:
TTFFile.h:96
eNameTblIndex
eNameTblIndex
Definition:
TTFFile.h:149
TTNP_MAC
Definition:
TTFFile.h:134
TTT_GLYF
'glyf' - Glyph data
Definition:
TTFFile.h:47
TTFDirEntry::Tag
ULONG Tag
Definition:
TTFFile.h:32
TTFDirectory::Range
USHORT Range
Definition:
TTFFile.h:98
TTFFile.h
Generated by
1.8.15