@@ -275,7 +275,8 @@ impl HtmlHandlebars {
275
275
"FontAwesome/fonts/FontAwesome.ttf" ,
276
276
theme:: FONT_AWESOME_TTF ,
277
277
) ?;
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 ( ) {
279
280
write_file ( destination, "fonts/fonts.css" , theme:: fonts:: CSS ) ?;
280
281
for ( file_name, contents) in theme:: fonts:: LICENSES . iter ( ) {
281
282
write_file ( destination, file_name, contents) ?;
@@ -291,20 +292,13 @@ impl HtmlHandlebars {
291
292
}
292
293
if let Some ( fonts_css) = & theme. fonts_css {
293
294
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
- }
301
295
write_file ( destination, "fonts/fonts.css" , & fonts_css) ?;
302
296
}
303
297
}
304
298
if !html_config. copy_fonts && theme. fonts_css . is_none ( ) {
305
299
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 \
308
302
Add an empty `theme/fonts/fonts.css` file to squelch this warning."
309
303
) ;
310
304
}
0 commit comments