MsdfAtlasGen.Native 1.0.0

dotnet add package MsdfAtlasGen.Native --version 1.0.0
                    
NuGet\Install-Package MsdfAtlasGen.Native -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MsdfAtlasGen.Native" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MsdfAtlasGen.Native" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="MsdfAtlasGen.Native" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add MsdfAtlasGen.Native --version 1.0.0
                    
#r "nuget: MsdfAtlasGen.Native, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package MsdfAtlasGen.Native@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=MsdfAtlasGen.Native&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=MsdfAtlasGen.Native&version=1.0.0
                    
Install as a Cake Tool

MsdfAtlasGen.Native

A thin NuGet package that bundles the msdf-atlas-gen executable (MSDF/MTSDF font-atlas generator) as native runtime assets for win-x64, linux-x64, osx-x64, and osx-arm64, plus a tiny managed helper that resolves the RID-appropriate binary at runtime. Upstream ships Windows-only release binaries; this package builds every RID from source in CI.

Install

<PackageReference Include="MsdfAtlasGen.Native" Version="X.Y.Z" />

The RID-appropriate msdf-atlas-gen[.exe] is copied into your build/publish output automatically by a buildTransitive targets file (the binary is packed under tools/<rid>/).

Use

using MsdfAtlasGen.Native;

var tool = MsdfAtlasGenTool.ExecutablePath; // absolute path to the bundled binary for the current RID;
                                            // ensures the exec bit on Unix. Throws PlatformNotSupportedException
                                            // on an unbundled RID, FileNotFoundException if the asset is missing.

var psi = new ProcessStartInfo(tool) { UseShellExecute = false };
psi.ArgumentList.Add("-font");     psi.ArgumentList.Add("MyFont.ttf");
psi.ArgumentList.Add("-type");     psi.ArgumentList.Add("mtsdf");
psi.ArgumentList.Add("-imageout"); psi.ArgumentList.Add("atlas.png");
psi.ArgumentList.Add("-json");     psi.ArgumentList.Add("atlas.json");
Process.Start(psi)!.WaitForExit();

The package exposes only the binary; atlas parameters (-type, -size, -pxrange, …) are the caller's policy.

Packaged runtime identifiers

RID Notes
win-x64 statically linked, single .exe
linux-x64 statically linked (except glibc/libstdc++)
osx-x64 statically linked
osx-arm64 statically linked

Building from source

Binaries are produced by CI (.github/workflows/build-native.yml) from the pinned external/msdf-atlas-gen submodule (tag v1.4, recursive → msdfgen). Locally:

git submodule update --init --recursive
# Unix (needs cmake + a vcpkg checkout in $VCPKG_ROOT):
build/build-native-unix.sh linux-x64      # or osx-x64 / osx-arm64
# Windows:
pwsh build/build-native-win.ps1

Skia-based geometry preprocessing is disabled (-DMSDF_ATLAS_USE_SKIA=OFF), which keeps the vcpkg dependency set to freetype + libpng and produces a self-contained executable. This is sufficient for standard -type mtsdf -format png atlas generation.

Output is staged into artifacts/native/<rid>/ and packed under tools/<rid>/ in the NuGet package.

Releasing

Tag vX.Y.Z (or run the package workflow manually) → CI builds all RIDs, packs, and pushes to NuGet.org using the NUGET_API_KEY repository secret.

License

MIT (this wrapper). Redistributed native binaries retain their upstream licenses — see THIRD-PARTY-NOTICES.md.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 107 7/10/2026