Skip to content

Commit c938d58

Browse files
Optional too optional, apparently
Local testing did not reveal that "optional" is incredibly eagerly skipped if it involves network transit, so successive page loads didn't actually load the fonts. "fallback" behaved as-predicted (success on next page load). Some styles set to "swap" to guarantee better readability. "Oops."
1 parent 664fcd3 commit c938d58

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/librustdoc/html/static/rustdoc.css

+7
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33
font-family: 'Fira Sans';
44
font-style: normal;
55
font-weight: 400;
6+
font-display: swap;
67
src: local('Fira Sans'), url("FiraSans-Regular.woff") format('woff');
78
}
89
@font-face {
910
font-family: 'Fira Sans';
1011
font-style: normal;
1112
font-weight: 500;
13+
font-display: swap;
1214
src: local('Fira Sans Medium'), url("FiraSans-Medium.woff") format('woff');
1315
}
1416

@@ -17,18 +19,21 @@
1719
font-family: 'Source Serif Pro';
1820
font-style: normal;
1921
font-weight: 400;
22+
font-display: fallback;
2023
src: local('Source Serif Pro'), url("SourceSerifPro-Regular.ttf.woff") format('woff');
2124
}
2225
@font-face {
2326
font-family: 'Source Serif Pro';
2427
font-style: italic;
2528
font-weight: 400;
29+
font-display: fallback;
2630
src: local('Source Serif Pro Italic'), url("SourceSerifPro-It.ttf.woff") format('woff');
2731
}
2832
@font-face {
2933
font-family: 'Source Serif Pro';
3034
font-style: normal;
3135
font-weight: 700;
36+
font-display: fallback;
3237
src: local('Source Serif Pro Bold'), url("SourceSerifPro-Bold.ttf.woff") format('woff');
3338
}
3439

@@ -37,6 +42,7 @@
3742
font-family: 'Source Code Pro';
3843
font-style: normal;
3944
font-weight: 400;
45+
font-display: fallback;
4046
/* Avoid using locally installed font because bad versions are in circulation:
4147
* see https://github.com/rust-lang/rust/issues/24355 */
4248
src: url("SourceCodePro-Regular.woff") format('woff');
@@ -45,6 +51,7 @@
4551
font-family: 'Source Code Pro';
4652
font-style: normal;
4753
font-weight: 600;
54+
font-display: swap;
4855
src: url("SourceCodePro-Semibold.woff") format('woff');
4956
}
5057

0 commit comments

Comments
 (0)