16

There is a problem with code readability due to the font used on this site. It is not clear if the font is the same on all platforms, but on my computer (OS X)

f[a_, α_] := α + a^2

renders as

Here it is in double size.

enter image description here

The problem is that the italic and the upright versions of a look considerably different, making it hard to match up the pattern name on the LHS with the value on the RHS.

I found that this threw me off-balance in questions like this. While this is the first time I noticed this, I found it quite confusing. I am not sure if the font has changed recently or if it always has been like this.

There is a style difference in g too, but that is not nearly as irritating to me, probably because there isn't a distinct character that it can be confused with. In the case of a, it is easy to confuse with the Greek α.


Does anyone else find this to be a problem? Can anything be done about this, such as changing the stylesheet of the site?

10

The prettyprint process, that is used on the main site, chances the appearance of a_ to its italic version a_. The Consolas part of the default font-family for code makes a and α look very similar. The default text font-family, Arial, isn't suitable for code. Here are two alternatives I have tested by changing the code style with the developer tools of the browser:

  1. Roboto Mono

    enter image description here

  2. Office Code Pro

    enter image description here

Here is a stylish style I created on https://userstyles.org/ that changes Consolas to Office Code Pro for all code on the main site.

Here is another one, that let's you input (as text) whatever font you prefer or want to test. enter image description here

  • 2
    If we, as a community, can come to a decision which font-family is most suitable (look and availability for everyone), than it would make sense to ask for such a change in the default style setting (css file) for the site. – Karsten 7. Oct 16 '17 at 18:53
  • If we were to change the font, what are the odds that some other letter's shape will cause problems? I don't really want to get this changed and then find out a bit later that the new font isn't working so well. It's not likely we'll want to switch back. – Jon Ericson Oct 19 '17 at 20:16
  • The font must support the full Unicode Basic Multilingual Plane, hence Office Code Pro isn't appropriate (although I like how Greek letters look in this font). – Alexey Popkov Oct 20 '17 at 9:09
  • STIX fonts? – Chris Chiasson Oct 27 '17 at 15:55

You must log in to answer this question.

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