Easy Sdl3 Text
This crate adds easy text rendering function for sdl3 using ab_glyph. Current features:
- Cache for reusing textures
- Both regular and sub-pixel rendering
- Vertical and horizontal alignment
- Multithreaded rasterization
- Pure rust, no compilation headaches
This might work best as a starting point for you to make your own text rendering library, but it is already very usable on its own. Also, rendering uncached text usually takes over a millisecond (sometimes over 5 ms in the examples), but it's mostly a one-time cost, and frame-time spikes from text rasterizing should very quickly disappear as the program continues running.
NOTE: This currently depends on sdl3 version "0.16", ab_glyph version "0.2", and rayon version "1", if any of these crates update and you need this crate to update too, please let me know!
Example Output: (looks better in the demo, run cargo run --example subpixel --release with the downloaded crate to see the true sub-pixel rendering)

Example Code:
use *;
This crate and all its code is dedicated to the public domain, being licensed under CC0 1.0 Universal