Test font created from paint
This is meant to allow clients to migrate over to a SkFont api on canvas (e.g. drawText(text, font, paint)) while still permitting the current setters in paint (e.g. setTextSize, setFlags).
R=bungeman@google.com, eae@chromium.org, fmalita@google.com, fmalita@chromium.org
Author: reed@google.com
Review URL: https://codereview.chromium.org/245953003
git-svn-id: http://skia.googlecode.com/svn/trunk/include@14997 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/core/SkFont.h b/core/SkFont.h
index 4891926..9bdecd6 100644
--- a/core/SkFont.h
+++ b/core/SkFont.h
@@ -5,6 +5,9 @@
* found in the LICENSE file.
*/
+#ifndef SkFont_DEFINED
+#define SkFont_DEFINED
+
#include "SkRefCnt.h"
#include "SkScalar.h"
@@ -125,6 +128,12 @@
uint32_t getFlags() const { return fFlags; }
MaskType getMaskType() const { return (MaskType)fMaskType; }
+ bool isVertical() const { return SkToBool(fFlags & kVertical_Flag); }
+ bool isEmbolden() const { return SkToBool(fFlags & kEmbolden_Flag); }
+ bool isEnableAutoHints() const { return SkToBool(fFlags & kEnableAutoHints_Flag); }
+ bool isEnableByteCodeHints() const { return SkToBool(fFlags & kEnableByteCodeHints_Flag); }
+ bool isUseNonLinearMetrics() const { return SkToBool(fFlags & kUseNonlinearMetrics_Flag); }
+
int textToGlyphs(const void* text, size_t byteLength, SkTextEncoding,
uint16_t glyphs[], int maxGlyphCount) const;
@@ -148,3 +157,5 @@
uint8_t fMaskType;
// uint8_t fPad;
};
+
+#endif