Font rendering questions in 23.05

Hello everyone,

I feel like I need to state this first: I am a new NixOS user, I am currently evaluating different Linux distributions by installing them in VMware workstation 17, which is running on Windows 11. My goal is to find a real desktop alternative to Windows. I am familiar with Linux from a commandline perspective, but looking at it as a “desktop daily driver” is a first for me.

I am running KDE plasma as it came out of the box when installing NixOS 23.05.
Things basically work as expected however there is this font rendering issue I am unable to solve. I have added screenshots and placed the referring questions below.

The Vivaldi browser under my NixOS installation looks like this:

No.1: shows a relatively clear font rendering, it looks a bit more washed out than the Windows ClearType font rendering. Is there a way to achieve the same crisp font rendering/display quality?

No.2: all letters are evenly spaced, rendering is quite nice, would be totally ok.

Firefox on the other hand looks like this:

No.3: shows a different font rendering than in Vivaldi. OK, it’s a different browser but is there a way to harmonize font rendering/display for all applications installed?

No.4: The letter spacing is very different. It seems almost random when looking at it. Can this be solved?

I hope someone can point me in the right direction here.

Cheers!

Hi,

I’m using gnome with nixos, I don’t see any letter spacing issue on Firefox with this website.

Some screenshots in various browsers

Firefox

firefox

Chromium

chromium

Vivaldi

vivaldi

And my font configuration in nixos

  fonts.fonts = with pkgs; [
    # https://nixos.wiki/wiki/Fonts
    (unstable.nerdfonts.override { fonts = [ "FiraCode" "SourceCodePro" ]; })
    fira
    fira-code
    libertine
    source-serif-pro
    stix-two
    vistafonts
  ];

Thank you for this hint, after adding the fonts snippet from the nixos.wiki/wiki/Fonts the font on the website itself looks as expected.
I do not exactly understand why though.

What does that even change except of adding these font packages? I mean the font on the website didn’t change except for proper spacing? I am confused :slight_smile:

  1. There might be subtle differences in the font you see in the screenshot and what you see now. Just because glyphs look similar that doesn’t mean that the same font is used. With all the various similar looking fonts that act as replacements for weirdly licensed “system defaults” of some closed operating systems, you now might have one that is better done. Fonts and their fallback strategies can be quite nasty and also depend on the rendering and configuration engines used.
  2. Also, as far as I remember, the gecko engine always had troubles with letterspacing when it tried to combine into ligatures but there actually weren’t any. This might be an issue of the font that gives wrong hints about its capabilities, which vivaldi might have simply ignored as an unknown font feature
  3. ClearType rendering only makes sense on the host. Activating it within a VM might in theory make things worse, as the rendering then tries to adjust to the virtualised screen, rather than the real screen.

@NobbZ thank you for the clarification. Would it then be a correct assumption that my currently virtual desktop (with all its fancy rendered fonts) could actually look better/worse when running on a native system in regards to font rendering?

Yes. Native can always be different.