@@ -275,7 +275,8 @@ impl HtmlHandlebars {
275275 "FontAwesome/fonts/FontAwesome.ttf" ,
276276 theme:: FONT_AWESOME_TTF ,
277277 ) ?;
278- if html_config. copy_fonts {
278+ // Don't copy the stock fonts if the user has specified their own fonts to use.
279+ if html_config. copy_fonts && theme. fonts_css . is_none ( ) {
279280 write_file ( destination, "fonts/fonts.css" , theme:: fonts:: CSS ) ?;
280281 for ( file_name, contents) in theme:: fonts:: LICENSES . iter ( ) {
281282 write_file ( destination, file_name, contents) ?;
@@ -291,20 +292,13 @@ impl HtmlHandlebars {
291292 }
292293 if let Some ( fonts_css) = & theme. fonts_css {
293294 if !fonts_css. is_empty ( ) {
294- if html_config. copy_fonts {
295- warn ! (
296- "output.html.copy_fonts is deprecated.\n \
297- Set copy_fonts=false and ensure the fonts you want are in \
298- the `theme/fonts/` directory."
299- ) ;
300- }
301295 write_file ( destination, "fonts/fonts.css" , & fonts_css) ?;
302296 }
303297 }
304298 if !html_config. copy_fonts && theme. fonts_css . is_none ( ) {
305299 warn ! (
306- "output.html.copy_fonts is deprecated.\n \
307- This book appears to have copy_fonts =false without a fonts.css file.\n \
300+ "output.html.copy-fonts is deprecated.\n \
301+ This book appears to have copy-fonts =false in book.toml without a fonts.css file.\n \
308302 Add an empty `theme/fonts/fonts.css` file to squelch this warning."
309303 ) ;
310304 }
0 commit comments