aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/ports
diff options
context:
space:
mode:
Diffstat (limited to 'include/ports')
-rw-r--r--include/ports/SkFontConfigInterface.h8
-rw-r--r--include/ports/SkFontMgr.h12
-rw-r--r--include/ports/SkFontMgr_indirect.h25
3 files changed, 32 insertions, 13 deletions
diff --git a/include/ports/SkFontConfigInterface.h b/include/ports/SkFontConfigInterface.h
index 063cb9d553..464251bc2d 100644
--- a/include/ports/SkFontConfigInterface.h
+++ b/include/ports/SkFontConfigInterface.h
@@ -80,11 +80,19 @@ public:
*
* If a match is not found, return false, and ignore all out parameters.
*/
+#ifdef SK_VERY_LEGACY_CREATE_TYPEFACE
virtual bool matchFamilyName(const char familyName[],
SkTypeface::Style requested,
FontIdentity* outFontIdentifier,
SkString* outFamilyName,
SkTypeface::Style* outStyle) = 0;
+#else
+ virtual bool matchFamilyName(const char familyName[],
+ SkFontStyle requested,
+ FontIdentity* outFontIdentifier,
+ SkString* outFamilyName,
+ SkFontStyle* outStyle) = 0;
+#endif
/**
* Given a FontRef, open a stream to access its data, or return null
diff --git a/include/ports/SkFontMgr.h b/include/ports/SkFontMgr.h
index 3e6c785be9..a961cd48ad 100644
--- a/include/ports/SkFontMgr.h
+++ b/include/ports/SkFontMgr.h
@@ -164,8 +164,11 @@ public:
*/
SkTypeface* createFromFile(const char path[], int ttcIndex = 0) const;
- SkTypeface* legacyCreateTypeface(const char familyName[],
- unsigned typefaceStyleBits) const;
+#ifdef SK_VERY_LEGACY_CREATE_TYPEFACE
+ SkTypeface* legacyCreateTypeface(const char familyName[], unsigned typefaceStyleBits) const;
+#else
+ SkTypeface* legacyCreateTypeface(const char familyName[], SkFontStyle style) const;
+#endif
/**
* Return a ref to the default fontmgr. The caller must call unref() on
@@ -196,8 +199,13 @@ protected:
virtual SkTypeface* onCreateFromFontData(SkFontData*) const;
virtual SkTypeface* onCreateFromFile(const char path[], int ttcIndex) const = 0;
+#ifdef SK_VERY_LEGACY_CREATE_TYPEFACE
virtual SkTypeface* onLegacyCreateTypeface(const char familyName[],
unsigned styleBits) const = 0;
+#else
+ virtual SkTypeface* onLegacyCreateTypeface(const char familyName[], SkFontStyle) const = 0;
+#endif
+
private:
static SkFontMgr* Factory(); // implemented by porting layer
friend SkFontMgr* sk_fontmgr_create_default();
diff --git a/include/ports/SkFontMgr_indirect.h b/include/ports/SkFontMgr_indirect.h
index 37502d2404..b3f31c3b8e 100644
--- a/include/ports/SkFontMgr_indirect.h
+++ b/include/ports/SkFontMgr_indirect.h
@@ -38,24 +38,27 @@ protected:
SkFontStyleSet* onMatchFamily(const char familyName[]) const override;
- virtual SkTypeface* onMatchFamilyStyle(const char familyName[],
- const SkFontStyle& fontStyle) const override;
+ SkTypeface* onMatchFamilyStyle(const char familyName[],
+ const SkFontStyle& fontStyle) const override;
- virtual SkTypeface* onMatchFamilyStyleCharacter(const char familyName[],
- const SkFontStyle&,
- const char* bcp47[],
- int bcp47Count,
- SkUnichar character) const override;
+ SkTypeface* onMatchFamilyStyleCharacter(const char familyName[],
+ const SkFontStyle&,
+ const char* bcp47[],
+ int bcp47Count,
+ SkUnichar character) const override;
- virtual SkTypeface* onMatchFaceStyle(const SkTypeface* familyMember,
- const SkFontStyle& fontStyle) const override;
+ SkTypeface* onMatchFaceStyle(const SkTypeface* familyMember,
+ const SkFontStyle& fontStyle) const override;
SkTypeface* onCreateFromStream(SkStreamAsset* stream, int ttcIndex) const override;
SkTypeface* onCreateFromFile(const char path[], int ttcIndex) const override;
SkTypeface* onCreateFromData(SkData* data, int ttcIndex) const override;
- virtual SkTypeface* onLegacyCreateTypeface(const char familyName[],
- unsigned styleBits) const override;
+#ifdef SK_VERY_LEGACY_CREATE_TYPEFACE
+ SkTypeface* onLegacyCreateTypeface(const char familyName[], unsigned styleBits) const override;
+#else
+ SkTypeface* onLegacyCreateTypeface(const char familyName[], SkFontStyle) const override;
+#endif
private:
SkTypeface* createTypefaceFromFontId(const SkFontIdentity& fontId) const;