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

Unified Diff: ui/gfx/font_list.h

Issue 19352002: Fixes vertical alignment of RenderText. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixes the unit test. Created 7 years, 5 months 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 side-by-side diff with in-line comments
Download patch
Index: ui/gfx/font_list.h
diff --git a/ui/gfx/font_list.h b/ui/gfx/font_list.h
index d070b5b588c2f63f834bc31c0f3dbac15f14d72e..d8f5e72bb28ba9c173224814428681ffc2e72bc7 100644
--- a/ui/gfx/font_list.h
+++ b/ui/gfx/font_list.h
@@ -57,6 +57,14 @@ class UI_EXPORT FontList {
// given font |size| in pixels.
FontList DeriveFontListWithSize(int size) const;
+ // Returns the height of this font list, which is max(ascent) + max(descent)
+ // for all the fonts in the font list.
+ int GetHeight() const;
+
+ // Returns the baseline of this font list, which is max(baseline) for all the
+ // fonts in the font list.
+ int GetBaseline() const;
+
// Returns the |gfx::Font::FontStyle| style flags for this font list.
int GetFontStyle() const;
@@ -81,6 +89,10 @@ class UI_EXPORT FontList {
// |font_description_string_| is not initialized during construction. Instead,
// it is computed lazily when user asked to get the font description string.
mutable std::string font_description_string_;
+
+ // The cached common height and baseline of the fonts in the font list.
+ mutable int common_height_;
+ mutable int common_baseline_;
};
} // namespace gfx

Powered by Google App Engine
This is Rietveld 408576698