8 #ifndef SkFontMetrics_DEFINED
9 #define SkFontMetrics_DEFINED
12 #include "include/private/base/SkTo.h"
21 this->fFlags == that.
fFlags &&
22 this->fTop == that.
fTop &&
23 this->fAscent == that.
fAscent &&
25 this->fBottom == that.
fBottom &&
29 this->fXMin == that.
fXMin &&
30 this->fXMax == that.
fXMax &&
45 kUnderlineThicknessIsValid_Flag = 1 << 0,
46 kUnderlinePositionIsValid_Flag = 1 << 1,
47 kStrikeoutThicknessIsValid_Flag = 1 << 2,
48 kStrikeoutPositionIsValid_Flag = 1 << 3,
49 kBoundsInvalid_Flag = 1 << 4,
77 if (SkToBool(fFlags & kUnderlineThicknessIsValid_Flag)) {
78 *thickness = fUnderlineThickness;
92 if (SkToBool(fFlags & kUnderlinePositionIsValid_Flag)) {
93 *position = fUnderlinePosition;
107 if (SkToBool(fFlags & kStrikeoutThicknessIsValid_Flag)) {
108 *thickness = fStrikeoutThickness;
122 if (SkToBool(fFlags & kStrikeoutPositionIsValid_Flag)) {
123 *position = fStrikeoutPosition;
135 return !SkToBool(fFlags & kBoundsInvalid_Flag);
float SkScalar
Definition: SkScalar.h:14
The metrics of an SkFont.
Definition: SkFontMetrics.h:18
SkScalar fTop
greatest extent above origin of any glyph bounding box, typically negative; deprecated with variable ...
Definition: SkFontMetrics.h:53
SkScalar fLeading
distance to add between lines, typically positive or zero
Definition: SkFontMetrics.h:57
SkScalar fAvgCharWidth
average character width, zero if unknown
Definition: SkFontMetrics.h:58
bool hasBounds() const
Returns true if SkFontMetrics has a valid fTop, fBottom, fXMin, and fXMax.
Definition: SkFontMetrics.h:134
SkScalar fStrikeoutPosition
distance from baseline to bottom of stroke, typically negative
Definition: SkFontMetrics.h:67
SkScalar fStrikeoutThickness
strikeout thickness
Definition: SkFontMetrics.h:66
SkScalar fMaxCharWidth
maximum character width, zero if unknown
Definition: SkFontMetrics.h:59
bool operator==(const SkFontMetrics &that)
Definition: SkFontMetrics.h:19
SkScalar fBottom
greatest extent below origin of any glyph bounding box, typically positive; deprecated with variable ...
Definition: SkFontMetrics.h:56
bool hasUnderlinePosition(SkScalar *position) const
Returns true if SkFontMetrics has a valid underline position, and sets position to that value.
Definition: SkFontMetrics.h:91
uint32_t fFlags
FontMetricsFlags indicating which metrics are valid.
Definition: SkFontMetrics.h:52
SkScalar fAscent
distance to reserve above baseline, typically negative
Definition: SkFontMetrics.h:54
bool hasUnderlineThickness(SkScalar *thickness) const
Returns true if SkFontMetrics has a valid underline thickness, and sets thickness to that value.
Definition: SkFontMetrics.h:76
SkScalar fXHeight
height of lower-case 'x', zero if unknown, typically negative
Definition: SkFontMetrics.h:62
bool hasStrikeoutPosition(SkScalar *position) const
Returns true if SkFontMetrics has a valid strikeout position, and sets position to that value.
Definition: SkFontMetrics.h:121
SkScalar fUnderlineThickness
underline thickness
Definition: SkFontMetrics.h:64
FontMetricsFlags
FontMetricsFlags indicate when certain metrics are valid; the underline or strikeout metrics may be v...
Definition: SkFontMetrics.h:44
SkScalar fDescent
distance to reserve below baseline, typically positive
Definition: SkFontMetrics.h:55
SkScalar fCapHeight
height of an upper-case letter, zero if unknown, typically negative
Definition: SkFontMetrics.h:63
bool hasStrikeoutThickness(SkScalar *thickness) const
Returns true if SkFontMetrics has a valid strikeout thickness, and sets thickness to that value.
Definition: SkFontMetrics.h:106
SkScalar fXMin
greatest extent to left of origin of any glyph bounding box, typically negative; deprecated with vari...
Definition: SkFontMetrics.h:60
SkScalar fUnderlinePosition
distance from baseline to top of stroke, typically positive
Definition: SkFontMetrics.h:65
SkScalar fXMax
greatest extent to right of origin of any glyph bounding box, typically positive; deprecated with var...
Definition: SkFontMetrics.h:61