Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Unified Diff: include/core/SkPaint.h

Issue 152073003: Adding code to calculate Underline Thickness from Font Metrics, this will be useful when Skia is us… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Adding Bitfield to Font Metrics Structure Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/core/SkPaint.cpp » ('j') | src/core/SkPaint.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkPaint.h
diff --git a/include/core/SkPaint.h b/include/core/SkPaint.h
index abb859950c5bb6a66aecccded690ca8cd6ae02a2..5b0addf126cd4bd82bd0625152edae0f576cea94 100644
--- a/include/core/SkPaint.h
+++ b/include/core/SkPaint.h
@@ -731,6 +731,15 @@ public:
void setTextEncoding(TextEncoding encoding);
struct FontMetrics {
+ /** Describes defined to identify which values are unknown, later can be
bungeman-skia 2014/02/17 19:10:06 nit: this comment needs to be un-indented This co
h.joshi 2014/02/18 05:48:48 Okey, will make suggested changes On 2014/02/17 1
+ used for other uses
+ */
+ 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)
@@ -742,8 +751,17 @@ public:
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
+ @param bitSet bit whose value we want to know is set or not
+ @param retrun true if FontMetrics bit i set false otherwise
+ */
+ bool isFontMetricsFlagSet(FontMetrics * fObject, FontMetrics::FontMetricsFlags bitSet) const;
bungeman-skia 2014/02/17 19:10:06 This seems like a really odd public interface to h
h.joshi 2014/02/18 05:48:48 Pls suggest should I move method inside FontMetric
+
/** Return the recommend spacing between lines (which will be
fDescent - fAscent + fLeading).
If metrics is not null, return in it the font metrics for the
« no previous file with comments | « no previous file | src/core/SkPaint.cpp » ('j') | src/core/SkPaint.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698