Index: ui/gfx/font_list.h |
diff --git a/ui/gfx/font_list.h b/ui/gfx/font_list.h |
index 1ba8ad1aff9f0511bcf3c17421f15655766e14f1..8c4cac32b6967555f1e56d9bc02f815d8f4d105f 100644 |
--- a/ui/gfx/font_list.h |
+++ b/ui/gfx/font_list.h |
@@ -117,6 +117,31 @@ class GFX_EXPORT FontList { |
// Returns the first font in the list. |
const Font& GetPrimaryFont() const; |
+ // Given a containing |height| and a |base_font_list|, shrinks the font size |
Peter Kasting
2014/08/28 19:34:18
This comment is out of date.
noms (inactive)
2014/08/28 20:36:25
Done.
|
+ // until the font list will fit within |height| while having its cap height |
+ // vertically centered. Returns the correctly-sized font list. |
+ // |
+ // The expected layout: |
+ // +--------+-----------------------------------------------+------------+ |
+ // | | y offset | space | |
+ // | +--------+-------------------+------------------+ above | |
+ // | | | | internal leading | cap height | |
+ // | box | font | ascent (baseline) +------------------+------------+ |
+ // | height | height | | cap height | |
+ // | | |-------------------+------------------+------------+ |
+ // | | | descent (height - baseline) | space | |
+ // | +--------+--------------------------------------+ below | |
+ // | | space at bottom | cap height | |
+ // +--------+-----------------------------------------------+------------+ |
+ // Goal: |
+ // center of box height == center of cap height |
+ // (i.e. space above cap height == space below cap height) |
+ // Restrictions: |
+ // y offset >= 0 |
+ // space at bottom >= 0 |
+ // (i.e. Entire font must be visible inside the box.) |
+ gfx::FontList GetLargestFontListWithHeightBound(int height) const; |
msw
2014/08/28 19:40:03
Follow the Derive* pattern and reorder as (DeriveW
noms (inactive)
2014/08/28 20:36:25
Done.
|
+ |
private: |
explicit FontList(FontListImpl* impl); |