076926cef9
The Cairo-based way reuses code that is used for OpenGL, but it's needlessly complicated, given that Skia itself is capable of text rendering as well. This requires a small patch for Skia so that it uses the FcPattern* we use for selecting a font. The rendering with this commit is usable, but visually the result is noticeably different, so this will need tweaks to the font rendering (TBD). Change-Id: I058c282307106c929ccc9faa7b2bddfabf0f0a2c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90580 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
32 lines
1.4 KiB
Text
32 lines
1.4 KiB
Text
--- ./src/ports/SkFontMgr_fontconfig.cpp.sav 2020-01-20 16:42:51.322186451 +0100
|
|
+++ ./src/ports/SkFontMgr_fontconfig.cpp 2020-03-13 11:25:15.793936659 +0100
|
|
@@ -699,6 +699,7 @@ class SkFontMgr_fontconfig : public SkFo
|
|
/** Creates a typeface using a typeface cache.
|
|
* @param pattern a complete pattern from FcFontRenderPrepare.
|
|
*/
|
|
+public:
|
|
sk_sp<SkTypeface> createTypefaceFromFcPattern(FcPattern* pattern) const {
|
|
FCLocker::AssertHeld();
|
|
SkAutoMutexExclusive ama(fTFCacheMutex);
|
|
@@ -1039,3 +1040,9 @@ 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)
|
|
+{
|
|
+ FCLocker lock;
|
|
+ return static_cast<SkFontMgr_fontconfig*>(mgr.get())->createTypefaceFromFcPattern(pattern);
|
|
+}
|
|
--- ./include/ports/SkFontMgr_fontconfig.h.sav 2019-09-19 11:38:00.943185323 +0200
|
|
+++ ./include/ports/SkFontMgr_fontconfig.h 2020-03-13 11:31:48.025716543 +0100
|
|
@@ -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
|