rlText is a library that contains an alternate font rendering system for raylib, that supports some new features not found in the core system
- Better support for HighDPI displays and automatic display scaling
- Allingment (left, right center)
- Text Wrapping
- Better handling of glpyh ranges
- Custom glyphs
- Inline color changes
- Kerning
- Flip Y for use with render textures
- Merge glyphs from other fonts
- Add glyph ranges as needed
- Atlas resizising
rlText is a single header library, just add rlText.h to your project and add #define RL_TEXT_IMPLEMENTATION before you include it in your cpp file.
The examples use Game-premake from https://github.com/raylib-extras/game-premake/
You can run the batch files on windows or premake5 gmake2 on other OSs to generate makefiles or visual studio proejcts for the examples, but it is not required to use the lib. The library and it's examples are also setup for use in vscode, simply open the folder in vscode and run the build task.
The example folder contains a simple use case of the library.
This library currently has some limitations
- TTF only, bitmap fonts are not supported
- Grayscale rendering only
The library does use C++ but does not use any complex classes or templates. Only basic C++ features such as references and containers are used.
The font drawing system uses \a as an escape code for color, simply provide \a then a HTML color code "Text \a#FF0000FFTHIS TEXT IS RED" This will swap to the red color after "\a#FF0000FF". The color state will stay untill you change it back to a specific color. Text will default to the tint color. You must specify all 4 components of the HTML color, including the alpha