diff options
author | jungshik@google.com <jungshik@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-12 17:07:55 +0000 |
---|---|---|
committer | jungshik@google.com <jungshik@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-12 17:07:55 +0000 |
commit | 0435f737a39aa8d6a0b8d567264dbfd02242c0d9 (patch) | |
tree | 70d610c56882c4a4e2f8b5ece1eb1104daae7128 /base/gfx | |
parent | b98a1b6cc056e6f78737a1c587eb179b064b4789 (diff) | |
download | chromium_src-0435f737a39aa8d6a0b8d567264dbfd02242c0d9.zip chromium_src-0435f737a39aa8d6a0b8d567264dbfd02242c0d9.tar.gz chromium_src-0435f737a39aa8d6a0b8d567264dbfd02242c0d9.tar.bz2 |
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
Diffstat (limited to 'base/gfx')
-rw-r--r-- | base/gfx/font_utils.cc | 27 |
1 files 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; } } |