Index: third_party/WebKit/WebCore/platform/graphics/chromium/UniscribeHelper.cpp |
=================================================================== |
--- third_party/WebKit/WebCore/platform/graphics/chromium/UniscribeHelper.cpp (revision 7936) |
+++ third_party/WebKit/WebCore/platform/graphics/chromium/UniscribeHelper.cpp (working copy) |
@@ -86,6 +86,8 @@ |
, m_spaceWidth(0) |
, m_wordSpacing(0) |
, m_ascent(0) |
+ , m_disableFontFallback(false) |
+ |
{ |
m_logfont.lfFaceName[0] = 0; |
} |
@@ -508,7 +510,10 @@ |
HDC tempDC = NULL; |
HGDIOBJ oldFont = 0; |
HRESULT hr; |
- bool lastFallbackTried = false; |
+ // When used to fill up glyph pages for simple scripts in non-BMP, |
+ // we don't want any font fallback in this class. The simple script |
+ // font path can take care of font fallback. |
+ bool lastFallbackTried = m_disableFontFallback; |
bool result; |
int generatedGlyphs = 0; |
@@ -572,7 +577,8 @@ |
tempDC = NULL; |
} |
- if (NextWinFontData(&hfont, &scriptCache, &fontProperties, &ascent)) { |
+ if (!m_disableFontFallback && |
+ NextWinFontData(&hfont, &scriptCache, &fontProperties, &ascent)) { |
// The primary font does not support this run. Try next font. |
// In case of web page rendering, they come from fonts specified in |
// CSS stylesheets. |
@@ -688,6 +694,13 @@ |
shaping)) |
continue; |
+ // At the moment, the only time m_disableFontFallback is set is |
+ // when we look up glyph indices for non-BMP code ranges. So, |
+ // we can skip the glyph placement. When that becomes not the case |
+ // any more, we have to add a new flag to control glyph placement. |
+ if (m_disableFontFallback) |
+ continue; |
+ |
// Compute placements. Note that offsets is documented incorrectly |
// and is actually an array. |