Bug 29341 - Make some fontconfig paths configurable
Summary: Make some fontconfig paths configurable
Status: RESOLVED FIXED
Alias: None
Product: fontconfig
Classification: Unclassified
Component: library (show other bugs)
Version: 2.8
Hardware: Other All
: medium normal
Assignee: Akira TAGOH
QA Contact: Keith Packard
URL:
Whiteboard:
Keywords:
: 18470 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-08-01 07:22 UTC by Nicolas Mailhot
Modified: 2012-04-09 00:46 UTC (History)
5 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Patch to make those changes, lightly tested inside an rpm build environement (7.75 KB, patch)
2010-08-01 07:25 UTC, Nicolas Mailhot
Details | Splinter Review

Description Nicolas Mailhot 2010-08-01 07:22:36 UTC
The FHS mandates that some files installed by fontconfig should probably not be installed where they are now (for example, the configuration snippets should *not* be modified by users, they should unlink the one they want to change and edit a copy as a new file, to prevent problems on fontconfig package upgrades)

Make the associated paths configurable, and set sane default values

(see attached patch)
Comment 1 Nicolas Mailhot 2010-08-01 07:24:19 UTC
Paths use the same conventions already in place for a few releases in Fedora font packages

Moving the dtd is more cosmetic, but is nice when a distro uses xmlcatalog (as Fedora does)
Comment 2 Nicolas Mailhot 2010-08-01 07:25:17 UTC
Created attachment 37500 [details] [review]
Patch to make those changes, lightly tested inside an rpm build environement
Comment 3 Parag 2010-10-26 18:18:35 UTC
ping Behdad,
   Please provide your feedback for attached patch. If looks ok then can you please commit it upstream so that I can use it in Fedora fontconfig build?
Comment 4 Behdad Esfahbod 2010-12-28 00:46:19 UTC
The confdir vs masterconfdir distinction looks like an overkill to me.  Why do you need both?
Comment 5 Nicolas Mailhot 2010-12-28 01:06:29 UTC
(In reply to comment #4)
> The confdir vs masterconfdir distinction looks like an overkill to me.  Why do
> you need both?

That's mainly historical, I didn't want to be too invasive and move /etc/fonts/fonts.conf (no idea how many places this part is hardcoded into).

Unless you want to prohibit users changing fonts.conf, and force them to make all their changes in detached /etc/fonts/conf.d files, you need to keep a directory in /etc to put it in

Granted, if FHS support had been built in fontconfig from the start, and not retrofited now, the directory structure would probably have looked more like :

/usr/share/xml/fontconfig/
/usr/share/fontconfig/
/etc/fontconfig.conf
/etc/fontconfig.d/

with :
/usr/share/xml/fontconfig/ ← dtd and other schema files, /usr/share/xml/fontconfig.dtd if we're sure there will only be one dtd file forever

/usr/share/fontconfig/ ← configuration snippets, templates, etc

/etc/fontconfig.conf ← master configuration file

/etc/fontconfig.d/10-foo.conf

I tried to limit changes to the strict minimum to be FHS compliant and silence rpm warnings
Comment 6 Behdad Esfahbod 2010-12-28 01:22:29 UTC
That's the same structure as we have right now, more or less...

I need more time processing this then.  I still think it can be done in a simpler way.

What's the required features you want to see?  Being able to move templates to /usr/share is one.  What else?  Do you want other packages to be able to query the conf.d dir?
Comment 7 Nicolas Mailhot 2010-12-28 01:42:40 UTC
(In reply to comment #6)

> What's the required features you want to see?  Being able to move templates to
> /usr/share is one.  What else?  Do you want other packages to be able to query
> the conf.d dir?

I want to :

1. move the schema files to /usr/share/xml to be able to register them in the system catalog files cleanly so xml tools just as xmllint just work

2. move the detached configuration snippets somewhere in /usr/share/fontconfig to make clear they should not be modified by users

3. reserve a subdirectory in /usr/share/fontconfig where Fedora and other distributions can drop their own configuration templates 
(such as the ones in http://git.fedorahosted.org/git/?p=fontpackages.git;a=tree;f=fontconfig-templates)

4. have a specific place in /etc where active configuration files can be dropped or symlinked to

5. have 2. 3. 4. locations configurable at ./configure time so Fedora can pass its locations to fontconfig nad be sure font packages and fontconfig agree where files are (basically, we define font-related locations in http://git.fedorahosted.org/git/?p=fontpackages.git;a=blob_plain and have all font-related packages use those variable to decide where they put stuff)

6. be able to invoque fontconfig utilities such as fc-scan with a directory containing additionnal configuration files (or be able to pass a list of absolute paths of additionnal configuration files), to ask questions such as "what would be the font name associated with this ttf file if you consider the system font configuration and those configuration files I intend to install with the ttf file?
Comment 8 Akira TAGOH 2012-03-23 02:02:34 UTC
I basically agree with this idea. we should avoid keeping files in /etc at least which isn't desired to be modified by the users.
Comment 9 Akira TAGOH 2012-04-04 00:55:54 UTC
the proposed fix:
http://cgit.freedesktop.org/~tagoh/fontconfig/commit/?h=bz29341

the default path for conf.avail only is changed. others are compatible with the older releases. this should less affects.
Comment 10 Akira TAGOH 2012-04-04 20:26:52 UTC
fixed in e181ab4d
Comment 11 Akira TAGOH 2012-04-09 00:46:08 UTC
*** Bug 18470 has been marked as a duplicate of this bug. ***


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.