aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/core/SkTypeface.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/core/SkTypeface.h b/include/core/SkTypeface.h
index 665491c3db..4118152dea 100644
--- a/include/core/SkTypeface.h
+++ b/include/core/SkTypeface.h
@@ -117,6 +117,14 @@ public:
*/
static sk_sp<SkTypeface> MakeFromFontData(std::unique_ptr<SkFontData>);
+ /** Return a new typeface based on this typeface but parameterized as specified in the
+ SkFontArguments. If the SkFontArguments does not supply an argument for a parameter
+ in the font then the value from this typeface will be used as the value for that
+ argument. If the cloned typeface would be exaclty the same as this typeface then
+ this typeface may be ref'ed and returned. May return nullptr on failure.
+ */
+ sk_sp<SkTypeface> makeClone(const SkFontArguments&) const;
+
/** Write a unique signature to a stream, sufficient to reconstruct a
typeface referencing the same font when Deserialize is called.
*/
@@ -301,6 +309,8 @@ protected:
SkTypeface(const SkFontStyle& style, bool isFixedPitch = false);
virtual ~SkTypeface();
+ virtual sk_sp<SkTypeface> onMakeClone(const SkFontArguments&) const;
+
/** Sets the fixedPitch bit. If used, must be called in the constructor. */
void setIsFixedPitch(bool isFixedPitch) { fIsFixedPitch = isFixedPitch; }
/** Sets the font style. If used, must be called in the constructor. */