Skip to content

Commit 0e96c62

Browse files
authored
Rollup merge of #80705 - tspiteri:italic-and-update-SourceCodePro, r=GuillaumeGomez
Update Source Code Pro and include italics Fixes #65502. #65665, a similar PR to this was merged but reverted because of #65665 (comment). The issue in that comment is the upstream issue adobe-fonts/source-code-pro#217 which should now be fixed in the upstream since [2.032R-ro/1.052R-it/1.012R-VAR release](https://github.com/adobe-fonts/source-code-pro/releases/tag/2.032R-ro/1.052R-it/1.012R-VAR), so I think this can now be merged. A couple of notes from the original PR: * Since this PR changes the font set, I think docs.rs would have to be updated if this PR is merged. * The fonts have a double extension (.ttf.woff); this is to keep the names consistent with the upstream font release which does that to distinguish these from the .otf.woff files (Source Code Pro otf renders poorly on older Windows system apps).
2 parents 5d04957 + 87d17bb commit 0e96c62

10 files changed

+25
-11
lines changed

Diff for: src/librustdoc/html/render/write_shared.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ crate static FILES_UNVERSIONED: Lazy<FxHashMap<&str, &[u8]>> = Lazy::new(|| {
3030
"SourceSerifPro-Bold.ttf.woff" => static_files::source_serif_pro::BOLD,
3131
"SourceSerifPro-It.ttf.woff" => static_files::source_serif_pro::ITALIC,
3232
"SourceSerifPro-LICENSE.md" => static_files::source_serif_pro::LICENSE,
33-
"SourceCodePro-Regular.woff" => static_files::source_code_pro::REGULAR,
34-
"SourceCodePro-Semibold.woff" => static_files::source_code_pro::SEMIBOLD,
33+
"SourceCodePro-Regular.ttf.woff" => static_files::source_code_pro::REGULAR,
34+
"SourceCodePro-Semibold.ttf.woff" => static_files::source_code_pro::SEMIBOLD,
35+
"SourceCodePro-It.ttf.woff" => static_files::source_code_pro::ITALIC,
3536
"SourceCodePro-LICENSE.txt" => static_files::source_code_pro::LICENSE,
3637
"LICENSE-MIT.txt" => static_files::LICENSE_MIT,
3738
"LICENSE-APACHE.txt" => static_files::LICENSE_APACHE,

Diff for: src/librustdoc/html/static/COPYRIGHT.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ included, and carry their own copyright notices and license terms:
2323
Copyright (c) Nicolas Gallagher and Jonathan Neal.
2424
Licensed under the MIT license (see LICENSE-MIT.txt).
2525

26-
* Source Code Pro (SourceCodePro-Regular.woff, SourceCodePro-Semibold.woff):
26+
* Source Code Pro (SourceCodePro-Regular.ttf.woff,
27+
SourceCodePro-Semibold.ttf.woff, SourceCodePro-It.ttf.woff):
2728

2829
Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/),
2930
with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark

Diff for: src/librustdoc/html/static/SourceCodePro-It.ttf.woff

57.1 KB
Binary file not shown.
66.6 KB
Binary file not shown.
-54.2 KB
Binary file not shown.
66.5 KB
Binary file not shown.
-54.1 KB
Binary file not shown.

Diff for: src/librustdoc/html/static/rustdoc.css

+9-2
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,21 @@
4848
font-weight: 400;
4949
/* Avoid using locally installed font because bad versions are in circulation:
5050
* see https://github.com/rust-lang/rust/issues/24355 */
51-
src: url("SourceCodePro-Regular.woff") format('woff');
51+
src: url("SourceCodePro-Regular.ttf.woff") format('woff');
52+
font-display: swap;
53+
}
54+
@font-face {
55+
font-family: 'Source Code Pro';
56+
font-style: italic;
57+
font-weight: 400;
58+
src: url("SourceCodePro-It.ttf.woff") format('woff');
5259
font-display: swap;
5360
}
5461
@font-face {
5562
font-family: 'Source Code Pro';
5663
font-style: normal;
5764
font-weight: 600;
58-
src: url("SourceCodePro-Semibold.woff") format('woff');
65+
src: url("SourceCodePro-Semibold.ttf.woff") format('woff');
5966
font-display: swap;
6067
}
6168

Diff for: src/librustdoc/html/static_files.rs

+8-4
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,15 @@ crate mod source_serif_pro {
107107

108108
/// Files related to the Source Code Pro font.
109109
crate mod source_code_pro {
110-
/// The file `SourceCodePro-Regular.woff`, the Regular variant of the Source Code Pro font.
111-
crate static REGULAR: &[u8] = include_bytes!("static/SourceCodePro-Regular.woff");
110+
/// The file `SourceCodePro-Regular.ttf.woff`, the Regular variant of the Source Code Pro font.
111+
crate static REGULAR: &[u8] = include_bytes!("static/SourceCodePro-Regular.ttf.woff");
112112

113-
/// The file `SourceCodePro-Semibold.woff`, the Semibold variant of the Source Code Pro font.
114-
crate static SEMIBOLD: &[u8] = include_bytes!("static/SourceCodePro-Semibold.woff");
113+
/// The file `SourceCodePro-Semibold.ttf.woff`, the Semibold variant of the Source Code Pro
114+
/// font.
115+
crate static SEMIBOLD: &[u8] = include_bytes!("static/SourceCodePro-Semibold.ttf.woff");
116+
117+
/// The file `SourceCodePro-It.ttf.woff`, the Italic variant of the Source Code Pro font.
118+
crate static ITALIC: &[u8] = include_bytes!("static/SourceCodePro-It.ttf.woff");
115119

116120
/// The file `SourceCodePro-LICENSE.txt`, the license text of the Source Code Pro font.
117121
crate static LICENSE: &[u8] = include_bytes!("static/SourceCodePro-LICENSE.txt");

Diff for: src/test/run-make-fulldeps/print-unversioned-files/unversioned-files.txt

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ FiraSans-Regular.woff
66
FiraSans-Regular.woff2
77
LICENSE-APACHE.txt
88
LICENSE-MIT.txt
9+
SourceCodePro-It.ttf.woff
910
SourceCodePro-LICENSE.txt
10-
SourceCodePro-Regular.woff
11-
SourceCodePro-Semibold.woff
11+
SourceCodePro-Regular.ttf.woff
12+
SourceCodePro-Semibold.ttf.woff
1213
SourceSerifPro-Bold.ttf.woff
1314
SourceSerifPro-It.ttf.woff
1415
SourceSerifPro-LICENSE.md

0 commit comments

Comments
 (0)