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

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

Issue 8565011: Implement font fallback in RenderTextWin. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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_win.cc » ('j') | ui/gfx/render_text_win.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_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 25 matching lines...) Expand all
36 SCRIPT_ANALYSIS script_analysis; 36 SCRIPT_ANALYSIS script_analysis;
37 37
38 scoped_array<WORD> glyphs; 38 scoped_array<WORD> glyphs;
39 scoped_array<WORD> logical_clusters; 39 scoped_array<WORD> logical_clusters;
40 scoped_array<SCRIPT_VISATTR> visible_attributes; 40 scoped_array<SCRIPT_VISATTR> visible_attributes;
41 int glyph_count; 41 int glyph_count;
42 42
43 scoped_array<int> advance_widths; 43 scoped_array<int> advance_widths;
44 scoped_array<GOFFSET> offsets; 44 scoped_array<GOFFSET> offsets;
45 ABC abc_widths; 45 ABC abc_widths;
46 SCRIPT_CACHE script_cache;
46 47
47 private: 48 private:
48 DISALLOW_COPY_AND_ASSIGN(TextRun); 49 DISALLOW_COPY_AND_ASSIGN(TextRun);
49 }; 50 };
50 51
51 } // namespace internal 52 } // namespace internal
52 53
53 // RenderTextWin is the Windows implementation of RenderText using Uniscribe. 54 // RenderTextWin is the Windows implementation of RenderText using Uniscribe.
54 class RenderTextWin : public RenderText { 55 class RenderTextWin : public RenderText {
55 public: 56 public:
(...skipping 26 matching lines...) Expand all
82 void LayoutVisualText(); 83 void LayoutVisualText();
83 84
84 // Return the run index that contains the argument; or the length of the 85 // Return the run index that contains the argument; or the length of the
85 // |runs_| vector if argument exceeds the text length or width. 86 // |runs_| vector if argument exceeds the text length or width.
86 size_t GetRunContainingPosition(size_t position) const; 87 size_t GetRunContainingPosition(size_t position) const;
87 size_t GetRunContainingPoint(const Point& point) const; 88 size_t GetRunContainingPoint(const Point& point) const;
88 89
89 // Given a |run|, returns the SelectionModel that contains the logical first 90 // Given a |run|, returns the SelectionModel that contains the logical first
90 // or last caret position inside (not at a boundary of) the run. 91 // or last caret position inside (not at a boundary of) the run.
91 // The returned value represents a cursor/caret position without a selection. 92 // The returned value represents a cursor/caret position without a selection.
92 SelectionModel FirstSelectionModelInsideRun(internal::TextRun*); 93 SelectionModel FirstSelectionModelInsideRun(internal::TextRun* run);
93 SelectionModel LastSelectionModelInsideRun(internal::TextRun*); 94 SelectionModel LastSelectionModelInsideRun(internal::TextRun* run);
94 95
95 // Get the selection model visually left/right of |selection| by one grapheme. 96 // Get the selection model visually left/right of |selection| by one grapheme.
96 // The returned value represents a cursor/caret position without a selection. 97 // The returned value represents a cursor/caret position without a selection.
97 SelectionModel LeftSelectionModel(const SelectionModel& selection); 98 SelectionModel LeftSelectionModel(const SelectionModel& selection);
98 SelectionModel RightSelectionModel(const SelectionModel& selection); 99 SelectionModel RightSelectionModel(const SelectionModel& selection);
99 100
100 // Draw the text, cursor, and selection. 101 // Draw the text, cursor, and selection.
101 void DrawSelection(Canvas* canvas); 102 void DrawSelection(Canvas* canvas);
102 void DrawVisualText(Canvas* canvas); 103 void DrawVisualText(Canvas* canvas);
103 void DrawCursor(Canvas* canvas); 104 void DrawCursor(Canvas* canvas);
104 105
105 bool text_is_dirty_; 106 bool text_is_dirty_;
106 bool style_is_dirty_; 107 bool style_is_dirty_;
107 108
108 // National Language Support native digit and digit substitution settings. 109 // National Language Support native digit and digit substitution settings.
109 SCRIPT_DIGITSUBSTITUTE digit_substitute_; 110 SCRIPT_DIGITSUBSTITUTE digit_substitute_;
110 111
111 SCRIPT_CONTROL script_control_; 112 SCRIPT_CONTROL script_control_;
112 SCRIPT_STATE script_state_; 113 SCRIPT_STATE script_state_;
113 114
114 SCRIPT_CACHE script_cache_;
115
116 std::vector<internal::TextRun*> runs_; 115 std::vector<internal::TextRun*> runs_;
117 int string_width_; 116 int string_width_;
118 117
119 scoped_array<int> visual_to_logical_; 118 scoped_array<int> visual_to_logical_;
120 scoped_array<int> logical_to_visual_; 119 scoped_array<int> logical_to_visual_;
121 120
122 DISALLOW_COPY_AND_ASSIGN(RenderTextWin); 121 DISALLOW_COPY_AND_ASSIGN(RenderTextWin);
123 }; 122 };
124 123
125 } // namespace gfx 124 } // namespace gfx
126 125
127 #endif // UI_GFX_RENDER_TEXT_WIN_H_ 126 #endif // UI_GFX_RENDER_TEXT_WIN_H_
OLDNEW
« no previous file with comments | « no previous file | ui/gfx/render_text_win.cc » ('j') | ui/gfx/render_text_win.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698