~ubuntu-branches/ubuntu/karmic/pango1.0/karmic-security

« back to all changes in this revision

Viewing changes to pango/opentype/harfbuzz-gdef.h

Tags: upstream-1.15.4
ImportĀ upstreamĀ versionĀ 1.15.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*******************************************************************
 
2
 *
 
3
 *  Copyright 1996-2000 by
 
4
 *  David Turner, Robert Wilhelm, and Werner Lemberg.
 
5
 *
 
6
 *  Copyright 2006  Behdad Esfahbod
 
7
 *
 
8
 *  This is part of HarfBuzz, an OpenType Layout engine library.
 
9
 *
 
10
 *  See the file name COPYING for licensing information.
 
11
 *
 
12
 ******************************************************************/
 
13
#ifndef HARFBUZZ_GDEF_H
 
14
#define HARFBUZZ_GDEF_H
 
15
 
 
16
#include "harfbuzz-open.h"
 
17
 
 
18
FT_BEGIN_HEADER
 
19
 
 
20
#define HB_Err_Invalid_GDEF_SubTable_Format  0x1030
 
21
#define HB_Err_Invalid_GDEF_SubTable         0x1031
 
22
 
 
23
 
 
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
 
30
 
 
31
 
 
32
typedef struct HB_AttachPoint_  HB_AttachPoint;
 
33
 
 
34
 
 
35
struct  HB_AttachList_
 
36
{
 
37
  FT_Bool           loaded;
 
38
 
 
39
  HB_Coverage       Coverage;         /* Coverage table              */
 
40
  FT_UShort         GlyphCount;       /* number of glyphs with
 
41
                                         attachments                 */
 
42
  HB_AttachPoint*   AttachPoint;      /* array of AttachPoint tables */
 
43
};
 
44
 
 
45
typedef struct HB_AttachList_  HB_AttachList;
 
46
 
 
47
typedef struct HB_LigGlyph_  HB_LigGlyph;
 
48
 
 
49
struct  HB_LigCaretList_
 
50
{
 
51
  FT_Bool        loaded;
 
52
 
 
53
  HB_Coverage    Coverage;            /* Coverage table            */
 
54
  FT_UShort      LigGlyphCount;       /* number of ligature glyphs */
 
55
  HB_LigGlyph*   LigGlyph;            /* array of LigGlyph tables  */
 
56
};
 
57
 
 
58
typedef struct HB_LigCaretList_  HB_LigCaretList;
 
59
 
 
60
 
 
61
 
 
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.
 
70
 
 
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).
 
74
 
 
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.      */
 
81
 
 
82
struct  HB_GDEFHeader_
 
83
{
 
84
  FT_Memory            memory;
 
85
  FT_ULong             offset;
 
86
 
 
87
  FT_Fixed             Version;
 
88
 
 
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 */
 
94
 
 
95
  FT_UShort            LastGlyph;
 
96
  FT_UShort**          NewGlyphClasses;
 
97
};
 
98
 
 
99
typedef struct HB_GDEFHeader_   HB_GDEFHeader;
 
100
typedef struct HB_GDEFHeader_*  HB_GDEF;
 
101
 
 
102
 
 
103
FT_Error  HB_New_GDEF_Table( FT_Face          face,
 
104
                             HB_GDEFHeader** retptr );
 
105
      
 
106
 
 
107
FT_Error  HB_Load_GDEF_Table( FT_Face          face,
 
108
                              HB_GDEFHeader** gdef );
 
109
 
 
110
 
 
111
FT_Error  HB_Done_GDEF_Table ( HB_GDEFHeader* gdef );
 
112
 
 
113
 
 
114
FT_Error  HB_GDEF_Get_Glyph_Property( HB_GDEFHeader*  gdef,
 
115
                                      FT_UShort        glyphID,
 
116
                                      FT_UShort*       property );
 
117
 
 
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 );
 
123
 
 
124
 
 
125
FT_END_HEADER
 
126
 
 
127
#endif /* HARFBUZZ_GDEF_H */