File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ use std::process;
44
55use clap:: Parser ;
66use termcolor:: { ColorChoice , ColorSpec , StandardStream , WriteColor } ;
7+ use usvg:: { TreeParsing , TreeTextToPath } ;
78
89#[ derive( Debug , Parser ) ]
910#[ clap( about, version) ]
@@ -37,11 +38,12 @@ fn run() -> Result<(), String> {
3738 std:: fs:: read_to_string ( & args. input ) . map_err ( |_| "Failed to load SVG file" ) ?;
3839
3940 // Convert string to SVG.
40- let mut options = usvg:: Options :: default ( ) ;
41- options. fontdb = fontdb:: Database :: new ( ) ;
42- options. fontdb . load_system_fonts ( ) ;
43- let tree =
44- usvg:: Tree :: from_str ( & svg, & options. to_ref ( ) ) . map_err ( |err| err. to_string ( ) ) ?;
41+ let options = usvg:: Options :: default ( ) ;
42+ let mut fontdb = fontdb:: Database :: new ( ) ;
43+ fontdb. load_system_fonts ( ) ;
44+
45+ let mut tree = usvg:: Tree :: from_str ( & svg, & options) . map_err ( |err| err. to_string ( ) ) ?;
46+ tree. convert_text ( & fontdb) ;
4547
4648 // Convert SVG to PDF.
4749 let mut options = svg2pdf:: Options :: default ( ) ;
You can’t perform that action at this time.
0 commit comments