Thread overview
Hairetsu 0.5 - Text Shaping and Rendering for D
Apr 27
Luna
April 27

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

April 27

On Sunday, 27 April 2025 at 05:30:09 UTC, Luna wrote:

>

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.

Impressive! Good job!

April 27

On Sunday, 27 April 2025 at 05:30:09 UTC, Luna wrote:

>

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.

Congratulations, that is a ton of work going on here!