Skip to content

Monospace font isn't monospace on Android on Chrome. #1708

Closed
@verhovsky

Description

@verhovsky

If you open https://docs.python.org in Chrome on an Android phone, the code samples are in a sans-serif proportional font.

Screenshot_20201218-034914

Currently this is the font-family for code tags:

tt, code, pre {
    font-family: monospace, sans-serif;
    font-size: 96.5%;
}

monospace not working is a longstanding Android Chrome issue, see https://meta.stackexchange.com/questions/230878/code-blocks-dont-show-up-as-monospace-text-on-the-mobile-website-on-android for details. I think you have to specify fonts by name. If you're going to do this, please set Source Code Pro as the first one, it's the best monospace font in my opinion. Or you could use the font-family used for code samples on the CPython homepage:

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

Smartphone:

  • Device: Pixel 5
  • OS: Android 11
  • Browser: Chrome
  • Version: 87.0.4280.101

(Firefox works fine)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions