Skip to content
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

Closed
jessetan opened this issue Dec 22, 2017 · 8 comments
Closed

Decide on code font #524

jessetan opened this issue Dec 22, 2017 · 8 comments

Comments

@jessetan
Copy link
Contributor

jessetan commented Dec 22, 2017

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.

@jessetan jessetan added the Needed: design decision A core team decision is required label Dec 22, 2017
@davidfischer
Copy link
Contributor

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 SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace.

GitHub also uses a native font stack. Their monospaced one is "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;.

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.

  • SFMono-Regular - This is pretty much iOS only.
  • Menlo - This is an Apple font available on MacOS.
  • Consolas - This is a Windows font.
  • Liberation Mono - This is a free font comparable to Courier. It is designed for Red Hat and I believe it is included in a default Ubuntu install as well as some other distros.
  • Courier - This is an old font that is widely available with a somewhat permissive license.
  • Courier New - This is a widely available proprietary version of the above font.

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:

"SFMono-Regular", Consolas, "Liberation Mono", Menlo, "Courier New", Courier, monospace;

Thoughts?

@jessetan
Copy link
Contributor Author

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.

@davidfischer
Copy link
Contributor

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.

@jessetan
Copy link
Contributor Author

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.
The font stack used by Bootstrap seems better, since it will use native fonts on macOS (SF mono if it ever becomes available, Menlo for recent versions, and Monaco for older versions) even if MS Office is installed.
Since there is no Linux version of MS Office, there is a much lower chance of Linux users seeing Consolas.
Ubuntu users might prefer the use of Ubuntu Monospace

My suggestion:

SFMono-Regular, Menlo, Monaco, Consolas, "Ubuntu Monospace", "Liberation Mono", "Courier New", Courier, monospace

So +1 on native code fonts for me.

@davidfischer
Copy link
Contributor

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.

@davidfischer
Copy link
Contributor

@jessetan, what do you think about a native font stack for the header font (replacing Roboto Slab) and the regular font (Lato)?

@jessetan
Copy link
Contributor Author

I think that deserves its own ticket since these fonts are used for much more text.
Since this theme is used to document many different projects, I don't think unique branding (i.e. one single, custom font) is so important. Users of the theme are of course free to use a font that matches their project.
On the other hand, I like the look of Lato (I'm meh on Roboto Slab), and with proper compression, Lato and Roboto will have less of a performance impact.

@jessetan jessetan added PR: ready for review and removed Needed: design decision A core team decision is required labels Apr 23, 2018
@davidfischer
Copy link
Contributor

Based on discussion readthedocs/readthedocs.org#3982, we are going to stick with Lato.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants