Fix RenderTextWin font linking with custom fonts.

Call ScriptGetFontProperties() lazily, only right
before its output is needed. This makes sure that
the correct font's properties are used to determine
if there are missing glyphs when going through the
fallback / linking path.

BUG=124453, 105550
TEST=See http://crbug.com/124453.

Review URL: http://codereview.chromium.org/10189001

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@133505 0039d316-1c4b-4281-b951-d872f2087c98
parent 9bbbc076
......@@ -601,10 +601,9 @@ void RenderTextWin::LayoutVisualText() {
// Select the font desired for glyph generation.
SelectObject(cached_hdc_, run->font.GetNativeFont());
SCRIPT_FONTPROPERTIES font_properties;
memset(&font_properties, 0, sizeof(font_properties));
font_properties.cBytes = sizeof(SCRIPT_FONTPROPERTIES);
ScriptGetFontProperties(cached_hdc_, &run->script_cache, &font_properties);
SCRIPT_FONTPROPERTIES properties;
memset(&properties, 0, sizeof(properties));
properties.cBytes = sizeof(properties);
run->logical_clusters.reset(new WORD[run_length]);
run->glyph_count = 0;
......@@ -632,8 +631,9 @@ void RenderTextWin::LayoutVisualText() {
} else if (hr == S_OK) {
// If |hr| is S_OK, there could still be missing glyphs in the output,
// see: http://msdn.microsoft.com/en-us/library/windows/desktop/dd368564.aspx
ScriptGetFontProperties(cached_hdc_, &run->script_cache, &properties);
for (int i = 0; i < run->glyph_count; ++i) {
if (run->glyphs[i] == font_properties.wgDefault) {
if (run->glyphs[i] == properties.wgDefault) {
glyphs_missing = true;
break;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment