Code blocks are not rendered using a fixed-width font in Firefox 99 64-bit Ubuntu.

A screenshot of the issue for this post (left is using Chrome, and right is using Firefox):

Screenshot of bug

The issue is caused by this here. In https://cdn.sstatic.net/Shared/stacks.css line 646:


It would be fixed if replacing it with:

font-family:Consolas,Monaco,Lucida Console,Liberation Mono,DejaVu Sans Mono,Bitstream Vera Sans Mono,Courier New, monospace, serif;


  • 1
    This is probably limited to Ubuntu, and other linux based OS's, as this works perfectly fine on MacOS. Adding the linux tag for that.
    – Luuklag
    Commented Apr 26, 2022 at 8:27
  • I can't reproduce it in Firefox 99 on Ubuntu 64-bit. It shows as your left screenshot, the Fonts tab in the Inspector says that it uses Liberation Mono for the code block (and Liberation Sans for the other text). In your screenshot on the right the text also shows much larger than it should be. Maybe your issue is caused by a general font problem in your Firefox setup?
    – Marijn
    Commented Apr 26, 2022 at 10:33
  • 1
    It's not clear why that change would fix it for you. It is a CSS variable which is set properly to the monospace font set. Is your browser not properly pulling in that variable and calculating the value? Does manually changing the CSS in your dev tools actually change it to the proper font on the page?
    – animuson StaffMod
    Commented Apr 27, 2022 at 5:24
  • @animuson I think it just fit ok if it is changed at the variable. I tried playing with changing the various font variants in the variable. At some point I got it working after removing a bunch of font alternatives but could not pinpoint a sspecific one that was causing this issue. The only one that always works is monospace. I also checked I have the very same issue with GitHub which uses the same font selection for code blocks.
    – Léa Gris
    Commented Apr 27, 2022 at 6:49
  • 2
    Marking this as norepro since it appears to be something specific to your system.
    – animuson StaffMod
    Commented Apr 28, 2022 at 4:50
  • I don't observe the problem in Firefox 99.0 on Ubuntu 18.04.6 (Bionic Beaver). Commented Apr 28, 2022 at 9:14
  • Can you add the link to the specific example to the question? Can you add the Ubuntu version (there is a time correlation with the new Ubuntu 22.04 LTS (Jammy Jellyfish) released seven days ago)? (For example, from cat /etc/os-release on the command line.) Commented Apr 28, 2022 at 9:19
  • 1
    @This_is_NOT_a_forum stackoverflow.com/q/12543541/7939871
    – Léa Gris
    Commented Apr 28, 2022 at 9:20
  • Do you use Ubuntu 22.04? Commented Apr 28, 2022 at 10:57
  • @This_is_NOT_a_forum Using Ubuntu 21.10
    – Léa Gris
    Commented Apr 28, 2022 at 11:21
  • After trying fc-cache to rebuild the font cache without success, I finally migrated to Ubuntu 22.04 and the issue is gone.
    – Léa Gris
    Commented May 2, 2022 at 10:31
  • And the issue is back
    – Léa Gris
    Commented Jun 21, 2022 at 16:12


You must log in to answer this question.

Browse other questions tagged .