]> git.saurik.com Git - apple/icu.git/blame - icuSources/layout/ValueRecords.h
ICU-491.11.2.tar.gz
[apple/icu.git] / icuSources / layout / ValueRecords.h
CommitLineData
b75a7d8f 1/*
b75a7d8f 2 *
73c04bcf 3 * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved
b75a7d8f
A
4 *
5 */
6
7#ifndef __VALUERECORDS_H
8#define __VALUERECORDS_H
9
10/**
11 * \file
12 * \internal
13 */
14
15#include "LETypes.h"
16#include "LEFontInstance.h"
17#include "OpenTypeTables.h"
18#include "GlyphIterator.h"
b75a7d8f
A
19
20U_NAMESPACE_BEGIN
21
22typedef le_uint16 ValueFormat;
23typedef le_int16 ValueRecordField;
24
25struct ValueRecord
26{
27 le_int16 values[ANY_NUMBER];
28
29 le_int16 getFieldValue(ValueFormat valueFormat, ValueRecordField field) const;
30 le_int16 getFieldValue(le_int16 index, ValueFormat valueFormat, ValueRecordField field) const;
73c04bcf 31 void adjustPosition(ValueFormat valueFormat, const char *base, GlyphIterator &glyphIterator,
b75a7d8f 32 const LEFontInstance *fontInstance) const;
73c04bcf 33 void adjustPosition(le_int16 index, ValueFormat valueFormat, const char *base, GlyphIterator &glyphIterator,
b75a7d8f
A
34 const LEFontInstance *fontInstance) const;
35
36 static le_int16 getSize(ValueFormat valueFormat);
37
38private:
39 static le_int16 getFieldCount(ValueFormat valueFormat);
40 static le_int16 getFieldIndex(ValueFormat valueFormat, ValueRecordField field);
41};
42
43enum ValueRecordFields
44{
45 vrfXPlacement = 0,
46 vrfYPlacement = 1,
47 vrfXAdvance = 2,
48 vrfYAdvance = 3,
49 vrfXPlaDevice = 4,
50 vrfYPlaDevice = 5,
51 vrfXAdvDevice = 6,
52 vrfYAdvDevice = 7
53};
54
55enum ValueFormatBits
56{
57 vfbXPlacement = 0x0001,
58 vfbYPlacement = 0x0002,
59 vfbXAdvance = 0x0004,
60 vfbYAdvance = 0x0008,
61 vfbXPlaDevice = 0x0010,
62 vfbYPlaDevice = 0x0020,
63 vfbXAdvDevice = 0x0040,
64 vfbYAdvDevice = 0x0080,
65 vfbReserved = 0xFF00,
66 vfbAnyDevice = vfbXPlaDevice + vfbYPlaDevice + vfbXAdvDevice + vfbYAdvDevice
67};
68
69U_NAMESPACE_END
70#endif
71
72