You are not logged in.

#1 2019-03-23 17:44:00

crem
Member
Registered: 2018-01-14
Posts: 41

[SOLVED] Some fonts started to render incorrectly in terminal after u…

Since an update ~2 weeks ago some fonts in my terminal fail to render correctly.
Could you help me to debug/fix that?

Facts about the issue:

  • When I select one of the fonts which don't work, wrong font is displayed, and also characters overlap:
    https://cdn.discordapp.com/attachments/ … nknown.png

  • The issue at least occurs in Terminator and Gnome Terminal, while in some other places, including font selection dialog, those fonts are rendered fine:
    https://media.discordapp.net/attachment … nknown.png

  • The font that I'm trying to use is Dina, which is a bitmap font, but the same issue happens with some TTF fonts (e.g. "DejaVu Sans Book" doesn't work, while "DejaVu Sans Mono bold" does work).

  • Other bitmap fonts work (e.g. Gohu).

What I tried so far:

  • Reinstalled font-related packages (some of them)

  • Did fc-cache -f -v, and the same with sudo. Don't know what it's supposed to do, probably rebuild some caches. smile

  • Tried to symlink 70-no-bitmaps.conf from /etc/conf.avail/ to conf.d.  That (expectedly) broke all other bitmap fonts, so reverted.

$ fc-list 'Dina'
/usr/share/fonts/misc/DinaBold10.pcf.gz: Dina:style=Bold
/usr/share/fonts/misc/DinaBold9.pcf.gz: Dina:style=Bold
/usr/share/fonts/misc/DinaBoldItalic10.pcf.gz: Dina:style=Bold Italic
/usr/share/fonts/misc/DinaMedium10.pcf.gz: Dina:style=Regular
/usr/share/fonts/misc/DinaBoldItalic9.pcf.gz: Dina:style=Bold Italic
/usr/share/fonts/misc/DinaMedium9.pcf.gz: Dina:style=Regular
/usr/share/fonts/misc/DinaItalic8.pcf.gz: Dina:style=Italic
/usr/share/fonts/misc/DinaBold8.pcf.gz: Dina:style=Bold
/usr/share/fonts/misc/DinaMedium6.pcf.gz: Dina:style=Regular
/usr/share/fonts/misc/DinaBoldItalic8.pcf.gz: Dina:style=Bold Italic
/usr/share/fonts/misc/DinaItalic10.pcf.gz: Dina:style=Italic
/usr/share/fonts/misc/DinaItalic9.pcf.gz: Dina:style=Italic
/usr/share/fonts/misc/DinaMedium8.pcf.gz: Dina:style=Regular
$ fc-match Dina
DinaMedium10.pcf.gz: "Dina" "Regular"

moderator edit -- replaced oversized images with links.
Pasting pictures and code


Solution

It was a bug in freetype2, the problem went away with upgrade to freetype2-2.10.0-2
Don't forget to rebuild the cache after upgrade:

$ sudo fc-cache -rs

Last edited by crem (2019-04-28 14:05:48)

Offline

#2 2019-03-23 18:05:08

seth
Member
Registered: 2012-09-03
Posts: 51,017

Re: [SOLVED] Some fonts started to render incorrectly in terminal after u…

