4

Has the font in code blocks changed recently? Is this intended?

Being exclusively active in the tag, I'm very irritated by the distracting misalignment of < and -, which together are the assignment operator in R. This is how it looks like (in Firefox 117.0.1 with default settings on Windows 10 Enterprise):

Screenshot showing R code

If I change the settings in Firefox to disallow websites using their own fonts (which means the Consolas font is used), it looks much better:

screenshot showing the same R code with different font setting

Actual code block for check for rendered differences:

DF <- data.frame(x = x_values, y = y_actual)

library(ggplot2)
p <- ggplot(DF, aes(x, y)) +
  geom_point()

Please consider using a better font in code blocks.

7
  • 2
    Firefox, Mac, this is what I see: cln.sh/0xL9GVYBP1ZCWPHkT3Kr
    – yivi
    Commented Sep 27, 2023 at 6:40
  • 1
    I haven't heard any news about another font change since the change to system font in May 2021. FWIW, this is what I see on Chrome 117, Windows 10. Did you (accidentally) install Cascadia Mono or Segoe UI Mono?
    – Andrew T.
    Commented Sep 27, 2023 at 7:11
  • @AndrewT. It could well be related to me updating the browser. I did not install any fonts (I don't even have admin rights on the machine).
    – Roland
    Commented Sep 27, 2023 at 7:12
  • 3
    Note that you can install user fonts without admin rights on Windows 10 and 11, and programs can do so as well. You might want to check %localappdata%\Microsoft\Windows\Fonts and see if any fonts appeared (and possibly %windir%\Fonts as well, recent Office builds come with new fonts afaik and might've installed automatically).
    – Erik A
    Commented Sep 27, 2023 at 8:23
  • Also note, Firefox can reveal the actual fonts used. Enter the inspector (Ctrl + I), select the code block, and in the rightmost box, select "Fonts". For me, it's still Consolas. You may want to edit in what it is for you.
    – Erik A
    Commented Sep 27, 2023 at 8:26
  • @ErikA Thanks, installing LibreOffice has caused this.
    – Roland
    Commented Sep 27, 2023 at 8:37
  • 1
    The font family is specified as ui-monospace, "Cascadia Mono", "Segoe UI Mono", "Liberation Mono", Menlo, Monaco, Consolas, monospace. So if your OS has a higher priority ui-monospace font, that will be rendered.
    – Cerbrus
    Commented Sep 27, 2023 at 8:46

1 Answer 1

-1

Thanks to @Erik A, I found that a recent installation of LibreOffice has caused this. After deinstalling LibreOffice, I see the proper font. However, I would still say that this indicates a bug in the website. Clearly, they are using the wrong font somewhere and users only don't have issues because it isn't installed.

4
  • You do not need to uninstall LibreOffice. Just deleting the offending fonts should be enough.
    – yivi
    Commented Sep 27, 2023 at 8:38
  • 1
    @yivi I'm not starting to mess with installed fonts if I have no idea what the possible side effects are. I only needed LibreOffice for a specific task and that task is done.
    – Roland
    Commented Sep 27, 2023 at 8:40
  • 1
    And having to deinstall fonts for proper code display in a website is just absurd.
    – Roland
    Commented Sep 27, 2023 at 8:42
  • SO is deliberately designed to let the system pick the proper font for code blocks. It's not a bug, it's a feature :D
    – Cerbrus
    Commented Sep 27, 2023 at 8:48

Not the answer you're looking for? Browse other questions tagged .