Commit 1a92176b authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

dwrite: Add fallback data for some of Japanese ranges.

parent fca83b09
...@@ -191,6 +191,8 @@ struct fallback_mapping { ...@@ -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) ...@@ -1736,16 +1738,23 @@ static ULONG WINAPI fontfallback_Release(IDWriteFontFallback *iface)
return IDWriteFactory2_Release(fallback->factory); return IDWriteFactory2_Release(fallback->factory);
} }
static const struct fallback_mapping *find_fallback_mapping(struct dwrite_fontfallback *fallback, UINT32 ch) static int compare_fallback_mapping(const void *a, const void *b)
{ {
UINT32 i; UINT32 ch = *(UINT32*)a;
struct fallback_mapping *mapping = (struct fallback_mapping*)b;
for (i = 0; i < fallback->count; i++) { if (ch > mapping->range.last)
if (fallback->mappings[i].range.first <= ch && fallback->mappings[i].range.last >= ch) return 1;
return &fallback->mappings[i]; else if (ch < mapping->range.first)
} return -1;
else
return 0;
}
return NULL; static const struct fallback_mapping *find_fallback_mapping(struct dwrite_fontfallback *fallback, UINT32 ch)
{
return bsearch(&ch, fallback->mappings, fallback->count, sizeof(*fallback->mappings),
compare_fallback_mapping);
} }
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 ...@@ -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;
} }
......
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