1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/textandloc/fontservices/textshaperplugin/IcuSource/layout/ValueRecords.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,72 @@
1.4 +/*
1.5 + *
1.6 + * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved
1.7 + *
1.8 + */
1.9 +
1.10 +#ifndef __VALUERECORDS_H
1.11 +#define __VALUERECORDS_H
1.12 +
1.13 +/**
1.14 + * \file
1.15 + * \internal
1.16 + */
1.17 +
1.18 +#include "LETypes.h"
1.19 +#include "LEFontInstance.h"
1.20 +#include "OpenTypeTables.h"
1.21 +#include "GlyphIterator.h"
1.22 +
1.23 +U_NAMESPACE_BEGIN
1.24 +
1.25 +typedef le_uint16 ValueFormat;
1.26 +typedef le_int16 ValueRecordField;
1.27 +
1.28 +struct ValueRecord
1.29 +{
1.30 + le_int16 values[ANY_NUMBER];
1.31 +
1.32 + le_int16 getFieldValue(ValueFormat valueFormat, ValueRecordField field) const;
1.33 + le_int16 getFieldValue(le_int16 index, ValueFormat valueFormat, ValueRecordField field) const;
1.34 + void adjustPosition(ValueFormat valueFormat, const char *base, GlyphIterator &glyphIterator,
1.35 + const LEFontInstance *fontInstance) const;
1.36 + void adjustPosition(le_int16 index, ValueFormat valueFormat, const char *base, GlyphIterator &glyphIterator,
1.37 + const LEFontInstance *fontInstance) const;
1.38 +
1.39 + static le_int16 getSize(ValueFormat valueFormat);
1.40 +
1.41 +private:
1.42 + static le_int16 getFieldCount(ValueFormat valueFormat);
1.43 + static le_int16 getFieldIndex(ValueFormat valueFormat, ValueRecordField field);
1.44 +};
1.45 +
1.46 +enum ValueRecordFields
1.47 +{
1.48 + vrfXPlacement = 0,
1.49 + vrfYPlacement = 1,
1.50 + vrfXAdvance = 2,
1.51 + vrfYAdvance = 3,
1.52 + vrfXPlaDevice = 4,
1.53 + vrfYPlaDevice = 5,
1.54 + vrfXAdvDevice = 6,
1.55 + vrfYAdvDevice = 7
1.56 +};
1.57 +
1.58 +enum ValueFormatBits
1.59 +{
1.60 + vfbXPlacement = 0x0001,
1.61 + vfbYPlacement = 0x0002,
1.62 + vfbXAdvance = 0x0004,
1.63 + vfbYAdvance = 0x0008,
1.64 + vfbXPlaDevice = 0x0010,
1.65 + vfbYPlaDevice = 0x0020,
1.66 + vfbXAdvDevice = 0x0040,
1.67 + vfbYAdvDevice = 0x0080,
1.68 + vfbReserved = 0xFF00,
1.69 + vfbAnyDevice = vfbXPlaDevice + vfbYPlaDevice + vfbXAdvDevice + vfbYAdvDevice
1.70 +};
1.71 +
1.72 +U_NAMESPACE_END
1.73 +#endif
1.74 +
1.75 +