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

Use sans-serif fonts in rustdoc #16207

Closed
wants to merge 1 commit into from
Closed

Conversation

ftxqxd
Copy link
Contributor

@ftxqxd ftxqxd commented Aug 3, 2014

Rustdoc was previously using a serif font, Source Serif Pro. Sans-serif fonts are generally considered better for the web, so this changes rustdoc to use Source Sans Pro instead.

The reason I have made this change is that sans-serif fonts are significantly more common on the web than serif ones. Looking at Python’s docs, MDN, Java’s docs, and practically any random website I come across, I see nothing but sans-serif fonts for the body text. Many websites seem to recommend using sans-serif fonts for the web. (It should be noted that all of those sites themselves use sans fonts for the main body text!) Sans-serif fonts also give a more ‘modern’ feel, which certainly fits with the rest of rustdoc’s design and Rust in general.

New rustdoc

This is a controversial change; any opinions would be appreciated.

cc #16173

Rustdoc was previously using a serif font, Source Serif Pro. Sans-serif fonts
are generally considered better for the web, so this changes rustdoc to use
Source Sans Pro instead.
@lilyball
Copy link
Contributor

lilyball commented Aug 3, 2014

Personally, I like the current serif font. But I'm not sure if I like it because it's actually better or just because that's what I'm used to.

@steveklabnik
Copy link
Member

Big 👎 from me. I like the serifs.

@mahkoh
Copy link
Contributor

mahkoh commented Aug 3, 2014

Big 👍 👍 to make up for the previous two comments.

@schmee
Copy link
Contributor

schmee commented Aug 3, 2014

👍 I never liked the font in the docs but I couldn't put my finger on why. But now I see that it's the serifs, looks much cleaner and more readable without them!

@wsddn
Copy link

wsddn commented Aug 3, 2014

👍

@tinaun
Copy link
Contributor

tinaun commented Aug 3, 2014

eeh i don't really like this.

I've thought about sans serif text with serif headers, but it looks better the way it is.

@adrientetar
Copy link
Contributor

Sans-serif fonts are generally considered better for the web

Really?

Let’s see what typographers have to say here:

Against common beliefs, both serif and sans serif can perform equally well, if you choose a body text size above 12 pixels. Below 12 pixels serifed typefaces don’t render sharply enough, but (and this brings us to the second point) on contemporary monitors 12 pixels is definitely too small anyway.

http://ia.net/blog/responsive-typography-the-basics/

The reason I have made this change is that sans-serif fonts are significantly more common on the web than serif ones.

So...?

Looking at Python’s docs, MDN, Java’s docs, and practically any random website I come across, I see nothing but sans-serif fonts for the body text.

Again: so what?

The Racket Docs do and they were conceived by a professional typographer and type designer, Matthew Butterick (@mbutterick).

Actually, he also did a redesign mockup of the Python docs with an extensive explanation; I would advise you to check that out to learn more.

Many websites seem to recommend using sans-serif fonts for the web.

