aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ports/SkFontHost_fontconfig.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ports/SkFontHost_fontconfig.cpp')
-rw-r--r--src/ports/SkFontHost_fontconfig.cpp24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/ports/SkFontHost_fontconfig.cpp b/src/ports/SkFontHost_fontconfig.cpp
index c53328b89b..75c21c243b 100644
--- a/src/ports/SkFontHost_fontconfig.cpp
+++ b/src/ports/SkFontHost_fontconfig.cpp
@@ -72,9 +72,10 @@ static bool find_proc(SkTypeface* face, SkTypeface::Style style, void* ctx) {
return rec->fStyle == style && fci->isFamilyName(rec->fFamilyName);
}
-SkTypeface* SkFontHost::CreateTypeface(const SkTypeface* familyFace,
- const char familyName[],
- SkTypeface::Style style) {
+SkTypeface* FontConfigTypeface::LegacyCreateTypeface(
+ const SkTypeface* familyFace,
+ const char familyName[],
+ SkTypeface::Style style) {
SkAutoTUnref<SkFontConfigInterface> fci(RefFCI());
if (NULL == fci.get()) {
return NULL;
@@ -107,6 +108,15 @@ SkTypeface* SkFontHost::CreateTypeface(const SkTypeface* familyFace,
return face;
}
+#ifndef SK_FONTHOST_USES_FONTMGR
+
+SkTypeface* SkFontHost::CreateTypeface(const SkTypeface* familyFace,
+ const char familyName[],
+ SkTypeface::Style style) {
+ return FontConfigTypeface::LegacyCreateTypeface(familyFace, familyName,
+ style);
+}
+
SkTypeface* SkFontHost::CreateTypefaceFromStream(SkStream* stream) {
if (!stream) {
return NULL;
@@ -130,6 +140,8 @@ SkTypeface* SkFontHost::CreateTypefaceFromFile(const char path[]) {
return stream.get() ? CreateTypefaceFromStream(stream) : NULL;
}
+#endif
+
///////////////////////////////////////////////////////////////////////////////
SkStream* FontConfigTypeface::onOpenStream(int* ttcIndex) const {
@@ -196,4 +208,8 @@ void FontConfigTypeface::onGetFontDescriptor(SkFontDescriptor* desc,
*isLocalStream = SkToBool(this->getLocalStream());
}
-///////////////////////////////////////////////////////////////////////////////
+SkTypeface* FontConfigTypeface::onRefMatchingStyle(Style style) const {
+ return LegacyCreateTypeface(this, NULL, style);
+}
+
+