Chromium Code Reviews

Unified Diff: views/view_text_utils.cc

Issue 3083022: Rework gfx::Font by moving platform-specific code into inner classes.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « views/drag_utils.cc ('k') | views/widget/tooltip_manager_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/view_text_utils.cc
===================================================================
--- views/view_text_utils.cc (revision 55911)
+++ views/view_text_utils.cc (working copy)
@@ -62,7 +62,7 @@
if (link && rect) {
gfx::Size sz = link->GetPreferredSize();
gfx::Insets insets = link->GetInsets();
- WrapIfWordDoesntFit(sz.width(), font.height(), position, bounds);
+ WrapIfWordDoesntFit(sz.width(), font.GetHeight(), position, bounds);
int x = position->width();
int y = position->height();
@@ -116,11 +116,11 @@
else
word = text; // Draw the whole text at once.
- int w = font.GetStringWidth(word), h = font.height();
+ int w = font.GetStringWidth(word), h = font.GetHeight();
gfx::CanvasSkia::SizeStringInt(word, font, &w, &h, flags);
// If we exceed the boundaries, we need to wrap.
- WrapIfWordDoesntFit(w, font.height(), position, bounds);
+ WrapIfWordDoesntFit(w, font.GetHeight(), position, bounds);
int x = label->MirroredXCoordinateInsideView(position->width()) +
bounds.x();
@@ -130,7 +130,7 @@
// draw the trailing space (if one exists after the LTR text) to the
// left of the LTR string.
if (ltr_within_rtl && word[word.size() - 1] == L' ') {
- int space_w = font.GetStringWidth(L" "), space_h = font.height();
+ int space_w = font.GetStringWidth(L" "), space_h = font.GetHeight();
gfx::CanvasSkia::SizeStringInt(L" ", font, &space_w, &space_h, flags);
x += space_w;
}
@@ -138,13 +138,13 @@
int y = position->height() + bounds.y();
// Draw the text on the screen (mirrored, if RTL run).
- canvas->DrawStringInt(word, font, text_color, x, y, w, font.height(),
+ canvas->DrawStringInt(word, font, text_color, x, y, w, font.GetHeight(),
flags);
if (word.size() > 0 && word[word.size() - 1] == L'\x0a') {
// When we come across '\n', we move to the beginning of the next line.
position->set_width(0);
- position->Enlarge(0, font.height());
+ position->Enlarge(0, font.GetHeight());
} else {
// Otherwise, we advance position to the next word.
position->Enlarge(w, 0);
« no previous file with comments | « views/drag_utils.cc ('k') | views/widget/tooltip_manager_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine