Bug 104713 - fontconfig now loads all conf.avail files, breaks system configuration
Summary: fontconfig now loads all conf.avail files, breaks system configuration
Status: RESOLVED FIXED
Alias: None
Product: fontconfig
Classification: Unclassified
Component: library (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: fontconfig-bugs
QA Contact: Behdad Esfahbod
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-20 21:48 UTC by Mike Miller
Modified: 2018-01-23 14:07 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Mike Miller 2018-01-20 21:48:10 UTC
With git master, fontconfig now loads all configuration files in /usr/share/fontconfig/conf.avail after loading the desired system configuration. This conflicts with the desired system configuration. For example, if the system has enabled 70-no-bitmaps.conf, 70-yes-bitmaps.conf is loaded later and overrides it.

This appears to be due to

    (void) FcConfigParseOnly (config, (const FcChar8 *)FC_TEMPLATEDIR, FcFalse);

in FcInitLoadOwnConfig. The intent seems to be to parse the files for their syntax and descriptions only, but it appears that the configurations are added to the selection rules anyway.

With fontconfig 2.12.6 on my system

    $ fc-list :scalable=false

returns no fonts because 70-no-bitmaps.conf is enabled.

With git master, and the same system configuration,

    $ ./fc-list/fc-list :scalable=false
    /usr/share/fonts/X11/75dpi/courR24-ISO8859-1.pcf.gz: Courier:style=Regular
    /usr/share/fonts/X11/75dpi/courR08-ISO8859-1.pcf.gz: Courier:style=Regular
    ...

FC_DEBUG=1024 shows that fontconfig is "scanning" conf.avail files instead of "loading".

If I delete the call to FcConfigParseOnly, then the "scanning" output disappears and the fc-list and fc-match results behave correctly.
Comment 1 Akira TAGOH 2018-01-22 07:48:44 UTC
The problem is that there are some code in fcxml.c that immediately takes effects during parsing. will fix that.
Comment 2 Akira TAGOH 2018-01-23 14:07:18 UTC
fixed in git ef748b3


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.