Chromium Code Reviews| Index: ui/gfx/font_list.h |
| diff --git a/ui/gfx/font_list.h b/ui/gfx/font_list.h |
| index 1ba8ad1aff9f0511bcf3c17421f15655766e14f1..4762216d4aac7d020a9b2871bfde60786840a985 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| shrinks the font size until the font list |
| + // will fit within |height| while having its cap height vertically centered. |
| + // Returns the correctly-sized font list. |
| + // |
| + // The expected layout: |
|
msw
2014/08/28 21:43:50
Perhaps the expected layout comment belongs in the
Peter Kasting
2014/08/28 21:52:03
I think the comment should either be left here or
|
| + // +--------+-----------------------------------------------+------------+ |
| + // | | 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 DeriveWithHeightUpperBound(int height) const; |
|
msw
2014/08/28 21:43:50
Reorder this (and the impl) with the other derive
noms (inactive)
2014/08/29 17:10:29
Done.
|
| + |
| private: |
| explicit FontList(FontListImpl* impl); |