yeslogic / allsorts

Font parser, shaping engine, and subsetter implemented in Rust
https://yeslogic.com/blog/allsorts-rust-font-shaping-engine/
Apache License 2.0
706 stars 23 forks source link

Emit error if Allsorts is built without one of the flate2 features #55

Closed wezm closed 2 years ago

wezm commented 2 years ago

Fixes #53

If Allsorts is built without one of the flate2 features enabled emit a compile error with a message indicating this. The flate2 dependency is also marked optional so that in this case we a avoid a bunch of cryptic errors from trying to build that crate without a backend. There are still errors originating from Allsorts attempting to use flate2 when it's not been pulled in but there's fewer of them and they're a bit more obviously tied to the flate2 dependency.

LoganDark commented 2 years ago

LGTM!

wezm commented 2 years ago

For future reference this is what the errors look like:

Screenshot from 2022-01-18 10-32-49
LoganDark commented 2 years ago

Have you tested what happens when they are both enabled? It should just work then, right?

wezm commented 2 years ago

Have you tested what happens when they are both enabled?

Yes, flate2 builds ok. It appears to use zlib in that case

wezm commented 2 years ago

Merged manually.