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