diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:06:44 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:06:44 +0000 |
commit | ed5640d8b587fbcfed7dd7967f3de04b37a76f26 (patch) | |
tree | 7a5f7c6c9d02226d7471cb3cc8fbbf631b415303 /external/skia/fontconfig-get-typeface.patch.0 | |
parent | Initial commit. (diff) | |
download | libreoffice-ed5640d8b587fbcfed7dd7967f3de04b37a76f26.tar.xz libreoffice-ed5640d8b587fbcfed7dd7967f3de04b37a76f26.zip |
Adding upstream version 4:7.4.7.upstream/4%7.4.7upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | external/skia/fontconfig-get-typeface.patch.0 | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/external/skia/fontconfig-get-typeface.patch.0 b/external/skia/fontconfig-get-typeface.patch.0 new file mode 100644 index 000000000..20c3f5b9c --- /dev/null +++ b/external/skia/fontconfig-get-typeface.patch.0 @@ -0,0 +1,40 @@ +diff --git a/include/ports/SkFontMgr_fontconfig.h b/include/ports/SkFontMgr_fontconfig.h +index 4b2bb2d297..2b82cbfedd 100644 +--- include/ports/SkFontMgr_fontconfig.h ++++ include/ports/SkFontMgr_fontconfig.h +@@ -19,4 +19,9 @@ class SkFontMgr; + */ + SK_API sk_sp<SkFontMgr> SkFontMgr_New_FontConfig(FcConfig* fc); + ++struct _FcPattern; ++typedef struct _FcPattern FcPattern; ++class SkTypeface; ++SK_API sk_sp<SkTypeface> SkFontMgr_createTypefaceFromFcPattern(const sk_sp<SkFontMgr>& mgr, FcPattern* pattern); ++ + #endif // #ifndef SkFontMgr_fontconfig_DEFINED +diff --git a/src/ports/SkFontMgr_fontconfig.cpp b/src/ports/SkFontMgr_fontconfig.cpp +index c2da39b28f..28483faf02 100644 +--- src/ports/SkFontMgr_fontconfig.cpp ++++ src/ports/SkFontMgr_fontconfig.cpp +@@ -690,6 +690,7 @@ class SkFontMgr_fontconfig : public SkFontMgr { + /** Creates a typeface using a typeface cache. + * @param pattern a complete pattern from FcFontRenderPrepare. + */ ++public: + sk_sp<SkTypeface> createTypefaceFromFcPattern(SkAutoFcPattern pattern) const { + if (!pattern) { + return nullptr; +@@ -1043,3 +1044,13 @@ protected: + SK_API sk_sp<SkFontMgr> SkFontMgr_New_FontConfig(FcConfig* fc) { + return sk_make_sp<SkFontMgr_fontconfig>(fc); + } ++ ++SK_API sk_sp<SkTypeface> SkFontMgr_createTypefaceFromFcPattern(const sk_sp<SkFontMgr>& mgr, FcPattern* pattern) ++{ ++ SkAutoFcPattern p([pattern]() { ++ FCLocker lock; ++ FcPatternReference(pattern); ++ return pattern; ++ }()); ++ return static_cast<SkFontMgr_fontconfig*>(mgr.get())->createTypefaceFromFcPattern(std::move(p)); ++} |