Nikolay Sivov : dwrite: Include required feature when collecting lookups.
Alexandre Julliard
julliard at winehq.org
Tue Jun 2 16:34:10 CDT 2020
Module: wine
Branch: master
Commit: 15baea930a3563bf66c688612e08b7f8925eda3c
URL: https://source.winehq.org/git/wine.git/?a=commit;h=15baea930a3563bf66c688612e08b7f8925eda3c
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Tue Jun 2 11:48:51 2020 +0300
dwrite: Include required feature when collecting lookups.
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/dwrite/opentype.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/dlls/dwrite/opentype.c b/dlls/dwrite/opentype.c
index fd59f40dcb..629bc7f407 100644
--- a/dlls/dwrite/opentype.c
+++ b/dlls/dwrite/opentype.c
@@ -4405,6 +4405,7 @@ static void opentype_layout_collect_lookups(struct scriptshaping_context *contex
{
unsigned int last_num_lookups = 0, stage, script_feature_count = 0;
UINT16 total_feature_count, total_lookup_count;
+ struct shaping_feature required_feature = { 0 };
const struct ot_feature_list *feature_list;
const struct ot_langsys *langsys = NULL;
struct shaping_feature *feature;
@@ -4455,6 +4456,12 @@ static void opentype_layout_collect_lookups(struct scriptshaping_context *contex
if (!feature_list)
return;
+ /* Required feature. */
+ required_feature.index = langsys ? GET_BE_WORD(langsys->required_feature_index) : 0xffff;
+ if (required_feature.index < total_feature_count)
+ required_feature.tag = feature_list->features[required_feature.index].tag;
+ required_feature.mask = global_bit_mask;
+
context->global_mask = global_bit_mask;
next_bit = global_bit_shift + 1;
for (i = 0; i < features->count; ++i)
@@ -4474,6 +4481,9 @@ static void opentype_layout_collect_lookups(struct scriptshaping_context *contex
if (!feature->max_value || next_bit + bits_needed > 8 * sizeof (feature->mask))
continue;
+ if (required_feature.tag == feature->tag)
+ required_feature.stage = feature->stage;
+
for (j = 0; j < script_feature_count; ++j)
{
feature_index = GET_BE_WORD(langsys->feature_index[j]);
@@ -4517,6 +4527,9 @@ static void opentype_layout_collect_lookups(struct scriptshaping_context *contex
for (stage = 0; stage <= features->stage; ++stage)
{
+ if (required_feature.index != 0xffff && required_feature.stage == stage)
+ opentype_layout_add_lookups(feature_list, total_lookup_count, table, &required_feature, lookups);
+
for (i = 0; i < features->count; ++i)
{
if (features->features[i].stage == stage)
More information about the wine-cvs
mailing list