 Chromium Code Reviews
 Chromium Code Reviews Issue 11087016:
  Create font with DEFAULT_CHARSET instead of ANSI_CHARSET.  (Closed) 
  Base URL: https://src.chromium.org/chrome/trunk/src/
    
  
    Issue 11087016:
  Create font with DEFAULT_CHARSET instead of ANSI_CHARSET.  (Closed) 
  Base URL: https://src.chromium.org/chrome/trunk/src/| 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); | 
| } |