Bug 161533 - Tests affected by system fontconfig with SAL_NON_APPLICATION_FONT_USE=abort
Summary: Tests affected by system fontconfig with SAL_NON_APPLICATION_FONT_USE=abort
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: graphics stack (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:25.2.0
Keywords:
Depends on:
Blocks:
 
Reported: 2024-06-12 16:49 UTC by Jonathan Clark
Modified: 2024-09-11 12:04 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Clark 2024-06-12 16:49:55 UTC
Description:
As I understand, the intended purpose of the `SAL_NON_APPLICATION_FONT_USE` environment variable is to isolate tests from the system fontconfig. Unfortunately, this does not seem to work in all cases.

For example: `CppunitTest_sw_txtimport` requires use of Chinese text. On a clean install of Ubuntu 24.04 without any CJK features, this test passes as expected. However, after installing CJK font packages, this test fails due to an assertion in font fallback. The assertion does technically stop the test from using the system font, but the existence of a system-wide config file pointing to a system font changes the test's behavior.

Steps to Reproduce:
1. Install Ubuntu 24.04 with Japanese language support (System -> Manage Installed Languages -> Install/Remove Languages...), `fonts-noto-cjk`, and `fonts-noto-cjk-extra`.
2. Run test `CppunitTest_sw_txtimport` with non-application font use set to `abort`. The test will fail.
3. Remove CJK-related font config and rebuild cache. (On my system, in `/etc/fonts/conf.d` remove `30-cjk-aliases.conf`, `64-language-selector-cjk-prefer.conf`, `69-*.conf`, `70-fonts-noto-cjk.conf`, and then run `fc-cache -f`.)
4. Run test `CppunitTest_sw_txtimport`, as before. The test now passes.

Actual Results:
Test behavior is affected by system fontconfig configuration files.

Expected Results:
Tests should behave the same way regardless of system fontconfig.


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: e406fc87d631cb2edf3c6dec70772cd0511a251c
CPU threads: 32; OS: Linux 6.8; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 1 Commit Notification 2024-06-12 21:52:02 UTC
Jonathan Clark committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/95dd795e7510e62e9fc316e5ac8c1057b58a8f4e

Related: tdf#161533 Test fixes for CJK systems

It will be available in 25.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.