DejaVu Sans Book is no monospace font and virtually no TE can reasonably deal w/ that (because there's no good way to deal with that)
https://www.archlinux.org/packages/comm … dina-font/ supposingly is a monospace font and was last update in Nov. 2018 but there's no way the "Dina" font in https://media.discordapp.net/attachment … nknown.png is monospace

Output for

FC_DEBUG=4 pango-view --font="Dina" -t D | grep family:

?

Offline

#3 2019-03-23 18:10:43

crem
Member
Registered: 2018-01-14
Posts: 41

Re: [SOLVED] Some fonts started to render incorrectly in terminal after u…

Output: https://gist.github.com/mooskagh/af8e84 … 13c7ba1ad8
Window: https://cdn.discordapp.com/attachments/ … nknown.png
("D" does not look like it's Dina font for me)

seth wrote:

2018 but there's no way the "Dina" font in https://media.discordapp.net/attachment … nknown.png is monospace

Indeed the text "Dina Regular" etc is not rendered in Dina (monospace) font.

But the sample below "The quick brown fox..." does look like proper Dina to me.

Last edited by crem (2019-03-23 18:59:14)

Offline

#4 2019-03-23 20:08:58

seth
Member
Registered: 2012-09-03
Posts: 51,017

Re: [SOLVED] Some fonts started to render incorrectly in terminal after u…

There's something off.
The glyph is resolved from DejaVu - I installed dina and checked, it's resolved from Dina here.
Check "pacman -Qkk dina-font" and inspect your pacman log on fontconfig/freetype related updates around the time when this broke.

Offline

#5 2019-03-23 20:27:24

crem
Member
Registered: 2018-01-14
Posts: 41

Re: [SOLVED] Some fonts started to render incorrectly in terminal after u…

seth wrote:

There's something off.
The glyph is resolved from DejaVu - I installed dina and checked, it's resolved from Dina here.
Check "pacman -Qkk dina-font" and inspect your pacman log on fontconfig/freetype related updates around the time when this broke.

$ pacman -Qkk dina-font
dina-font: 26 total files, 0 altered files

Relevant part of pacman log: https://gist.github.com/mooskagh/dc48d4 … 29d1fa2889. I'm 70% sure that it's broke after update on 2019-03-13, but it may also be previous or next update (2019-03-09 [25% sure] or 2019-03-15 [5% sure]).

Although the only two font-related packages (xorg-mkfontscale and libfontenc) happened at 2019-03-09. There's also gtk3 update, who knows maybe it could affect it..
Ah, and also there are freetype2 library upgrades..

Downgrading freetype2 and libfontenc didn't help.
Trying to downgrade xorg-mkfontscale, so far getting those:

$ sudo pacman -U /var/cache/pacman/pkg/xorg-mkfontscale-1.1.3-1-x86_64.pkg.tar.xz
loading packages...
warning: downgrading package xorg-mkfontscale (1.2.1-1 => 1.1.3-1)
resolving dependencies...
looking for conflicting packages...
error: failed to prepare transaction (could not satisfy dependencies)
:: installing xorg-mkfontscale (1.1.3-1) breaks dependency 'xorg-mkfontdir' required by mathjax
:: installing xorg-mkfontscale (1.1.3-1) breaks dependency 'xorg-mkfontdir' required by ttf-dejavu
:: installing xorg-mkfontscale (1.1.3-1) breaks dependency 'xorg-mkfontdir' required by ttf-google-fonts-git
:: installing xorg-mkfontscale (1.1.3-1) breaks dependency 'xorg-mkfontdir' required by ttf-ms-win8
:: installing xorg-mkfontscale (1.1.3-1) breaks dependency 'xorg-mkfontdir' required by ttf-ms-win8-arabic
:: installing xorg-mkfontscale (1.1.3-1) breaks dependency 'xorg-mkfontdir' required by ttf-ms-win8-hebrew
:: installing xorg-mkfontscale (1.1.3-1) breaks dependency 'xorg-mkfontdir' required by ttf-ms-win8-indic
:: installing xorg-mkfontscale (1.1.3-1) breaks dependency 'xorg-mkfontdir' required by ttf-ms-win8-japanese
:: installing xorg-mkfontscale (1.1.3-1) breaks dependency 'xorg-mkfontdir' required by ttf-ms-win8-korean
:: installing xorg-mkfontscale (1.1.3-1) breaks dependency 'xorg-mkfontdir' required by ttf-ms-win8-other
:: installing xorg-mkfontscale (1.1.3-1) breaks dependency 'xorg-mkfontdir' required by ttf-ms-win8-sea
:: installing xorg-mkfontscale (1.1.3-1) breaks dependency 'xorg-mkfontdir' required by ttf-ms-win8-thai
:: installing xorg-mkfontscale (1.1.3-1) breaks dependency 'xorg-mkfontdir' required by ttf-ms-win8-zh_cn
:: installing xorg-mkfontscale (1.1.3-1) breaks dependency 'xorg-mkfontdir' required by ttf-ms-win8-zh_tw
:: installing xorg-mkfontscale (1.1.3-1) breaks dependency 'xorg-mkfontdir' required by xorg-font-utils

(probably dependencies from AUR)

Last edited by crem (2019-03-23 20:36:59)

Offline

#6 2019-03-23 21:46:40

seth
Member
Registered: 2012-09-03
Posts: 51,017

Re: [SOLVED] Some fonts started to render incorrectly in terminal after u…

Check

uxrvt -fn "xft:dina"

(You might have to install rxvt-unicode, urxvt doesn't use fontconfig)

It doesn't show up in your list, but was updated on 2019-03-15, so try to downgrade vte3 and vte-common (especially since you say the font shows correctly in the preview of some gtk dialog and despite the wrong glyph resolution)

Offline

#7 2019-03-23 22:12:01

crem
Member
Registered: 2018-01-14
Posts: 41

Re: [SOLVED] Some fonts started to render incorrectly in terminal after u…

seth wrote:

Check

uxrvt -fn "xft:dina"

(You might have to install rxvt-unicode, urxvt doesn't use fontconfig)

It doesn't show up in your list, but was updated on 2019-03-15, so try to downgrade vte3 and vte-common (especially since you say the font shows correctly in the preview of some gtk dialog and despite the wrong glyph resolution)

Reverted, but still didn't help..
vte3 and vte-common were updated on 2019-03-17, and I'm pretty sure by that date I already had the issue... But here is the log for the case I remember it wrong: https://gist.github.com/mooskagh/06cfd8 … 32dcef3c7a

urxvt doesn't start:

$ urxvt -fn "xft:dina"
urxvt: unable to calculate font width for 'dina:minspace=True', ignoring.
urxvt: unable to load base fontset, please specify a valid one using -fn, aborting.

I managed to rollback freetype2, gtk3, libfontenc, vte-common, vte3 and xorg-mkfontscale, but issue is still there.
I didn't manage to rollback entire system to earlier date, as same AUR packages complain about missing dependencies.


LibreOffice doesn't show Dina in the list of fonts (probably doesn't support bitmap fonts).
Trying to set "Dina" in SublimeText editor makes it display some non-monospace ttf font. (But behaviour is different from when I try to set non-existing font. In this case SublimeText sets system default monospace font).

Offline

#8 2019-03-23 22:17:21

crem
Member
Registered: 2018-01-14
Posts: 41

Re: [SOLVED] Some fonts started to render incorrectly in terminal after u…

Ok, instead of just reinstalling the dina-font package on top of existing, I've removed it first, and then installed.

This solved the issue, I can use Dina font again!

Thanks for your help and sorry for the noise, this is now solved.

Offline

#9 2019-03-24 08:59:56

crem
Member
Registered: 2018-01-14
Posts: 41

Re: [SOLVED] Some fonts started to render incorrectly in terminal after u…

Ok, the problem reappeared again:

1. Yesterday after uninstalling and installing dina-font, it started to render (I believe I didn't reboot, it just started to work).

2. Today when I booted, Dina font still rendered fine, but Gohu font started to show boxes with "0020" inside instead of spaces.
     It was already happening since ~20 February to me, but fixed itself at the same time as Dina became broken (~March 13).

3. I uninstalled and installed Gohu font, and rebooted. After that Gohu rendering was correct, but Dina became broken again.
    (I also removed ttf-ms-win8-arabic ttf-ms-win8-hebrew ttf-ms-win8-indic ttf-ms-win8-japanese ttf-ms-win8-korean ttf-ms-win8-other ttf-ms-win8-sea ttf-ms-win8-thai ttf-ms-win8-zh_cn ttf-ms-win8-zh_tw, if that matters.
     Decided to reinstall them when I finish debugging, and now they make rollbacks harder)

4. Uninstalling and installing dina-font (and rebooting) doesn't help anymore.

Last edited by crem (2019-03-24 09:05:26)

Offline

#10 2019-03-24 11:18:04

seth
Member
Registered: 2012-09-03
Posts: 51,017

Re: [SOLVED] Some fonts started to render incorrectly in terminal after u…

Interesting. Also see https://bbs.archlinux.org/viewtopic.php?id=245197

This package?
https://aur.archlinux.org/packages/gohufont/

pacman -Ql dina-font gohufont

I assume something drops some bad config into /etc/fonts/conf.d …

Offline

#11 2019-03-24 18:19:31

crem
Member
Registered: 2018-01-14
Posts: 41

Re: [SOLVED] Some fonts started to render incorrectly in terminal after u…

seth wrote:

Interesting. Also see https://bbs.archlinux.org/viewtopic.php?id=245197

This package?
https://aur.archlinux.org/packages/gohufont/

pacman -Ql dina-font gohufont

I assume something drops some bad config into /etc/fonts/conf.d …

Yes, this is the package for gohufont that I use.

Output of the command line you gave (and contents of 75-yes-dina.conf):
https://gist.github.com/mooskagh/f524e0 … 6e9d12dad2

Last edited by crem (2019-03-24 18:22:47)

Offline

#12 2019-03-24 18:23:15

pedrocbelem
Member
Registered: 2019-03-24
Posts: 5

Re: [SOLVED] Some fonts started to render incorrectly in terminal after u…

Can I see your output of

 fc-list | grep gohu 

Offline

#13 2019-03-24 19:14:45

crem
Member
Registered: 2018-01-14
Posts: 41

Re: [SOLVED] Some fonts started to render incorrectly in terminal after u…

pedrocbelem wrote:

Can I see your output of

 fc-list | grep gohu 
$ fc-list | grep gohu 
/usr/share/fonts/misc/gohufont-uni-11.pcf.gz: Gohu GohuFont:style=Regular
/usr/share/fonts/misc/gohufont-uni-11b.pcf.gz: Gohu GohuFont:style=Bold

Hm, does it mean I can only use 11px variant?
It seems that I indeed cannot, I don't use 14px Gohu font so I wouldn't otherwise notice, but indeed when I set font size to 7,8,9 it shows 11px variant (due to DPI settings I guess), and at other sizes it just scales that font.

Offline

#14 2019-03-24 19:35:43

pedrocbelem
Member
Registered: 2019-03-24
Posts: 5

Re: [SOLVED] Some fonts started to render incorrectly in terminal after u…

Yeah, that's exactly what is happening to me. I noticed since the last update that my terminal font was different and I noticed that it is being scaled from 11px. I am not sure if it was supposed to recognize the 14px variant and since the update no longer does or if the scaling has changed. xlsfonts recognizes the 14px variant and I can use it in emacs with the xft format, however on rofi and terminator I cannot use that format and it only recognizes the 11px variant

Offline

#15 2019-03-24 20:14:40

seth
Member
Registered: 2012-09-03
Posts: 51,017

Re: [SOLVED] Some fonts started to render incorrectly in terminal after u…

What if you remove /etc/fonts/conf.d/10-scale-bitmap-fonts.conf ? (should be a symlink to the file in /etc/fonts/conf.avail)

Offline

#16 2019-03-24 20:46:04

pedrocbelem
Member
Registered: 2019-03-24
Posts: 5

Re: [SOLVED] Some fonts started to render incorrectly in terminal after u…

seth wrote:

What if you remove /etc/fonts/conf.d/10-scale-bitmap-fonts.conf ? (should be a symlink to the file in /etc/fonts/conf.avail)

It still doesn't recognize 14px variant but it doesn't scale the 11px which is very tiny.

Offline

#17 2019-03-24 20:52:56

crem
Member
Registered: 2018-01-14
Posts: 41

Re: [SOLVED] Some fonts started to render incorrectly in terminal after u…

pedrocbelem wrote:
seth wrote:

What if you remove /etc/fonts/conf.d/10-scale-bitmap-fonts.conf ? (should be a symlink to the file in /etc/fonts/conf.avail)

It still doesn't recognize 14px variant but it doesn't scale the 11px which is very tiny.

Same for me.
Also didn't help with Dina font (probably not supposed to help though), still some non-monospace font is rendered. In font selection dialog as expected, the "The brown fox..." text sample is displayed in one of "native" sizes (Dina has 4 different sizes), but doesn't scale bitmap fonts.

Also I don't know what is 75-yes-dina.conf supposed to do, but deleting it doesn't change anything for me. Dina is still listed in font selection dialog, still renders fine in that dialog's sample text, doesn't render in terminals.

Last edited by crem (2019-03-24 20:57:38)

Offline

#18 2019-03-24 22:34:54

crem
Member
Registered: 2018-01-14
Posts: 41

Re: [SOLVED] Some fonts started to render incorrectly in terminal after u…

It seems that there are already 3 different font problems, which may or may not be caused by the same reason:

1. Dina font is not rendered (other non-monospace font is rendered instead)
2. 14px version of Gohu font is not available.
3. In Gohu font, space is sometimes rendered as [0020].

(1) and (3) never occur at the same time, but during last month (I think?) I had either one or another.
Also found a thread with a problem similar to (3): https://bbs.archlinux.org/viewtopic.php?id=244962

Offline

#19 2019-03-25 06:59:11

seth
Member
Registered: 2012-09-03
Posts: 51,017

Re: [SOLVED] Some fonts started to render incorrectly in terminal after u…

75-yes-dina.conf whitelists the font against a list of blacklisted fonts, presumingly 70-no-bitmaps.conf

The other thread isolated freetype 2.10 as the cause for the artwiz (in your case gohu) issue and because the issues are mutually exclusive, it would at least seem that gohu is the original troublemaker here.
Did you try the gohu behavior (missing size & glyphs) with downgraded freetype? (ignoring the Dina issues which were not resolved by the freetype downgrade)

Offline

#20 2019-03-25 08:02:00

crem
Member
Registered: 2018-01-14
Posts: 41

Re: [SOLVED] Some fonts started to render incorrectly in terminal after u…

Downgrading freetype to 2.9.1 and running

$ sudo fc-cache -rs

helped with all issues: 14px Gohu font is back, Dina renders fine. Just downgrading without rebuilding cache did not help.

I suspect that just upgrading to 2.10 doesn't break it, one also need to rebuild cache. That's why doing seemingly unrelated manipulations (e.g. remove some fonts, although I don't know whether that rebuilds cache) appear to break it.

UPD:
1. Upgraded back to 2.10 and rebooted, issue (3) reappeared ([0020] instead of spaces in Gohu), but not yet (1) and (2) (Dina font works, 14px Gohu exists).
https://cdn.discordapp.com/attachments/ … nknown.png

2. Then I ran this and rebooted:

$ sudo fc-cache -rs

Issue (3) disappeared, (1) and (2) appeared. (Dina fails to render, no 14px Gohu anymore)

Last edited by crem (2019-03-25 10:34:59)

Offline

#21 2019-03-25 13:58:13

seth
Member
Registered: 2012-09-03
Posts: 51,017

Re: [SOLVED] Some fonts started to render incorrectly in terminal after u…

https://savannah.nongnu.org/bugs/?func= … m_id=55979
ftview is in https://www.archlinux.org/packages/extr … pe2-demos/

Possibly some incompatibility between freetype and fontconfig.
https://git.savannah.gnu.org/cgit/freet … VER-2-10-0
There's been quite some hazzle around the defaultChar …

Offline

#22 2019-04-02 13:08:35

arch-ed
Member
Registered: 2019-04-02
Posts: 7

Re: [SOLVED] Some fonts started to render incorrectly in terminal after u…

Has anyone found a solution to this problem?

I really miss Dina font on my terminals.

Offline

#23 2019-04-02 13:18:03

crem
Member
Registered: 2018-01-14
Posts: 41

Re: [SOLVED] Some fonts started to render incorrectly in terminal after u…

Nope, although there were some posts here recently: https://gitlab.gnome.org/GNOME/pango/issues/360
(also just providing more details rather than having solution).

I don't know how freetype2, fontconfig and pango relate to each other, but someone who knows should make a guess where problem is most likely, and bring it up to the devs (or maybe it's a config issue, then bring to archlinux maintainers). smile

For me personally, I've downgraded to freetype 2.9.1, and as I temporary don't have Internet at home anyway (just moved to another apartment), I don't upgrade and therefore cannot break it again for now.
Hopefully by the time I'm back online, someone will figure that out.

Offline

#24 2019-04-02 16:39:12

dnkl
Member
Registered: 2019-04-02
Posts: 10

Re: [SOLVED] Some fonts started to render incorrectly in terminal after u…

I'm the guy who posted "more details" in https://gitlab.gnome.org/GNOME/pango/issues/360.

To me, it looks like a change in freetype 2.10 broke pango's fallback handling. It seems pango now thinks (most?) bitmap fonts are missing the glyphs required to render "normal" text. Possibly (likely?) related to the "defaultChar" changes mentioned above.

Offline

#25 2019-04-02 20:04:47

arch-ed
Member
Registered: 2019-04-02
Posts: 7

Re: [SOLVED] Some fonts started to render incorrectly in terminal after u…

Thanks for the updates crem and dnkl. I'll be following issue 360 closely.

Totally subjective and OT, but suddenly being "forced" to use a new terminal font after approximately 16128 hours (252 workdays * 8 years * 8 hours) of looking at Dina feels rather strange. Everything just feels "off". If it it gets unbearable I guess I will downgrade freetype. big_smile

Offline

Board footer

Powered by FluxBB