Bug 179815 - system configuration overrides per-user configuration.
system configuration overrides per-user configuration.
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: fontconfig (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Behdad Esfahbod
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-02-03 00:09 EST by Tim Mayberry
Modified: 2007-11-30 17:11 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-10-25 21:40:28 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
user font configuration (294 bytes, text/plain)
2006-02-03 00:09 EST, Tim Mayberry
no flags Details
Patch to system font configuration so that user preferences are not overwritten (7.72 KB, patch)
2006-02-23 20:43 EST, Tim Mayberry
no flags Details | Diff

  None (edit)
Description Tim Mayberry 2006-02-03 00:09:01 EST
Description of problem:
It appears that the global fontconfig configuration file overrides any
directives that a user sets in thier ~/.font.conf

Version-Release number of selected component (if applicable):
2.3.93

How reproducible:

Write a ~/.font.conf file that contains matching rules etc that are contrary to
the system configuration.

Steps to Reproduce:
1. put attached .font.conf file in your home directory
2. install fonts-chinese via yum install fonts-chinese
3. $LANG=zh_TW.UTF-8 gedit
  
Actual results:

The embedded bitmaps are still used.

Expected results:

That the outline glyphs are used.

Additional info:

Assuming that the correct behaviour is for the user configuration to override
the system configuration then changing the include order of the configuration
files within the system /etc/fonts/fonts.conf file from this:

<!--
  Load per-user customization file
-->
        <include ignore_missing="yes">~/.fonts.conf</include>

<!--
  Load local system customization file
-->
        <include ignore_missing="yes">conf.d</include>
        <include ignore_missing="yes">local.conf</include>

to this:

<!--
  Load local system customization file
-->
        <include ignore_missing="yes">conf.d</include>
        <include ignore_missing="yes">local.conf</include>

<!--
  Load per-user customization file
-->
        <include ignore_missing="yes">~/.fonts.conf</include>

Seems to fix the problem.
Comment 1 Tim Mayberry 2006-02-03 00:09:01 EST
Created attachment 124084 [details]
user font configuration
Comment 2 Tim Mayberry 2006-02-23 20:42:28 EST
I found this bug in the upstream tracker that relates to this problem
https://bugs.freedesktop.org/show_bug.cgi?id=3537

Based on the comment from Keith I believe that any setting in the system font
configuration should not overwrite an existing setting but in order to do so
each time a particular option is set we need to test whether the user or some
other part of the config has already set that option. This seems a little
strange but I have attached a patch to do this for the 50-no-hint-fonts.conf
file which controls the system preferences for whether hinting or embedded
bitmaps are used for particular fonts. The embedded bitmap stuff could probably
be moved to another file.

With this patch the user font configuration file that is attached to this bug
should work. I have not gone through the rest of the system configuration files
to check whether the system configuration overwrites user font preferences, but
if the patch is considered to be the correct approach I can do that.
Comment 3 Tim Mayberry 2006-02-23 20:43:55 EST
Created attachment 125152 [details]
Patch to system font configuration so that user preferences are not overwritten
Comment 4 Matthias Clasen 2006-07-27 23:19:41 EDT
Behdad, what do you say ?
Comment 5 Behdad Esfahbod 2006-07-28 00:11:50 EDT
It's a hard call.  The main fonts.conf is ordered like this:

  general configuration
  include ~/.fonts.conf
  include conf.d
  include local.conf
  alias common families to sans, serif, and mono
  synthesize artificial oblique and bold

So, it's not obvious whether including conf.d after ~/.fonts.conf is correct. 
Depending on what is being done in conf.d, they should be before or after
.fonts.conf.  Somebody suggested on the fontconfig mailing list just yesterday
that we switch the order and include user config after other config.  That looks
more natural to me, but may break current configurations.

The patch attached is indeed a partial solution that works in the case of
50-no-hint-fonts.conf.  I'll rather wait a bit to discuss this on the list
before committing.
Comment 6 Matthias Clasen 2007-04-01 22:44:07 EDT
Any conclusions on this, Behdad ?
Comment 7 Behdad Esfahbod 2007-10-25 21:40:28 EDT
Things have changed in the mean time.  User config is now loaded from
50-user.conf, so system config can go both before and after it.

We've renamed 50-no-hint-fonts.conf to 25-no-hint-fonts.conf since, so it's
loaded before user config.  So, user can delete current configuration and
override it.

Note You need to log in before you can comment on or make changes to this bug.