diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs index f5eb92c1bb5aa..507ae8e3e2c6f 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/FiraSans-Medium.woff2 b/src/librustdoc/html/static/FiraSans-Medium.woff2 new file mode 100644 index 0000000000000..7a1e5fc548ef2 Binary files /dev/null and b/src/librustdoc/html/static/FiraSans-Medium.woff2 differ diff --git a/src/librustdoc/html/static/FiraSans-Regular.woff2 b/src/librustdoc/html/static/FiraSans-Regular.woff2 new file mode 100644 index 0000000000000..e766e06ccb0d4 Binary files /dev/null and b/src/librustdoc/html/static/FiraSans-Regular.woff2 differ diff --git a/src/librustdoc/html/static/rustdoc.css b/src/librustdoc/html/static/rustdoc.css index 56f17b7a616cd..e3d63fa2308e2 100644 --- a/src/librustdoc/html/static/rustdoc.css +++ b/src/librustdoc/html/static/rustdoc.css @@ -3,13 +3,17 @@ font-family: 'Fira Sans'; font-style: normal; font-weight: 400; - src: local('Fira Sans'), url("FiraSans-Regular.woff") format('woff'); + src: local('Fira Sans'), + url("FiraSans-Regular.woff2") format("woff2"), + url("FiraSans-Regular.woff") format('woff'); } @font-face { font-family: 'Fira Sans'; font-style: normal; font-weight: 500; - src: local('Fira Sans Medium'), url("FiraSans-Medium.woff") format('woff'); + src: local('Fira Sans Medium'), + url("FiraSans-Medium.woff2") format("woff2"), + url("FiraSans-Medium.woff") format('woff'); } /* See SourceSerifPro-LICENSE.txt for the Source Serif Pro license. */ diff --git a/src/librustdoc/html/static_files.rs b/src/librustdoc/html/static_files.rs index 132ac42c42283..701e106df67f3 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"); }