This is a very basic implementation of Eric Lengyel's work: GPU-Centered Font Rendering Directly from Glyph Outlines. It only implements the non-optimised version. The purpose of this is to have something that works.
At first I implemented a version where there was no anti-aliasing done, and the way I defined the quadratic Bézier curves was questionable, but at least it rendered something:
Then I tried adding anti-aliasing:
The difference can be seen either at lower resolutions or when zooming in:
In the sdl folder there is a version which uses the GPU to render the curves, with similar anti-aliasing done:
In the glyph folder I implemented actual glyph rendering using Freetype to read .ttf
files:
${CXX} main.cpp stb.cpp
For the GPU version:
mkdir build && cd build
conan install ..
cmake ..
cmake --build .
./Bezier