Index: include/core/SkPaint.h |
diff --git a/include/core/SkPaint.h b/include/core/SkPaint.h |
index abb859950c5bb6a66aecccded690ca8cd6ae02a2..92d2aeae926b41bfa15d5c29bdfc79433211d9cc 100644 |
--- a/include/core/SkPaint.h |
+++ b/include/core/SkPaint.h |
@@ -731,17 +731,48 @@ public: |
void setTextEncoding(TextEncoding encoding); |
struct FontMetrics { |
+ /** Flags which indicate the confidence level of various metrics. |
+ A set flag indicates that the metric may be trusted. |
+ */ |
+ enum FontMetricsFlags { |
+ kUnderlineThinknessIsValid_FontMetricFlag = 0x01, |
+ kUnderlinePositionIsValid_FontMetricsflag = 1 << 1, |
+ }; |
+ |
+ uint32_t fFontMetricsFlag; //!< 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 charactor width (>= 0) |
- SkScalar fMaxCharWidth; //!< the max charactor width (>= 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, or 0 if cannot be determined |
+ |
+ /** Method to get bit set for Font Metrics |
+ @param fObject Pointer of FontMetrics object |
bungeman-skia
2014/02/19 15:39:17
Here and on the other two... there is no longer an
h.joshi
2014/02/19 17:12:03
Forgot to remove comments, will make changes.
On
|
+ @param bitSet bit whose value we want to know is set or not |
+ */ |
+ void setFontMetricsFlag(FontMetrics::FontMetricsFlags bitSet); |
+ |
+ /** Method to get bit set for Font Metrics |
+ @param fObject Pointer of FontMetrics object |
+ @param bitSet bit whose value we want to know is set or not |
+ */ |
+ void unsetFontMetricsFlag(FontMetrics::FontMetricsFlags bitSet); |
+ |
+ /** Method to get bit set for Font Metrics |
+ @param fObject Pointer of FontMetrics object |
+ @param bitSet bit whose value we want to know is set or not |
+ @param return true if FontMetrics bit i set false otherwise |
+ */ |
+ bool checkFontMetricsFlag(FontMetrics::FontMetricsFlags bitSet) const; |
+ |
}; |
/** Return the recommend spacing between lines (which will be |