← Back to context

Comment by edflsafoiewq

6 months ago

No, the formatting was definitely botched. It should look much better than it does even in a proportional font.

Agreed. I wouldn't mind if, say, end of line comments weren't perfectly aligned. There's zero indentation so things like

     for (string line; getline(is,line); )
  s.insert(line);

are hard to visually parse.

  • This must depend on some settings of the browser and perhaps also on the locally installed typefaces.

    On my Firefox on Linux, this HTML page is not rendered with any custom typefaces, but it uses those specified by me as defaults for serif/sans serif/monospace.

    The C++ code is rendered in my browser with my default, i.e. with JetBrains Mono and there is nothing weird.

    The code quoted by you is indented as expected, not as in your posting.

    On my computer, I have mostly typefaces that I have bought myself and which are seldom encountered in most computers. I do not have any of the typefaces that are typically specified in CSS rules, i.e. none of the typefaces that can be found in default installations of Windows, Linux or MacOS.

    So perhaps there is a bug in their CSS at the definition of "wp-block-code", which on other computers selects a bad typeface that is proportional, so that the narrow spaces make the indentation disappear. (Their wp-block-code says "font-family:inherit" and I have not searched further to see from where the wrong font-family may be inherited.)

    Here, perhaps because that bad typeface cannot be found, the browser uses my default monospace font and the code is displayed fine.

    Or else, perhaps you have not set in your browser a proper default for monospace fonts and it just takes Arial or other such inappropriate system font even for monospace.