dwrite: Add fallback data for some of Japanese ranges.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
fca83b0915
commit
1a92176b67
@ -191,6 +191,8 @@ struct fallback_mapping {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static const struct fallback_mapping fontfallback_neutral_data[] = {
|
static const struct fallback_mapping fontfallback_neutral_data[] = {
|
||||||
|
{ { 0x3000, 0x30ff }, meiryoW }, /* CJK Symbols and Punctuation, Hiragana, Katakana */
|
||||||
|
{ { 0x31f0, 0x31ff }, meiryoW }, /* Katakana Phonetic Extensions */
|
||||||
{ { 0x4e00, 0x9fff }, meiryoW }, /* CJK Unified Ideographs */
|
{ { 0x4e00, 0x9fff }, meiryoW }, /* CJK Unified Ideographs */
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1736,16 +1738,23 @@ static ULONG WINAPI fontfallback_Release(IDWriteFontFallback *iface)
|
|||||||
return IDWriteFactory2_Release(fallback->factory);
|
return IDWriteFactory2_Release(fallback->factory);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int compare_fallback_mapping(const void *a, const void *b)
|
||||||
|
{
|
||||||
|
UINT32 ch = *(UINT32*)a;
|
||||||
|
struct fallback_mapping *mapping = (struct fallback_mapping*)b;
|
||||||
|
|
||||||
|
if (ch > mapping->range.last)
|
||||||
|
return 1;
|
||||||
|
else if (ch < mapping->range.first)
|
||||||
|
return -1;
|
||||||
|
else
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static const struct fallback_mapping *find_fallback_mapping(struct dwrite_fontfallback *fallback, UINT32 ch)
|
static const struct fallback_mapping *find_fallback_mapping(struct dwrite_fontfallback *fallback, UINT32 ch)
|
||||||
{
|
{
|
||||||
UINT32 i;
|
return bsearch(&ch, fallback->mappings, fallback->count, sizeof(*fallback->mappings),
|
||||||
|
compare_fallback_mapping);
|
||||||
for (i = 0; i < fallback->count; i++) {
|
|
||||||
if (fallback->mappings[i].range.first <= ch && fallback->mappings[i].range.last >= ch)
|
|
||||||
return &fallback->mappings[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT create_matching_font(IDWriteFontCollection *collection, const WCHAR *name,
|
HRESULT create_matching_font(IDWriteFontCollection *collection, const WCHAR *name,
|
||||||
|
@ -4200,6 +4200,7 @@ static HRESULT WINAPI fontcollection_FindFamilyName(IDWriteFontCollection *iface
|
|||||||
*exists = TRUE;
|
*exists = TRUE;
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
todo_wine
|
||||||
ok(0, "unexpected call, name %s\n", wine_dbgstr_w(name));
|
ok(0, "unexpected call, name %s\n", wine_dbgstr_w(name));
|
||||||
return E_NOTIMPL;
|
return E_NOTIMPL;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user