Designers sometimes lack a proper knowledge of type and typography (which is sad because it's a core element of design). Now what do typographers say?

On the web, body text can be in a sans serif or serif font. Sans ser­ifs were once pre­ferred for screen text be­cause they ren­dered bet­ter on the low­er-res­o­lu­tion screens of the past. (That’s why most graph­i­cal user in­ter­faces are built around sans serif fonts). But on to­day’s screens, serif fonts look equal­ly good.

http://practicaltypography.com/body-text.html

Now reading the original issue, I came across weird things, like this for example:

Although I do prefer the 16px style, I have to admit that the majority of sites seem to have a font size around 14px (Github, MDN, etc.) so I think that the 14px option is probably best.

??
Rust is cutting-edge in many fields, why shouldn’t it be so with its web design also?

"But bad habits don’t be­come good habits through rep­e­ti­tion."

Currently we find between 16 and 22 px to be reasonable for desktop webpages

http://blog.weare1910.com/post/72755990718/grids-from-typography

The guys up here are designers but they know about type. They start on a grid and define the typeface before anything else happens.

BTW, it’s always good to cc the person who added something when you’re removing it.

Bottom line: if we are doing this here, I’d at least want it to be for good reasons (reason, reasoning… same root), not just “hey look, the websites I browse usually use a 14px sans-serif font…”.

@ftxqxd
Copy link
Contributor Author

ftxqxd commented Aug 7, 2014

Let’s see what typographers have to say here: [...]

I’m not talking about readability here, I’m talking about style. Rust’s documentation shouldn’t have a style that seems too formal and (perhaps to some people) old-fashioned, it needs to look modern.

In general I do actually prefer serif typefaces, however I consider sans-serif more appropriate for Rust’s documentation.

Actually, he also did a redesign mockup of the Python docs with an extensive explanation

I mentioned that very redesign in the original thread: #16173 (comment). It uses sans-serif fonts. That’s not necessarily saying that we should definitely go with sans-serif, but it’s still a point. (Although your point that the Racket docs that the same person designed use serif fonts is equally valid.)

Rust is cutting-edge in many fields, why shouldn’t it be so with its web design also?

In reflection I’m not really sure what I was saying there. I suppose it has precedent, and people are used to it. These websites have at least some sense of design (MDN & GitHub, at least). But I do certainly agree that sticking with bad habits is a bad idea. This discussion is really about whether or not it is a bad habit. (I think there are some places where more serifs would be good, just maybe not docs.)

BTW, it’s always good to cc the person who added something when you’re removing it.

Sorry about that; it completely slipped my mind to notify you.

if we are doing this here, I’d at least want it to be for good reasons

I agree wholeheartedly. I suppose my reason[ing] is something along these lines:

  • Sans-serif, at least to me, looks more modern and suitable for a programming language
  • The old font looked slightly out of place somehow. Maybe it was just too small too look good to me (I tend to prefer larger serif fonts to smaller ones), I don’t know. Probably I’m just biased. Maybe it’s because the fixed-width font is also sans-serif.
  • Some people found the old font blurry (well, at least @mahkoh did).

But design isn’t about hard-and-fast rules, it’s about opinions and ‘looking right’. The real question is whether or not it ‘looks right’ to everyone.

@mahkoh
Copy link
Contributor

mahkoh commented Aug 7, 2014

Some people found the old font blurry (well, at least @mahkoh did).

I've seen other people on IRC agree that this particular font renders badly on linux.

@adrientetar
Copy link
Contributor

Let's see what people think.

I see that the bold weight of Source Serif Pro got corrupted again… thought I had disabled git newline normalization but I don't know what could be causing it still.

@mahkoh
Copy link
Contributor

mahkoh commented Aug 7, 2014

Not sure if this is related but the bold ! here is hardly recognizable:
2014-08-07-121213_611x252_scrot

@adrientetar
Copy link
Contributor

Is fine by me, font served correctly.

play

@adrientetar
Copy link
Contributor

What is your OS and screen specifications, also browser?

@mahkoh
Copy link
Contributor

mahkoh commented Aug 7, 2014

Arch Linux, 1366x768, chromium.

@adrientetar
Copy link
Contributor

Maybe try to install Bohoomil's Infinality bundle, it improves things for me when I'm on Ubuntu. Through it's way better than the on the pic you posted from the beginning (well I'm on a 1080p (22") monitor).
What is the inches size of your monitor?

EDIT: instructions are here.

@mahkoh
Copy link
Contributor

mahkoh commented Aug 7, 2014

I'm not going to install Infinality just because this one font looks bad. First of all: infinality is buggy, leaks memory, and causes urxvt{,d} to crash. Second of all: Infinality is not a strict improvement over freetype2 in terms of font rendering.

15"

@adrientetar
Copy link
Contributor

I'm not going to install Infinality just because this one font looks bad. First of all: infinality is buggy, leaks memory, and causes urxvt{,d} to crash.

Well the base infinality package has been unmaintained for over a year unlike Bohoomil's.

Second of all: Infinality is not a strict improvement over freetype2 in terms of font rendering.

Saw better crispiness under Ubuntu, noticeably for the font-families having custom fontconfig settings.

15"

Okay so that's not bad, it should be as bad as what you posted. Then again I've never used Arch so I can't really tell.
Maybe if you try to install it locally it could be better, I don't know really (CSS takes on local fonts before webfont).

@mahkoh
Copy link
Contributor

mahkoh commented Aug 7, 2014

Saw better crispiness under Ubuntu

I'm not going to install Infinality to prove it but I can assure you that the indicator numbers in chromium become unreadable with it:
2014-08-07-123310_38x34_scrot

Maybe if you try to install it locally it could be better

If I have to go to such lengths then I'd obviously rather write a small script that disables this font. This is not a solution.

@adrientetar
Copy link
Contributor

Alternatively you can disable webfonts under chromium it seems: https://code.google.com/p/chromium/issues/detail?id=9633
Debugging everyone's computer will get tricky otherwise (this is where you praise the fragmentation of GNU+Linux). This is something that should get reported upstream but then again, the latest freetype on Ubuntu gives very good results even the vanilla one so it mustn't come from that (eventually do try an Ubuntu 14.04 live cd if you want to test that).

@mahkoh
Copy link
Contributor

mahkoh commented Aug 7, 2014

I'm not sure how to do that and I doubt that an issue from 2009 is still relevant today.

Either way: You chose to use this font for a reason I guess. Do you think it worked?

@adrientetar
Copy link
Contributor

Either way: You chose to use this font for a reason I guess. Do you think it worked?

I was not the person who chose to use Source Code Pro. But it's produced by Adobe and used in a lot of websites over the internet and it's the first time I see such botches.

@mahkoh
Copy link
Contributor

mahkoh commented Aug 7, 2014

used in a lot of websites over the internet

Really? I can't remember seeing it ever before.

it's the first time I see such botches.

Other people have reported similar problems with this font on linux.

If this font was chosen to create a uniform, predictable, and good look, then it failed. Looking at this thread and the other one, its neither uniform nor predictable nor good looking. It even varies when you switch between chromium and fx on the same system.

@adrientetar
Copy link
Contributor

Really? I can't remember seeing it ever before.

Okay.

Other people have reported similar problems with this font on linux.

On Arch Linux?

If this font was chosen to create a uniform, predictable, and good look, then it failed.

It failed for you on your system, you're making your particular case into a generality.

It even varies when you switch between chromium and fx on the same system.

Because there are different font renderers out there, this is not an issue per se. When I switch to Windows font rendering get crispier because it blurs fonts less. In comparison Mac OS blurs a lot fonts, more than GNU+Linux. So even across platforms, it varies.

@mahkoh
Copy link
Contributor

mahkoh commented Aug 7, 2014

On Arch Linux?

Who knows.

It failed for you on your system, you're making your particular case into a generality.

The thing about uniformity and predictability is that they fail if there is even one case where the predictions don't hold.

So even across platforms, it varies.

Then don't try to do the impossible and let the user choose the font he likes best.

@adrientetar
Copy link
Contributor

The thing about uniformity and predictability is that they fail if there is even one case where the predictions don't hold.

Good thing they didn't do any promise about that.

Then don't try to do the impossible

No one has been willing to do that.

@mahkoh
Copy link
Contributor

mahkoh commented Aug 7, 2014

The other thread makes this sound quite different:

There are numerous reasons for [using a certain font] —the page needs to be consistent across many browsers (to make styling more easy, and also just for consistency reasons), so the font needs to be explicitly specified. Using a system font is generally not a good idea—Arial and Times New Roman, some of the most widely-supported fonts, are well known for being awful. Using a ‘fancy font’ means that we can actually get a font that is good.

@adrientetar
Copy link
Contributor

Consistent does not mean displayed exactly the same. If your system's render displays fonts generally thicker, it will display the webfont the same way. You have consistency across what you see on your platform and so across fonts since all of them are displayed the same on your platform – given that your platform has software that works properly.

@mahkoh
Copy link
Contributor

mahkoh commented Aug 7, 2014

Sure works properly with every font except this one. And I'm not sure if my fonts are thicker than usual.
2014-08-07-160705_668x102_scrot
And, if you only want consistency per platform, then using the font used by the rest of the platform is obviously the most consistent way to accomplish this.

@mahkoh
Copy link
Contributor

mahkoh commented Aug 7, 2014

FWIW: Some googleing suggests that ubuntu ships a patched freetype2 that makes Source Sans Pro look better.

@adrientetar
Copy link
Contributor

Looks like Arch has a package: https://aur.archlinux.org/packages/freetype2-ubuntu/

@mahkoh
Copy link
Contributor

mahkoh commented Aug 7, 2014

Does rustdoc not support vanilla freetype2?

@adrientetar
Copy link
Contributor

Does rustdoc not support vanilla freetype2?

I do not know. But I don't remember of any problems using Ubuntu and webfonts, so this might help solving your problem, otherwise it should be reported to the Freetype developers.
Do you have the latest version of freetype installed currently?

@mahkoh
Copy link
Contributor

mahkoh commented Aug 7, 2014

Do you have the latest version of freetype installed currently?

Sure.

so this might help solving your problem

Again: I can solve "my problem" by disabling this particular font.

@retep998
Copy link
Member

One of my primary complaints about the text is actually that the color for the text is dark gray instead of black and the resulting loss of contrast decreases readability for me. Especially at the small font size the text is at, contrast is essential.
However definitely 👍 to using a sans-serif font for the text.

@adrientetar
Copy link
Contributor

the color for the text is dark gray instead of black

Too much contrast kiils it, most websites use #333 nowadays instead of #000 (talking abt doing like others…). Only headlines use #000.

@mahkoh
Copy link
Contributor

mahkoh commented Aug 14, 2014

See also #16372

@alexcrichton
Copy link
Member

Closing due to inactivity, but please feel free to reopen!

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

Successfully merging this pull request may close these issues.

10 participants