Also copy font licenses when copy-fonts is enabled

This commit is contained in:
Aphek 2020-05-19 03:17:01 -03:00
parent 122c988477
commit 7e090ca42f
2 changed files with 14 additions and 0 deletions

View File

@ -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)?;
}

View File

@ -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",