about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJacob Hoffman-Andrews <github@hoffman-andrews.com>2021-02-26 00:38:05 -0800
committerJacob Hoffman-Andrews <github@hoffman-andrews.com>2021-02-26 00:38:05 -0800
commitad7ed13eab09f2bb9311e4338de0fb347e700e73 (patch)
treeece2a1366f40603e24db12ef674c165bf5af37d9
parentc47903f063465f3a2f963613d290e84e43dd510f (diff)
downloadrust-ad7ed13eab09f2bb9311e4338de0fb347e700e73.tar.gz
rust-ad7ed13eab09f2bb9311e4338de0fb347e700e73.zip
Embed woff2 files in rustdoc binary.
-rw-r--r--src/librustdoc/html/render/mod.rs2
-rw-r--r--src/librustdoc/html/static_files.rs6
2 files changed, 8 insertions, 0 deletions
diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs
index f5eb92c1bb5..507ae8e3e2c 100644
--- a/src/librustdoc/html/render/mod.rs
+++ b/src/librustdoc/html/render/mod.rs
@@ -883,6 +883,8 @@ themePicker.onblur = handleThemeButtonsBlur;
         static_files::NORMALIZE_CSS,
         options.enable_minification,
     )?;
+    write(cx.dst.join("FiraSans-Regular.woff2"), static_files::fira_sans::REGULAR2)?;
+    write(cx.dst.join("FiraSans-Medium.woff2"), static_files::fira_sans::MEDIUM2)?;
     write(cx.dst.join("FiraSans-Regular.woff"), static_files::fira_sans::REGULAR)?;
     write(cx.dst.join("FiraSans-Medium.woff"), static_files::fira_sans::MEDIUM)?;
     write(cx.dst.join("FiraSans-LICENSE.txt"), static_files::fira_sans::LICENSE)?;
diff --git a/src/librustdoc/html/static_files.rs b/src/librustdoc/html/static_files.rs
index 132ac42c422..701e106df67 100644
--- a/src/librustdoc/html/static_files.rs
+++ b/src/librustdoc/html/static_files.rs
@@ -76,9 +76,15 @@ crate mod fira_sans {
     /// The file `FiraSans-Regular.woff`, the Regular variant of the Fira Sans font.
     crate static REGULAR: &[u8] = include_bytes!("static/FiraSans-Regular.woff");
 
+    /// The file `FiraSans-Regular.woff2`, the Regular variant of the Fira Sans font in woff2.
+    crate static REGULAR2: &[u8] = include_bytes!("static/FiraSans-Regular.woff2");
+
     /// The file `FiraSans-Medium.woff`, the Medium variant of the Fira Sans font.
     crate static MEDIUM: &[u8] = include_bytes!("static/FiraSans-Medium.woff");
 
+    /// The file `FiraSans-Medium.woff2`, the Medium variant of the Fira Sans font in woff2.
+    crate static MEDIUM2: &[u8] = include_bytes!("static/FiraSans-Medium.woff2");
+
     /// The file `FiraSans-LICENSE.txt`, the license text for the Fira Sans font.
     crate static LICENSE: &[u8] = include_bytes!("static/FiraSans-LICENSE.txt");
 }