[PATCH 7/9] dwrite: Add free fallback fonts for CJK.

Giovanni Mascellani gmascellani at codeweavers.com
Thu Mar 4 04:23:10 CST 2021


Add two fonts which are easily found on modern Linux installations. It might
be wise to add others in the future, so that any random Linux installation
has at least one of them.

Signed-off-by: Giovanni Mascellani <gmascellani at codeweavers.com>
---
 dlls/dwrite/analyzer.c     | 4 +++-
 dlls/dwrite/tests/layout.c | 7 -------
 2 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/dlls/dwrite/analyzer.c b/dlls/dwrite/analyzer.c
index 6b74a23540a..e4bc8d42943 100644
--- a/dlls/dwrite/analyzer.c
+++ b/dlls/dwrite/analyzer.c
@@ -208,8 +208,10 @@ const char *debugstr_sa_script(UINT16 script)
 
 /* system font falback configuration */
 static const WCHAR meiryoW[] = {'M','e','i','r','y','o',0};
+static const WCHAR droidW[] = {'D','r','o','i','d',' ','S','a','n','s',' ','F','a','l','l','b','a','c','k',0};
+static const WCHAR notoW[] = {'N','o','t','o',' ','S','e','r','i','f',' ','C','J','K',' ','S','C',0};
 
-static const WCHAR *cjk_families[] = { meiryoW };
+static const WCHAR *cjk_families[] = { meiryoW, droidW, notoW };
 
 static const DWRITE_UNICODE_RANGE cjk_ranges[] =
 {
diff --git a/dlls/dwrite/tests/layout.c b/dlls/dwrite/tests/layout.c
index 51290d167d9..526ff4d7112 100644
--- a/dlls/dwrite/tests/layout.c
+++ b/dlls/dwrite/tests/layout.c
@@ -4732,12 +4732,9 @@ if (font) {
     font = NULL;
     hr = IDWriteFontFallback_MapCharacters(fallback, &analysissource, 1, 2, NULL, NULL, DWRITE_FONT_WEIGHT_NORMAL,
         DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, &mappedlength, &font, &scale);
-todo_wine {
     ok(hr == S_OK, "got 0x%08x\n", hr);
     ok(mappedlength == 2, "got %u\n", mappedlength);
-}
     ok(scale == 1.0f, "got %f\n", scale);
-todo_wine
     ok(font != NULL, "got %p\n", font);
 if (font) {
     IDWriteFont_Release(font);
@@ -4784,7 +4781,6 @@ if (font) {
     ok(hr == S_OK && exists, "got 0x%08x, exists %d\n", hr, exists);
     hr = IDWriteLocalizedStrings_GetString(strings, 0, buffW, ARRAY_SIZE(buffW));
     ok(hr == S_OK, "got 0x%08x\n", hr);
-todo_wine
     ok(lstrcmpW(buffW, L"Tahoma"), "Unexpected string %s.\n", wine_dbgstr_w(buffW));
     IDWriteLocalizedStrings_Release(strings);
     IDWriteFont_Release(font);
@@ -4798,7 +4794,6 @@ todo_wine
     hr = IDWriteFontFallback_MapCharacters(fallback, &analysissource, 1, 3, &fallbackcollection, g_blahfontW, DWRITE_FONT_WEIGHT_NORMAL,
         DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, &mappedlength, &font, &scale);
     ok(hr == S_OK, "got 0x%08x\n", hr);
-todo_wine
     ok(mappedlength == 2, "got %u\n", mappedlength);
     ok(scale == 1.0f, "got %f\n", scale);
     ok(font != NULL, "got %p\n", font);
@@ -4809,7 +4804,6 @@ if (font) {
     ok(hr == S_OK && exists, "got 0x%08x, exists %d\n", hr, exists);
     hr = IDWriteLocalizedStrings_GetString(strings, 0, buffW, ARRAY_SIZE(buffW));
     ok(hr == S_OK, "got 0x%08x\n", hr);
-todo_wine
     ok(lstrcmpW(buffW, L"Tahoma"), "Unexpected string %s.\n", wine_dbgstr_w(buffW));
     IDWriteLocalizedStrings_Release(strings);
     IDWriteFont_Release(font);
@@ -4860,7 +4854,6 @@ if (font) {
     hr = IDWriteFontFallback_MapCharacters(fallback, &analysissource, 1, 3, &fallbackcollection, g_blahfontW, DWRITE_FONT_WEIGHT_NORMAL,
         DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, &mappedlength, &font, &scale);
     ok(hr == S_OK, "got 0x%08x\n", hr);
-todo_wine
     ok(mappedlength == 2, "got %u\n", mappedlength);
     ok(scale == 1.0f, "got %f\n", scale);
     ok(font != NULL, "got %p\n", font);
-- 
2.30.1




More information about the wine-devel mailing list