mooman219 / fontdue

The fastest font renderer in the world, written in pure rust.
Apache License 2.0
1.45k stars 72 forks source link

Compilation fails with `method not found` #57

Closed loveencounterflow closed 3 years ago

loveencounterflow commented 3 years ago

When doing cargo run --example layout, I get

error[E0599]: no method named `to_string` found for struct `ttf_parser::tables::name::Name<'_>` in the current scope
   --> src/font.rs:212:25
    |
212 |             return name.to_string();
    |                         ^^^^^^^^^ method not found in `ttf_parser::tables::name::Name<'_>`

I was able to get the samples running by replacing the call to to_string() with a call to format!() (for which I had to add #[macro_use] extern crate std; to lib.rs), but clearly that is just a kludge.

mooman219 commented 3 years ago

Sorry about that, really thought that was in core because there's no reason for it to be in std. Parsing utf16 is easy enough, fixed aadbbf9a791658fba67a687f2a315fe2c37f3cd7