Add extra font config options for emscripten wasm build

In case of wasm build we can have missing default font config
options compared to Linux or other builds. These options are
necessary for the FontConfig lib.

Change-Id: I3e04847f28bdbd28c767793bf5cb4061b7b3a251
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182462
Tested-by: Jenkins
Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de>
This commit is contained in:
Balazs Varga
2025-03-04 09:55:12 +01:00
parent d4a878c726
commit ac5c93bfbe
8 changed files with 46 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
<!-- Use the Antialiasing -->
<match target="pattern">
<edit name="antialias" mode="assign">
<bool>true</bool>
</edit>
</match>

View File

@@ -0,0 +1,6 @@
<!-- Use Slight Hinting -->
<match target="pattern">
<edit name="hintstyle" mode="assign">
<const>hintslight</const>
</edit>
</match>

View File

@@ -0,0 +1,6 @@
<!-- Use Hinting -->
<match target="pattern">
<edit name="hinting" mode="assign">
<bool>true</bool>
</edit>
</match>

View File

@@ -0,0 +1,6 @@
<!-- Use Auto Hinting -->
<match target="pattern">
<edit name="autohint" mode="assign">
<bool>false</bool>
</edit>
</match>

View File

@@ -0,0 +1,6 @@
<!-- Use lcddefault as default for LCD filter -->
<match target="pattern">
<edit name="lcdfilter" mode="assign">
<const>lcddefault</const>
</edit>
</match>

View File

@@ -22,6 +22,13 @@ endif
$(gb_CustomTarget_workdir)/postprocess/fontconfig/fc_local.conf:
printf '<?xml version="1.0"?>\n<!DOCTYPE fontconfig SYSTEM "/etc/fonts/conf.d/fonts.dtd">\n<fontconfig>\n' >$@
cat $(SRCDIR)/extras/source/truetype/symbol/fc_local.snippet >>$@
ifeq (EMSCRIPTEN,$(OS))
cat $(SRCDIR)/extras/source/truetype/symbol/fc_10-antialias.snippet >>$@
cat $(SRCDIR)/extras/source/truetype/symbol/fc_10-hinting.snippet >>$@
cat $(SRCDIR)/extras/source/truetype/symbol/fc_10-hinting-style.snippet >>$@
cat $(SRCDIR)/extras/source/truetype/symbol/fc_10-no-autohint.snippet >>$@
cat $(SRCDIR)/extras/source/truetype/symbol/fc_11-lcdfilter-default.snippet >>$@
endif
ifneq ($(filter MORE_FONTS,$(BUILD_TYPE)),)
cat $(SRCDIR)/external/more_fonts/fc_local.snippet >>$@
endif

View File

@@ -222,6 +222,9 @@ public:
virtual css::uno::Reference<css::uno::XInterface>
ImplCreateDropTarget(const SystemEnvData*) override;
// for qt font options
virtual const cairo_font_options_t* GetCairoFontOptions() override;
// whether to reduce animations; KFSalInstance overrides this to read Plasma settings
virtual bool GetUseReducedAnimation() { return false; }
void UpdateStyle(bool bFontsChanged);

View File

@@ -670,6 +670,12 @@ QtInstance::ImplCreateDropTarget(const SystemEnvData* pSysEnv)
return vcl::X11DnDHelper(new QtDropTarget(), pSysEnv->aShellWindow);
}
const cairo_font_options_t* QtInstance::GetCairoFontOptions()
{
static cairo_font_options_t* gOptions = cairo_font_options_create();
return gOptions;
}
IMPL_LINK_NOARG(QtInstance, updateStyleHdl, Timer*, void)
{
SolarMutexGuard aGuard;