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

Unified Diff: ui/gfx/platform_font_win.cc

Issue 11087016: Create font with DEFAULT_CHARSET instead of ANSI_CHARSET. (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 2 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 | « no previous file | ui/gfx/render_text_win.cc » ('j') | ui/gfx/render_text_win.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/platform_font_win.cc
===================================================================
--- ui/gfx/platform_font_win.cc (revision 160607)
+++ ui/gfx/platform_font_win.cc (working copy)
@@ -98,8 +98,14 @@
if (GetHeight() > height) {
const int min_font_size = GetMinimumFontSize();
Font font = DeriveFont(-1, style);
- while (font.GetHeight() > height && font.GetFontSize() != min_font_size) {
+ int font_height = font.GetHeight();
+ int font_size = font.GetFontSize();
+ while (font_height > height && font_size != min_font_size) {
font = font.DeriveFont(-1, style);
+ if (font_height == font.GetHeight() && font_size == font.GetFontSize())
+ break;
+ font_height = font.GetHeight();
+ font_size = font.GetFontSize();
}
return font;
}
@@ -193,8 +199,8 @@
void PlatformFontWin::InitWithFontNameAndSize(const std::string& font_name,
int font_size) {
Vitaly Buka (NO REVIEWS) 2012/10/09 06:09:42 This also fixes hang and makes visible work. I sti
- HFONT hf = ::CreateFont(-font_size, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- UTF8ToUTF16(font_name).c_str());
+ HFONT hf = ::CreateFont(-font_size, 0, 0, 0, 0, 0, 0, 0, DEFAULT_CHARSET, 0,
msw 2012/10/12 20:50:57 MSDN indicates that this picks a char set "based o
Vitaly Buka (NO REVIEWS) 2012/10/12 21:11:33 I guess with ANSI_CHARSET it's consistent in sense
+ 0, 0, 0, UTF8ToUTF16(font_name).c_str());
font_ref_ = CreateHFontRef(hf);
}
« no previous file with comments | « no previous file | ui/gfx/render_text_win.cc » ('j') | ui/gfx/render_text_win.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698