Skip to content

Commit b77f439

Browse files
committed
Don't override the user's fonts
This patch is similar in spirit to rust-lang/blog.rust-lang.org#263 and onur/docs.rs#240; it removes the specific font overrides in rustdoc.css so that the browser will use the user's configured fonts. This reduces the weight of all rustdoc pages (yay for mobile!) while also letting users use whatever fonts they prefer. The net result of the change is that the page will look less "uniform" across different browsers, OSes, and devices, but the overall aesthetic should be preserved. It also means that user preferences are respected, and that legibility is improved for users with particular font needs, or on platforms that sometimes gets confused about how to render fonts nicely (ehrm, Linux).
1 parent 2bd5993 commit b77f439

9 files changed

+5
-99
lines changed

src/librustdoc/html/static/COPYRIGHT.txt

-43
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,6 @@ These documentation pages include resources by third parties. This copyright
22
file applies only to those resources. The following third party resources are
33
included, and carry their own copyright notices and license terms:
44

5-
* Fira Sans (FiraSans-Regular.woff, FiraSans-Medium.woff):
6-
7-
Copyright (c) 2014, Mozilla Foundation https://mozilla.org/
8-
with Reserved Font Name Fira Sans.
9-
10-
Copyright (c) 2014, Telefonica S.A.
11-
12-
Licensed under the SIL Open Font License, Version 1.1.
13-
See FiraSans-LICENSE.txt.
14-
15-
* Heuristica (Heuristica-Italic.woff):
16-
17-
Copyright 1989, 1991 Adobe Systems Incorporated. All rights reserved.
18-
Utopia is either a registered trademark or trademark of Adobe Systems
19-
Incorporated in the United States and/or other countries. Used under
20-
license.
21-
22-
Copyright 2006 Han The Thanh, Vntopia font family, http://vntex.sf.net
23-
24-
Copyright (c) 2008-2012, Andrey V. Panov (panov@canopus.iacp.dvo.ru),
25-
with Reserved Font Name Heuristica.
26-
27-
Licensed under the SIL Open Font License, Version 1.1.
28-
See Heuristica-LICENSE.txt.
29-
305
* rustdoc.css, main.js, and playpen.js:
316

327
Copyright 2015 The Rust Developers.
@@ -38,22 +13,4 @@ included, and carry their own copyright notices and license terms:
3813
Copyright (c) Nicolas Gallagher and Jonathan Neal.
3914
Licensed under the MIT license (see LICENSE-MIT.txt).
4015

41-
* Source Code Pro (SourceCodePro-Regular.woff, SourceCodePro-Semibold.woff):
42-
43-
Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/),
44-
with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark
45-
of Adobe Systems Incorporated in the United States and/or other countries.
46-
47-
Licensed under the SIL Open Font License, Version 1.1.
48-
See SourceCodePro-LICENSE.txt.
49-
50-
* Source Serif Pro (SourceSerifPro-Regular.woff, SourceSerifPro-Bold.woff):
51-
52-
Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/), with
53-
Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of
54-
Adobe Systems Incorporated in the United States and/or other countries.
55-
56-
Licensed under the SIL Open Font License, Version 1.1.
57-
See SourceSerifPro-LICENSE.txt.
58-
5916
This copyright file is intended to be distributed with rustdoc output.
-87.8 KB
Binary file not shown.
-89.8 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

src/librustdoc/html/static/rustdoc.css

+5-56
Original file line numberDiff line numberDiff line change
@@ -10,57 +10,6 @@
1010
* except according to those terms.
1111
*/
1212

13-
/* See FiraSans-LICENSE.txt for the Fira Sans license. */
14-
@font-face {
15-
font-family: 'Fira Sans';
16-
font-style: normal;
17-
font-weight: 400;
18-
src: local('Fira Sans'), url("FiraSans-Regular.woff") format('woff');
19-
}
20-
@font-face {
21-
font-family: 'Fira Sans';
22-
font-style: normal;
23-
font-weight: 500;
24-
src: local('Fira Sans Medium'), url("FiraSans-Medium.woff") format('woff');
25-
}
26-
27-
/* See SourceSerifPro-LICENSE.txt for the Source Serif Pro license and
28-
* Heuristica-LICENSE.txt for the Heuristica license. */
29-
@font-face {
30-
font-family: 'Source Serif Pro';
31-
font-style: normal;
32-
font-weight: 400;
33-
src: local('Source Serif Pro'), url("SourceSerifPro-Regular.woff") format('woff');
34-
}
35-
@font-face {
36-
font-family: 'Source Serif Pro';
37-
font-style: italic;
38-
font-weight: 400;
39-
src: url("Heuristica-Italic.woff") format('woff');
40-
}
41-
@font-face {
42-
font-family: 'Source Serif Pro';
43-
font-style: normal;
44-
font-weight: 700;
45-
src: local('Source Serif Pro Bold'), url("SourceSerifPro-Bold.woff") format('woff');
46-
}
47-
48-
/* See SourceCodePro-LICENSE.txt for the Source Code Pro license. */
49-
@font-face {
50-
font-family: 'Source Code Pro';
51-
font-style: normal;
52-
font-weight: 400;
53-
/* Avoid using locally installed font because bad versions are in circulation:
54-
* see https://github.com/rust-lang/rust/issues/24355 */
55-
src: url("SourceCodePro-Regular.woff") format('woff');
56-
}
57-
@font-face {
58-
font-family: 'Source Code Pro';
59-
font-style: normal;
60-
font-weight: 600;
61-
src: url("SourceCodePro-Semibold.woff") format('woff');
62-
}
63-
6413
* {
6514
-webkit-box-sizing: border-box;
6615
-moz-box-sizing: border-box;
@@ -70,7 +19,7 @@
7019
/* General structure and fonts */
7120

7221
body {
73-
font: 16px/1.4 "Source Serif Pro", Georgia, Times, "Times New Roman", serif;
22+
font-size: 1em;
7423
margin: 0;
7524
position: relative;
7625
padding: 10px 15px 20px 15px;
@@ -115,7 +64,7 @@ h3.impl, h3.method, h3.type {
11564
h1, h2, h3, h4,
11665
.sidebar, a.source, .search-input, .content table :not(code)>a,
11766
.collapse-toggle, div.item-list .out-of-band {
118-
font-family: "Fira Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
67+
font-family: sans-serif;
11968
}
12069

12170
ol, ul {
@@ -134,7 +83,7 @@ summary {
13483
}
13584

13685
code, pre {
137-
font-family: "Source Code Pro", Menlo, Monaco, Consolas, "DejaVu Sans Mono", Inconsolata, monospace;
86+
font-family: monospace;
13887
white-space: pre-wrap;
13988
}
14089
.docblock code, .docblock-short code {
@@ -395,7 +344,7 @@ h4 > code, h3 > code, .invisible > code {
395344
}
396345
#main > .since {
397346
top: inherit;
398-
font-family: "Fira Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
347+
font-family: sans-serif;
399348
}
400349

401350
.content table:not(.table-display) {
@@ -1272,7 +1221,7 @@ h3.important {
12721221
kbd {
12731222
display: inline-block;
12741223
padding: 3px 5px;
1275-
font: 15px "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
1224+
font: 0.9rem monospace;
12761225
line-height: 10px;
12771226
vertical-align: middle;
12781227
border: solid 1px;

0 commit comments

Comments
 (0)