diff options
author | 2010-06-17 20:49:17 +0000 | |
---|---|---|
committer | 2010-06-17 20:49:17 +0000 | |
commit | a2c71cbd51da8b7767d43fe8954e7a4c674b2005 (patch) | |
tree | d55c29cf5bac1edd63950cb9ee4ebac8c79924ad /include/core/SkPaint.h | |
parent | 46e2ec51010866c425712aa40edbc2897e889594 (diff) |
Add support for forcing autohinting.
http://codereview.appspot.com/1651044/show
git-svn-id: http://skia.googlecode.com/svn/trunk@580 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core/SkPaint.h')
-rw-r--r-- | include/core/SkPaint.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/include/core/SkPaint.h b/include/core/SkPaint.h index 5fef527f65..722bc5d851 100644 --- a/include/core/SkPaint.h +++ b/include/core/SkPaint.h @@ -110,10 +110,11 @@ public: kDevKernText_Flag = 0x100, //!< mask to enable device kerning text kLCDRenderText_Flag = 0x200, //!< mask to enable subpixel glyph renderering kEmbeddedBitmapText_Flag = 0x400, //!< mask to enable embedded bitmap strikes + kAutoHinting_Flag = 0x800, //!< mask to force Freetype's autohinter // when adding extra flags, note that the fFlags member is specified // with a bit-width and you'll have to expand it. - kAllFlags = 0x7FF + kAllFlags = 0xFFF }; /** Return the paint's flags. Use the Flag enum to test flag values. @@ -202,6 +203,18 @@ public: */ void setEmbeddedBitmapText(bool useEmbeddedBitmapText); + bool isAutohinted() const + { + return SkToBool(this->getFlags() & kAutoHinting_Flag); + } + + /** Helper for setFlags(), setting or clearing the kAutoHinting_Flag bit + @param useAutohinter true to set the kEmbeddedBitmapText bit in the + paint's flags, + false to clear it. + */ + void setAutohinted(bool useAutohinter); + /** Helper for getFlags(), returning true if kUnderlineText_Flag bit is set @return true if the underlineText bit is set in the paint's flags. */ @@ -823,7 +836,7 @@ private: SkColor fColor; SkScalar fWidth; SkScalar fMiterLimit; - unsigned fFlags : 11; + unsigned fFlags : 12; unsigned fTextAlign : 2; unsigned fCapType : 2; unsigned fJoinType : 2; |