dwrite: Set initial justification value for default shaper.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
This commit is contained in:
Nikolay Sivov 2022-09-09 09:10:53 +03:00 committed by Alexandre Julliard
parent 33c56be5ae
commit c8592b97e3
3 changed files with 22 additions and 7 deletions

View file

@ -200,7 +200,22 @@ static void shape_merge_features(struct scriptshaping_context *context, struct s
features->count = j + 1;
}
static const struct shaper null_shaper;
static void default_shaper_setup_masks(struct scriptshaping_context *context,
const struct shaping_features *features)
{
unsigned int i;
for (i = 0; i < context->glyph_count; ++i)
{
context->u.buffer.glyph_props[i].justification = iswspace(context->glyph_infos[i].codepoint) ?
SCRIPT_JUSTIFY_BLANK : SCRIPT_JUSTIFY_CHARACTER;
}
}
static const struct shaper default_shaper =
{
.setup_masks = default_shaper_setup_masks
};
static void shape_set_shaper(struct scriptshaping_context *context)
{
@ -211,7 +226,7 @@ static void shape_set_shaper(struct scriptshaping_context *context)
context->shaper = &arabic_shaper;
break;
default:
context->shaper = &null_shaper;
context->shaper = &default_shaper;
}
}

View file

@ -183,6 +183,6 @@ static void arabic_setup_masks(struct scriptshaping_context *context,
const struct shaper arabic_shaper =
{
arabic_collect_features,
arabic_setup_masks,
.collect_features = arabic_collect_features,
.setup_masks = arabic_setup_masks,
};

View file

@ -2904,9 +2904,6 @@ static void test_glyph_justification_property(void)
unsigned int i, j;
HRESULT hr;
if (!strcmp(winetest_platform, "wine"))
return;
analyzer = create_text_analyzer(&IID_IDWriteTextAnalyzer);
ok(!!analyzer, "Failed to create analyzer instance.\n");
@ -2914,6 +2911,9 @@ static void test_glyph_justification_property(void)
for (i = 0; i < ARRAY_SIZE(tests); ++i)
{
if (tests[i].script == Script_Arabic && !strcmp(winetest_platform, "wine"))
continue;
winetest_push_context("Test %s", debugstr_w(tests[i].text));
sa.script = tests[i].script;