Fonterator
About | Source | Changelog | Cala Blog
Load fonts as vector graphics in pure Rust with advanced text layout. When you want to render text, fonterator gives you an iterator over footile PathOp
s, which you can easily pass right into footile.
Simple Example
use fonterator as font; // For parsing font file.
use ; // For rendering font text.
use ; // For saving PNG
const FONT_SIZE: f32 = 32.0;
Features
- Load TTF/OTF fonts and font collections.
- Automatic kerning and font layout.
- Horizontal and vertical text layout.
- Left-to-right and right-to-left text layout.
- Use fallback fonts if a character is not available from one font.
- Align text left/center/right/vertical
- Line Wrapping
TODO
- Arabic and other script text shaping
- Better interoperability for monospace when mixing scripts.
Contributing
Contributors are always welcome! Whether it is a bug report, bug fix, feature request, feature implementation or whatever. Don't be shy about getting involved. I always make time to fix bugs, so usually a patched version of the library will be out soon after a report. Features take me longer, though. I'll also always listen to any design critiques you have. If you have any questions you can email me at jeronlau@plopgrizzly.com. Otherwise, here's a link to the issues on GitHub.
And, as always, make sure to always follow the code of conduct. Happy coding!
License
This repository is licensed under either of the following:
- MIT License (MIT) - See accompanying file LICENSE_MIT.txt or copy at https://opensource.org/licenses/MIT
- Boost Software License (BSL-1.0) - See accompanying file LICENSE_BSL.txt or copy at https://www.boost.org/LICENSE_1_0.txt
at your option.
Contribution Licensing
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you shall be dual licensed as above without any additional terms or conditions.