How to fix broken Inconsolata font in urxvt on 21.05

I just upgraded to 21.05 and for some reason my urxvt terminal is unable to use Inconsolata font:

I have no idea what happened. It works just fine in the navigation bar of Awesome WM:

image

But urxvt seems broken. Here’s my font config from .Xdefaults:

*font:     xft:Inconsolata:size=14:lang=pl:antialias=true:hinting=true
*boldFont: xft:Inconsolata:size=14:lang=pl:antialias=true:hinting=true:Bold

I’m installing it like this:

{
  # Fonts
  fonts = {
    fontconfig = {
      cache32Bit = true;
      allowBitmaps = true;
      useEmbeddedBitmaps = true;
      defaultFonts = {
        monospace = [ "Inconsolata" ];
      };
    };
    fonts = with pkgs; [
      terminus_font terminus_font_ttf
      corefonts fira-code inconsolata
      dejavu_fonts ubuntu_font_family
    ];
  };
}

Oh, this appears to be a known issue: Inconsolata v3.000 letter-spacing is too wide in programs that use Xft · Issue #42 · googlefonts/Inconsolata · GitHub

And the suggestions appear to be to downgrade, like here:
https://www.reddit.com/r/archlinux/comments/fn0txx/st_and_dmenu_font_rendering_suddenly_broken

It appears Inconsolata comes from google-fonts:

I tried downgrading Inconsolata to the google-fonts package 2019-07-14 but it didn’t work.

It did work. I didn’t see it because I was also using urxvtd which cause urxvtc to not pick up changes.

{
  oldNixPkgs = pkgs.fetchzip {
    url = "https://github.com/NixOS/nixpkgs/archive/47e580e291ff40bbde191e9fed35128727963b0c.zip";
    sha256 = "1fnz42w2p6avnz76p8n0dr2lvdgv1v1kipysih61mdakr4lc2fs8";
  };
  oldPackages = import oldNixPkgs { };
in {
  fonts.fonts = with pkgs; [
    terminus_font oldPackages.inconsolata
    corefonts fira-code dejavu_fonts ubuntu_font_family
  ];
}

Not sure if there’s a cleaner way of doing this.

I tried the suggestion from this comment:
https://github.com/googlefonts/Inconsolata/issues/42#issuecomment-744094647

And changed my config to be:

*font:     xft:Inconsolata Regular:family=mono:size=14:lang=pl:antialias=true:hinting=true
*boldFont: xft:Inconsolata Regular:family=mono:size=14:lang=pl:antialias=true:hinting=true:Bold

But that didn’t work.

I have a fix for this here:

1 Like