diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs index 6665f160dec..58e9e41e6a5 100644 --- a/src/librustdoc/html/render/mod.rs +++ b/src/librustdoc/html/render/mod.rs @@ -883,6 +883,8 @@ fn write_shared( 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 00000000000..7a1e5fc548e 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 00000000000..e766e06ccb0 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 56f17b7a616..e3d63fa2308 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 132ac42c422..701e106df67 100644 --- a/src/librustdoc/html/static_files.rs +++ b/src/librustdoc/html/static_files.rs @@ -76,9 +76,15 @@ /// 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"); }