Skip to content

Commit 4c25e1e

Browse files
feat: add a warning about edge case
1 parent ccd1048 commit 4c25e1e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/rust/lib.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,15 @@ fn resvg_magic(mut options: Opts, svg_string: String) -> Result<Vec<u8>, String>
178178
}
179179

180180
if has_text_nodes {
181+
if options.skip_system_fonts {
182+
let no_font_files = options.font_files.as_ref().map_or(true, |v| v.is_empty());
183+
let no_font_dirs = options.font_dirs.as_ref().map_or(true, |v| v.is_empty());
184+
185+
if no_font_files && no_font_dirs {
186+
log::warn!("No fonts provided and system fonts are skipped. Text might not be rendered.");
187+
}
188+
}
189+
181190
// Extract font options before passing to load_fonts
182191
load_fonts(
183192
fontdb,

0 commit comments

Comments
 (0)