You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Ampersands in documentation are drawn incorrectly in some browser configurations #24355
On my system, ampersands in the documentation are drawn incorrectly in Chrome: https://i.imgur.com/FmG93G5.png. I'm using Windows 7, 64-bit. This doesn't happen in Firefox.
I'm thinking this could be a bug in Chrome, but I haven't seen it on any other site. It seems to happen on any page generated with rustdoc. Ampersands in the examples aren't affected.
Reacted by Jonas Schievink, Juhan Oskar Hennoste, Andrew Thorburn, Proc, tatref, Andy Hayden, Skip R., Lukas Pioch, nacho.d.g, Alexey Pozdnyakov and 1 more
It looks like this is similar to #16372. I deleted the Source Code Pro font, which fixed it. Since I'm at least the second person to come across this issue, maybe we should try to find a more permanent solution. Is it possible for rustdoc to automatically download and use the most recent version of the font? If not, maybe this issue should at least be documented somewhere.
I'm still not sure why this issue was happening in Chrome but not Firefox.
Is there a reason why for the Source (\w*) Pro fonts the locally installed version is requested first, but not for Fira Sans (cf. rustdoc's main.css)? Are there many people who have those installed? (Even then, why not give Fira the same chance?)
If we are concerned about file sizes or compatibility, we should probably add woff2 (newer, smaller format) and eot (legacy IE format) versions of the fonts.
It may be a good idea to use a CDN for the font's (like Google font) with a local fallback when the CDN can't be reached, for example when offline. This has a couple of advantages
loading the latest version from the CDN
parallel http request and thus faster load times
if the font from the CDN has been loaded on another page, it will be cached and thus speed up the page load too.
It might be interesting to do that for jQuery too since it is the most downloaded js library there is a very high probability that it will already be in the browser cache.
This is getting pretty annoying now, and this happens on basically the most common Windows configuration (plus, this issue is almost a year old now). Can't we just use another font for now?
Reacted by Will, Andrew Thorburn, Alex M. M. and Josh Leverette
I've got the same problem with the ampersands, and it makes the documentation very hard to read. After some time you can get used to it, but at first this not just sucks, it tells me to leave the page and never come back.
The solution to update the font on all of my computers is not acceptable for me. I have 2 win10 and 2 win7 machines having the same problem, all in chrome browser, and to be honest: I don't want to update my computers by hand, just for one website. Even if it's a chrome problem, there is a way to work around that problem.
Why not just remove the font, and use the other ones? DejaVu Sans Mono looks very clean and good, and it's been around for quite some time, so I guess it's glitch free?
The disadvantage there is that we lose the ability to predict which font most people will have active (something which is useful for design). Moreover if Source Code Pro is their monospace default, this bug will continue to affect them.
Moreover if Source Code Pro is their monospace default, this bug will continue to affect them.
Some old version of Source Code Pro obtained from the fishy source that google fonts is, which is getting more unlikely over time.
To make it clear, I’ve never been affected by this bug and SCP is set to be the default monospace font on my system. I would like to keep reading rustdoc in SCP, and couldn’t care about design or whatnot any less.
Meanwhile, I agree with @nagisa regarding just using monospace because I have mine set to Inconsolata Go, and am similarly unmoved by "design" as an argument (especially given this mostly applies to... types and signatures, which were not carefully chosen to fit some form of web-first design).
So looking at Rustdoc's CSS I find this : src: local('Source Code Pro'), url("SourceCodePro-Regular.woff") format('woff'); which seems to imply we'll use the local version of source code pro before the web font version. I think just removing the local clause will force using the web font and thus avoid the buggy old version of the font that some people have on their systems.
I've been affected by this bug multiple times, since something on my machine (Windows) seems to keep reinstalling an old version of Source Code Pro. I haven't been able to figure out what it is. @nrc's fix sounds like the right solution to me.
See also /issues/34681, around a same-origin problem loading fonts from the doc tree on Firefox. It seems like just removing the local clause could make that happen more often?
Activity
nstoddard commentedon Apr 12, 2015
It looks like this is similar to #16372. I deleted the Source Code Pro font, which fixed it. Since I'm at least the second person to come across this issue, maybe we should try to find a more permanent solution. Is it possible for rustdoc to automatically download and use the most recent version of the font? If not, maybe this issue should at least be documented somewhere.
I'm still not sure why this issue was happening in Chrome but not Firefox.
killercup commentedon Apr 13, 2015
Is there a reason why for the Source (\w*) Pro fonts the locally installed version is requested first, but not for Fira Sans (cf. rustdoc's
main.css)? Are there many people who have those installed? (Even then, why not give Fira the same chance?)If we are concerned about file sizes or compatibility, we should probably add
woff2(newer, smaller format) andeot(legacy IE format) versions of the fonts.ZobyTwo commentedon May 9, 2015
I dont have any of those fonts installed and still have the same issue (windows, chrome). I found (https://code.google.com/p/googlefontdirectory/issues/detail?id=178) which suggests that there is a newer version of the font which might fix the problem.
azerupi commentedon Jun 29, 2015
It may be a good idea to use a CDN for the font's (like Google font) with a local fallback when the CDN can't be reached, for example when offline. This has a couple of advantages
It might be interesting to do that for jQuery too since it is the most downloaded js library there is a very high probability that it will already be in the browser cache.
jonimake commentedon Feb 6, 2016
Still happening with Chrome 48.0.2564.103 m and Windows 10.
jonas-schievink commentedon Mar 12, 2016
This is getting pretty annoying now, and this happens on basically the most common Windows configuration (plus, this issue is almost a year old now). Can't we just use another font for now?
rust-lang#24355 Update to latest version of the SourceCodePro fonts
sateffen commentedon Jun 11, 2016
Hey,
I've got the same problem with the ampersands, and it makes the documentation very hard to read. After some time you can get used to it, but at first this not just sucks, it tells me to leave the page and never come back.
The solution to update the font on all of my computers is not acceptable for me. I have 2 win10 and 2 win7 machines having the same problem, all in chrome browser, and to be honest: I don't want to update my computers by hand, just for one website. Even if it's a chrome problem, there is a way to work around that problem.
Why not just remove the font, and use the other ones? DejaVu Sans Mono looks very clean and good, and it's been around for quite some time, so I guess it's glitch free?
brson commentedon Sep 13, 2016
Let's just add another similar font at a higher priority. Help wanted.
2 remaining items
matthew-piziak commentedon Sep 16, 2016
The disadvantage there is that we lose the ability to predict which font most people will have active (something which is useful for design). Moreover if
Source Code Prois theirmonospacedefault, this bug will continue to affect them.nagisa commentedon Sep 16, 2016
Some old version of Source Code Pro obtained from the fishy source that google fonts is, which is getting more unlikely over time.
To make it clear, I’ve never been affected by this bug and SCP is set to be the default monospace font on my system. I would like to keep reading rustdoc in SCP, and couldn’t care about design or whatnot any less.
matthew-piziak commentedon Sep 17, 2016
I understand your reasoning now.
eternaleye commentedon Sep 17, 2016
Meanwhile, I agree with @nagisa regarding just using
monospacebecause I have mine set to Inconsolata Go, and am similarly unmoved by "design" as an argument (especially given this mostly applies to... types and signatures, which were not carefully chosen to fit some form of web-first design).matthew-piziak commentedon Sep 17, 2016
Yep, I'm convinced. 👍
nrc commentedon Sep 20, 2016
So looking at Rustdoc's CSS I find this :
src: local('Source Code Pro'), url("SourceCodePro-Regular.woff") format('woff');which seems to imply we'll use the local version of source code pro before the web font version. I think just removing thelocalclause will force using the web font and thus avoid the buggy old version of the font that some people have on their systems.Boddlnagg commentedon Sep 21, 2016
I've been affected by this bug multiple times, since something on my machine (Windows) seems to keep reinstalling an old version of Source Code Pro. I haven't been able to figure out what it is. @nrc's fix sounds like the right solution to me.
sourcefrog commentedon Dec 4, 2016
See also /issues/34681, around a same-origin problem loading fonts from the doc tree on Firefox. It seems like just removing the
localclause could make that happen more often?Avoid using locally installed Source Code Pro font (fixes rust-lang#2…
sourcefrog commentedon Dec 4, 2016
I made the change suggested by @nrc of removing use of the local font in . The results are in https://storage.googleapis.com/mbp-rust-builds/fonts/doc/std/index.html so perhaps people who can reproduce this can try that and report how it looks.
Rollup merge of rust-lang#38164 - sourcefrog:fonts, r=GuillaumeGomez
Rollup merge of rust-lang#38164 - sourcefrog:fonts, r=GuillaumeGomez
template: Add SourceCodePro