Index: webkit/port/platform/graphics/chromium/SimpleFontDataLinux.cpp |
diff --git a/webkit/port/platform/graphics/chromium/SimpleFontDataLinux.cpp b/webkit/port/platform/graphics/chromium/SimpleFontDataLinux.cpp |
index 8e0e3f6d4b0e5d0a3d88309f962509cd2cd2bba4..7b8a75e9f29ddb35f1f18c060216d69c84a7c1b3 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'; |
ojan
2008/11/26 00:17:45
Why "x" as the fallback? This is what Firefox uses
agl
2008/11/26 00:22:19
Microsoft documents suggest using the 'x' width an
|
+ m_avgCharWidth = widthForGlyph(glyphPageZero->glyphDataForCharacter(x_char).glyph); |
+ } |
} |
void SimpleFontData::platformDestroy() |