This fixes Chinese and Japanese text display issue for Sins of a Solar Empire: Rebellion.
From: Ziqing Hui zhui@codeweavers.com
--- dlls/usp10/tests/usp10.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
diff --git a/dlls/usp10/tests/usp10.c b/dlls/usp10/tests/usp10.c index aee751423b3..35d25d46ccc 100644 --- a/dlls/usp10/tests/usp10.c +++ b/dlls/usp10/tests/usp10.c @@ -1617,6 +1617,16 @@ static void test_ScriptShapeOpenType(HDC hdc) {1,{{SCRIPT_JUSTIFY_NONE,1,0,0,0,0},0}}, {1,{{SCRIPT_JUSTIFY_NONE,0,0,0,0,0},0}} };
+ /* CJK */ + static const WCHAR test_cjk[] = {0x4e2d, 0x6587, 0x65e5, 0x672c, 0x8a9e}; + static const shapeTest_char cjk_c[] = {{0,{0,0}},{1,{0,0}},{2,{0,0}},{3,{0,0}},{4,{0,0}}}; + static const shapeTest_glyph cjk_g[] = { + {1,{{SCRIPT_JUSTIFY_CHARACTER,1,0,0,0,0},0}}, + {1,{{SCRIPT_JUSTIFY_CHARACTER,1,0,0,0,0},0}}, + {1,{{SCRIPT_JUSTIFY_CHARACTER,1,0,0,0,0},0}}, + {1,{{SCRIPT_JUSTIFY_CHARACTER,1,0,0,0,0},0}}, + {1,{{SCRIPT_JUSTIFY_CHARACTER,1,0,0,0,0},0}} }; + static const font_fingerprint fingerprint_estrangelo = { {'A','a','B','b','C','c','D','d',0,0}, {284,310,285,311,286,312,287,313,0,0}}; @@ -1801,6 +1811,14 @@ static void test_ScriptShapeOpenType(HDC hdc) SelectObject(hdc, hfont_orig); DeleteObject(hfont); } + + test_valid = find_font_for_range(hdc, "SimSun", 59, test_cjk[0], &hfont, &hfont_orig, NULL); + if (hfont != NULL) + { + test_shape_ok_valid(test_valid, hdc, test_cjk, 5, &Control, &State, 0, 5, cjk_c, cjk_g); + SelectObject(hdc, hfont_orig); + DeleteObject(hfont); + } }
static void test_ScriptShape(HDC hdc)
From: Ziqing Hui zhui@codeweavers.com
--- dlls/usp10/tests/usp10.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
diff --git a/dlls/usp10/tests/usp10.c b/dlls/usp10/tests/usp10.c index 35d25d46ccc..432e4bdce07 100644 --- a/dlls/usp10/tests/usp10.c +++ b/dlls/usp10/tests/usp10.c @@ -1617,6 +1617,14 @@ static void test_ScriptShapeOpenType(HDC hdc) {1,{{SCRIPT_JUSTIFY_NONE,1,0,0,0,0},0}}, {1,{{SCRIPT_JUSTIFY_NONE,0,0,0,0,0},0}} };
+ /* Hiragana */ + static const WCHAR test_hiragana[] = {0x306b, 0x307b, 0x3093, 0x3054}; + static const shapeTest_char hiragana_c[] = {{0,{0,0}},{1,{0,0}},{2,{0,0}},{3,{0,0}}}; + static const shapeTest_glyph hiragana_g[] = { + {1,{{SCRIPT_JUSTIFY_CHARACTER,1,0,0,0,0},0}}, + {1,{{SCRIPT_JUSTIFY_CHARACTER,1,0,0,0,0},0}}, + {1,{{SCRIPT_JUSTIFY_CHARACTER,1,0,0,0,0},0}}, + {1,{{SCRIPT_JUSTIFY_CHARACTER,1,0,0,0,0},0}} }; /* CJK */ static const WCHAR test_cjk[] = {0x4e2d, 0x6587, 0x65e5, 0x672c, 0x8a9e}; static const shapeTest_char cjk_c[] = {{0,{0,0}},{1,{0,0}},{2,{0,0}},{3,{0,0}},{4,{0,0}}}; @@ -1812,6 +1820,14 @@ static void test_ScriptShapeOpenType(HDC hdc) DeleteObject(hfont); }
+ test_valid = find_font_for_range(hdc, "SimSun", 49, test_hiragana[0], &hfont, &hfont_orig, NULL); + if (hfont != NULL) + { + test_shape_ok_valid(test_valid, hdc, test_hiragana, 4, &Control, &State, 0, 4, hiragana_c, hiragana_g); + SelectObject(hdc, hfont_orig); + DeleteObject(hfont); + } + test_valid = find_font_for_range(hdc, "SimSun", 59, test_cjk[0], &hfont, &hfont_orig, NULL); if (hfont != NULL) {
From: Ziqing Hui zhui@codeweavers.com
--- dlls/usp10/tests/usp10.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
diff --git a/dlls/usp10/tests/usp10.c b/dlls/usp10/tests/usp10.c index 432e4bdce07..7516bfb2a97 100644 --- a/dlls/usp10/tests/usp10.c +++ b/dlls/usp10/tests/usp10.c @@ -1625,6 +1625,14 @@ static void test_ScriptShapeOpenType(HDC hdc) {1,{{SCRIPT_JUSTIFY_CHARACTER,1,0,0,0,0},0}}, {1,{{SCRIPT_JUSTIFY_CHARACTER,1,0,0,0,0},0}}, {1,{{SCRIPT_JUSTIFY_CHARACTER,1,0,0,0,0},0}} }; + + /* Katakana */ + static const WCHAR test_katakana[] = {0x30b3, 0x30fc, 0x30c9}; + static const shapeTest_char katakana_c[] = {{0,{0,0}},{1,{0,0}},{2,{0,0}}}; + static const shapeTest_glyph katakana_g[] = { + {1,{{SCRIPT_JUSTIFY_CHARACTER,1,0,0,0,0},0}}, + {1,{{SCRIPT_JUSTIFY_CHARACTER,1,0,0,0,0},0}}, + {1,{{SCRIPT_JUSTIFY_CHARACTER,1,0,0,0,0},0}} }; /* CJK */ static const WCHAR test_cjk[] = {0x4e2d, 0x6587, 0x65e5, 0x672c, 0x8a9e}; static const shapeTest_char cjk_c[] = {{0,{0,0}},{1,{0,0}},{2,{0,0}},{3,{0,0}},{4,{0,0}}}; @@ -1828,6 +1836,14 @@ static void test_ScriptShapeOpenType(HDC hdc) DeleteObject(hfont); }
+ test_valid = find_font_for_range(hdc, "SimSun", 50, test_katakana[0], &hfont, &hfont_orig, NULL); + if (hfont != NULL) + { + test_shape_ok_valid(test_valid, hdc, test_katakana, 3, &Control, &State, 0, 3, katakana_c, katakana_g); + SelectObject(hdc, hfont_orig); + DeleteObject(hfont); + } + test_valid = find_font_for_range(hdc, "SimSun", 59, test_cjk[0], &hfont, &hfont_orig, NULL); if (hfont != NULL) {
From: Ziqing Hui zhui@codeweavers.com
This fixes Chinese and Japanese text display issue for Sins of a Solar Empire: Rebellion. --- dlls/gdi32/uniscribe/usp10.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/gdi32/uniscribe/usp10.c b/dlls/gdi32/uniscribe/usp10.c index eb86048a6bd..75fc7b380a7 100644 --- a/dlls/gdi32/uniscribe/usp10.c +++ b/dlls/gdi32/uniscribe/usp10.c @@ -465,7 +465,7 @@ const scriptData scriptInformation[] = { MS_MAKE_TAG('k','h','m','r'), L"DaunPenh"}, {{Script_CJK_Han, 0, 0, 0, 0, 0, 0, { 0,0,0,0,0,0,0,0,0,0,0}}, {LANG_ENGLISH, 0, 0, 0, 0, ANSI_CHARSET, 0, 0, 0, 0, 0, 0, 1, 0, 0}, - MS_MAKE_TAG('h','a','n','i'), L""}, + MS_MAKE_TAG('h','a','n','i'), L"SimSun"}, {{Script_Ideograph, 0, 0, 0, 0, 0, 0, { 0,0,0,0,0,0,0,0,0,0,0}}, {LANG_ENGLISH, 0, 0, 0, 0, ANSI_CHARSET, 0, 0, 0, 0, 0, 0, 1, 0, 0}, MS_MAKE_TAG('h','a','n','i'), L""}, @@ -474,7 +474,7 @@ const scriptData scriptInformation[] = { MS_MAKE_TAG('b','o','p','o'), L""}, {{Script_Kana, 0, 0, 0, 0, 0, 0, { 0,0,0,0,0,0,0,0,0,0,0}}, {LANG_ENGLISH, 0, 0, 0, 0, ANSI_CHARSET, 0, 0, 0, 0, 0, 0, 1, 0, 0}, - MS_MAKE_TAG('k','a','n','a'), L""}, + MS_MAKE_TAG('k','a','n','a'), L"SimSun"}, {{Script_Hangul, 0, 0, 0, 0, 0, 0, { 0,0,0,0,0,0,0,0,0,0,0}}, {LANG_KOREAN, 0, 1, 0, 1, DEFAULT_CHARSET, 0, 0, 0, 0, 0, 0, 1, 0, 0}, MS_MAKE_TAG('h','a','n','g'), L""},