dwrite: Check all 'vert' lookups, not just the first one.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2016-07-06 23:16:42 +03:00 committed by Alexandre Julliard
parent c52fa73a43
commit c4d08275d0
2 changed files with 64 additions and 63 deletions

View File

@ -1954,7 +1954,7 @@ BOOL opentype_has_vertical_variants(IDWriteFontFace3 *fontface)
for (i = 0; i < GET_BE_WORD(featurelist->FeatureCount); i++) {
if (*(UINT32*)featurelist->FeatureRecord[i].FeatureTag == DWRITE_FONT_FEATURE_TAG_VERTICAL_WRITING) {
const OT_Feature *feature = (const OT_Feature*)((BYTE*)featurelist + GET_BE_WORD(featurelist->FeatureRecord[i].Feature));
UINT16 lookup_count = GET_BE_WORD(feature->LookupCount), index, count, type;
UINT16 lookup_count = GET_BE_WORD(feature->LookupCount), i, index, count, type;
const GSUB_SingleSubstFormat2 *subst2;
const OT_LookupTable *lookup_table;
UINT32 offset;
@ -1962,8 +1962,9 @@ BOOL opentype_has_vertical_variants(IDWriteFontFace3 *fontface)
if (lookup_count == 0)
continue;
for (i = 0; i < lookup_count; i++) {
/* check if lookup is empty */
index = GET_BE_WORD(feature->LookupListIndex[0]);
index = GET_BE_WORD(feature->LookupListIndex[i]);
lookup_table = (const OT_LookupTable*)((BYTE*)lookup_list + GET_BE_WORD(lookup_list->Lookup[index]));
type = GET_BE_WORD(lookup_table->LookupType);
@ -1998,6 +1999,7 @@ BOOL opentype_has_vertical_variants(IDWriteFontFace3 *fontface)
WARN("Unknown Single Substitution Format, %u\n", index);
}
}
}
IDWriteFontFace3_ReleaseFontTable(fontface, context);

View File

@ -6381,7 +6381,7 @@ static BOOL has_vertical_glyph_variants(IDWriteFontFace1 *fontface)
for (i = 0; i < GET_BE_WORD(featurelist->FeatureCount); i++) {
if (*(UINT32*)featurelist->FeatureRecord[i].FeatureTag == DWRITE_FONT_FEATURE_TAG_VERTICAL_WRITING) {
const OT_Feature *feature = (const OT_Feature*)((BYTE*)featurelist + GET_BE_WORD(featurelist->FeatureRecord[i].Feature));
UINT16 lookup_count = GET_BE_WORD(feature->LookupCount), index, count, type;
UINT16 lookup_count = GET_BE_WORD(feature->LookupCount), i, index, count, type;
const GSUB_SingleSubstFormat2 *subst2;
const OT_LookupTable *lookup_table;
UINT32 offset;
@ -6389,16 +6389,14 @@ static BOOL has_vertical_glyph_variants(IDWriteFontFace1 *fontface)
if (lookup_count == 0)
continue;
ok(lookup_count == 1, "got lookup count %u\n", lookup_count);
for (i = 0; i < lookup_count; i++) {
/* check if lookup is empty */
index = GET_BE_WORD(feature->LookupListIndex[0]);
index = GET_BE_WORD(feature->LookupListIndex[i]);
lookup_table = (const OT_LookupTable*)((BYTE*)lookup_list + GET_BE_WORD(lookup_list->Lookup[index]));
type = GET_BE_WORD(lookup_table->LookupType);
ok(type == 1 || type == 7, "got unexpected lookup type %u\n", type);
count = GET_BE_WORD(lookup_table->SubTableCount);
if (count == 0)
continue;
@ -6429,6 +6427,7 @@ static BOOL has_vertical_glyph_variants(IDWriteFontFace1 *fontface)
ok(0, "unknown Single Substitution Format, %u\n", index);
}
}
}
IDWriteFontFace1_ReleaseFontTable(fontface, context);