Skip to content

Rust docs should at least have the option of using sans-serif fonts #52449

Closed

Description

Edit: When I say "docs" I mean the standard library docs. The font in places like "The Book" is absolutely fine.

I'm sure I've seen this brought up in the issues before, but I don't seem to be able to find those issues anymore because I can't remember what I searched, so I hope you don't mind me creating a new issue for this.

Currently the rust docs only really display all text in a serif style font, which is extremely difficult to read, especially when there are large sections of bold text.

I understand that this may be a deliberate design decision, but unfortunately it makes it hard for people like me (no disabilities, just bad eyesight) to read anything. In my case I don't care about the design, I just want to be able to read the text without straining my eyes.

If the docs can't be changed to a sans-serif font by default, then could an option at least be provided to change the font to a sans-serif one instead?

Even the default font-family: sans-serif; is fine. Anything but serif will do for me.

Currently when I open the docs I have to open the inspector in Chrome and apply font-family: sans-serif; to the entire site just to get anything done. This works but I shouldn't really have to do this in the first place.

A serif font is fine for short pieces of text, like titles for example, but for the main body of text I hope a sans-serif font option can be seriously considered.

I hope I'm not missing anything. If there's already an option to do this then please let me know.

Activity

  1. scottmcm commented on Jul 17, 2018

    @scottmcm
    Member

    Maybe just use the default font in the user's browser? Though personally I just override all fonts anyway...

  2. hellow554 commented on Jul 18, 2018

    @hellow554
    Contributor

    I think we should hear @GuillaumeGomez for his opinion.

    IMHO: I really think, that serif fonts are good for large block texts, because they will help you with read flow. This is my opinions and I have the feeling, that it does not suits you. Code and captions are always sanserif.
    I think the best solution would be a browser plugin, that will give you the option to replace the font (not manually, but you create a rule for a certain website).

  3. GuillaumeGomez commented on Jul 18, 2018

    @GuillaumeGomez
    Member

    I can add a setting to allow the switch if you want? Well, if I find it more comfortable to read, I'll set it as default. :)

  4. steveklabnik commented on Jul 19, 2018

    @steveklabnik
    Contributor
  5. added
    T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.
    A-docsArea: Documentation for any part of the project, including the compiler, standard library, and tools
    on Jan 8, 2019
  6. lolbinarycat commented on Nov 6, 2024

    @lolbinarycat
    Contributor

    triage: headings use Fira Sans, but the body text still uses serifs.

  7. playbahn commented on Nov 10, 2024

    @playbahn

    What's the name of the exact font? I plan to use it with Dark Reader. (odd one out here, I like the sans font used by docs.rs and the rust library docs, it's just more comfortable for me.)

  8. lolbinarycat commented on Nov 10, 2024

    @lolbinarycat
    Contributor

    the font stack used by rustdoc's css is "Source Serif 4",NanumBarunGothic,serif

  9. matthiasg commented on Nov 29, 2024

    @matthiasg

    Is there any progress made here ? Choosing a non-serif font optionally would be as important to me or more important than choosing between two different dark themes (though i love and use ayu).

    Its incredibly uncomfortable to read the time new roman style fonts on the site interspersed with non-serif fonts.

    also it would be nice to offer some built-in options to make the comments more lively (within reason). Similar to badges or e.g https://vitepress.dev/guide/markdown#custom-containers

  10. GuillaumeGomez commented on Nov 29, 2024

    @GuillaumeGomez
    Member

    Completely forgot about it. Gonna use the fonts used in mdBook as they seem to be appreciated here.

  11. GuillaumeGomez commented on Nov 29, 2024

    @GuillaumeGomez
    Member

    Opened #133636.

  12. added a commit that references this issue on Jan 29, 2025
  13. added 2 commits that reference this issue on Jan 30, 2025
  14. added a commit that references this issue on Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-feature-requestCategory: A feature request, i.e: not implemented / a PR.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions