-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decide on code font #524
Comments
I actually wouldn't mind it if we went to a native font stack as opposed to one where we have to download a web font. I would actually propose we do this for both monospace and regular fonts. Currently fonts require about 1.5MB of downloads to load up the docs. At the same time, I think we do need to be sensitive about what works especially since we do display monospaced fonts sometimes in bold because they are passed through Pygments. Bootstrap switched to all native font stacks for 4.0. Their monospaced native stack is GitHub also uses a native font stack. Their monospaced one is While a couple popular sites doing it isn't enough to make me want to do it, I do think that coupled with the performance gains are pretty good reasons.
I verified that every one of the above fonts has a bold version so I think we should just eliminate Monaco and a few others from our font stack. I'd propose we go with a slight tweak on GitHub's font stack. Something like:
Thoughts? |
Regarding performance, we could gain a lot if the server compresses the fonts (readthedocs/readthedocs.org#3564) or if we switch to an already compressed format like woff. I usually like the look of system fonts and for me the question boils down to if it is more important to have a unified look for RTD on all OSes. |
I don't think we need to use precisely the same font across platforms. I'm +1 on using a native font stack. I will look at the compression issue. The nginx settings aren't correct. |
Regarding your suggested font stack, I like adding in Courier New, but I can't understand why GitHub uses Consolas as the second font choice if they want to make code look native. Consolas is bundled with Microsoft Office apps and SF Mono is only available in Terminal.app (without hacks), so any macOS users with MS Office will see Consolas. My suggestion:
So +1 on native code fonts for me. |
I think your point about Consolas is a good one. Let's put Menlo first. I lean against Ubuntu monospace. I know GitHub received complaints around Ubuntu (not specifically the monospace) in their stack. Liberation Mono is very close to Courier which I think is why it is preferred. I'll put together a PR. |
@jessetan, what do you think about a native font stack for the header font (replacing Roboto Slab) and the regular font (Lato)? |
I think that deserves its own ticket since these fonts are used for much more text. |
Based on discussion readthedocs/readthedocs.org#3982, we are going to stick with Lato. |
Fo non-code text, the theme provides the actual font file. It also include Inconsolata, which could be used for code, but isn't.
The current font stack for code is
Consolas, "Andale Mono WT", "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco, "Courier New", Courier, monospace
.This causes code to look differently on various platforms. It can also look less than ideal or not native on some platforms (Andale has a comma that looks like a period, iOS does not have any of the specified fonts except Courier New, Monaco may not have a bold variant #460)
It would be nice to standardise on one single code font (whether Inconsolata or something else) or at to choose a font stack that uses system fonts for each OS to have a more native look. In the latter case, Inconsolata can be removed from the repo.
The text was updated successfully, but these errors were encountered: