Hairetsu 0.5 - Text Shaping and Rendering for D

Luna luna at foxgirls.gay
Sun Apr 27 05:30:09 UTC 2025


Due to requirements of the Inochi2D Project I've decided to start 
work on a custom text shaping, layouting and rendering solution 
in pure D. Having dealt with various C and C++ libraries in the 
past and how fragile it is to maintain them with D I went ahead 
and rolled my own.

Hairetsu currently features support for reading OpenType and 
TrueType fonts (Only TrueType outlines are supported currently, 
CFF and CFF2 are TODO), Additionally Hairetsu has a built in 
vector renderer which uses signed coverage masks (not SDFs); with 
and without anti aliasing. It can natively read CMAP table 
formats 0, 4, 6 and 12 to cover most base characters of scripts 
and Unicode (4 for basic plane, 12 for extended multilingual 
plane, emoji, etc.). It has a basic text shaper supporting both 
horizontal and vertical text layouts, with a more complex 
OpenType shaper planned.

Hairetsu is built to not use the garbage collector, using numem 
and nulib internally, however it is still possible to use in a 
garbage collected context (See the provided example projects)

You can find the source here: https://github.com/Inochi2D/hairetsu
And the package on dub here: 
https://code.dlang.org/packages/hairetsu


More information about the Digitalmars-d-announce mailing list