1
/*******************************************************************
5
* TrueType Open GDEF table support
7
* Copyright 1996-2000 by
8
* David Turner, Robert Wilhelm, and Werner Lemberg.
10
* This file is part of the FreeType project, and may only be used
11
* modified and distributed under the terms of the FreeType project
12
* license, LICENSE.TXT. By continuing to use, modify, or distribute
13
* this file you indicate that you have read the license and
14
* understand and accept it fully.
16
******************************************************************/
19
#error "Don't include this file! Use ftxopen.h instead."
29
#define TTO_Err_Invalid_GDEF_SubTable_Format 0x1030
30
#define TTO_Err_Invalid_GDEF_SubTable 0x1031
33
/* GDEF glyph properties, corresponding to class values 1-4. Note that
34
TTO_COMPONENT has no corresponding flag in the LookupFlag field. */
36
#define TTO_BASE_GLYPH 0x0002
37
#define TTO_LIGATURE 0x0004
38
#define TTO_MARK 0x0008
39
#define TTO_COMPONENT 0x0010
42
/* Attachment related structures */
44
struct TTO_AttachPoint_
46
FT_UShort PointCount; /* size of the PointIndex array */
47
FT_UShort* PointIndex; /* array of contour points */
50
typedef struct TTO_AttachPoint_ TTO_AttachPoint;
53
struct TTO_AttachList_
57
TTO_Coverage Coverage; /* Coverage table */
58
FT_UShort GlyphCount; /* number of glyphs with
60
TTO_AttachPoint* AttachPoint; /* array of AttachPoint tables */
63
typedef struct TTO_AttachList_ TTO_AttachList;
66
/* Ligature Caret related structures */
68
struct TTO_CaretValueFormat1_
70
FT_Short Coordinate; /* x or y value (in design units) */
73
typedef struct TTO_CaretValueFormat1_ TTO_CaretValueFormat1;
76
struct TTO_CaretValueFormat2_
78
FT_UShort CaretValuePoint; /* contour point index on glyph */
81
typedef struct TTO_CaretValueFormat2_ TTO_CaretValueFormat2;
84
struct TTO_CaretValueFormat3_
86
FT_Short Coordinate; /* x or y value (in design units) */
87
TTO_Device Device; /* Device table for x or y value */
90
typedef struct TTO_CaretValueFormat3_ TTO_CaretValueFormat3;
93
struct TTO_CaretValueFormat4_
95
FT_UShort IdCaretValue; /* metric ID */
98
typedef struct TTO_CaretValueFormat4_ TTO_CaretValueFormat4;
101
struct TTO_CaretValue_
103
FT_UShort CaretValueFormat; /* 1, 2, 3, or 4 */
107
TTO_CaretValueFormat1 cvf1;
108
TTO_CaretValueFormat2 cvf2;
109
TTO_CaretValueFormat3 cvf3;
110
TTO_CaretValueFormat4 cvf4;
114
typedef struct TTO_CaretValue_ TTO_CaretValue;
121
FT_UShort CaretCount; /* number of caret values */
122
TTO_CaretValue* CaretValue; /* array of caret values */
125
typedef struct TTO_LigGlyph_ TTO_LigGlyph;
128
struct TTO_LigCaretList_
132
TTO_Coverage Coverage; /* Coverage table */
133
FT_UShort LigGlyphCount; /* number of ligature glyphs */
134
TTO_LigGlyph* LigGlyph; /* array of LigGlyph tables */
137
typedef struct TTO_LigCaretList_ TTO_LigCaretList;
140
/* The `NewGlyphClasses' field is not defined in the TTO specification.
141
We use it for fonts with a constructed `GlyphClassDef' structure
142
(i.e., which don't have a GDEF table) to collect glyph classes
143
assigned during the lookup process. The number of arrays in this
144
pointer array is GlyphClassDef->cd.cd2.ClassRangeCount+1; the nth
145
array then contains the glyph class values of the glyphs not covered
146
by the ClassRangeRecords structures with index n-1 and n. We store
147
glyph class values for four glyphs in a single array element.
149
`LastGlyph' is identical to the number of glyphs minus one in the
150
font; we need it only if `NewGlyphClasses' is not NULL (to have an
151
upper bound for the last array).
153
Note that we first store the file offset to the `MarkAttachClassDef'
154
field (which has been introduced in OpenType 1.2) -- since the
155
`Version' field value hasn't been increased to indicate that we have
156
one more field for some obscure reason, we must parse the GSUB table
157
to find out whether class values refer to this table. Only then we
158
can finally load the MarkAttachClassDef structure if necessary. */
160
struct TTO_GDEFHeader_
167
TTO_ClassDefinition GlyphClassDef;
168
TTO_AttachList AttachList;
169
TTO_LigCaretList LigCaretList;
170
FT_ULong MarkAttachClassDef_offset;
171
TTO_ClassDefinition MarkAttachClassDef; /* new in OT 1.2 */
174
FT_UShort** NewGlyphClasses;
177
typedef struct TTO_GDEFHeader_ TTO_GDEFHeader;
178
typedef struct TTO_GDEFHeader_* TTO_GDEF;
181
/* finally, the GDEF API */
184
FT_Error TT_Init_GDEF_Extension( TT_Engine engine ); */
187
FT_Error TT_Load_GDEF_Table( FT_Face face,
188
TTO_GDEFHeader** gdef );
191
FT_Error TT_Done_GDEF_Table ( TTO_GDEFHeader* gdef );
194
FT_Error TT_GDEF_Get_Glyph_Property( TTO_GDEFHeader* gdef,
196
FT_UShort* property );
198
FT_Error TT_GDEF_Build_ClassDefinition( TTO_GDEFHeader* gdef,
199
FT_UShort num_glyphs,
200
FT_UShort glyph_count,
201
FT_UShort* glyph_array,
202
FT_UShort* class_array );
209
#endif /* FTXGDEF_H */