Commit 4ae8191e authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

dwrite/arabic: Set per-glyph mask.

parent bea9c706
......@@ -590,6 +590,8 @@ extern void shape_enable_feature(struct shaping_features *features, unsigned int
unsigned int flags) DECLSPEC_HIDDEN;
extern void shape_add_feature_full(struct shaping_features *features, unsigned int tag,
unsigned int flags, unsigned int value) DECLSPEC_HIDDEN;
extern unsigned int shape_get_feature_1_mask(const struct shaping_features *features,
unsigned int tag) DECLSPEC_HIDDEN;
extern void shape_start_next_stage(struct shaping_features *features, stage_func func) DECLSPEC_HIDDEN;
struct scriptshaping_context
......
......@@ -4632,6 +4632,12 @@ static unsigned int shaping_features_get_mask(const struct shaping_features *fea
return feature->mask;
}
unsigned int shape_get_feature_1_mask(const struct shaping_features *features, unsigned int tag)
{
unsigned int shift, mask = shaping_features_get_mask(features, tag, &shift);
return (1 << shift) & mask;
}
static void opentype_layout_get_glyph_range_for_text(struct scriptshaping_context *context, unsigned int start_char,
unsigned int end_char, unsigned int *start_glyph, unsigned int *end_glyph)
{
......
......@@ -41,6 +41,7 @@ enum arabic_shaping_action
MED2,
INIT,
NONE,
NUM_FEATURES = NONE,
};
static BOOL feature_is_syriac(unsigned int tag)
......@@ -134,10 +135,17 @@ static void arabic_set_shaping_action(struct scriptshaping_context *context,
context->glyph_infos[idx].props |= (action & 0xf) << 16;
}
static enum arabic_shaping_action arabic_get_shaping_action(const struct scriptshaping_context *context,
unsigned int idx)
{
return (context->glyph_infos[idx].props >> 16) & 0xf;
}
static void arabic_setup_masks(struct scriptshaping_context *context,
const struct shaping_features *features)
{
unsigned int i, prev = ~0u, state = 0;
unsigned int masks[NUM_FEATURES];
for (i = 0; i < context->length; ++i)
{
......@@ -160,6 +168,13 @@ static void arabic_setup_masks(struct scriptshaping_context *context,
prev = i;
state = entry->next_state;
}
for (i = 0; i < ARRAY_SIZE(masks); ++i)
masks[i] = shape_get_feature_1_mask(features, arabic_features[i]);
/* Unaffected glyphs get action NONE with zero mask. */
for (i = 0; i < context->length; ++i)
context->glyph_infos[i].mask |= masks[arabic_get_shaping_action(context, i)];
}
const struct shaper arabic_shaper =
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment