1/*
2 *
3 * (C) Copyright IBM Corp. 1998-2013 - All Rights Reserved
4 *
5 */
6
7#ifndef __GLYPHDEFINITIONTABLES_H
8#define __GLYPHDEFINITIONTABLES_H
9
10/**
11 * \file
12 * \internal
13 */
14
15#include "LETypes.h"
16#include "OpenTypeTables.h"
17#include "ClassDefinitionTables.h"
18
19U_NAMESPACE_BEGIN
20
21typedef ClassDefinitionTable GlyphClassDefinitionTable;
22
23enum GlyphClassDefinitions
24{
25    gcdNoGlyphClass     = 0,
26    gcdSimpleGlyph      = 1,
27    gcdLigatureGlyph    = 2,
28    gcdMarkGlyph        = 3,
29    gcdComponentGlyph   = 4
30};
31
32struct AttachmentListTable
33{
34    Offset  coverageTableOffset;
35    le_uint16  glyphCount;
36    Offset  attachPointTableOffsetArray[ANY_NUMBER];
37};
38LE_VAR_ARRAY(AttachmentListTable, attachPointTableOffsetArray)
39
40struct AttachPointTable
41{
42    le_uint16  pointCount;
43    le_uint16  pointIndexArray[ANY_NUMBER];
44};
45LE_VAR_ARRAY(AttachPointTable, pointIndexArray)
46
47struct LigatureCaretListTable
48{
49    Offset  coverageTableOffset;
50    le_uint16  ligGlyphCount;
51    Offset  ligGlyphTableOffsetArray[ANY_NUMBER];
52};
53LE_VAR_ARRAY(LigatureCaretListTable, ligGlyphTableOffsetArray)
54
55struct LigatureGlyphTable
56{
57    le_uint16  caretCount;
58    Offset  caretValueTableOffsetArray[ANY_NUMBER];
59};
60LE_VAR_ARRAY(LigatureGlyphTable, caretValueTableOffsetArray)
61
62struct CaretValueTable
63{
64    le_uint16  caretValueFormat;
65};
66
67struct CaretValueFormat1Table : CaretValueTable
68{
69    le_int16   coordinate;
70};
71
72struct CaretValueFormat2Table : CaretValueTable
73{
74    le_uint16  caretValuePoint;
75};
76
77struct CaretValueFormat3Table : CaretValueTable
78{
79    le_int16   coordinate;
80    Offset  deviceTableOffset;
81};
82
83typedef ClassDefinitionTable MarkAttachClassDefinitionTable;
84
85struct GlyphDefinitionTableHeader
86{
87    fixed32 version;
88    Offset  glyphClassDefOffset;
89    Offset  attachListOffset;
90    Offset  ligCaretListOffset;
91    Offset  MarkAttachClassDefOffset;
92
93    const LEReferenceTo<GlyphClassDefinitionTable>
94    getGlyphClassDefinitionTable(const LEReferenceTo<GlyphDefinitionTableHeader>& base,
95                                 LEErrorCode &success) const;
96    const LEReferenceTo<AttachmentListTable>
97    getAttachmentListTable(const LEReferenceTo<GlyphDefinitionTableHeader>& base,
98                           LEErrorCode &success)const ;
99    const LEReferenceTo<LigatureCaretListTable>
100    getLigatureCaretListTable(const LEReferenceTo<GlyphDefinitionTableHeader>& base,
101                              LEErrorCode &success) const;
102    const LEReferenceTo<MarkAttachClassDefinitionTable>
103    getMarkAttachClassDefinitionTable(const LEReferenceTo<GlyphDefinitionTableHeader>& base,
104                                      LEErrorCode &success) const;
105};
106
107U_NAMESPACE_END
108#endif
109