summaryrefslogtreecommitdiffstats
path: root/webkit/port/platform
diff options
context:
space:
mode:
authorjungshik@google.com <jungshik@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-22 21:07:03 +0000
committerjungshik@google.com <jungshik@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-22 21:07:03 +0000
commit2d5cdce4c2389657ad844a2456f00759806c2371 (patch)
treeddefd9df7b0df90b0f0e8f5e73cabcdce7357f91 /webkit/port/platform
parent4915a6945f7b2817e483eaa3d502a9e009b16c4d (diff)
downloadchromium_src-2d5cdce4c2389657ad844a2456f00759806c2371.zip
chromium_src-2d5cdce4c2389657ad844a2456f00759806c2371.tar.gz
chromium_src-2d5cdce4c2389657ad844a2456f00759806c2371.tar.bz2
Not checking whether a font covers a character or not for LATIN make a lot of
characters otherwise supported by a font the system. Not checking would not save any time, either for the most common case (English or Western European). In other words, checking it would not slow them down. This is a regression and affects Vietnamese (when no font is specified at all). Besides, add some more fonts to the font fallback list (4 Chinese fonts to cover CJK Ext. A), FreeSerif/FreeSans and Gentium/GentiumAlt to cover a wider range of non-CJK BMP characters including Latin, Greek Cyrillic and other less-used scripts. These fonts are not usually installed on Windows, but 'geeks' tend to install them and they would make a loud noise if Chrome does not make use of them. Note: Somehow gcl created a new issue (although I just wanted to update my CL for issue 1385 : http://chrome-reviews.prom.corp.google.com/1385). The previous CL was already in the branch and was ok'd by Brett. (the change since issue 1385 is adding several fonts to the list). So, I'm TBR'ing it. BUG=1317551 TEST=http://unicode.org/cldr/utility/list-unicodeset.jsp?a=[:Script=Latin:] TBR=brettw git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1242 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/port/platform')
-rw-r--r--webkit/port/platform/graphics/FontCacheWin.cpp52
1 files changed, 41 insertions, 11 deletions
diff --git a/webkit/port/platform/graphics/FontCacheWin.cpp b/webkit/port/platform/graphics/FontCacheWin.cpp
index 480dbd9..caa1bde 100644
--- a/webkit/port/platform/graphics/FontCacheWin.cpp
+++ b/webkit/port/platform/graphics/FontCacheWin.cpp
@@ -170,6 +170,29 @@ static bool LookupAltName(const String& name, String& altName)
// 標楷體, DFKai-SB
{L"\x6A19\x6977\x9AD4", {L"DFKai-SB", 950}},
{L"dfkai-sb", {L"\x6A19\x6977\x9AD4", 950}},
+ // WenQuanYi Zen Hei
+ {L"\x6587\x6cc9\x9a5b\x6b63\x9ed1", {L"WenQuanYi Zen Hei", 950}},
+ {L"wenquanyi zen hei", {L"\x6587\x6cc9\x9a5b\x6b63\x9ed1", 950}},
+ // WenQuanYi Zen Hei
+ {L"\x6587\x6cc9\x9a7f\x6b63\x9ed1", {L"WenQuanYi Zen Hei", 936}},
+ {L"wenquanyi zen hei", {L"\x6587\x6cc9\x9a7f\x6b63\x9ed1", 936}},
+ // AR PL ShanHeiSun Uni,
+ {L"\x6587\x9f0e\x0050\x004c\x7d30\x4e0a\x6d77\x5b8b\x0055\x006e\x0069",
+ {L"AR PL ShanHeiSun Uni", 950}},
+ {L"ar pl shanheisun uni",
+ {L"\x6587\x9f0e\x0050\x004c\x7d30\x4e0a\x6d77\x5b8b\x0055\x006e\x0069", 950}},
+ // AR PL ShanHeiSun Uni,
+ {L"\x6587\x9f0e\x0050\x004c\x7ec6\x4e0a\x6d77\x5b8b\x0055\x006e\x0069",
+ {L"AR PL ShanHeiSun Uni", 936}},
+ {L"ar pl shanheisun uni",
+ {L"\x6587\x9f0e\x0050\x004c\x7ec6\x4e0a\x6d77\x5b8b\x0055\x006e\x0069", 936}},
+ // AR PL ZenKai Uni
+ // Traditional Chinese (950) and Simplified Chinese (936) names are
+ // identical.
+ {L"\x6587\x0050\x004C\x4E2D\x6977\x0055\x006E\x0069", {L"AR PL ZenKai Uni", 950}},
+ {L"ar pl zenkai uni", {L"\x6587\x0050\x004C\x4E2D\x6977\x0055\x006E\x0069", 950}},
+ {L"\x6587\x0050\x004C\x4E2D\x6977\x0055\x006E\x0069", {L"AR PL ZenKai Uni", 936}},
+ {L"ar pl zenkai uni", {L"\x6587\x0050\x004C\x4E2D\x6977\x0055\x006E\x0069", 936}},
};
typedef stdext::hash_map<std::wstring, const fontCodepage*> nameMap;
@@ -344,17 +367,30 @@ const SimpleFontData* FontCache::getFontDataForCharacters(const Font& font,
L"simsun",
L"gulim",
L"pmingliu",
- L"code2000",
- L"bitstream cyberbit",
- L"titus cyberbit basic",
+ L"wenquanyi zen hei", // partial CJK Ext. A coverage but more
+ // widely known to Chinese users.
+ L"ar pl shanheisun uni",
+ L"ar pl zenkai uni",
+ L"han nom a", // Complete CJK Ext. A coverage
+ L"code2000", // Complete CJK Ext. A coverage
+ // CJK Ext. B fonts are not listed here because it's of no use
+ // with our current non-BMP character handling because we use
+ // Uniscribe for it and that code path does not go through here.
+ // This will be fixed when we move a bulk of this to base/gfx.
};
const static wchar_t* const commonFonts[] = {
+ L"tahoma",
L"arial unicode ms",
- L"tahoma",
L"microsoft sans serif",
L"lucida sans unicode",
L"palatino linotype",
+ // Four fonts below (code2000 at the end) are not from MS, but
+ // once installed, cover a very wide range of characters.
+ L"freeserif",
+ L"freesans",
+ L"gentium",
+ L"gentiumalt",
L"ms pgothic",
L"simsun",
L"gulim",
@@ -375,13 +411,8 @@ const SimpleFontData* FontCache::getFontDataForCharacters(const Font& font,
// because it's based on script to font mapping. This problem is
// critical enough for non-Latin scripts (especially Han) to
// warrant an additional (real coverage) check with fontCotainsCharacter.
- // In case of Latin, just trust that it covers a character and
- // skip the coverage check as long as the font is available
- // (i.e. |data| is not NULL).
int i;
- for (i = 0;
- (!data ||
- (script != USCRIPT_LATIN && !fontContainsCharacter(data, family, c)))
+ for (i = 0; (!data || !fontContainsCharacter(data, family, c))
&& i < numFonts; ++i) {
family = panUniFonts[i];
data = getCachedFontPlatformData(font.fontDescription(),
@@ -610,4 +641,3 @@ FontPlatformData* FontCache::createFontPlatformData(const FontDescription& fontD
}
}
-