<div dir="auto"><div dir="auto">A link to the previous discussion? which gives this some context would be appreciated.</div><div dir="auto"><br></div><br><br><div class="gmail_quote" dir="auto"><div dir="ltr">On Tue, Oct 16, 2018, 5:41 PM Nicolas Mailhot <<a href="mailto:nicolas.mailhot@laposte.net" target="_blank" rel="noreferrer">nicolas.mailhot@laposte.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Akira,<br>
<br>
> The priority number of fontconfig config files in packages is<br>
> hardcoded at this moment. this requires huge works to update,<br>
> particularly when changing default fonts say (even though it won't so<br>
> often happens but still when fixing config files and updating for huge<br>
> packages etc). so I'm pondering to manage the priority in centralized<br>
> package and determine it at runtime, allowing users to have own<br>
> ordering.<br>
> <br>
> I don't have any implementations for this but just to share an idea<br>
> with you.<br>
<br>
It’s great you’re looking at improving things! fontconfig has served us<br>
well all those years. But there are really a lot more free and open<br>
fonts nowadays than when fontconfig config syntax and file layout was<br>
defined (which is wonderful!). So things are cracking a bit at the<br>
seams, and not only on your side.<br>
<br>
If I may give my opinion (CC-ing the fontconfig ML since I don't think<br>
any of this is Fedora-specific). Probably more than what you asked, but<br>
such is life ;)<br>
<br>
1. fontconfig config syntax is too low level for the everyday needs of<br>
2018. It was great when fonts on freedesktop systems were a small known<br>
pile of semi-broken files squirrelled away by xorg and texlive, it’s not<br>
so great to manage today’s huge numbers of standardized opentype files.<br>
The current syntax allows writing excruciately precise and accurate<br>
rules, except no human has the time to define those rules for every<br>
possible font file we deploy, so we get to write precisely things we are<br>
not so sure about.<br>
<br>
2. so, this precise syntax should be kept to manage special cases, and<br>
something simpler and higher level should be introduced, with more<br>
things delegated to the fontconfig engine (like priorizing, as you<br>
rightly noted). Something like, process special precise rule in low-<br>
level fontconfig syntax first, then mass-process simplified high-level<br>
syntax.<br>
<br>
3. the first higher level object should be a set-of-rules object, so<br>
ordering can be managed independently of file layout (basically you<br>
would order sets, regardless if the sets are each in their own file or<br>
share a single file, and regardless of the naming of those files. So<br>
stop shuffling and renaming files around to order things.<br>
<br>
4. set ordering would be undefined and left to fontconfig by default,<br>
with one explicit human-maintained per-generic sets-that-must-go-<br>
first ordered list, and another per-generic sets-that-must-go-last list.<br>
And optional per-script overrides for those lists. Everything in between<br>
we don’t have the time and energy to order manually (and there’s no need<br>
to).<br>
<br>
5. Of course, one copy of the lists in /usr/share/fontconfig for the<br>
system integrator, with an override in /etc for the sysadmin, and<br>
another override in .config for each user <br>
<br>
6. IMHO to keep things manageable you should have one set = one font<br>
family (in the WWS sense, ie do not create as many sets as there are<br>
font family name variations, do not create separate sets for acmefont<br>
armenian and acmefont greek). We can extend font family definition to<br>
more things than just WWS when apps learn to manage more facets than<br>
just WWS for one font family, but at this point of time just doing WWS<br>
is taxing for the average app. Things like caption fonts, math fonts,<br>
etc should probably be merged with the WWS stuff eventually once we have<br>
more experience on handling those transparently in apps.<br>
<br>
7. that does force fontconfig to manage high-level simplified and<br>
unified font family naming, instead of hoping font files will come with<br>
clean consistent naming (they don't and they won't, stop hoping for it,<br>
stop relying on fontconfig config writers to fix it, stop inflicting on<br>
users long lists of non-merged font names and expect them to jungle with<br>
the result, managing technical splits in font families is fontconfig's<br>
job not the user job, the user should only have to specify the design<br>
and the style he wants). <br>
<br>
8. if there are several set definitions for the same font family at the<br>
same level of config (system integrator, sysadmin or user) just merge<br>
them transparently with undefined ordering rules when merging<br>
<br>
9. if one set exists in several level, allow the override levels<br>
(sysadmin and user) to define in their set if they want it merged with<br>
lower levels or if they want it to replace the lower level definitions<br>
<br>
10. The typical set should probably just define:<br>
* the generic the font family belongs to (what generic should be used<br>
to complete the font family, and what generic should ne constructed from<br>
the font family)<br>
* the list of known font families with similar design or metrics (so<br>
substitute this font family to those other font families if they are<br>
absent or lacking coverage, and conversely use those other font families<br>
to complete the font family if it lacks coverage). I really don’t think<br>
there is much benefit in ordering those manually. If there is some<br>
benefit, ordering should be an explicit attribute of the list, not the<br>
default.<br>
<br>
11. Eventually, the set could also contain<br>
* an explicit list of internal hidden font families to map to this set<br>
(ie hide those font families from font lists, present only the unified<br>
clean name, manage internally in fontconfig which font file to use<br>
depending on what needs to be rendered)<br>
* the same thing, with also a face mapping, if face needs correction<br>
too<br>
* an explicit "use this internal font family for this script" to manage<br>
situations when there are regional variations on how to render an<br>
unicode codepoint<br>
<br>
12. though I do hope opentype tables in shipped fonts get complete<br>
enough over time, and fontconfig gets smart enough over time, that all<br>
those mappings and overrides won’t need manual declaration long term.<br>
* IMHO fontconfig should map automatically by default everything<br>
defined in the WWS whitepaper,<br>
* and probably all the per-script/region/language common name<br>
variations<br>
<br>
13. and since people will rightfully object that naming heuristics are<br>
not reliable and fail in some cases<br>
* allow defining a set with a property that basically says "do not<br>
merge me, I’m different"<br>
* make merging the default, and not-merging an explicit exception<br>
<br>
With just that you should be able to handle 90% of what people need to<br>
declare to fontconfig today (handwaves). And have something easy to<br>
order at system, sysadmin or user level. The 10% of very specific and<br>
complex configuration that does not fit in this simplified model, can be<br>
handled with the current syntax. It’s small enough in volume that I<br>
doubt its causes you lots of management problems.<br>
<br>
Best regards,<br>
<br>
-- <br>
Nicolas Mailhot<br>
<br>
_______________________________________________<br>
Fontconfig mailing list<br>
<a href="mailto:Fontconfig@lists.freedesktop.org" rel="noreferrer noreferrer" target="_blank">Fontconfig@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/fontconfig" rel="noreferrer noreferrer noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/fontconfig</a><br>
</blockquote></div></div>