Index: include/core/SkFont.h |
diff --git a/include/core/SkFont.h b/include/core/SkFont.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..7a09f82c393d7d5d256b054277d8cb13076fbbfd |
--- /dev/null |
+++ b/include/core/SkFont.h |
@@ -0,0 +1,52 @@ |
+/* |
+ * Copyright 2014 Google Inc. |
+ * |
+ * Use of this source code is governed by a BSD-style license that can be |
+ * found in the LICENSE file. |
+ */ |
+ |
+#include "SkRefCnt.h" |
+#include "SkScalar.h" |
+ |
+class SkTypeface; |
+ |
+enum SkTextEncoding { |
+ kUTF8_SkTextEncoding, |
+ kUTF16_SkTextEncoding, |
+ kUTF32_SkTextEncoding, |
+ kGlyphID_SkTextEncoding, |
+}; |
+ |
+class SkFont : public SkRefCnt { |
+public: |
+ enum Flags { |
bungeman-skia
2014/03/25 19:51:45
Should requests for synthetics go here (fake bold)
|
+ kAutoHint_Flag = 1 << 0, |
+ kByteCodeHint_Flag = 1 << 1, |
+ kGridAlignMetrics_Flag = 1 << 2, |
bungeman-skia
2014/03/25 19:51:45
These three bits are awesome, but I almost want a
|
+ kVertical_Flag = 1 << 3, |
+ kEmbeddedBitmaps_Flag = 1 << 4, |
+ kGenA8FromLCD_Flag = 1 << 5, |
+ kLCD_Mask_Flag = 1 << 6, |
+ }; |
+ uint32_t getFlags() const { return fFlags; } |
+ |
+ SkTypeface* getTypeface() const { return fTypeface; } |
+ SkScalar getSize() const { return fSize; } |
+ SkScalar getScaleX() const { return fScaleX; } |
+ SkScalar getSkewX() const { return fSkewX; } |
+ |
+ int textToGlyphs(const void* text, size_t byteLength, SkTextEncoding, |
+ uint16_t glyphs[], int maxGlyphCount) const; |
+ |
+ SkScalar measureText(const void* text, size_t byteLength, SkTextEncoding) const; |
+ |
+private: |
+ virtual ~SkFont(); |
+ |
+ SkTypeface* fTypeface; |
+ SkScalar fScale; |
+ SkScalar fScaleX; |
+ SkScalar fSkewX; |
+ uint32_t fFlags; |
+}; |
+ |