FyroxEngine / Fyrox

3D and 2D game engine written in Rust
https://fyrox.rs
MIT License
7.69k stars 348 forks source link

Dynamic font atlas #575

Closed mrDIMAS closed 9 months ago

mrDIMAS commented 9 months ago

This PR adds support for dynamic font atlases which removes height parameter from fonts and gives access to all glyphs in a font on demand. An atlas (for a particular glyph size) will automatically be updated and a requested glyph will be rendered and packed in the atlas. Each atlas is split into a multiple number of pages to bypass texture size limitation on some GPUs.

This PR also adds an ability to specify text height for both Text and TextBox widgets, allowing you to use a single font for any character size.