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

Side by Side Diff: ui/gfx/render_text.h

Issue 8575020: Improve RenderTextWin font fallback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: sync Created 9 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | ui/gfx/render_text.cc » ('j') | ui/gfx/render_text.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef UI_GFX_RENDER_TEXT_H_ 5 #ifndef UI_GFX_RENDER_TEXT_H_
6 #define UI_GFX_RENDER_TEXT_H_ 6 #define UI_GFX_RENDER_TEXT_H_
7 #pragma once 7 #pragma once
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <vector> 10 #include <vector>
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 virtual SelectionModel GetLeftSelectionModel(const SelectionModel& current, 202 virtual SelectionModel GetLeftSelectionModel(const SelectionModel& current,
203 BreakType break_type); 203 BreakType break_type);
204 virtual SelectionModel GetRightSelectionModel(const SelectionModel& current, 204 virtual SelectionModel GetRightSelectionModel(const SelectionModel& current,
205 BreakType break_type); 205 BreakType break_type);
206 206
207 // Get the SelectionModels corresponding to visual text ends. 207 // Get the SelectionModels corresponding to visual text ends.
208 // The returned value represents a cursor/caret position without a selection. 208 // The returned value represents a cursor/caret position without a selection.
209 virtual SelectionModel LeftEndSelectionModel(); 209 virtual SelectionModel LeftEndSelectionModel();
210 virtual SelectionModel RightEndSelectionModel(); 210 virtual SelectionModel RightEndSelectionModel();
211 211
212 // Get the logical index of the grapheme preceeding the argument |position|. 212 // Get the logical index of the grapheme preceding the argument |position|.
213 virtual size_t GetIndexOfPreviousGrapheme(size_t position); 213 virtual size_t GetIndexOfPreviousGrapheme(size_t position);
214 214
215 // Get the visual bounds containing the logical substring within |from| to 215 // Get the visual bounds containing the logical substring within |from| to
216 // |to|. These bounds could be visually discontinuous if the substring is 216 // |to|. These bounds could be visually discontinuous if the substring is
217 // split by a LTR/RTL level change. These bounds are in local coordinates, but 217 // split by a LTR/RTL level change. These bounds are in local coordinates, but
218 // may be outside the visible region if the text is longer than the textfield. 218 // may be outside the visible region if the text is longer than the textfield.
219 // Subsequent text, cursor, or bounds changes may invalidate returned values. 219 // Subsequent text, cursor, or bounds changes may invalidate returned values.
220 // TODO(msw) Re-evaluate this function's necessity and signature. 220 // TODO(msw) Re-evaluate this function's necessity and signature.
221 virtual std::vector<Rect> GetSubstringBounds(size_t from, size_t to); 221 virtual std::vector<Rect> GetSubstringBounds(size_t from, size_t to);
222 222
223 // Return true if cursor can appear in front of the character at |position|, 223 // Returns true if the cursor can appear at the specified location, which
224 // which means it is a grapheme boundary or the first character in the text. 224 // means it is a grapheme boundary or the first character in the text. If
225 virtual bool IsCursorablePosition(size_t position) = 0; 225 // |is_trailing| is false, the location specified is in front of the character
226 // at index |position|, otherwise the location corresponds to the end of the
227 // character.
228 virtual bool IsCursorablePosition(size_t position, bool is_trailing) = 0;
msw 2011/11/29 20:42:00 Can this take a SelectionModel::CaretPlacement ins
226 229
227 // Updates the layout so that the next draw request can correctly 230 // Updates the layout so that the next draw request can correctly
228 // render the text and its attributes. 231 // render the text and its attributes.
229 virtual void UpdateLayout() = 0; 232 virtual void UpdateLayout() = 0;
230 233
231 // Apply composition style (underline) to composition range and selection 234 // Apply composition style (underline) to composition range and selection
232 // style (foreground) to selection range. 235 // style (foreground) to selection range.
233 void ApplyCompositionAndSelectionStyles(StyleRanges* style_ranges) const; 236 void ApplyCompositionAndSelectionStyles(StyleRanges* style_ranges) const;
234 237
235 // Convert points from the text space to the view space and back. 238 // Convert points from the text space to the view space and back.
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 // The cached bounds and offset are invalidated by changes to the cursor, 299 // The cached bounds and offset are invalidated by changes to the cursor,
297 // selection, font, and other operations that adjust the visible text bounds. 300 // selection, font, and other operations that adjust the visible text bounds.
298 bool cached_bounds_and_offset_valid_; 301 bool cached_bounds_and_offset_valid_;
299 302
300 DISALLOW_COPY_AND_ASSIGN(RenderText); 303 DISALLOW_COPY_AND_ASSIGN(RenderText);
301 }; 304 };
302 305
303 } // namespace gfx 306 } // namespace gfx
304 307
305 #endif // UI_GFX_RENDER_TEXT_H_ 308 #endif // UI_GFX_RENDER_TEXT_H_
OLDNEW
« no previous file with comments | « no previous file | ui/gfx/render_text.cc » ('j') | ui/gfx/render_text.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698