Skip to content

Commit

Permalink
Also copy font licenses when copy-fonts is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
pheki committed May 19, 2020
1 parent 0f8b105 commit d58d647
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/renderer/html_handlebars/hbs_renderer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ impl HtmlHandlebars {
)?;
if html_config.copy_fonts {
write_file(destination, "fonts/fonts.css", theme::fonts::CSS)?;
for (file_name, contents) in theme::fonts::LICENSES.iter() {
write_file(destination, file_name, contents)?;
}
for (file_name, contents) in theme::fonts::OPEN_SANS.iter() {
write_file(destination, file_name, contents)?;
}
Expand Down
11 changes: 11 additions & 0 deletions src/theme/fonts/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
pub static CSS: &[u8] = include_bytes!("fonts.css");
// An array of (file_name, file_contents) pairs
pub static LICENSES: [(&str, &[u8]); 2] = [
(
"fonts/OPEN-SANS-LICENSE.txt",
include_bytes!("OPEN-SANS-LICENSE.txt"),
),
(
"fonts/SOURCE-CODE-PRO-LICENSE.txt",
include_bytes!("SOURCE-CODE-PRO-LICENSE.txt"),
),
];
// An array of (file_name, file_contents) pairs
pub static OPEN_SANS: [(&str, &[u8]); 10] = [
(
"fonts/open-sans-v17-all-charsets-300.woff2",
Expand Down

0 comments on commit d58d647

Please sign in to comment.