Chromium Code Reviews| Index: ui/gfx/render_text_win.cc |
| =================================================================== |
| --- ui/gfx/render_text_win.cc (revision 133499) |
| +++ ui/gfx/render_text_win.cc (working copy) |
| @@ -597,6 +597,7 @@ |
| bool tried_fallback = false; |
| size_t linked_font_index = 0; |
| const std::vector<Font>* linked_fonts = NULL; |
| + Font original_font = run->font; |
| // Select the font desired for glyph generation. |
| SelectObject(cached_hdc_, run->font.GetNativeFont()); |
| @@ -661,9 +662,17 @@ |
| // The meta file approach did not yield a replacement font, try to find |
| // one using font linking. First time through, get the linked fonts list. |
| - if (linked_fonts == NULL) |
| - linked_fonts = GetLinkedFonts(run->font); |
| + if (linked_fonts == NULL) { |
| + // First, try to get the list for the original font. |
| + linked_fonts = GetLinkedFonts(original_font); |
| + // If there are no linked fonts for the original font, try querying the |
| + // ones for the Uniscribe fallback font. This may happen if the first |
| + // font is a custom font that has no linked fonts in the Registry. |
|
msw
2012/04/23 20:20:59
nit: Should registry be capitalized? Are you refer
Alexei Svitkine (slow)
2012/04/23 21:13:14
Yes, the Windows Registry. It's capitalized in the
|
| + if (linked_fonts->empty()) |
| + linked_fonts = GetLinkedFonts(run->font); |
|
msw
2012/04/23 20:20:59
Have you considered appending the linked fonts for
Alexei Svitkine (slow)
2012/04/23 21:13:14
I've thought about it, but decided to keep it up m
msw
2012/04/24 00:05:11
Cool, how about a TODO or less directed/actionable
|
| + } |
| + |
| // None of the linked fonts worked, break out of the loop. |
| if (linked_font_index == linked_fonts->size()) { |
| // TODO(msw): Don't use SCRIPT_UNDEFINED. Apparently Uniscribe can |