Rollup merge of #86402 - tspiteri:source-woff2, r=jsha
rustdoc: add optional woff2 versions of Source Serif and Source Code This provides woff2 versions of Source Serif and Source Code similar to how #82545 provides woff2 versions of Fira Sans. The total byte count for the six files (three for each font family) is reduced by 25% from 476 KiB to 358 KiB.
This commit is contained in:
commit
fd96d55426
10 changed files with 54 additions and 11 deletions
|
@ -25,10 +25,16 @@ static FILES_UNVERSIONED: Lazy<FxHashMap<&str, &[u8]>> = Lazy::new(|| {
|
||||||
"FiraSans-Regular.woff" => static_files::fira_sans::REGULAR,
|
"FiraSans-Regular.woff" => static_files::fira_sans::REGULAR,
|
||||||
"FiraSans-Medium.woff" => static_files::fira_sans::MEDIUM,
|
"FiraSans-Medium.woff" => static_files::fira_sans::MEDIUM,
|
||||||
"FiraSans-LICENSE.txt" => static_files::fira_sans::LICENSE,
|
"FiraSans-LICENSE.txt" => static_files::fira_sans::LICENSE,
|
||||||
|
"SourceSerif4-Regular.ttf.woff2" => static_files::source_serif_4::REGULAR2,
|
||||||
|
"SourceSerif4-Bold.ttf.woff2" => static_files::source_serif_4::BOLD2,
|
||||||
|
"SourceSerif4-It.ttf.woff2" => static_files::source_serif_4::ITALIC2,
|
||||||
"SourceSerif4-Regular.ttf.woff" => static_files::source_serif_4::REGULAR,
|
"SourceSerif4-Regular.ttf.woff" => static_files::source_serif_4::REGULAR,
|
||||||
"SourceSerif4-Bold.ttf.woff" => static_files::source_serif_4::BOLD,
|
"SourceSerif4-Bold.ttf.woff" => static_files::source_serif_4::BOLD,
|
||||||
"SourceSerif4-It.ttf.woff" => static_files::source_serif_4::ITALIC,
|
"SourceSerif4-It.ttf.woff" => static_files::source_serif_4::ITALIC,
|
||||||
"SourceSerif4-LICENSE.md" => static_files::source_serif_4::LICENSE,
|
"SourceSerif4-LICENSE.md" => static_files::source_serif_4::LICENSE,
|
||||||
|
"SourceCodePro-Regular.ttf.woff2" => static_files::source_code_pro::REGULAR2,
|
||||||
|
"SourceCodePro-Semibold.ttf.woff2" => static_files::source_code_pro::SEMIBOLD2,
|
||||||
|
"SourceCodePro-It.ttf.woff2" => static_files::source_code_pro::ITALIC2,
|
||||||
"SourceCodePro-Regular.ttf.woff" => static_files::source_code_pro::REGULAR,
|
"SourceCodePro-Regular.ttf.woff" => static_files::source_code_pro::REGULAR,
|
||||||
"SourceCodePro-Semibold.ttf.woff" => static_files::source_code_pro::SEMIBOLD,
|
"SourceCodePro-Semibold.ttf.woff" => static_files::source_code_pro::SEMIBOLD,
|
||||||
"SourceCodePro-It.ttf.woff" => static_files::source_code_pro::ITALIC,
|
"SourceCodePro-It.ttf.woff" => static_files::source_code_pro::ITALIC,
|
||||||
|
|
|
@ -2,7 +2,8 @@ These documentation pages include resources by third parties. This copyright
|
||||||
file applies only to those resources. The following third party resources are
|
file applies only to those resources. The following third party resources are
|
||||||
included, and carry their own copyright notices and license terms:
|
included, and carry their own copyright notices and license terms:
|
||||||
|
|
||||||
* Fira Sans (FiraSans-Regular.woff, FiraSans-Medium.woff):
|
* Fira Sans (FiraSans-Regular.woff2, FiraSans-Medium.woff2,
|
||||||
|
FiraSans-Regular.woff, FiraSans-Medium.woff):
|
||||||
|
|
||||||
Copyright (c) 2014, Mozilla Foundation https://mozilla.org/
|
Copyright (c) 2014, Mozilla Foundation https://mozilla.org/
|
||||||
with Reserved Font Name Fira Sans.
|
with Reserved Font Name Fira Sans.
|
||||||
|
@ -23,8 +24,10 @@ included, and carry their own copyright notices and license terms:
|
||||||
Copyright (c) Nicolas Gallagher and Jonathan Neal.
|
Copyright (c) Nicolas Gallagher and Jonathan Neal.
|
||||||
Licensed under the MIT license (see LICENSE-MIT.txt).
|
Licensed under the MIT license (see LICENSE-MIT.txt).
|
||||||
|
|
||||||
* Source Code Pro (SourceCodePro-Regular.ttf.woff,
|
* Source Code Pro (SourceCodePro-Regular.ttf.woff2,
|
||||||
SourceCodePro-Semibold.ttf.woff, SourceCodePro-It.ttf.woff):
|
SourceCodePro-Semibold.ttf.woff2, SourceCodePro-It.ttf.woff2,
|
||||||
|
SourceCodePro-Regular.ttf.woff, SourceCodePro-Semibold.ttf.woff,
|
||||||
|
SourceCodePro-It.ttf.woff):
|
||||||
|
|
||||||
Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/),
|
Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/),
|
||||||
with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark
|
with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark
|
||||||
|
@ -33,8 +36,9 @@ included, and carry their own copyright notices and license terms:
|
||||||
Licensed under the SIL Open Font License, Version 1.1.
|
Licensed under the SIL Open Font License, Version 1.1.
|
||||||
See SourceCodePro-LICENSE.txt.
|
See SourceCodePro-LICENSE.txt.
|
||||||
|
|
||||||
* Source Serif 4 (SourceSerif4-Regular.ttf.woff, SourceSerif4-Bold.ttf.woff,
|
* Source Serif 4 (SourceSerif4-Regular.ttf.woff2, SourceSerif4-Bold.ttf.woff2,
|
||||||
SourceSerif4-It.ttf.woff):
|
SourceSerif4-It.ttf.woff2, SourceSerif4-Regular.ttf.woff,
|
||||||
|
SourceSerif4-Bold.ttf.woff, SourceSerif4-It.ttf.woff):
|
||||||
|
|
||||||
Copyright 2014-2021 Adobe (http://www.adobe.com/), with Reserved Font Name
|
Copyright 2014-2021 Adobe (http://www.adobe.com/), with Reserved Font Name
|
||||||
'Source'. All Rights Reserved. Source is a trademark of Adobe in the United
|
'Source'. All Rights Reserved. Source is a trademark of Adobe in the United
|
||||||
|
|
BIN
src/librustdoc/html/static/SourceCodePro-It.ttf.woff2
Normal file
BIN
src/librustdoc/html/static/SourceCodePro-It.ttf.woff2
Normal file
Binary file not shown.
BIN
src/librustdoc/html/static/SourceCodePro-Regular.ttf.woff2
Normal file
BIN
src/librustdoc/html/static/SourceCodePro-Regular.ttf.woff2
Normal file
Binary file not shown.
BIN
src/librustdoc/html/static/SourceCodePro-Semibold.ttf.woff2
Normal file
BIN
src/librustdoc/html/static/SourceCodePro-Semibold.ttf.woff2
Normal file
Binary file not shown.
BIN
src/librustdoc/html/static/SourceSerif4-Bold.ttf.woff2
Normal file
BIN
src/librustdoc/html/static/SourceSerif4-Bold.ttf.woff2
Normal file
Binary file not shown.
BIN
src/librustdoc/html/static/SourceSerif4-It.ttf.woff2
Normal file
BIN
src/librustdoc/html/static/SourceSerif4-It.ttf.woff2
Normal file
Binary file not shown.
BIN
src/librustdoc/html/static/SourceSerif4-Regular.ttf.woff2
Normal file
BIN
src/librustdoc/html/static/SourceSerif4-Regular.ttf.woff2
Normal file
Binary file not shown.
|
@ -23,21 +23,27 @@
|
||||||
font-family: 'Source Serif 4';
|
font-family: 'Source Serif 4';
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
src: local('Source Serif 4'), url("SourceSerif4-Regular.ttf.woff") format('woff');
|
src: local('Source Serif 4'),
|
||||||
|
url("SourceSerif4-Regular.ttf.woff2") format("woff2"),
|
||||||
|
url("SourceSerif4-Regular.ttf.woff") format("woff");
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
}
|
}
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Source Serif 4';
|
font-family: 'Source Serif 4';
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
src: local('Source Serif 4 Italic'), url("SourceSerif4-It.ttf.woff") format('woff');
|
src: local('Source Serif 4 Italic'),
|
||||||
|
url("SourceSerif4-It.ttf.woff2") format("woff2"),
|
||||||
|
url("SourceSerif4-It.ttf.woff") format("woff");
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
}
|
}
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Source Serif 4';
|
font-family: 'Source Serif 4';
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
src: local('Source Serif 4 Bold'), url("SourceSerif4-Bold.ttf.woff") format('woff');
|
src: local('Source Serif 4 Bold'),
|
||||||
|
url("SourceSerif4-Bold.ttf.woff2") format("woff2"),
|
||||||
|
url("SourceSerif4-Bold.ttf.woff") format("woff");
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,21 +54,24 @@
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
/* Avoid using locally installed font because bad versions are in circulation:
|
/* Avoid using locally installed font because bad versions are in circulation:
|
||||||
* see https://github.com/rust-lang/rust/issues/24355 */
|
* see https://github.com/rust-lang/rust/issues/24355 */
|
||||||
src: url("SourceCodePro-Regular.ttf.woff") format('woff');
|
src: url("SourceCodePro-Regular.ttf.woff2") format("woff2"),
|
||||||
|
url("SourceCodePro-Regular.ttf.woff") format("woff");
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
}
|
}
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Source Code Pro';
|
font-family: 'Source Code Pro';
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
src: url("SourceCodePro-It.ttf.woff") format('woff');
|
src: url("SourceCodePro-It.ttf.woff2") format("woff2"),
|
||||||
|
url("SourceCodePro-It.ttf.woff") format("woff");
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
}
|
}
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Source Code Pro';
|
font-family: 'Source Code Pro';
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
src: url("SourceCodePro-Semibold.ttf.woff") format('woff');
|
src: url("SourceCodePro-Semibold.ttf.woff2") format("woff2"),
|
||||||
|
url("SourceCodePro-Semibold.ttf.woff") format("woff");
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -102,12 +102,24 @@ crate mod source_serif_4 {
|
||||||
/// The file `SourceSerif4-Regular.ttf.woff`, the Regular variant of the Source Serif 4 font.
|
/// The file `SourceSerif4-Regular.ttf.woff`, the Regular variant of the Source Serif 4 font.
|
||||||
crate static REGULAR: &[u8] = include_bytes!("static/SourceSerif4-Regular.ttf.woff");
|
crate static REGULAR: &[u8] = include_bytes!("static/SourceSerif4-Regular.ttf.woff");
|
||||||
|
|
||||||
|
/// The file `SourceSerif4-Regular.ttf.woff2`, the Regular variant of the Source Serif 4 font in
|
||||||
|
/// woff2.
|
||||||
|
crate static REGULAR2: &[u8] = include_bytes!("static/SourceSerif4-Regular.ttf.woff2");
|
||||||
|
|
||||||
/// The file `SourceSerif4-Bold.ttf.woff`, the Bold variant of the Source Serif 4 font.
|
/// The file `SourceSerif4-Bold.ttf.woff`, the Bold variant of the Source Serif 4 font.
|
||||||
crate static BOLD: &[u8] = include_bytes!("static/SourceSerif4-Bold.ttf.woff");
|
crate static BOLD: &[u8] = include_bytes!("static/SourceSerif4-Bold.ttf.woff");
|
||||||
|
|
||||||
|
/// The file `SourceSerif4-Bold.ttf.woff2`, the Bold variant of the Source Serif 4 font in
|
||||||
|
/// woff2.
|
||||||
|
crate static BOLD2: &[u8] = include_bytes!("static/SourceSerif4-Bold.ttf.woff2");
|
||||||
|
|
||||||
/// The file `SourceSerif4-It.ttf.woff`, the Italic variant of the Source Serif 4 font.
|
/// The file `SourceSerif4-It.ttf.woff`, the Italic variant of the Source Serif 4 font.
|
||||||
crate static ITALIC: &[u8] = include_bytes!("static/SourceSerif4-It.ttf.woff");
|
crate static ITALIC: &[u8] = include_bytes!("static/SourceSerif4-It.ttf.woff");
|
||||||
|
|
||||||
|
/// The file `SourceSerif4-It.ttf.woff2`, the Italic variant of the Source Serif 4 font in
|
||||||
|
/// woff2.
|
||||||
|
crate static ITALIC2: &[u8] = include_bytes!("static/SourceSerif4-It.ttf.woff2");
|
||||||
|
|
||||||
/// The file `SourceSerif4-LICENSE.txt`, the license text for the Source Serif 4 font.
|
/// The file `SourceSerif4-LICENSE.txt`, the license text for the Source Serif 4 font.
|
||||||
crate static LICENSE: &[u8] = include_bytes!("static/SourceSerif4-LICENSE.md");
|
crate static LICENSE: &[u8] = include_bytes!("static/SourceSerif4-LICENSE.md");
|
||||||
}
|
}
|
||||||
|
@ -117,13 +129,25 @@ crate mod source_code_pro {
|
||||||
/// The file `SourceCodePro-Regular.ttf.woff`, the Regular variant of the Source Code Pro font.
|
/// The file `SourceCodePro-Regular.ttf.woff`, the Regular variant of the Source Code Pro font.
|
||||||
crate static REGULAR: &[u8] = include_bytes!("static/SourceCodePro-Regular.ttf.woff");
|
crate static REGULAR: &[u8] = include_bytes!("static/SourceCodePro-Regular.ttf.woff");
|
||||||
|
|
||||||
|
/// The file `SourceCodePro-Regular.ttf.woff2`, the Regular variant of the Source Code Pro font
|
||||||
|
/// in woff2.
|
||||||
|
crate static REGULAR2: &[u8] = include_bytes!("static/SourceCodePro-Regular.ttf.woff2");
|
||||||
|
|
||||||
/// The file `SourceCodePro-Semibold.ttf.woff`, the Semibold variant of the Source Code Pro
|
/// The file `SourceCodePro-Semibold.ttf.woff`, the Semibold variant of the Source Code Pro
|
||||||
/// font.
|
/// font.
|
||||||
crate static SEMIBOLD: &[u8] = include_bytes!("static/SourceCodePro-Semibold.ttf.woff");
|
crate static SEMIBOLD: &[u8] = include_bytes!("static/SourceCodePro-Semibold.ttf.woff");
|
||||||
|
|
||||||
|
/// The file `SourceCodePro-Semibold.ttf.woff2`, the Semibold variant of the Source Code Pro
|
||||||
|
/// font in woff2.
|
||||||
|
crate static SEMIBOLD2: &[u8] = include_bytes!("static/SourceCodePro-Semibold.ttf.woff2");
|
||||||
|
|
||||||
/// The file `SourceCodePro-It.ttf.woff`, the Italic variant of the Source Code Pro font.
|
/// The file `SourceCodePro-It.ttf.woff`, the Italic variant of the Source Code Pro font.
|
||||||
crate static ITALIC: &[u8] = include_bytes!("static/SourceCodePro-It.ttf.woff");
|
crate static ITALIC: &[u8] = include_bytes!("static/SourceCodePro-It.ttf.woff");
|
||||||
|
|
||||||
|
/// The file `SourceCodePro-It.ttf.woff2`, the Italic variant of the Source Code Pro font in
|
||||||
|
/// woff2.
|
||||||
|
crate static ITALIC2: &[u8] = include_bytes!("static/SourceCodePro-It.ttf.woff2");
|
||||||
|
|
||||||
/// The file `SourceCodePro-LICENSE.txt`, the license text of the Source Code Pro font.
|
/// The file `SourceCodePro-LICENSE.txt`, the license text of the Source Code Pro font.
|
||||||
crate static LICENSE: &[u8] = include_bytes!("static/SourceCodePro-LICENSE.txt");
|
crate static LICENSE: &[u8] = include_bytes!("static/SourceCodePro-LICENSE.txt");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue