aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-11-10 15:20:49 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-11-10 15:20:49 +0000
commit830a23e39bb4a126e573940cd6e354732e295b10 (patch)
tree342bf79695ce04ba6f16a05fcb6d2716fd3d8294 /include/core
parenta2092aab4bc086cb7f0663775b37341207b22911 (diff)
add vertical-text bit to paint (not supported yet)
check-point for using freetype on mac (not enabled yet) git-svn-id: http://skia.googlecode.com/svn/trunk@2657 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core')
-rw-r--r--include/core/SkPaint.h21
-rw-r--r--include/core/SkScalerContext.h7
2 files changed, 22 insertions, 6 deletions
diff --git a/include/core/SkPaint.h b/include/core/SkPaint.h
index eb5611bef9..9073e2049e 100644
--- a/include/core/SkPaint.h
+++ b/include/core/SkPaint.h
@@ -99,14 +99,15 @@ public:
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
+ kVerticalText_Flag = 0x1000,
// experimental/private
- kForceAAText_Flag = 0x1000,
+ kForceAAText_Flag = 0x2000,
// when adding extra flags, note that the fFlags member is specified
// with a bit-width and you'll have to expand it.
- kAllFlags = 0x1FFF
+ kAllFlags = 0x2FFF
};
/** Return the paint's flags. Use the Flag enum to test flag values.
@@ -203,6 +204,20 @@ public:
*/
void setAutohinted(bool useAutohinter);
+ bool isVerticalText() const {
+ return SkToBool(this->getFlags() & kVerticalText_Flag);
+ }
+
+ /**
+ * Helper for setting or clearing the kVerticalText_Flag bit in
+ * setFlags(...).
+ *
+ * If this bit is set, then advances are treated as Y values rather than
+ * X values, and drawText will places its glyphs vertically rather than
+ * horizontally.
+ */
+ void setVerticalText(bool);
+
/** Helper for getFlags(), returning true if kUnderlineText_Flag bit is set
@return true if the underlineText bit is set in the paint's flags.
*/
@@ -847,7 +862,7 @@ private:
SkColor fColor;
SkScalar fWidth;
SkScalar fMiterLimit;
- unsigned fFlags : 13;
+ unsigned fFlags : 14;
unsigned fTextAlign : 2;
unsigned fCapType : 2;
unsigned fJoinType : 2;
diff --git a/include/core/SkScalerContext.h b/include/core/SkScalerContext.h
index 71826e8b45..c9fb83b2c4 100644
--- a/include/core/SkScalerContext.h
+++ b/include/core/SkScalerContext.h
@@ -171,13 +171,14 @@ public:
kEmbolden_Flag = 0x80,
kSubpixelPositioning_Flag = 0x100,
kAutohinting_Flag = 0x200,
+ kVertical_Flag = 0x400,
// these should only ever be set if fMaskFormat is LCD16 or LCD32
- kLCD_Vertical_Flag = 0x400, // else Horizontal
- kLCD_BGROrder_Flag = 0x800, // else RGB order
+ kLCD_Vertical_Flag = 0x0800, // else Horizontal
+ kLCD_BGROrder_Flag = 0x1000, // else RGB order
// experimental
- kForceAA_Flag = 0x1000
+ kForceAA_Flag = 0x2000
};
private:
enum {