Skia
2D Graphics Library
|
The metrics of an SkFont. More...
#include <SkFontMetrics.h>
Public Types | |
enum | FontMetricsFlags { kUnderlineThicknessIsValid_Flag = 1 << 0 , kUnderlinePositionIsValid_Flag = 1 << 1 , kStrikeoutThicknessIsValid_Flag = 1 << 2 , kStrikeoutPositionIsValid_Flag = 1 << 3 , kBoundsInvalid_Flag = 1 << 4 } |
FontMetricsFlags indicate when certain metrics are valid; the underline or strikeout metrics may be valid and zero. More... | |
Public Member Functions | |
bool | operator== (const SkFontMetrics &that) |
bool | hasUnderlineThickness (SkScalar *thickness) const |
Returns true if SkFontMetrics has a valid underline thickness, and sets thickness to that value. More... | |
bool | hasUnderlinePosition (SkScalar *position) const |
Returns true if SkFontMetrics has a valid underline position, and sets position to that value. More... | |
bool | hasStrikeoutThickness (SkScalar *thickness) const |
Returns true if SkFontMetrics has a valid strikeout thickness, and sets thickness to that value. More... | |
bool | hasStrikeoutPosition (SkScalar *position) const |
Returns true if SkFontMetrics has a valid strikeout position, and sets position to that value. More... | |
bool | hasBounds () const |
Returns true if SkFontMetrics has a valid fTop, fBottom, fXMin, and fXMax. More... | |
Public Attributes | |
uint32_t | fFlags |
FontMetricsFlags indicating which metrics are valid. More... | |
SkScalar | fTop |
greatest extent above origin of any glyph bounding box, typically negative; deprecated with variable fonts More... | |
SkScalar | fAscent |
distance to reserve above baseline, typically negative More... | |
SkScalar | fDescent |
distance to reserve below baseline, typically positive More... | |
SkScalar | fBottom |
greatest extent below origin of any glyph bounding box, typically positive; deprecated with variable fonts More... | |
SkScalar | fLeading |
distance to add between lines, typically positive or zero More... | |
SkScalar | fAvgCharWidth |
average character width, zero if unknown More... | |
SkScalar | fMaxCharWidth |
maximum character width, zero if unknown More... | |
SkScalar | fXMin |
greatest extent to left of origin of any glyph bounding box, typically negative; deprecated with variable fonts More... | |
SkScalar | fXMax |
greatest extent to right of origin of any glyph bounding box, typically positive; deprecated with variable fonts More... | |
SkScalar | fXHeight |
height of lower-case 'x', zero if unknown, typically negative More... | |
SkScalar | fCapHeight |
height of an upper-case letter, zero if unknown, typically negative More... | |
SkScalar | fUnderlineThickness |
underline thickness More... | |
SkScalar | fUnderlinePosition |
distance from baseline to top of stroke, typically positive More... | |
SkScalar | fStrikeoutThickness |
strikeout thickness More... | |
SkScalar | fStrikeoutPosition |
distance from baseline to bottom of stroke, typically negative More... | |
The metrics of an SkFont.
The metric values are consistent with the Skia y-down coordinate system.
FontMetricsFlags indicate when certain metrics are valid; the underline or strikeout metrics may be valid and zero.
Fonts with embedded bitmaps may not have valid underline or strikeout metrics.
|
inline |
Returns true if SkFontMetrics has a valid fTop, fBottom, fXMin, and fXMax.
If the bounds are not valid, return false.
|
inline |
Returns true if SkFontMetrics has a valid strikeout position, and sets position to that value.
If the underline position is not valid, return false, and ignore position.
position | storage for strikeout position |
|
inline |
Returns true if SkFontMetrics has a valid strikeout thickness, and sets thickness to that value.
If the underline thickness is not valid, return false, and ignore thickness.
thickness | storage for strikeout width |
|
inline |
Returns true if SkFontMetrics has a valid underline position, and sets position to that value.
If the underline position is not valid, return false, and ignore position.
position | storage for underline position |
|
inline |
Returns true if SkFontMetrics has a valid underline thickness, and sets thickness to that value.
If the underline thickness is not valid, return false, and ignore thickness.
thickness | storage for underline width |
|
inline |
SkScalar SkFontMetrics::fAscent |
distance to reserve above baseline, typically negative
SkScalar SkFontMetrics::fAvgCharWidth |
average character width, zero if unknown
SkScalar SkFontMetrics::fBottom |
greatest extent below origin of any glyph bounding box, typically positive; deprecated with variable fonts
SkScalar SkFontMetrics::fCapHeight |
height of an upper-case letter, zero if unknown, typically negative
SkScalar SkFontMetrics::fDescent |
distance to reserve below baseline, typically positive
uint32_t SkFontMetrics::fFlags |
FontMetricsFlags indicating which metrics are valid.
SkScalar SkFontMetrics::fLeading |
distance to add between lines, typically positive or zero
SkScalar SkFontMetrics::fMaxCharWidth |
maximum character width, zero if unknown
SkScalar SkFontMetrics::fStrikeoutPosition |
distance from baseline to bottom of stroke, typically negative
SkScalar SkFontMetrics::fStrikeoutThickness |
strikeout thickness
SkScalar SkFontMetrics::fTop |
greatest extent above origin of any glyph bounding box, typically negative; deprecated with variable fonts
SkScalar SkFontMetrics::fUnderlinePosition |
distance from baseline to top of stroke, typically positive
SkScalar SkFontMetrics::fUnderlineThickness |
underline thickness
SkScalar SkFontMetrics::fXHeight |
height of lower-case 'x', zero if unknown, typically negative
SkScalar SkFontMetrics::fXMax |
greatest extent to right of origin of any glyph bounding box, typically positive; deprecated with variable fonts
SkScalar SkFontMetrics::fXMin |
greatest extent to left of origin of any glyph bounding box, typically negative; deprecated with variable fonts