]> git.saurik.com Git - apple/icu.git/blame - icuSources/layout/ClassDefinitionTables.h
ICU-59180.0.1.tar.gz
[apple/icu.git] / icuSources / layout / ClassDefinitionTables.h
CommitLineData
b75a7d8f 1/*
b75a7d8f 2 *
57a6839d 3 * (C) Copyright IBM Corp. 1998-2013 - All Rights Reserved
b75a7d8f
A
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
18U_NAMESPACE_BEGIN
19
20struct ClassDefinitionTable
21{
22 le_uint16 classFormat;
23
57a6839d
A
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 }
b75a7d8f
A
38};
39
40struct ClassDefFormat1Table : ClassDefinitionTable
41{
42 TTGlyphID startGlyph;
43 le_uint16 glyphCount;
44 le_uint16 classValueArray[ANY_NUMBER];
45
57a6839d
A
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;
b75a7d8f 48};
57a6839d
A
49LE_VAR_ARRAY(ClassDefFormat1Table, classValueArray)
50
b75a7d8f
A
51
52struct ClassRangeRecord
53{
54 TTGlyphID start;
55 TTGlyphID end;
56 le_uint16 classValue;
57};
58
59struct ClassDefFormat2Table : ClassDefinitionTable
60{
61 le_uint16 classRangeCount;
62 GlyphRangeRecord classRangeRecordArray[ANY_NUMBER];
63
57a6839d
A
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;
b75a7d8f 66};
57a6839d 67LE_VAR_ARRAY(ClassDefFormat2Table, classRangeRecordArray)
b75a7d8f
A
68
69U_NAMESPACE_END
70#endif