summaryrefslogtreecommitdiffstats
path: root/ui/gfx/render_text_win.cc
diff options
context:
space:
mode:
Diffstat (limited to 'ui/gfx/render_text_win.cc')
-rw-r--r--ui/gfx/render_text_win.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/ui/gfx/render_text_win.cc b/ui/gfx/render_text_win.cc
index b821a44..d982c3d 100644
--- a/ui/gfx/render_text_win.cc
+++ b/ui/gfx/render_text_win.cc
@@ -74,7 +74,10 @@ bool ChooseFallbackFont(HDC hdc,
log_font.lfFaceName[0] = 0;
EnumEnhMetaFile(0, meta_file, MetaFileEnumProc, &log_font, NULL);
if (log_font.lfFaceName[0]) {
+ int font_style = font.GetStyle();
*result = gfx::Font(UTF16ToUTF8(log_font.lfFaceName), font.GetFontSize());
+ if (result->GetStyle() != font_style)
+ *result = result->DeriveFont(0, font_style);
found_fallback = true;
}
}
@@ -510,7 +513,7 @@ void RenderTextWin::ItemizeLogicalText() {
for (int run_break = 0; run_break < text_length;) {
internal::TextRun* run = new internal::TextRun();
run->range.set_start(run_break);
- run->font = GetFont();
+ run->font = GetFont().DeriveFont(0, style->font_style);
run->foreground = style->foreground;
run->strike = style->strike;
run->underline = style->underline;