1
/*******************************************************************
3
* Copyright 1996-2000 by
4
* David Turner, Robert Wilhelm, and Werner Lemberg.
6
* Copyright 2006 Behdad Esfahbod
8
* This is part of HarfBuzz, an OpenType Layout engine library.
10
* See the file name COPYING for licensing information.
12
******************************************************************/
13
#ifndef HARFBUZZ_GDEF_H
14
#define HARFBUZZ_GDEF_H
16
#include "harfbuzz-open.h"
20
#define HB_Err_Invalid_GDEF_SubTable_Format 0x1030
21
#define HB_Err_Invalid_GDEF_SubTable 0x1031
24
/* GDEF glyph properties. Note that HB_GDEF_COMPONENT has no corresponding
25
* flag in the LookupFlag field. */
26
#define HB_GDEF_BASE_GLYPH 0x0002
27
#define HB_GDEF_LIGATURE 0x0004
28
#define HB_GDEF_MARK 0x0008
29
#define HB_GDEF_COMPONENT 0x0010
32
typedef struct HB_AttachPoint_ HB_AttachPoint;
39
HB_Coverage Coverage; /* Coverage table */
40
FT_UShort GlyphCount; /* number of glyphs with
42
HB_AttachPoint* AttachPoint; /* array of AttachPoint tables */
45
typedef struct HB_AttachList_ HB_AttachList;
47
typedef struct HB_LigGlyph_ HB_LigGlyph;
49
struct HB_LigCaretList_
53
HB_Coverage Coverage; /* Coverage table */
54
FT_UShort LigGlyphCount; /* number of ligature glyphs */
55
HB_LigGlyph* LigGlyph; /* array of LigGlyph tables */
58
typedef struct HB_LigCaretList_ HB_LigCaretList;
62
/* The `NewGlyphClasses' field is not defined in the TTO specification.
63
We use it for fonts with a constructed `GlyphClassDef' structure
64
(i.e., which don't have a GDEF table) to collect glyph classes
65
assigned during the lookup process. The number of arrays in this
66
pointer array is GlyphClassDef->cd.cd2.ClassRangeCount+1; the nth
67
array then contains the glyph class values of the glyphs not covered
68
by the ClassRangeRecords structures with index n-1 and n. We store
69
glyph class values for four glyphs in a single array element.
71
`LastGlyph' is identical to the number of glyphs minus one in the
72
font; we need it only if `NewGlyphClasses' is not NULL (to have an
73
upper bound for the last array).
75
Note that we first store the file offset to the `MarkAttachClassDef'
76
field (which has been introduced in OpenType 1.2) -- since the
77
`Version' field value hasn't been increased to indicate that we have
78
one more field for some obscure reason, we must parse the GSUB table
79
to find out whether class values refer to this table. Only then we
80
can finally load the MarkAttachClassDef structure if necessary. */
89
HB_ClassDefinition GlyphClassDef;
90
HB_AttachList AttachList;
91
HB_LigCaretList LigCaretList;
92
FT_ULong MarkAttachClassDef_offset;
93
HB_ClassDefinition MarkAttachClassDef; /* new in OT 1.2 */
96
FT_UShort** NewGlyphClasses;
99
typedef struct HB_GDEFHeader_ HB_GDEFHeader;
100
typedef struct HB_GDEFHeader_* HB_GDEF;
103
FT_Error HB_New_GDEF_Table( FT_Face face,
104
HB_GDEFHeader** retptr );
107
FT_Error HB_Load_GDEF_Table( FT_Face face,
108
HB_GDEFHeader** gdef );
111
FT_Error HB_Done_GDEF_Table ( HB_GDEFHeader* gdef );
114
FT_Error HB_GDEF_Get_Glyph_Property( HB_GDEFHeader* gdef,
116
FT_UShort* property );
118
FT_Error HB_GDEF_Build_ClassDefinition( HB_GDEFHeader* gdef,
119
FT_UShort num_glyphs,
120
FT_UShort glyph_count,
121
FT_UShort* glyph_array,
122
FT_UShort* class_array );
127
#endif /* HARFBUZZ_GDEF_H */