GLLabel - GPU Vector Text Rendering
A C++ library for rendering vector text on the GPU.
Work in progress. You probably don't want to use this yet.
This rendering method allows text to be arbitrarily scaled and rotated, just as it could be with CPU-rendered text. The glyphs are loaded in real-time from font files. This project was made possible by Will Dobbie's algorithm for GPU rendering vector shapes and text defined by quadratic Bézier curves. This project builds on that algorithm by implementing a framework to load and display arbitrary text rather than the pregenerated data set used in his demo.
Related / relevant work
- Valve Signed Distance Fields (2007) - Early research into GPU text rendering
- GPU text rendering with vector textures (2016) - Will Dobbie's algorithm mentioned above
- Easy Scalable Text Rendering on the GPU (2016) - Rendering vector shapes with polygons
- Slug (algorithm whitepaper (2017)) - Closed-source commercial GPU vector text renderer
- Pathfinder (algorithm overview (2019)) - Open-source experimental GPU vector graphics renderer
- A Primer on Bézier Curves - almost everything you ever wanted to know about Bézier curvess
Demo
Building
Library dependencies
- C++14
- GLEW
- GLM
- FreeType2 (used only to load outline data from font files, not for rasterization)
Additional demo dependencies
- GLFW
To build the library and demo, modify the _INCLUDES
and _LIBS
lines at the
top of makefile
to match your system's configuration, then run make
.
License
The code in this project is licensed under the Apache License v2.0.