no_std support
I'd like to use rusttype in an embedded project instead of freetype. It shouldn't be a big deal to implement, the following changes need to be made:
- Crates
-
arrayvec
is already set to useno_std
-
stb_truetype
does not supportno_std
yet, but it doesn't use any features that aren't supported withno_std
-
ordered-float
supportsno_std
, but it just needs to be switched on withdefault-features = false
inCargo.toml
-
approx
is already set to useno_std
-
- Code
- Obviously
gpu_cache
will not be supported, but it is already disabled by default -
std::fmt
,std::sync::Arc
,std::vec::Vec
, and others are both in thealloc
crate, but it is behind a feature flag - Some math in
geometry.rs
is not supported yet withno_std
. An easy fix is to use m, or use#![feature(core_intrinsics)]
and callunsafe { intrinsics::sqrtf32(num) }
.
- Obviously