about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTrevor Spiteri <tspiteri@ieee.org>2021-06-17 17:36:42 +0200
committerTrevor Spiteri <tspiteri@ieee.org>2021-06-17 17:36:42 +0200
commit1738c7864cdb1cf91d9d1837d12e39138667a2b7 (patch)
tree641e6ed8ddc41b8098e484db81c8937bb8977141
parent0ef2b4a29bf70e8984d0d2febb7a546856c554a0 (diff)
downloadrust-1738c7864cdb1cf91d9d1837d12e39138667a2b7.tar.gz
rust-1738c7864cdb1cf91d9d1837d12e39138667a2b7.zip
rustdoc: add optional woff2 versions of Source Serif and Source Code
-rw-r--r--src/librustdoc/html/render/write_shared.rs6
-rw-r--r--src/librustdoc/html/static/SourceCodePro-It.ttf.woff2bin0 -> 44896 bytes
-rw-r--r--src/librustdoc/html/static/SourceCodePro-Regular.ttf.woff2bin0 -> 52228 bytes
-rw-r--r--src/librustdoc/html/static/SourceCodePro-Semibold.ttf.woff2bin0 -> 52348 bytes
-rw-r--r--src/librustdoc/html/static/SourceSerif4-Bold.ttf.woff2bin0 -> 81320 bytes
-rw-r--r--src/librustdoc/html/static/SourceSerif4-It.ttf.woff2bin0 -> 59860 bytes
-rw-r--r--src/librustdoc/html/static/SourceSerif4-Regular.ttf.woff2bin0 -> 76180 bytes
-rw-r--r--src/librustdoc/html/static/rustdoc.css21
-rw-r--r--src/librustdoc/html/static_files.rs24
9 files changed, 45 insertions, 6 deletions
diff --git a/src/librustdoc/html/render/write_shared.rs b/src/librustdoc/html/render/write_shared.rs
index a4188e6b203..1a2ddbaa81a 100644
--- a/src/librustdoc/html/render/write_shared.rs
+++ b/src/librustdoc/html/render/write_shared.rs
@@ -25,10 +25,16 @@ static FILES_UNVERSIONED: Lazy<FxHashMap<&str, &[u8]>> = Lazy::new(|| {
         "FiraSans-Regular.woff" => static_files::fira_sans::REGULAR,
         "FiraSans-Medium.woff" => static_files::fira_sans::MEDIUM,
         "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-Bold.ttf.woff" => static_files::source_serif_4::BOLD,
         "SourceSerif4-It.ttf.woff" => static_files::source_serif_4::ITALIC,
         "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-Semibold.ttf.woff" => static_files::source_code_pro::SEMIBOLD,
         "SourceCodePro-It.ttf.woff" => static_files::source_code_pro::ITALIC,
diff --git a/src/librustdoc/html/static/SourceCodePro-It.ttf.woff2 b/src/librustdoc/html/static/SourceCodePro-It.ttf.woff2
new file mode 100644
index 00000000000..462c34efcd9
--- /dev/null
+++ b/src/librustdoc/html/static/SourceCodePro-It.ttf.woff2
Binary files differdiff --git a/src/librustdoc/html/static/SourceCodePro-Regular.ttf.woff2 b/src/librustdoc/html/static/SourceCodePro-Regular.ttf.woff2
new file mode 100644
index 00000000000..10b558e0b69
--- /dev/null
+++ b/src/librustdoc/html/static/SourceCodePro-Regular.ttf.woff2
Binary files differdiff --git a/src/librustdoc/html/static/SourceCodePro-Semibold.ttf.woff2 b/src/librustdoc/html/static/SourceCodePro-Semibold.ttf.woff2
new file mode 100644
index 00000000000..5ec64eef0ec
--- /dev/null
+++ b/src/librustdoc/html/static/SourceCodePro-Semibold.ttf.woff2
Binary files differdiff --git a/src/librustdoc/html/static/SourceSerif4-Bold.ttf.woff2 b/src/librustdoc/html/static/SourceSerif4-Bold.ttf.woff2
new file mode 100644
index 00000000000..db57d21455c
--- /dev/null
+++ b/src/librustdoc/html/static/SourceSerif4-Bold.ttf.woff2
Binary files differdiff --git a/src/librustdoc/html/static/SourceSerif4-It.ttf.woff2 b/src/librustdoc/html/static/SourceSerif4-It.ttf.woff2
new file mode 100644
index 00000000000..1cbc021a3aa
--- /dev/null
+++ b/src/librustdoc/html/static/SourceSerif4-It.ttf.woff2
Binary files differdiff --git a/src/librustdoc/html/static/SourceSerif4-Regular.ttf.woff2 b/src/librustdoc/html/static/SourceSerif4-Regular.ttf.woff2
new file mode 100644
index 00000000000..2db73fe2b49
--- /dev/null
+++ b/src/librustdoc/html/static/SourceSerif4-Regular.ttf.woff2
Binary files differdiff --git a/src/librustdoc/html/static/rustdoc.css b/src/librustdoc/html/static/rustdoc.css
index 7535145caa5..411ca0b58b7 100644
--- a/src/librustdoc/html/static/rustdoc.css
+++ b/src/librustdoc/html/static/rustdoc.css
@@ -23,21 +23,27 @@
 	font-family: 'Source Serif 4';
 	font-style: normal;
 	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-face {
 	font-family: 'Source Serif 4';
 	font-style: italic;
 	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-face {
 	font-family: 'Source Serif 4';
 	font-style: normal;
 	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;
 }
 
@@ -48,21 +54,24 @@
 	font-weight: 400;
 	/* Avoid using locally installed font because bad versions are in circulation:
 	 * 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-face {
 	font-family: 'Source Code Pro';
 	font-style: italic;
 	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-face {
 	font-family: 'Source Code Pro';
 	font-style: normal;
 	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;
 }
 
diff --git a/src/librustdoc/html/static_files.rs b/src/librustdoc/html/static_files.rs
index ca7e5ef8150..fb230745477 100644
--- a/src/librustdoc/html/static_files.rs
+++ b/src/librustdoc/html/static_files.rs
@@ -100,12 +100,24 @@ crate mod source_serif_4 {
     /// 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");
 
+    /// 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.
     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.
     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.
     crate static LICENSE: &[u8] = include_bytes!("static/SourceSerif4-LICENSE.md");
 }
@@ -115,13 +127,25 @@ crate mod source_code_pro {
     /// 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");
 
+    /// 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
     /// font.
     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.
     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.
     crate static LICENSE: &[u8] = include_bytes!("static/SourceCodePro-LICENSE.txt");
 }