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 <vmiklos@collabora.com>
Tested-by: Jenkins
2024-07-18 08:35:49 -05:00
|
|
|
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
|
|
|
|
#*************************************************************************
|
|
|
|
#
|
|
|
|
# This file is part of the LibreOffice project.
|
|
|
|
#
|
|
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
#
|
|
|
|
#*************************************************************************
|
|
|
|
|
|
|
|
$(eval $(call gb_CppunitTest_CppunitTest,vcl_unx_generic))
|
|
|
|
|
|
|
|
$(eval $(call gb_CppunitTest_use_externals,vcl_unx_generic,\
|
|
|
|
boost_headers \
|
|
|
|
harfbuzz \
|
|
|
|
))
|
|
|
|
|
|
|
|
$(eval $(call gb_CppunitTest_set_include,vcl_unx_generic,\
|
|
|
|
-I$(SRCDIR)/vcl/inc \
|
|
|
|
$$(INCLUDE) \
|
|
|
|
))
|
|
|
|
|
|
|
|
$(eval $(call gb_CppunitTest_add_exception_objects,vcl_unx_generic, \
|
|
|
|
vcl/qa/unx/generic/generic \
|
|
|
|
))
|
|
|
|
|
|
|
|
$(eval $(call gb_CppunitTest_use_libraries,vcl_unx_generic, \
|
|
|
|
comphelper \
|
|
|
|
cppu \
|
|
|
|
cppuhelper \
|
|
|
|
sal \
|
|
|
|
subsequenttest \
|
|
|
|
test \
|
|
|
|
tl \
|
|
|
|
unotest \
|
|
|
|
utl \
|
|
|
|
vcl \
|
|
|
|
))
|
|
|
|
|
|
|
|
$(eval $(call gb_CppunitTest_use_sdk_api,vcl_unx_generic))
|
|
|
|
|
|
|
|
$(eval $(call gb_CppunitTest_use_ure,vcl_unx_generic))
|
|
|
|
$(eval $(call gb_CppunitTest_use_vcl,vcl_unx_generic))
|
|
|
|
|
|
|
|
$(eval $(call gb_CppunitTest_use_rdb,vcl_unx_generic,services))
|
|
|
|
|
|
|
|
$(eval $(call gb_CppunitTest_use_custom_headers,vcl_unx_generic,\
|
|
|
|
officecfg/registry \
|
|
|
|
))
|
|
|
|
|
|
|
|
$(eval $(call gb_CppunitTest_use_configuration,vcl_unx_generic))
|
|
|
|
|
2024-07-18 12:25:58 -05:00
|
|
|
# Note that this is intentionally 'deny' and not 'abort', so we allow font fallback (we want to
|
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 <vmiklos@collabora.com>
Tested-by: Jenkins
2024-07-18 08:35:49 -05:00
|
|
|
# test that code), but we want predictable results, so not considering system fonts.
|
|
|
|
$(eval $(call gb_CppunitTest_set_non_application_font_use,vcl_unx_generic,deny))
|
|
|
|
|
|
|
|
$(eval $(call gb_CppunitTest_use_more_fonts,vcl_unx_generic))
|
|
|
|
|
|
|
|
# vim: set noet sw=4 ts=4:
|