Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(554)

Unified Diff: include/core/SkFont.h

Issue 2163633002: Make SkFont a bit more useable (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix bug Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | include/core/SkPaint.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkFont.h
diff --git a/include/core/SkFont.h b/include/core/SkFont.h
index 6c231c963a0fe6996c97511c0828edb82b9c2598..6e8a71501fec4315f164e82d247a44f6ed0f0f5a 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&);
« no previous file with comments | « no previous file | include/core/SkPaint.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698