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

Unified Diff: ui/gfx/render_text_win.cc

Issue 10696058: Ignore Unicode BiDi control characters in missing glyphs check in RenderTextWin. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 6 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/render_text_win.cc
===================================================================
--- ui/gfx/render_text_win.cc (revision 144927)
+++ ui/gfx/render_text_win.cc (working copy)
@@ -224,6 +224,17 @@
*font = font->DeriveFont(font_size - current_size, font_style);
}
+// Returns true if |c| is a Unicode BiDi control character.
+bool IsUnicodeBidiControlCharacter(char16 c) {
+ return c == base::i18n::kRightToLeftMark ||
+ c == base::i18n::kLeftToRightMark ||
+ c == base::i18n::kLeftToRightEmbeddingMark ||
+ c == base::i18n::kRightToLeftEmbeddingMark ||
+ c == base::i18n::kPopDirectionalFormatting ||
+ c == base::i18n::kLeftToRightOverride ||
+ c == base::i18n::kRightToLeftOverride;
+}
+
} // namespace
namespace internal {
@@ -844,7 +855,8 @@
// See: http://crbug.com/125629
if (run->glyphs[glyph_index] == properties.wgBlank &&
run->visible_attributes[glyph_index].fZeroWidth &&
- !IsWhitespace(run_text[char_index])) {
+ !IsWhitespace(run_text[char_index]) &&
+ !IsUnicodeBidiControlCharacter(run_text[char_index])) {
xji 2012/06/29 23:13:19 so, it always return wgBlank && fZeroWidth for bid
Alexei Svitkine (slow) 2012/06/29 23:26:03 We don't care about the cases where it doesn't ret
return true;
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698