summaryrefslogtreecommitdiffstats
path: root/ui/gfx
diff options
context:
space:
mode:
authorasvitkine@chromium.org <asvitkine@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-23 20:13:29 +0000
committerasvitkine@chromium.org <asvitkine@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-23 20:13:29 +0000
commit77b1f1d0e61cdb351de88b9c7e12dfe4147f6702 (patch)
tree7d35264cfa44a908cb695b3409239afbd55ed04c /ui/gfx
parent9bbbc0761c37d495457c9bbf5d6873416043ec6b (diff)
downloadchromium_src-77b1f1d0e61cdb351de88b9c7e12dfe4147f6702.zip
chromium_src-77b1f1d0e61cdb351de88b9c7e12dfe4147f6702.tar.gz
chromium_src-77b1f1d0e61cdb351de88b9c7e12dfe4147f6702.tar.bz2
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
Diffstat (limited to 'ui/gfx')
-rw-r--r--ui/gfx/render_text_win.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/ui/gfx/render_text_win.cc b/ui/gfx/render_text_win.cc
index b50ccad..6323cca 100644
--- a/ui/gfx/render_text_win.cc
+++ b/ui/gfx/render_text_win.cc
@@ -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;
}