~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to src/3rdparty/opentype/ftxgdef.h

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-08-24 04:09:09 UTC
  • Revision ID: james.westby@ubuntu.com-20050824040909-xmxe9jfr4a0w5671
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*******************************************************************
 
2
 *
 
3
 *  ftxgdef.h
 
4
 *
 
5
 *    TrueType Open GDEF table support
 
6
 *
 
7
 *  Copyright 1996-2000 by
 
8
 *  David Turner, Robert Wilhelm, and Werner Lemberg.
 
9
 *
 
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.
 
15
 *
 
16
 ******************************************************************/
 
17
 
 
18
#ifndef FTXOPEN_H
 
19
#error "Don't include this file! Use ftxopen.h instead."
 
20
#endif
 
21
 
 
22
#ifndef FTXGDEF_H
 
23
#define FTXGDEF_H
 
24
 
 
25
#ifdef __cplusplus
 
26
extern "C" {
 
27
#endif
 
28
 
 
29
#define TTO_Err_Invalid_GDEF_SubTable_Format  0x1030
 
30
#define TTO_Err_Invalid_GDEF_SubTable         0x1031
 
31
 
 
32
 
 
33
/* GDEF glyph properties, corresponding to class values 1-4.  Note that
 
34
   TTO_COMPONENT has no corresponding flag in the LookupFlag field.     */
 
35
 
 
36
#define TTO_BASE_GLYPH  0x0002
 
37
#define TTO_LIGATURE    0x0004
 
38
#define TTO_MARK        0x0008
 
39
#define TTO_COMPONENT   0x0010
 
40
 
 
41
 
 
42
  /* Attachment related structures */
 
43
 
 
44
  struct  TTO_AttachPoint_
 
45
  {
 
46
    FT_UShort   PointCount;             /* size of the PointIndex array */
 
47
    FT_UShort*  PointIndex;             /* array of contour points      */
 
48
  };
 
49
 
 
50
  typedef struct TTO_AttachPoint_  TTO_AttachPoint;
 
51
 
 
52
 
 
53
  struct  TTO_AttachList_
 
54
  {
 
55
    FT_Bool           loaded;
 
56
 
 
57
    TTO_Coverage      Coverage;         /* Coverage table              */
 
58
    FT_UShort         GlyphCount;       /* number of glyphs with
 
59
                                           attachments                 */
 
60
    TTO_AttachPoint*  AttachPoint;      /* array of AttachPoint tables */
 
61
  };
 
62
 
 
63
  typedef struct TTO_AttachList_  TTO_AttachList;
 
64
 
 
65
 
 
66
  /* Ligature Caret related structures */
 
67
 
 
68
  struct  TTO_CaretValueFormat1_
 
69
  {
 
70
    FT_Short  Coordinate;               /* x or y value (in design units) */
 
71
  };
 
72
 
 
73
  typedef struct TTO_CaretValueFormat1_  TTO_CaretValueFormat1;
 
74
 
 
75
 
 
76
  struct  TTO_CaretValueFormat2_
 
77
  {
 
78
    FT_UShort  CaretValuePoint;         /* contour point index on glyph */
 
79
  };
 
80
 
 
81
  typedef struct TTO_CaretValueFormat2_  TTO_CaretValueFormat2;
 
82
 
 
83
 
 
84
  struct  TTO_CaretValueFormat3_
 
85
  {
 
86
    FT_Short    Coordinate;             /* x or y value (in design units) */
 
87
    TTO_Device  Device;                 /* Device table for x or y value  */
 
88
  };
 
89
 
 
90
  typedef struct TTO_CaretValueFormat3_  TTO_CaretValueFormat3;
 
91
 
 
92
 
 
93
  struct  TTO_CaretValueFormat4_
 
94
  {
 
95
    FT_UShort  IdCaretValue;            /* metric ID */
 
96
  };
 
97
 
 
98
  typedef struct TTO_CaretValueFormat4_  TTO_CaretValueFormat4;
 
99
 
 
100
 
 
101
  struct  TTO_CaretValue_
 
102
  {
 
103
    FT_UShort  CaretValueFormat;        /* 1, 2, 3, or 4 */
 
104
 
 
105
    union
 
106
    {
 
107
      TTO_CaretValueFormat1  cvf1;
 
108
      TTO_CaretValueFormat2  cvf2;
 
109
      TTO_CaretValueFormat3  cvf3;
 
110
      TTO_CaretValueFormat4  cvf4;
 
111
    } cvf;
 
112
  };
 
113
 
 
114
  typedef struct TTO_CaretValue_  TTO_CaretValue;
 
115
 
 
116
 
 
117
  struct  TTO_LigGlyph_
 
118
  {
 
119
    FT_Bool          loaded;
 
120
 
 
121
    FT_UShort        CaretCount;        /* number of caret values */
 
122
    TTO_CaretValue*  CaretValue;        /* array of caret values  */
 
123
  };
 
124
 
 
125
  typedef struct TTO_LigGlyph_  TTO_LigGlyph;
 
126
 
 
127
 
 
128
  struct  TTO_LigCaretList_
 
129
  {
 
130
    FT_Bool        loaded;
 
131
 
 
132
    TTO_Coverage   Coverage;            /* Coverage table            */
 
133
    FT_UShort      LigGlyphCount;       /* number of ligature glyphs */
 
134
    TTO_LigGlyph*  LigGlyph;            /* array of LigGlyph tables  */
 
135
  };
 
136
 
 
137
  typedef struct TTO_LigCaretList_  TTO_LigCaretList;
 
138
 
 
139
 
 
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.
 
148
 
 
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).
 
152
 
 
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.      */
 
159
 
 
160
  struct  TTO_GDEFHeader_
 
161
  {
 
162
    FT_Memory            memory;
 
163
    FT_ULong             offset;
 
164
 
 
165
    FT_Fixed             Version;
 
166
 
 
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 */
 
172
 
 
173
    FT_UShort            LastGlyph;
 
174
    FT_UShort**          NewGlyphClasses;
 
175
  };
 
176
 
 
177
  typedef struct TTO_GDEFHeader_   TTO_GDEFHeader;
 
178
  typedef struct TTO_GDEFHeader_*  TTO_GDEF;
 
179
 
 
180
 
 
181
  /* finally, the GDEF API */
 
182
 
 
183
  /*  EXPORT_DEF
 
184
      FT_Error  TT_Init_GDEF_Extension( TT_Engine  engine ); */
 
185
 
 
186
  EXPORT_DEF
 
187
  FT_Error  TT_Load_GDEF_Table( FT_Face          face,
 
188
                                TTO_GDEFHeader** gdef );
 
189
 
 
190
  EXPORT_DEF
 
191
  FT_Error  TT_Done_GDEF_Table ( TTO_GDEFHeader* gdef );
 
192
 
 
193
  EXPORT_DEF
 
194
  FT_Error  TT_GDEF_Get_Glyph_Property( TTO_GDEFHeader*  gdef,
 
195
                                        FT_UShort        glyphID,
 
196
                                        FT_UShort*       property );
 
197
  EXPORT_DEF
 
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 );
 
203
 
 
204
 
 
205
#ifdef __cplusplus
 
206
}
 
207
#endif
 
208
 
 
209
#endif /* FTXGDEF_H */
 
210
 
 
211
 
 
212
/* END */