behdad/glyphy

GLyphy is an implementation of the Slug algorithm for GPU text rasterization

C++

842

774 commits

updated Mar 30, 2026

See the code

README

GLyphy is a GPU text renderer that renders glyph outlines directly, using the Slug algorithm by Eric Lengyel for robust winding number calculation.

GLyphy works with quadratic Bezier curves (TrueType outlines) and produces pixel-perfect rendering at any scale with proper antialiasing.

Note: GLyphy is deprecated in favor of the HarfBuzz GPU module, which supports shaders for all major platforms.

Building

Requires: meson, OpenGL 3.3+, FreeType, HarfBuzz, GLUT, GLEW.

meson setup build
meson compile -C build
build/demo/glyphy-demo

How it works

Each glyph's outline is encoded into a compact blob stored in a GPU buffer texture. The fragment shader computes a winding number by casting horizontal and vertical rays against the quadratic Bezier curves, using Lengyel's equivalence class algorithm for numerical robustness. Curves are organized into bands for efficient early exit.

License

GLyphy is licensed under the HarfBuzz Old MIT license. See COPYING for details.

behdad/glyphy

GLyphy is an implementation of the Slug algorithm for GPU text rasterization

C++

842

774 commits

updated Mar 30, 2026

See the code

README

GLyphy is a GPU text renderer that renders glyph outlines directly, using the Slug algorithm by Eric Lengyel for robust winding number calculation.

GLyphy works with quadratic Bezier curves (TrueType outlines) and produces pixel-perfect rendering at any scale with proper antialiasing.

Note: GLyphy is deprecated in favor of the HarfBuzz GPU module, which supports shaders for all major platforms.

Building

Requires: meson, OpenGL 3.3+, FreeType, HarfBuzz, GLUT, GLEW.

meson setup build
meson compile -C build
build/demo/glyphy-demo

How it works

Each glyph's outline is encoded into a compact blob stored in a GPU buffer texture. The fragment shader computes a winding number by casting horizontal and vertical rays against the quadratic Bezier curves, using Lengyel's equivalence class algorithm for numerical robustness. Curves are organized into bands for efficient early exit.

License

GLyphy is licensed under the HarfBuzz Old MIT license. See COPYING for details.

Significant stargazers

(top 24 of 28)

Wez Furlong

3,940 followers · starred Mar 2022

gnzlbg

368 followers · starred Nov 2014

Almar Klein

386 followers · starred Mar 2022

David Wilson

1,977 followers · starred Mar 2023