From 0435f737a39aa8d6a0b8d567264dbfd02242c0d9 Mon Sep 17 00:00:00 2001 From: "jungshik@google.com" Date: Fri, 12 Sep 2008 17:07:55 +0000 Subject: Add a few more cases for Unicode blocks to script mapping. This is for next point release (of beta branch) to fix issue 1328. It includes Hironori's change to add a missing 'break'. ( http://codereview.chromium.org/1698 ) BUG=1328 TEST=After installing pandauk font (mentioned in 1328), go to http://my.wikipedia.org, copy and paste a Burmese word into the search box. It should be rendered as in the body (the rest) of the page. Review URL: http://codereview.chromium.org/2460 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2117 0039d316-1c4b-4281-b951-d872f2087c98 --- base/gfx/font_utils.cc | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/base/gfx/font_utils.cc b/base/gfx/font_utils.cc index 4bf72d1..d7e119a 100644 --- a/base/gfx/font_utils.cc +++ b/base/gfx/font_utils.cc @@ -68,9 +68,9 @@ struct ScriptToFontMapSingletonTraits {USCRIPT_KHMER, L"daunpenh"}, {USCRIPT_THAANA, L"mv boli"}, {USCRIPT_MONGOLIAN, L"mongolian balti"}, - // For common, perhaps we should return a font - // for the current application/system locale. - //{USCRIPT_COMMON, L"times new roman"} + {USCRIPT_MYANMAR, L"padauk"}, + // For USCRIPT_COMMON, we map blocks to scripts when + // that makes sense. }; ScriptToFontMap* new_instance = new ScriptToFontMap; @@ -210,7 +210,6 @@ const wchar_t* GetFallbackFamily(const wchar_t *characters, // by fonts for scripts closely related to them. // See http://unicode.org/cldr/utility/list-unicodeset.jsp?a=[:Script=Common:] // TODO(jungshik): make this more efficient with a wider coverage - // (Armenian, Georgian, Devanagari, etc) if (script == USCRIPT_COMMON || script == USCRIPT_INHERITED) { UBlockCode block = ublock_getCode(ucs4); switch (block) { @@ -223,8 +222,28 @@ const wchar_t* GetFallbackFamily(const wchar_t *characters, case UBLOCK_HIRAGANA: case UBLOCK_KATAKANA: script = USCRIPT_HIRAGANA; + break; case UBLOCK_ARABIC: script = USCRIPT_ARABIC; + break; + case UBLOCK_GREEK: + script = USCRIPT_GREEK; + break; + case UBLOCK_DEVANAGARI: + // For Danda and Double Danda (U+0964, U+0965), use a Devanagari + // font for now although they're used by other scripts as well. + // Without a context, we can't do any better. + script = USCRIPT_DEVANAGARI; + break; + case UBLOCK_ARMENIAN: + script = USCRIPT_ARMENIAN; + break; + case UBLOCK_GEORGIAN: + script = USCRIPT_GEORGIAN; + break; + case UBLOCK_KANNADA: + script = USCRIPT_KANNADA; + break; } } -- cgit v1.1