Nixpkgs: PCF fonts no longer selectable via lxappearance or via termite config

Created on 10 Feb 2017  路  9Comments  路  Source: NixOS/nixpkgs

Issue description

Recently I have done a few things. To name the major ones, I setup the unstable NixOS channel, then later updated all my packages to the unstable versions. I also changed from imperative to declarative package management, and after all that rebooted. At this point my terminal font, Tewi, does not show up properly anymore. My config is the same and it worked fine before. It's also no longer in the list of fonts in lxappearance. I suspect this may be an upstream issue, since I have a very similar issue on Arch that I also could not solve.

Steps to reproduce

>use NixOS unstable channel
>install tewi-font

screenshot_2017-02-09_17-04-07
Here's a screenshot showing a large amount of text on the left via a man page. You can see letters overlapping, weird spacing, etc. Also shown, my termite config showing that I am indeed using the Tewi font, also my nix configuration file to show I have the font's package installed. If there's any other info you need from me, please don't hesitate to ask.

Technical details

  • System: 17.03pre100522.01fef3f (Gorilla)
  • Nix version: nix-env (Nix) 1.11.6
  • Nixpkgs version: "17.03pre100522.01fef3f"

edit: have installed terminus_font to confirm it's also broken, just like on my Arch install. The same is probably true of lemon, although it's not packaged on NixOS.

All 9 comments

I tried creating a new user, and the problem seemed to persist there. This rules out it being a config issue, at least as far as stuff in .config or ~/

Okay, I changed the title after figuring out a few things. To start with, I solved the issue on Arch. I thought it was the same issue (and I still think it's _very_ similar!) but it is not yet solved on NixOS. Basically, PCF fonts now use longer 'family names', so 'tewi' became 'lucy tewi', at least on Arch. This was an upstream change with freetype2, I think. As for the fonts showing up all weird looking, I was basically selecting a font that it couldn't find, and so it was falling back to DejaVu Sans. This can be checked by running fc-match tewi or whatever font, and seeing that it comes up with DejaVu Sans instead of the right font. I guess fixed width fonts just don't show up well in most terminals. On Arch I was able to find the new font names with `fc-list | grep -i tewi' and so on. On NixOS this is not showing _any_ results. These distros are of course, very different, so perhaps someone can help me here. I've got both tewi and terminus installed declaratively via configuration.nix. I cannot verify they are properly installed, except that every other package I have listed there seems to be working.

If you need any more info from me, just ask!

Had a similar problem with Terminus.
After recent upgrade systemd-vconsole-setup service failed, saying it can't find "Lat12-Terminus14" font. fc-list | grep -i terminus gives the list of 36 files:

/nix/store/0j3zip2plzxff93sbraqlsc1hqd42lbq-terminus-font-4.40/share/fonts/terminus/ter-120b.pcf.gz: Terminus:style=Bold
/nix/store/0j3zip2plzxff93sbraqlsc1hqd42lbq-terminus-font-4.40/share/fonts/terminus/ter-118n.pcf.gz: Terminus:style=Regular
/nix/store/0j3zip2plzxff93sbraqlsc1hqd42lbq-terminus-font-4.40/share/fonts/terminus/ter-128n.pcf.gz: Terminus:style=Regular
/nix/store/0j3zip2plzxff93sbraqlsc1hqd42lbq-terminus-font-4.40/share/fonts/terminus/ter-120n.pcf.gz: Terminus:style=Regular
...

Changing i18n.consoleFont to one of them doesn't solve the problem. /etc/fonts/conf.d doesn't contain any terminus configs.

BTW, what name should be used in this option? What's the convention here?

I experienced the same thing today. I have a list like
fc-list | grep -i terminus gives

/nix/store/znkxgnf6lbpxingn17190z3982l974l1-terminus-font-4.40/share/fonts/terminus/ter-x14n.pcf.gz: xos4 Terminus:style=Regular
/nix/store/znkxgnf6lbpxingn17190z3982l974l1-terminus-font-4.40/share/fonts/terminus/ter-116n.pcf.gz: xos4 Terminus:style=Regular
/nix/store/znkxgnf6lbpxingn17190z3982l974l1-terminus-font-4.40/share/fonts/terminus/ter-x24n.pcf.gz: xos4 Terminus:style=Regular

The correct font name to use is now xos4 Terminus.

That's not quite the same issue. That's the issue I had on Arch, but on NixOS, I am not getting any results when running
fc-list | grep -i terminus or a similar command with the other problem font names. It is as if they aren't installed at all, despite being in my package list and working previously.

Could it be perhaps that you need to set fonts.enableFontDir? A snippet from my configuration.nix:

  fonts = {
    enableFontDir = true;
    enableGhostscriptFonts = true;
    fonts = with pkgs; [
      corefonts
      inconsolata
      powerline-fonts
      terminus_font
      unifont
    ];
  };

That actually worked! Thanks so much. Closing this issue.

Just ran updates and noticed my fonts broke again. First thing I tried was changing 'lucy tewi' back to 'tewi' and all is well. Not sure if upstream reverted the change or if NixOS decided to go against upstream. Either way, it seems there's a chance the old font names are being used again, at least in the unstable branch.

Just found this and thought it might be worth mentioning.
I had to delete /etc/fonts/conf.d/70-no-bitmaps.conf to get terminus/tewi fonts recognized by fontconfig on my arch box.
Hope this helps!

Was this page helpful?
0 / 5 - 0 ratings