Index: Source/platform/fonts/SimpleFontData.cpp |
diff --git a/Source/platform/fonts/SimpleFontData.cpp b/Source/platform/fonts/SimpleFontData.cpp |
index 67465b0e667b14ce859306629931729353f20665..34b5a2c45616abb8483889f0687f279cf6cad0d1 100644 |
--- a/Source/platform/fonts/SimpleFontData.cpp |
+++ b/Source/platform/fonts/SimpleFontData.cpp |
@@ -40,6 +40,7 @@ |
#include "platform/fonts/VDMXParser.h" |
#include "platform/geometry/FloatRect.h" |
#include "wtf/MathExtras.h" |
+#include "wtf/unicode/CharacterNames.h" |
#include "wtf/unicode/Unicode.h" |
#include <unicode/normlzr.h> |
@@ -275,12 +276,14 @@ void SimpleFontData::platformGlyphInit() |
return; |
} |
+ // Ask for the glyph for 0 to avoid paging in ZERO WIDTH SPACE. Control characters, including 0, |
+ // are mapped to the ZERO WIDTH SPACE glyph. |
m_zeroWidthSpaceGlyph = glyphPageZero->glyphForCharacter(0); |
// Nasty hack to determine if we should round or ceil space widths. |
// If the font is monospace or fake monospace we ceil to ensure that |
// every character and the space are the same width. Otherwise we round. |
- m_spaceGlyph = glyphPageZero->glyphForCharacter(' '); |
+ m_spaceGlyph = glyphPageZero->glyphForCharacter(space); |
float width = widthForGlyph(m_spaceGlyph); |
m_spaceWidth = width; |
m_zeroGlyph = glyphPageZero->glyphForCharacter('0'); |
@@ -289,8 +292,6 @@ void SimpleFontData::platformGlyphInit() |
// Force the glyph for ZERO WIDTH SPACE to have zero width, unless it is shared with SPACE. |
// Helvetica is an example of a non-zero width ZERO WIDTH SPACE glyph. |
// See <http://bugs.webkit.org/show_bug.cgi?id=13178> |
- // Ask for the glyph for 0 to avoid paging in ZERO WIDTH SPACE. Control characters, including 0, |
- // are mapped to the ZERO WIDTH SPACE glyph. |
if (m_zeroWidthSpaceGlyph == m_spaceGlyph) { |
m_zeroWidthSpaceGlyph = 0; |
WTF_LOG_ERROR("Font maps SPACE and ZERO WIDTH SPACE to the same glyph. Glyph width will not be overridden."); |