mooman219 / fontdue

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

Slow font loading (20 secs) #102

Closed toyboot4e closed 2 years ago

toyboot4e commented 2 years ago

It takes 20 seconds to load M PLUS 1p font (regular) with fontdue::Font::load_bytes on my mac. I tried it in both debug and release build, but the result did not change much. Can I make it faster?

Examples worked very fast 👍

mooman219 commented 2 years ago

load_bytes isn't a function. Did you mean from_bytes?

I downloaded MPLUS1p-Regular.ttf and ran it and it loaded in a few milliseconds on release via the simple example. Do you have any additional information or profile because I cannot reproduce this locally.

toyboot4e commented 2 years ago

Did you mean from_bytes?

It's from_bytes /

it loaded in a few milliseconds on release via the simple example

It worked lightning fast! I think I just failed to specify --release.

I'm sorry. Thank you for checking it out.

toyboot4e commented 2 years ago

I added the following to /my/repository/.cargo/config.toml:

[profile.dev.package."ttf-parser"]
opt-level = 3