Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(511)

Unified Diff: Source/platform/fonts/SimpleFontData.cpp

Issue 1060113003: Blink use old style character string notation for Unicode (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase patch Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/layout/line/BreakingContextInlineHeaders.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.");
« no previous file with comments | « Source/core/layout/line/BreakingContextInlineHeaders.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698