C# wrapper for msdf-atlas-gen with cross-platform native binaries included. Generates multi-channel signed distance field font atlases from TTF/OTF files.
$ dotnet add package Olve.MsdfAtlasGenC# wrapper for msdf-atlas-gen with cross-platform native binaries included.
dotnet add package Olve.MsdfAtlasGen
using Olve.MsdfAtlasGen;
using Olve.MsdfAtlasGen.Models;
var result = AtlasGenerator.Generate(new AtlasConfig
{
FontPath = "Roboto-Regular.ttf",
Type = AtlasType.MSDF,
Dimensions = (1024, 1024),
GlyphSize = 48,
PixelRange = 4,
OutputImagePath = "atlas.png",
OutputJsonPath = "atlas.json"
});
Console.WriteLine($"Generated {result.Glyphs.Count} glyphs");
Console.WriteLine($"Line height: {result.Metrics.LineHeight}");
Multi-channel signed distance fields (MSDF) is a technique for rendering sharp, scalable text in games and graphics applications. Unlike traditional bitmap fonts that look blurry when scaled, MSDF fonts maintain crisp edges at any size, making them perfect for games that need to support different resolutions.
This is a wrapper around Viktor Chlumský's excellent msdf-atlas-gen tool. All atlas generation is performed by the native msdf-atlas-gen binary.
MIT License. See LICENSE file.
The msdf-atlas-gen tool is licensed under its own terms - see the upstream repository.