Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation fails with method not found #57

Closed
loveencounterflow opened this issue Feb 16, 2021 · 1 comment
Closed

Compilation fails with method not found #57

loveencounterflow opened this issue Feb 16, 2021 · 1 comment

Comments

@loveencounterflow
Copy link

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.

mensi added a commit to mensi/fontdue that referenced this issue Mar 19, 2021
to_string is only available when using ttf-parser with the "std"
feature. Without it you currently can't compile.

This change implements the UTF16BE conversion on the raw data and
fixes mooman219#57.
@mooman219
Copy link
Owner

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 aadbbf9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants