forked from Mirrors/wine-wine
dwrite: Add main loop variant for reverse substitution.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>feature/deterministic
parent
db6c4156af
commit
3e59649c9e
|
@ -5610,6 +5610,19 @@ static void opentype_get_nominal_glyphs(struct scriptshaping_context *context, c
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static BOOL opentype_is_gsub_lookup_reversed(const struct scriptshaping_context *context, const struct lookup *lookup)
|
||||||
|
{
|
||||||
|
unsigned int subtable_offset, lookup_type = lookup->type;
|
||||||
|
|
||||||
|
if (lookup->type == GSUB_LOOKUP_EXTENSION_SUBST)
|
||||||
|
{
|
||||||
|
subtable_offset = opentype_layout_get_gsubgpos_subtable(context, lookup->offset, 0);
|
||||||
|
/* Assumes format 1. */
|
||||||
|
lookup_type = table_read_be_word(&context->table->table, subtable_offset + 2);
|
||||||
|
}
|
||||||
|
return lookup_type == GSUB_LOOKUP_REVERSE_CHAINING_CONTEXTUAL_SUBST;
|
||||||
|
}
|
||||||
|
|
||||||
void opentype_layout_apply_gsub_features(struct scriptshaping_context *context, unsigned int script_index,
|
void opentype_layout_apply_gsub_features(struct scriptshaping_context *context, unsigned int script_index,
|
||||||
unsigned int language_index, const struct shaping_features *features)
|
unsigned int language_index, const struct shaping_features *features)
|
||||||
{
|
{
|
||||||
|
@ -5626,6 +5639,8 @@ void opentype_layout_apply_gsub_features(struct scriptshaping_context *context,
|
||||||
{
|
{
|
||||||
const struct lookup *lookup = &lookups.lookups[i];
|
const struct lookup *lookup = &lookups.lookups[i];
|
||||||
|
|
||||||
|
if (!opentype_is_gsub_lookup_reversed(context, lookup))
|
||||||
|
{
|
||||||
context->cur = 0;
|
context->cur = 0;
|
||||||
while (context->cur < context->glyph_count)
|
while (context->cur < context->glyph_count)
|
||||||
{
|
{
|
||||||
|
@ -5641,6 +5656,23 @@ void opentype_layout_apply_gsub_features(struct scriptshaping_context *context,
|
||||||
context->cur++;
|
context->cur++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
context->cur = context->glyph_count - 1;
|
||||||
|
|
||||||
|
for (;;)
|
||||||
|
{
|
||||||
|
if ((context->glyph_infos[context->cur].mask & lookup->mask) &&
|
||||||
|
lookup_is_glyph_match(context, context->cur, lookup->flags))
|
||||||
|
{
|
||||||
|
opentype_layout_apply_gsub_lookup(context, lookup);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (context->cur == 0) break;
|
||||||
|
--context->cur;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
heap_free(lookups.lookups);
|
heap_free(lookups.lookups);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue