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 #ifndef UI_GFX_RENDER_TEXT_WIN_H_ | 5 #ifndef UI_GFX_RENDER_TEXT_WIN_H_ |
6 #define UI_GFX_RENDER_TEXT_WIN_H_ | 6 #define UI_GFX_RENDER_TEXT_WIN_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <usp10.h> | 9 #include <usp10.h> |
10 | 10 |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
88 virtual std::vector<Rect> GetSubstringBounds(ui::Range range) OVERRIDE; | 88 virtual std::vector<Rect> GetSubstringBounds(ui::Range range) OVERRIDE; |
89 virtual bool IsCursorablePosition(size_t position) OVERRIDE; | 89 virtual bool IsCursorablePosition(size_t position) OVERRIDE; |
90 virtual void ResetLayout() OVERRIDE; | 90 virtual void ResetLayout() OVERRIDE; |
91 virtual void EnsureLayout() OVERRIDE; | 91 virtual void EnsureLayout() OVERRIDE; |
92 virtual void DrawVisualText(Canvas* canvas) OVERRIDE; | 92 virtual void DrawVisualText(Canvas* canvas) OVERRIDE; |
93 | 93 |
94 private: | 94 private: |
95 void ItemizeLogicalText(); | 95 void ItemizeLogicalText(); |
96 void LayoutVisualText(); | 96 void LayoutVisualText(); |
97 | 97 |
98 // Helper function to update the font on a text run after font substitution. | |
99 void UpdateRunFont(internal::TextRun* run, int font_size); | |
msw
2012/04/12 21:32:14
nit: Consider renaming this ApplyFontSubstitute or
Alexei Svitkine (slow)
2012/04/13 13:56:15
Done.
| |
100 | |
98 // Returns a vector of linked fonts corresponding to |font|. | 101 // Returns a vector of linked fonts corresponding to |font|. |
99 const std::vector<Font>* GetLinkedFonts(const Font& font) const; | 102 const std::vector<Font>* GetLinkedFonts(const Font& font) const; |
100 | 103 |
101 // Return the run index that contains the argument; or the length of the | 104 // Return the run index that contains the argument; or the length of the |
102 // |runs_| vector if argument exceeds the text length or width. | 105 // |runs_| vector if argument exceeds the text length or width. |
103 size_t GetRunContainingCaret(const SelectionModel& caret) const; | 106 size_t GetRunContainingCaret(const SelectionModel& caret) const; |
104 size_t GetRunContainingPoint(const Point& point) const; | 107 size_t GetRunContainingPoint(const Point& point) const; |
105 | 108 |
106 // Given a |run|, returns the SelectionModel that contains the logical first | 109 // Given a |run|, returns the SelectionModel that contains the logical first |
107 // or last caret position inside (not at a boundary of) the run. | 110 // or last caret position inside (not at a boundary of) the run. |
(...skipping 21 matching lines...) Expand all Loading... | |
129 scoped_array<int> logical_to_visual_; | 132 scoped_array<int> logical_to_visual_; |
130 | 133 |
131 bool needs_layout_; | 134 bool needs_layout_; |
132 | 135 |
133 DISALLOW_COPY_AND_ASSIGN(RenderTextWin); | 136 DISALLOW_COPY_AND_ASSIGN(RenderTextWin); |
134 }; | 137 }; |
135 | 138 |
136 } // namespace gfx | 139 } // namespace gfx |
137 | 140 |
138 #endif // UI_GFX_RENDER_TEXT_WIN_H_ | 141 #endif // UI_GFX_RENDER_TEXT_WIN_H_ |
OLD | NEW |