4

[NB: The description below refers exclusively to Chromium; I have not tested any of this with Chrome, since I have no access to it. I still included [google-chrome] among the post's tags, because an answer that would work for Chrome may also work for Chromium.]


In a nutshell, Chromium insists on scaling a non-scalable bitmapped font (Terminus), even though the font is available in many suitable sizes.

Here1 is a comparison between Iceweasel's (left) and Chromium's rendering of the same test page, one where the style attributes for all the text-containing items specify Terminus as the font-family. (Please click on the image to see it at 100%. The test page's HTML can be seen here).

The only size that Chromium gets right is 12px. It looks like it gets the remaining sizes by scaling 12px.

How can I stop Chromium from scaling Terminus, and have it use the native sizes that are explicitly specified in the page's style attributes?


tl;dr

(All the essential information for my question is given above. What follows is non-essential background information.)

Here are the things I've tried so far, without success.

(OS is Debian.)

(1) I deleted the following symlinks:

/etc/fonts/conf.d/10-scale-bitmap-fonts.conf
/etc/fonts/conf.d/70-no-bitmaps.conf

(2) I added the following symlink:

/etc/fonts/conf.d/50-enable-terminus.conf

(3) I followed the recipe given here to inject a custom stylesheet into Chromium, with the following contents:

* {
  -webkit-font-smoothing: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

Actually, in order to get Chromium to display Terminus at all, I had to force it with this pretty heavy-handed ~/.config/fontconfig/fonts.conf file. Without it, the results I get are shown here. Granted, Chromium's side now looks nicer, but it is not rendering Terminus, the font specified in the test-page. (Also, it does not look as crisp to me as Iceweasel's side.)


All the specified sizes are the font's native sizes, as reported by fc-list --verbose.

(BTW, the lack of difference between "12px normal" and "12px bold" is to be expected, since there's no 12px bold in this font. On the other hand, there should be a difference between sizes 14px and 16px, and between 18px and 20px, since my system has separate font specification files for all those sizes. So maybe Iceweasel's rendering is not perfect either. Nevertheless, I'd be delighted if I could get Chromium to work as well as Iceweasel does here.)


1 The picture must be viewed at 100% for one to see what it's trying to show, but I have not been able to get it to appear at 100% when I include it directly in this post; hence I have resorted to using an external link.

kjo
  • 1,201
  • 4
  • 20
  • 39
  • 1
    Your `fonts.conf` is really heavy, i tried it and it disables anti-aliasing for all fonts, turning some of `edit`s to `match`es might be needed. – mykhal Jun 19 '21 at 13:27

0 Answers0