1 diff --git a/include/ports/SkFontMgr_fontconfig.h b/include/ports/SkFontMgr_fontconfig.h
2 index 4b2bb2d297..2b82cbfedd 100644
3 --- include/ports/SkFontMgr_fontconfig.h
4 +++ include/ports/SkFontMgr_fontconfig.h
5 @@ -19,4 +19,9 @@ class SkFontMgr;
7 SK_API sk_sp<SkFontMgr> SkFontMgr_New_FontConfig(FcConfig* fc);
10 +typedef struct _FcPattern FcPattern;
12 +SK_API sk_sp<SkTypeface> SkFontMgr_createTypefaceFromFcPattern(const sk_sp<SkFontMgr>& mgr, FcPattern* pattern);
14 #endif // #ifndef SkFontMgr_fontconfig_DEFINED
15 diff --git a/src/ports/SkFontMgr_fontconfig.cpp b/src/ports/SkFontMgr_fontconfig.cpp
16 index c2da39b28f..28483faf02 100644
17 --- src/ports/SkFontMgr_fontconfig.cpp
18 +++ src/ports/SkFontMgr_fontconfig.cpp
19 @@ -690,6 +690,7 @@ class SkFontMgr_fontconfig : public SkFontMgr {
20 /** Creates a typeface using a typeface cache.
21 * @param pattern a complete pattern from FcFontRenderPrepare.
24 sk_sp<SkTypeface> createTypefaceFromFcPattern(SkAutoFcPattern pattern) const {
27 @@ -1043,3 +1044,13 @@ protected:
28 SK_API sk_sp<SkFontMgr> SkFontMgr_New_FontConfig(FcConfig* fc) {
29 return sk_make_sp<SkFontMgr_fontconfig>(fc);
32 +SK_API sk_sp<SkTypeface> SkFontMgr_createTypefaceFromFcPattern(const sk_sp<SkFontMgr>& mgr, FcPattern* pattern)
34 + SkAutoFcPattern p([pattern]() {
36 + FcPatternReference(pattern);
39 + return static_cast<SkFontMgr_fontconfig*>(mgr.get())->createTypefaceFromFcPattern(std::move(p));