Skia
2DGraphicsLibrary
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SkPaint::FontMetrics Struct Reference

Public Types

enum  FontMetricsFlags { kUnderlineThinknessIsValid_Flag = 1 << 0, kUnderlinePositionIsValid_Flag = 1 << 1 }
 Flags which indicate the confidence level of various metrics. More...
 

Public Member Functions

bool hasUnderlineThickness (SkScalar *thickness) const
 If the fontmetrics has a valid underlinethickness, return true, and set the thickness param to that value. More...
 
bool hasUnderlinePosition (SkScalar *position) const
 If the fontmetrics has a valid underlineposition, return true, and set the thickness param to that value. More...
 

Public Attributes

uint32_t fFlags
 Bit field to identify which values are unknown.
 
SkScalar fTop
 The greatest distance above the baseline for any glyph (will be <= 0)
 
SkScalar fAscent
 The recommended distance above the baseline (will be <= 0)
 
SkScalar fDescent
 The recommended distance below the baseline (will be >= 0)
 
SkScalar fBottom
 The greatest distance below the baseline for any glyph (will be >= 0)
 
SkScalar fLeading
 The recommended distance to add between lines of text (will be >= 0)
 
SkScalar fAvgCharWidth
 the average character width (>= 0)
 
SkScalar fMaxCharWidth
 the max character width (>= 0)
 
SkScalar fXMin
 The minimum bounding box x value for all glyphs.
 
SkScalar fXMax
 The maximum bounding box x value for all glyphs.
 
SkScalar fXHeight
 The height of an 'x' in px, or 0 if no 'x' in face.
 
SkScalar fCapHeight
 The cap height (> 0), or 0 if cannot be determined.
 
SkScalar fUnderlineThickness
 underline thickness, or 0 if cannot be determined
 
SkScalar fUnderlinePosition
 Underline Position - position of the top of the Underline stroke relative to the baseline, this can have following values. More...
 

Member Enumeration Documentation

Flags which indicate the confidence level of various metrics.

A set flag indicates that the metric may be trusted.

Member Function Documentation

bool SkPaint::FontMetrics::hasUnderlinePosition ( SkScalar *  position) const
inline

If the fontmetrics has a valid underlineposition, return true, and set the thickness param to that value.

If it doesn't return false and ignore the thickness param.

bool SkPaint::FontMetrics::hasUnderlineThickness ( SkScalar *  thickness) const
inline

If the fontmetrics has a valid underlinethickness, return true, and set the thickness param to that value.

If it doesn't return false and ignore the thickness param.

Member Data Documentation

SkScalar SkPaint::FontMetrics::fUnderlinePosition

Underline Position - position of the top of the Underline stroke relative to the baseline, this can have following values.

  • Negative - means underline should be drawn above baseline.
  • Positive - means below baseline.
  • Zero - mean underline should be drawn on baseline.underline position, or 0 if cannot be determined

The documentation for this struct was generated from the following file: