Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 618918

Summary: =media-libs/freetype-2.8: font 'Terminus' renamed to 'xos4 Terminus'
Product: Gentoo Linux Reporter: Andrew Petelin <adrianopol>
Component: Current packagesAssignee: Gentoo Fonts Team <fonts>
Status: CONFIRMED ---    
Severity: normal CC: alexander, fonts, marien.zwart, nobrowser, polynomial-c, skrattaren, theli.ua
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: `fc-match -v terminus` output

Description Andrew Petelin 2017-05-19 10:36:23 UTC
After updating from freetype-2.7.1-r2 to 2.8, I noticed 'Terminus' font was renamed and became 'xos4 Terminus', so font settings became inconsistent in some end-user GUI applications using this font: terminal emulators, gvim, gitk.

freetype-2.7.1-r2:

> $ fc-list | grep -i terminus
> /usr/share/fonts/terminus/ter-x18n.pcf.gz: Terminus:style=Regular
> ...
> /usr/share/fonts/terminus/ter-x12b.pcf.gz: Terminus:style=Bold
> ...


freetype-2.8:

> $ fc-list | grep -i terminus
> /usr/share/fonts/terminus/ter-x18n.pcf.gz: xos4 Terminus:style=Regular
> ...
> /usr/share/fonts/terminus/ter-x12b.pcf.gz: xos4 Terminus:style=Bold
> ...
Comment 1 Andrew Petelin 2017-05-22 21:07:51 UTC
Small edition: on another gentoo system everything was OK (I mean update to freetype-2.8) until recompiling the package media-fonts/terminus-font-4.39-r1.
Comment 2 Andrew Petelin 2017-05-22 21:12:28 UTC
I see: emerging the freetype doesn't invoke fc-cache, unlike emerging the terminus-font.
Comment 3 Andrew Petelin 2017-05-22 21:28:11 UTC
So, here is a temporary solution (for those who have installed terminus-font *after* having installed freetype-2.8):

* emerge -1 =freetype-2.7.1-r2  # downgrade
* emerge -1 terminus-font
* emerge -1 -u freetype         # restore
Comment 4 Nikolaj Šujskij 2017-05-24 17:25:28 UTC
Hit it too, but Andrew's workaround didn't work for me.
Comment 5 Nikolaj Šujskij 2017-05-24 17:29:44 UTC
Here's updtream discussion: https://lists.nongnu.org/archive/html/freetype/2017-01/msg00019.html
Comment 6 Andrew Petelin 2017-05-25 18:14:21 UTC
(In reply to Nikolaj Šujskij from comment #4)
> Hit it too, but Andrew's workaround didn't work for me.

Can you show your `fc-match -v terminus` output after downgrading to freetype-2.7.1-r2?
Comment 7 Nikolaj Šujskij 2017-05-26 21:32:02 UTC
Created attachment 474434 [details]
`fc-match -v terminus` output
Comment 8 Nikolaj Šujskij 2017-05-26 21:33:19 UTC
(In reply to Andrew Petelin from comment #6)
> (In reply to Nikolaj Šujskij from comment #4)
> Can you show your `fc-match -v terminus` output after downgrading to
> freetype-2.7.1-r2?

See attachment.  Output doesn't change, I've checked and diff'ed outputs after all three steps.
Comment 9 Andrew Petelin 2017-05-29 14:42:09 UTC
(In reply to Nikolaj Šujskij from comment #8)
> See attachment.  Output doesn't change, I've checked and diff'ed outputs
> after all three steps.

Hmm, but it means you have a proper font installation (see line `family: "Terminus"(s)` in your attachment). If the font was installed as 'xos4 Treminus', there would have been something like 'family: "DejaVu Sans"(s)' in the fc-match output (since there was no more 'Terminus' font).

Are you sure you are choosing exactly 'Terminus' name in your GUI application after downgrading freetype and reinstalling terminus-font package?
Comment 10 Nikolaj Šujskij 2017-05-31 19:08:51 UTC
(In reply to Andrew Petelin from comment #9)
> (In reply to Nikolaj Šujskij from comment #8)
> > See attachment.  Output doesn't change, I've checked and diff'ed outputs
> > after all three steps.
> Are you sure you are choosing exactly 'Terminus' name in your GUI
> application after downgrading freetype and reinstalling terminus-font
> package?

Positive.  Just tried it again.  However, I'm testing it in urxvt: https://bitbucket.org/skrattaren/dotfiles/src/default/Xdefaults#Xdefaults-28, could that be the reason?

Just in case:

[ebuild   R    ] media-fonts/terminus-font-4.40::gentoo  USE="X center-tilde pcf pcf-unicode-only psf ru-g -a-like-o -distinct-l -quote -raw-font-data -ru-dv -ru-i -ru-k" 0 KiB
Comment 11 Marien Zwart 2017-06-03 15:40:22 UTC
This is a new feature which got introduced upstream in 2.7.1 and disabled by default in 2.8 (see https://lists.nongnu.org/archive/html/freetype/2017-01/msg00041.html).

Gentoo is explicitly enabling it (https://gitweb.gentoo.org/repo/gentoo.git/tree/media-libs/freetype/freetype-2.8.ebuild#n78).

The ebuild mentions it can be disabled through the FREETYPE_PROPERTIES="pcf:no-long-family-names=1" environment variable. This might only work correctly if set at the system level, because the font family gets cached in /var/cache/fontconfig. Those caches get updated whenever you emerge a font, so the variable would probably have to be set at that time.

It can also be worked around at the fontconfig level, by dropping something like "<fontconfig><alias><family>Terminus</family><prefer><family>xos4 Terminus</family></prefer></alias></fontconfig>" into ~/.config/fontconfig/conf.d/50-terminus-name.conf (or system-wide in /etc/fonts/conf.d). But that might not fix some unusual applications (it didn't fix Emacs for me).

So unless other distros also start enabling this, it's a bit annoying (for me, apparently there are pcf fonts for which this is quite useful as they otherwise have a generic name).
Comment 12 Nikolaj Šujskij 2017-06-07 19:47:27 UTC
(In reply to Andrew Petelin from comment #9)
> (In reply to Nikolaj Šujskij from comment #8)
> > See attachment.  Output doesn't change, I've checked and diff'ed outputs
> > after all three steps.
> 
> Hmm, but it means you have a proper font installation (see line `family:
> "Terminus"(s)` in your attachment). If the font was installed as 'xos4
> Treminus', there would have been something like 'family: "DejaVu Sans"(s)'
> in the fc-match output (since there was no more 'Terminus' font).
> 
> Are you sure you are choosing exactly 'Terminus' name in your GUI
> application after downgrading freetype and reinstalling terminus-font
> package?

Sorry, I confused myself with urxvt/urxvtc.  The former behaves just as you described, while the latter seems to use font family that were cached when urxvtd had been started.