00001
00002
00003
00004
00005
00006
00007
00008 #ifndef __VALUERECORDS_H
00009 #define __VALUERECORDS_H
00010
00011 #include "LETypes.h"
00012 #include "LEFontInstance.h"
00013 #include "OpenTypeTables.h"
00014 #include "GlyphIterator.h"
00015 #include "GlyphPositionAdjustments.h"
00016
00017 typedef le_uint16 ValueFormat;
00018 typedef le_int16 ValueRecordField;
00019
00020 struct ValueRecord
00021 {
00022 le_int16 values[ANY_NUMBER];
00023
00024 le_int16 getFieldValue(ValueFormat valueFormat, ValueRecordField field);
00025 le_int16 getFieldValue(le_int16 index, ValueFormat valueFormat, ValueRecordField field);
00026 void adjustPosition(ValueFormat valueFormat, char *base, GlyphPositionAdjustment &positionAdjustment,
00027 LEFontInstance *fontInstance);
00028 void adjustPosition(le_int16 index, ValueFormat valueFormat, char *base, GlyphPositionAdjustment &positionAdjustment,
00029 LEFontInstance *fontInstance);
00030
00031 static le_int16 getSize(ValueFormat valueFormat);
00032
00033 private:
00034 static le_int16 getFieldCount(ValueFormat valueFormat);
00035 static le_int16 getFieldIndex(ValueFormat valueFormat, ValueRecordField field);
00036 };
00037
00038 enum ValueRecordFields
00039 {
00040 vrfXPlacement = 0,
00041 vrfYPlacement = 1,
00042 vrfXAdvance = 2,
00043 vrfYAdvance = 3,
00044 vrfXPlaDevice = 4,
00045 vrfYPlaDevice = 5,
00046 vrfXAdvDevice = 6,
00047 vrfYAdvDevice = 7
00048 };
00049
00050 enum ValueFormatBits
00051 {
00052 vfbXPlacement = 0x0001,
00053 vfbYPlacement = 0x0002,
00054 vfbXAdvance = 0x0004,
00055 vfbYAdvance = 0x0008,
00056 vfbXPlaDevice = 0x0010,
00057 vfbYPlaDevice = 0x0020,
00058 vfbXAdvDevice = 0x0040,
00059 vfbYAdvDevice = 0x0080,
00060 vfbReserved = 0xFF00,
00061 vfbAnyDevice = vfbXPlaDevice + vfbYPlaDevice + vfbXAdvDevice + vfbYAdvDevice
00062 };
00063
00064
00065 #endif
00066
00067