From 6dfac38bacd449c64a13363797b56aff49cf8f52 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Thu, 18 Jul 2024 15:35:49 +0200 Subject: tdf#162072 vcl, fontconfig: consider font-family-generic for substitute Open the bugdoc, it has two paragraphs: first with a sans font, second with a serif font. These fonts are missing, but their metadata clearly state that they are sans vs serif. Still, Writer renders both as sans. Investigating a bit, the ODT case imports the "font-family-generic" of these fonts fine, but in the Linux case the fontconfig code ignored this info when building the search pattern for the font fallback. Fix the problem by extending vcl's PrintFontManager::Substitute() to also take the vcl-level "family type" into account, which is about sans vs serif (roman vs swiss). Note that FC_FAMILY is a string list, so once the actual font name is added to the pattern, the next "add" will append to this list, not drop the already added font name. The same problem is still there with the DOCX equivalent. Change-Id: I61f31ae73e524471a5261ac9426e5b566454a09c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170681 Reviewed-by: Miklos Vajna Tested-by: Jenkins --- vcl/Module_vcl.mk | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'vcl/Module_vcl.mk') diff --git a/vcl/Module_vcl.mk b/vcl/Module_vcl.mk index 35c6427b4ed1..c0a624acdc95 100644 --- a/vcl/Module_vcl.mk +++ b/vcl/Module_vcl.mk @@ -293,4 +293,12 @@ $(eval $(call gb_Module_add_slowcheck_targets,vcl,\ )) endif +ifneq ($(filter MORE_FONTS,$(BUILD_TYPE)),) +ifeq ($(OS),LINUX) +$(eval $(call gb_Module_add_slowcheck_targets,vcl,\ + CppunitTest_vcl_unx_generic \ +)) +endif +endif + # vim: set noet sw=4 ts=4: -- cgit