-
Notifications
You must be signed in to change notification settings - Fork 15
Description
These crates seem sufficiently simple to warrant a #![no-std] implementation. This would allow them to be used in binaries that do not link std. People may do that mostly on memory-constrained environments, such as embedded devices. Another reason to do that is simply trying to generate smaller binaries in general.
In any case, I believe it would make the crates more flexible, for very little cost.
For fontconfig-sys literally all it takes is changing the imports from std::os::raw to core::ffi. That's the recommended import anyway, in fact. For fontconfig, it is almost just changing the imports. The only problem is a PathBuf usage that will have to become a String in #[no_std] environments.
I have already implemented all these changes, and can open a PR if the maintainers of this repository are willing to maintain this. I believe it would be very easy. In fact, the diff is very small:
➜ g d --stat
fontconfig-sys/src/lib.rs | 6 ++++--
fontconfig/Cargo.toml | 2 ++
fontconfig/src/lib.rs | 46 ++++++++++++++++++++++++++++++++--------------
3 files changed, 38 insertions(+), 16 deletions(-)
EDIT: actually, upon more careful examination, fontconfig-sys depends on dlib which automatically generates stuff which imports std::mem::transmute;. So this is currently impossible.