freetype-rs
freetype-rs copied to clipboard
Render modes missing FT_RENDER_MODE_SDF
As seen in the FreeType documentation, there is a render mode for creating SDFs. This enum is missing in the rust binding as of yet
For anyone stumbling upon this you can set the render SDF flag with the following
let load_flags = freetype::face::LoadFlag::from_bits((0x1 << 2) | ((5 & 15) << 16)).unwrap();
Where:
0x1 << 2is equivalent toLoadFlag::RENDER((5 & 15) << 16)is equivalent toFT_LOAD_TARGET_(FT_RENDER_MODE_SDF)in C
Then you can use the load_flags with load_glyph() or load_char().