summaryrefslogtreecommitdiffstats
path: root/webkit/port
diff options
context:
space:
mode:
authoragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-26 00:23:23 +0000
committeragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-26 00:23:23 +0000
commitf42d28c678cd72979d64eebed9ea879c59e2576a (patch)
treef5212da1c6af24ec4b4dd82acea43b0335725b7b /webkit/port
parent5374a134f5547566ed821cceb9393201e4f68606 (diff)
downloadchromium_src-f42d28c678cd72979d64eebed9ea879c59e2576a.zip
chromium_src-f42d28c678cd72979d64eebed9ea879c59e2576a.tar.gz
chromium_src-f42d28c678cd72979d64eebed9ea879c59e2576a.tar.bz2
Linux: match average char width with Windows
Review URL: http://codereview.chromium.org/12656 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6017 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/port')
-rw-r--r--webkit/port/platform/graphics/chromium/FontCacheLinux.cpp3
-rw-r--r--webkit/port/platform/graphics/chromium/SimpleFontDataLinux.cpp9
2 files changed, 8 insertions, 4 deletions
diff --git a/webkit/port/platform/graphics/chromium/FontCacheLinux.cpp b/webkit/port/platform/graphics/chromium/FontCacheLinux.cpp
index 7a0606c..ab37374 100644
--- a/webkit/port/platform/graphics/chromium/FontCacheLinux.cpp
+++ b/webkit/port/platform/graphics/chromium/FontCacheLinux.cpp
@@ -42,7 +42,6 @@ const AtomicString& FontCache::alternateFamilyName(const AtomicString& familyNam
FontPlatformData* FontCache::getSimilarFontPlatformData(const Font& font)
{
- notImplemented();
return 0;
}
@@ -111,7 +110,7 @@ AtomicString FontCache::getGenericFontForScript(UScriptCode script,
const FontDescription&)
{
notImplemented();
- return AtomicString();
+ return AtomicString("Times New Roman");
}
} // namespace WebCore
diff --git a/webkit/port/platform/graphics/chromium/SimpleFontDataLinux.cpp b/webkit/port/platform/graphics/chromium/SimpleFontDataLinux.cpp
index 8e0e3f6..7b8a75e 100644
--- a/webkit/port/platform/graphics/chromium/SimpleFontDataLinux.cpp
+++ b/webkit/port/platform/graphics/chromium/SimpleFontDataLinux.cpp
@@ -52,10 +52,15 @@ void SimpleFontData::platformInit()
if (!glyphPageZero)
return;
- static const UChar32 e_char = 'e';
static const UChar32 M_char = 'M';
- m_avgCharWidth = widthForGlyph(glyphPageZero->glyphDataForCharacter(e_char).glyph);
m_maxCharWidth = widthForGlyph(glyphPageZero->glyphDataForCharacter(M_char).glyph);
+
+ if (metrics.fAvgCharWidth) {
+ m_avgCharWidth = SkScalarRound(metrics.fAvgCharWidth);
+ } else {
+ static const UChar32 x_char = 'x';
+ m_avgCharWidth = widthForGlyph(glyphPageZero->glyphDataForCharacter(x_char).glyph);
+ }
}
void SimpleFontData::platformDestroy()