ups10: Implement Single Adjustment Positioning: Format 2.

This commit is contained in:
Aric Stewart 2012-07-17 07:21:05 -05:00 committed by Alexandre Julliard
parent da7e0e38e8
commit ea9f2266de
1 changed files with 32 additions and 2 deletions

View File

@ -332,6 +332,14 @@ typedef struct {
WORD Value[1];
} GPOS_SinglePosFormat1;
typedef struct {
WORD PosFormat;
WORD Coverage;
WORD ValueFormat;
WORD ValueCount;
WORD Value[1];
} GPOS_SinglePosFormat2;
typedef struct {
WORD PosFormat;
WORD Coverage;
@ -1086,7 +1094,7 @@ static VOID GPOS_apply_SingleAdjustment(const OT_LookupTable *look, const WORD *
const GPOS_SinglePosFormat1 *spf1;
WORD offset = GET_BE_WORD(look->SubTable[j]);
spf1 = (const GPOS_SinglePosFormat1*)((const BYTE*)look+offset);
if (GET_BE_WORD(spf1->PosFormat == 1))
if (GET_BE_WORD(spf1->PosFormat) == 1)
{
offset = GET_BE_WORD(spf1->Coverage);
if (GSUB_is_glyph_covered((const BYTE*)spf1+offset, glyphs[glyph_index]) != -1)
@ -1098,8 +1106,30 @@ static VOID GPOS_apply_SingleAdjustment(const OT_LookupTable *look, const WORD *
TRACE("Glyph Adjusted by %i,%i\n",ValueRecord.XPlacement,ValueRecord.YPlacement);
}
}
else if (GET_BE_WORD(spf1->PosFormat) == 2)
{
int index;
const GPOS_SinglePosFormat2 *spf2;
spf2 = (const GPOS_SinglePosFormat2*)spf1;
offset = GET_BE_WORD(spf2->Coverage);
index = GSUB_is_glyph_covered((const BYTE*)spf2+offset, glyphs[glyph_index]);
if (index != -1)
{
int size;
GPOS_ValueRecord ValueRecord = {0,0,0,0,0,0,0,0};
WORD ValueFormat = GET_BE_WORD(spf2->ValueFormat);
size = GPOS_get_value_record(ValueFormat, spf2->Value, &ValueRecord);
if (index > 0)
{
offset = size * index;
GPOS_get_value_record(ValueFormat, &spf2->Value[offset], &ValueRecord);
}
GPOS_get_value_record_offsets((const BYTE*)spf2, &ValueRecord, ValueFormat, ppem, ptAdjust, ptAdvance);
TRACE("Glyph Adjusted by %i,%i\n",ValueRecord.XPlacement,ValueRecord.YPlacement);
}
}
else
FIXME("Single Adjustment Positioning: Format 2 Unhandled\n");
FIXME("Single Adjustment Positioning: Format %i Unhandled\n",GET_BE_WORD(spf1->PosFormat));
}
}