dwrite: Enable 'vert' feature.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
093d6966be
commit
b9f580c990
|
@ -505,10 +505,17 @@ extern struct scriptshaping_cache *create_scriptshaping_cache(void *context,
|
|||
extern void release_scriptshaping_cache(struct scriptshaping_cache*) DECLSPEC_HIDDEN;
|
||||
extern struct scriptshaping_cache *fontface_get_shaping_cache(struct dwrite_fontface *fontface) DECLSPEC_HIDDEN;
|
||||
|
||||
enum shaping_feature_flags
|
||||
{
|
||||
FEATURE_GLOBAL = 0x1,
|
||||
FEATURE_GLOBAL_SEARCH = 0x2,
|
||||
};
|
||||
|
||||
struct shaping_feature
|
||||
{
|
||||
unsigned int tag;
|
||||
unsigned int index;
|
||||
unsigned int flags;
|
||||
};
|
||||
|
||||
struct shaping_features
|
||||
|
|
|
@ -4143,14 +4143,25 @@ static void opentype_layout_collect_lookups(struct scriptshaping_context *contex
|
|||
langsys_offset + FIELD_OFFSET(struct ot_langsys, feature_index[j]));
|
||||
if (feature_index >= total_feature_count)
|
||||
continue;
|
||||
if (feature_list->features[feature_index].tag == features->features[i].tag)
|
||||
if ((found = feature_list->features[feature_index].tag == features->features[i].tag))
|
||||
{
|
||||
found = TRUE;
|
||||
features->features[i].index = feature_index;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!found && (features->features[i].flags & FEATURE_GLOBAL_SEARCH))
|
||||
{
|
||||
for (j = 0; j < total_feature_count; ++j)
|
||||
{
|
||||
if ((found = (feature_list->features[j].tag == features->features[i].tag)))
|
||||
{
|
||||
features->features[i].index = j;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!found)
|
||||
features->features[i].index = 0xffff;
|
||||
}
|
||||
|
|
|
@ -201,13 +201,20 @@ static DWORD shape_select_language(const struct scriptshaping_cache *cache, DWOR
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void shape_add_feature(struct shaping_features *features, unsigned int tag)
|
||||
static void shape_add_feature_flags(struct shaping_features *features, unsigned int tag, unsigned int flags)
|
||||
{
|
||||
if (!dwrite_array_reserve((void **)&features->features, &features->capacity, features->count + 1,
|
||||
sizeof(*features->features)))
|
||||
return;
|
||||
|
||||
features->features[features->count++].tag = tag;
|
||||
features->features[features->count].tag = tag;
|
||||
features->features[features->count].flags = flags;
|
||||
features->count++;
|
||||
}
|
||||
|
||||
static void shape_add_feature(struct shaping_features *features, unsigned int tag)
|
||||
{
|
||||
shape_add_feature_flags(features, tag, FEATURE_GLOBAL);
|
||||
}
|
||||
|
||||
static int features_sorting_compare(const void *a, const void *b)
|
||||
|
@ -344,6 +351,8 @@ HRESULT shape_get_glyphs(struct scriptshaping_context *context, const unsigned i
|
|||
for (i = 0; i < ARRAY_SIZE(horizontal_features); ++i)
|
||||
shape_add_feature(&features, horizontal_features[i]);
|
||||
}
|
||||
else
|
||||
shape_add_feature_flags(&features, DWRITE_MAKE_OPENTYPE_TAG('v','e','r','t'), FEATURE_GLOBAL_SEARCH);
|
||||
|
||||
shape_merge_features(&features);
|
||||
|
||||
|
|
Loading…
Reference in New Issue