[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#720953: fonts-texgyre: bump fontconfig hinting to 31 to win over inferior gsfonts



Am Dienstag, den 03.09.2013, 00:23 +0900 schrieb Norbert Preining: 
> I get loads of
> helvR12-ISO8859-1.pcf.gz: "Helvetica" "Regular"
> [...]

That's bitmap fonts, you should probably just get rid of them in
fontconfig: /etc/fonts/conf.d/70-no-bitmaps.conf

> followed by
> uhvr8a.pfb: "Nimbus Sans L" "Regular"
> [...]

That's the copy of Helvetica in texlive-fonts-recommended that is
symlinked into /usr/share/fonts.

> followed by
> n019003l.pfb: "Nimbus Sans" "Regular"
> [...]

That's the same font from the gsfonts package.

> followed by
> texgyreheros-regular.otf: "TeX Gyre Heros" "Regular"
> [...]

And finally the texgyre variant.

> So a bit a different order. What might be the reason for that?

I am not sure, but I have an idea. It has to do with the order in which
fontconfig parses its config files and the packages installed on the
system that provide the requested font. Also, it has to do with the
changed font family names of the updated URW fonts in the
fonts-urw-base35 package.

As far as I know, fontconfig parses and works on its config files in
strict alphabetic order and later rules override former ones. That means
that "Helvetica" is mapped to "TeX Gyre Heros" in
30-fonts-texgyre-aliases.conf which is then overridden by the mapping of
"Helvetica" to "Nimbus Sans L" in 30-metric-aliases.conf which is parsed
just afterwards. That's the reason why both copies of that font in Type
1 format (from texlive-fonts-recommended and gsfonts) appear in fc-match
*before* the corresponding texgyre variant on your system.

On my system, things are a bit different. I do not have the
texlive-fonts-recommended package installed, at least not a recent
version in which the urw fonts are symlinked into /usr/share/fonts. And
I have replaced gsfonts with the fonts-urw-base35 package, in which the
font family names have been slightly changed relative to the ones in
gsfonts. That means, the mapping of "Helvetica" to "Nimbus Sans L" in
30-metric-aliases.conf does not apply and the mapping of "TeX Gyre
Heros" still has precedence. In the later rule 31-fonts-urw-base35.conf
I re-map the new font family names to the ones from gsfonts that get
checked for in 30-metric-aliases.conf, but the mappings in this file
have already been deferred.

So, in order for the mappings of the PostScript fonts to the texgyre
fonts to get prefered in fontconfig (with either of gsfonts or
fonts-texlive-recommended or fonts-urw-base35 installed), the
30-fonts-texgyre-aliases.conf config file has to be moved to slot 32.
Else, we can wait until fonts-urw-base35 has replaced gsfonts, then the
problem will disappear because of the ordering of the fontconfig config
files and the absence of the expected font family names - that is, if
texlive-fonts-recommended does not ship the urw fonts itself anymore and
thus fulfills the rules in 30-metric-aliases.conf.

Complicated, isn't it? But I hope I could somehow shed some light on
this issue [personally, it helped me a lot to write it down and read
through it again ;)].

- Fabian


Reply to: