Firefox font rendering on CJK characters totally borken in pre block

  • NixOS version 24.05.20240507.b211b39 (Uakari)
  • Firefox version 125.0.3 (x64)
  • fontconfig is configured through system’s configuration.nix only, the related fragment is somehow like: = "full"; #1
    fonts.fontconfig.hinting.enable = true;
    fonts.fontconfig.defaultFonts = {
     # ...
    monospace = ["Sarasa Mono SC"] # from pkgs.sarasa-gothic
     # ...


  • Note: rendering is also broken in firefox’s inspector
  • source code:

the second character(“是”) is squeezed which is abnormal:

All extensions are disabled.

  • Note: if I alter the in #1 to “slight” (defaulted value) then everything is OK.
  • I’m not sure is this a firefox’s issue or nix’s, since Chromium has no such issue.