aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/core/SkFont.h9
-rw-r--r--include/core/SkPaint.h4
2 files changed, 12 insertions, 1 deletions
diff --git a/include/core/SkFont.h b/include/core/SkFont.h
index 6c231c963a..6e8a71501f 100644
--- a/include/core/SkFont.h
+++ b/include/core/SkFont.h
@@ -126,6 +126,10 @@ public:
* If size is not supported (e.g. <= 0 or non-finite) NULL will be returned.
*/
sk_sp<SkFont> makeWithSize(SkScalar size) const;
+ /**
+ * Return a font with the same attributes of this font, but with the flags.
+ */
+ sk_sp<SkFont> makeWithFlags(uint32_t newFlags) const;
SkTypeface* getTypeface() const { return fTypeface.get(); }
SkScalar getSize() const { return fSize; }
@@ -139,10 +143,15 @@ public:
bool isEnableAutoHints() const { return SkToBool(fFlags & kEnableAutoHints_Flag); }
bool isEnableByteCodeHints() const { return SkToBool(fFlags & kEnableByteCodeHints_Flag); }
bool isUseNonLinearMetrics() const { return SkToBool(fFlags & kUseNonlinearMetrics_Flag); }
+ bool isDevKern() const { return SkToBool(fFlags & kDevKern_Flag); }
int textToGlyphs(const void* text, size_t byteLength, SkTextEncoding,
uint16_t glyphs[], int maxGlyphCount) const;
+ int countText(const void* text, size_t byteLength, SkTextEncoding encoding) {
+ return this->textToGlyphs(text, byteLength, encoding, nullptr, 0);
+ }
+
SkScalar measureText(const void* text, size_t byteLength, SkTextEncoding) const;
static sk_sp<SkFont> Testing_CreateFromPaint(const SkPaint&);
diff --git a/include/core/SkPaint.h b/include/core/SkPaint.h
index c0f1f3eec8..caa185608a 100644
--- a/include/core/SkPaint.h
+++ b/include/core/SkPaint.h
@@ -1085,7 +1085,9 @@ private:
uint32_t fBitfieldsUInt;
};
- GlyphCacheProc getGlyphCacheProc(bool needFullMetrics) const;
+ static GlyphCacheProc GetGlyphCacheProc(TextEncoding encoding,
+ bool isDevKern,
+ bool needFullMetrics);
SkScalar measure_text(SkGlyphCache*, const char* text, size_t length,
int* count, SkRect* bounds) const;