OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/gfx/render_text_win.h" | 5 #include "ui/gfx/render_text_win.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/i18n/break_iterator.h" | 9 #include "base/i18n/break_iterator.h" |
10 #include "base/i18n/char_iterator.h" | 10 #include "base/i18n/char_iterator.h" |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 return; | 114 return; |
115 } | 115 } |
116 | 116 |
117 const int current_style = (font->GetStyle() & kStyleMask); | 117 const int current_style = (font->GetStyle() & kStyleMask); |
118 const int current_size = font->GetFontSize(); | 118 const int current_size = font->GetFontSize(); |
119 if (current_style != target_style || current_size != font_size) | 119 if (current_style != target_style || current_size != font_size) |
120 *font = font->DeriveFont(font_size - current_size, target_style); | 120 *font = font->DeriveFont(font_size - current_size, target_style); |
121 } | 121 } |
122 | 122 |
123 // Returns true if |c| is a Unicode BiDi control character. | 123 // Returns true if |c| is a Unicode BiDi control character. |
124 bool IsUnicodeBidiControlCharacter(char16 c) { | 124 bool IsUnicodeBidiControlCharacter(base::char16 c) { |
125 return c == base::i18n::kRightToLeftMark || | 125 return c == base::i18n::kRightToLeftMark || |
126 c == base::i18n::kLeftToRightMark || | 126 c == base::i18n::kLeftToRightMark || |
127 c == base::i18n::kLeftToRightEmbeddingMark || | 127 c == base::i18n::kLeftToRightEmbeddingMark || |
128 c == base::i18n::kRightToLeftEmbeddingMark || | 128 c == base::i18n::kRightToLeftEmbeddingMark || |
129 c == base::i18n::kPopDirectionalFormatting || | 129 c == base::i18n::kPopDirectionalFormatting || |
130 c == base::i18n::kLeftToRightOverride || | 130 c == base::i18n::kLeftToRightOverride || |
131 c == base::i18n::kRightToLeftOverride; | 131 c == base::i18n::kRightToLeftOverride; |
132 } | 132 } |
133 | 133 |
134 // Returns the corresponding glyph range of the given character range. | 134 // Returns the corresponding glyph range of the given character range. |
(...skipping 1134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1269 size_t position = LayoutIndexToTextIndex(run->range.end()); | 1269 size_t position = LayoutIndexToTextIndex(run->range.end()); |
1270 position = IndexOfAdjacentGrapheme(position, CURSOR_BACKWARD); | 1270 position = IndexOfAdjacentGrapheme(position, CURSOR_BACKWARD); |
1271 return SelectionModel(position, CURSOR_FORWARD); | 1271 return SelectionModel(position, CURSOR_FORWARD); |
1272 } | 1272 } |
1273 | 1273 |
1274 RenderText* RenderText::CreateInstance() { | 1274 RenderText* RenderText::CreateInstance() { |
1275 return new RenderTextWin; | 1275 return new RenderTextWin; |
1276 } | 1276 } |
1277 | 1277 |
1278 } // namespace gfx | 1278 } // namespace gfx |
OLD | NEW |