]> git.saurik.com Git - apple/icu.git/blob - icuSources/layout/ClassDefinitionTables.h
ICU-531.48.tar.gz
[apple/icu.git] / icuSources / layout / ClassDefinitionTables.h
1 /*
2 *
3 * (C) Copyright IBM Corp. 1998-2013 - All Rights Reserved
4 *
5 */
6
7 #ifndef __CLASSDEFINITIONTABLES_H
8 #define __CLASSDEFINITIONTABLES_H
9
10 /**
11 * \file
12 * \internal
13 */
14
15 #include "LETypes.h"
16 #include "OpenTypeTables.h"
17
18 U_NAMESPACE_BEGIN
19
20 struct ClassDefinitionTable
21 {
22 le_uint16 classFormat;
23
24 le_int32 getGlyphClass(const LETableReference &base, LEGlyphID glyphID, LEErrorCode &success) const;
25 le_bool hasGlyphClass(const LETableReference &base, le_int32 glyphClass, LEErrorCode &success) const;
26
27 le_int32 getGlyphClass(LEGlyphID glyphID) const {
28 LETableReference base((const le_uint8*)this);
29 LEErrorCode ignored = LE_NO_ERROR;
30 return getGlyphClass(base,glyphID,ignored);
31 }
32
33 le_bool hasGlyphClass(le_int32 glyphClass) const {
34 LETableReference base((const le_uint8*)this);
35 LEErrorCode ignored = LE_NO_ERROR;
36 return hasGlyphClass(base,glyphClass,ignored);
37 }
38 };
39
40 struct ClassDefFormat1Table : ClassDefinitionTable
41 {
42 TTGlyphID startGlyph;
43 le_uint16 glyphCount;
44 le_uint16 classValueArray[ANY_NUMBER];
45
46 le_int32 getGlyphClass(const LETableReference &base, LEGlyphID glyphID, LEErrorCode &success) const;
47 le_bool hasGlyphClass(const LETableReference &base, le_int32 glyphClass, LEErrorCode &success) const;
48 };
49 LE_VAR_ARRAY(ClassDefFormat1Table, classValueArray)
50
51
52 struct ClassRangeRecord
53 {
54 TTGlyphID start;
55 TTGlyphID end;
56 le_uint16 classValue;
57 };
58
59 struct ClassDefFormat2Table : ClassDefinitionTable
60 {
61 le_uint16 classRangeCount;
62 GlyphRangeRecord classRangeRecordArray[ANY_NUMBER];
63
64 le_int32 getGlyphClass(const LETableReference &base, LEGlyphID glyphID, LEErrorCode &success) const;
65 le_bool hasGlyphClass(const LETableReference &base, le_int32 glyphClass, LEErrorCode &success) const;
66 };
67 LE_VAR_ARRAY(ClassDefFormat2Table, classRangeRecordArray)
68
69 U_NAMESPACE_END
70 #endif