Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rustdoc: add optional woff2 versions of FiraSans. #82545

Merged
merged 2 commits into from
Feb 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/librustdoc/html/render/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)?;
Expand Down
Binary file added src/librustdoc/html/static/FiraSans-Medium.woff2
Binary file not shown.
Binary file not shown.
8 changes: 6 additions & 2 deletions src/librustdoc/html/static/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down
6 changes: 6 additions & 0 deletions src/librustdoc/html/static_files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down