typst / svg2pdf

Converts SVG files to PDF.
Apache License 2.0
287 stars 34 forks source link

CLI compilation error #28

Closed fabric-and-ink closed 1 year ago

fabric-and-ink commented 1 year ago

Compilation of feature cli fails with


error[E0609]: no field `fontdb` on type `usvg::Options`
  --> src/main.rs:41:13
   |
41 |     options.fontdb = fontdb::Database::new();
   |             ^^^^^^ unknown field
   |
   = note: available fields are: `resources_dir`, `dpi`, `font_family`, `font_size`, `languages` ... and 5 others

error[E0609]: no field `fontdb` on type `usvg::Options`
  --> src/main.rs:42:13
   |
42 |     options.fontdb.load_system_fonts();
   |             ^^^^^^ unknown field
   |
   = note: available fields are: `resources_dir`, `dpi`, `font_family`, `font_size`, `languages` ... and 5 others

error[E0599]: no function or associated item named `from_str` found for struct `Tree` in the current scope
  --> src/main.rs:44:21
   |
44 |         usvg::Tree::from_str(&svg, &options.to_ref()).map_err(|err| err.to_string())?;
   |                     ^^^^^^^^ function or associated item not found in `Tree`
   |
   = help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
   |
1  | use usvg::TreeParsing;
   |

error[E0599]: no method named `to_ref` found for struct `usvg::Options` in the current scope
  --> src/main.rs:44:45
   |
44 |         usvg::Tree::from_str(&svg, &options.to_ref()).map_err(|err| err.to_string())?;
   |                                             ^^^^^^ method not found in `Options`

Some errors have detailed explanations: E0599, E0609.
For more information about an error, try `rustc --explain E0599`.
error: could not compile `svg2pdf` due to 4 previous errors
error: failed to compile `svg2pdf v0.4.1 (https://github.com/typst/svg2pdf#6b9f5543)`, intermediate artifacts can be found at `/tmp/cargo-installORUKtb`