office-gobmx/external/skia/fontconfig-get-typeface.patch.1
Noel Grandin 9cf17d841a update to skia m124
Change-Id: I9bb712bdde8d2f2af792af5b439f4789e59f1595
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174720
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-10-09 18:21:02 +02:00

43 lines
1.7 KiB
Groff

diff -ur skia.org/include/ports/SkFontMgr_fontconfig.h skia/include/ports/SkFontMgr_fontconfig.h
--- skia.org/include/ports/SkFontMgr_fontconfig.h 2024-10-09 10:25:16.421928663 +0200
+++ skia/include/ports/SkFontMgr_fontconfig.h 2024-10-09 10:27:17.914640682 +0200
@@ -19,4 +19,9 @@
*/
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 -ur skia.org/src/ports/SkFontMgr_fontconfig.cpp skia/src/ports/SkFontMgr_fontconfig.cpp
--- skia.org/src/ports/SkFontMgr_fontconfig.cpp 2024-10-09 10:25:16.460928891 +0200
+++ skia/src/ports/SkFontMgr_fontconfig.cpp 2024-10-09 10:27:30.405714112 +0200
@@ -660,6 +660,7 @@
/** 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;
@@ -966,6 +967,16 @@
}
};
-sk_sp<SkFontMgr> SkFontMgr_New_FontConfig(FcConfig* fc) {
+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));
+}
Only in skia/src/ports: SkFontMgr_fontconfig.cpp.orig