Skip to content

Commit 423137b

Browse files
authored
Rollup merge of rust-lang#65665 - tspiteri:italic-and-update-SourceCodePro, r=GuillaumeGomez
Update Source Code Pro and include italics Fixes rust-lang#65502. A few notes: * As stated in rust-lang#65502, this does increase the download size. * 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](adobe-fonts/source-code-pro#25 (comment))).
2 parents f50d6ea + ea9519b commit 423137b

9 files changed

+22
-9
lines changed

src/librustdoc/html/render.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -697,10 +697,12 @@ themePicker.onblur = handleThemeButtonsBlur;
697697
static_files::source_serif_pro::ITALIC)?;
698698
write(cx.dst.join("SourceSerifPro-LICENSE.md"),
699699
static_files::source_serif_pro::LICENSE)?;
700-
write(cx.dst.join("SourceCodePro-Regular.woff"),
700+
write(cx.dst.join("SourceCodePro-Regular.ttf.woff"),
701701
static_files::source_code_pro::REGULAR)?;
702-
write(cx.dst.join("SourceCodePro-Semibold.woff"),
702+
write(cx.dst.join("SourceCodePro-Semibold.ttf.woff"),
703703
static_files::source_code_pro::SEMIBOLD)?;
704+
write(cx.dst.join("SourceCodePro-It.ttf.woff"),
705+
static_files::source_code_pro::ITALIC)?;
704706
write(cx.dst.join("SourceCodePro-LICENSE.txt"),
705707
static_files::source_code_pro::LICENSE)?;
706708
write(cx.dst.join("LICENSE-MIT.txt"),

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
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

+8-2
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,19 @@
3939
font-weight: 400;
4040
/* Avoid using locally installed font because bad versions are in circulation:
4141
* see https://github.com/rust-lang/rust/issues/24355 */
42-
src: url("SourceCodePro-Regular.woff") format('woff');
42+
src: url("SourceCodePro-Regular.ttf.woff") format('woff');
43+
}
44+
@font-face {
45+
font-family: 'Source Code Pro';
46+
font-style: italic;
47+
font-weight: 400;
48+
src: url("SourceCodePro-It.ttf.woff") format('woff');
4349
}
4450
@font-face {
4551
font-family: 'Source Code Pro';
4652
font-style: normal;
4753
font-weight: 600;
48-
src: url("SourceCodePro-Semibold.woff") format('woff');
54+
src: url("SourceCodePro-Semibold.ttf.woff") format('woff');
4955
}
5056

5157
* {

src/librustdoc/html/static_files.rs

+8-4
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,15 @@ pub mod source_serif_pro {
9696

9797
/// Files related to the Source Code Pro font.
9898
pub mod source_code_pro {
99-
/// The file `SourceCodePro-Regular.woff`, the Regular variant of the Source Code Pro font.
100-
pub static REGULAR: &'static [u8] = include_bytes!("static/SourceCodePro-Regular.woff");
99+
/// The file `SourceCodePro-Regular.ttf.woff`, the Regular variant of the Source Code Pro font.
100+
pub static REGULAR: &'static [u8] = include_bytes!("static/SourceCodePro-Regular.ttf.woff");
101101

102-
/// The file `SourceCodePro-Semibold.woff`, the Semibold variant of the Source Code Pro font.
103-
pub static SEMIBOLD: &'static [u8] = include_bytes!("static/SourceCodePro-Semibold.woff");
102+
/// The file `SourceCodePro-Semibold.ttf.woff`, the Semibold variant of the Source Code Pro
103+
/// font.
104+
pub static SEMIBOLD: &'static [u8] = include_bytes!("static/SourceCodePro-Semibold.ttf.woff");
105+
106+
/// The file `SourceCodePro-It.ttf.woff`, the Italic variant of the Source Code Pro font.
107+
pub static ITALIC: &'static [u8] = include_bytes!("static/SourceCodePro-It.ttf.woff");
104108

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

0 commit comments

Comments
 (0)