Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Gum Kernsmith Integrations?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/vchelaru-gum-kernsmith-integrations)
---
name: gum-kernsmith-integrations
description: KernSmith runtime bitmap-font packages. Triggers: Integrations/KernSmith, KernSmith.MonoGameGum, KernSmith.RaylibGum, KernSmith.KniGum, KernSmith.FnaGum, KernSmith.GumCommon, InMemoryFontCreator.
---
# KernSmith Integrations
[KernSmith](https://github.com/kaltinril/KernSmith) is a third-party, cross-platform, in-memory BMFont rasterizer. `Integrations/KernSmith/*` are optional first-party Gum packages that bridge it into each runtime. The tool itself also uses KernSmith directly as an alternate offline generator backend — see `gum-tool-font-generation` for that (`KernSmithFileGenerator`, unrelated to the runtime packages below).
## Package map
| Package | Role |
|---|---|
| `KernSmith.GumCommon` | Shared mapping layer: Gum's `BmfcSave` → KernSmith's `FontGeneratorOptions` |
| `KernSmith.MonoGameGum` | MonoGame `IRuntimeFontCreator`-style wiring, produces `BitmapFont` |
| `KernSmith.KniGum` / `KernSmith.FnaGum` | Same shape, KNI/FNA targets |
| `KernSmith.RaylibGum` | `KernSmithRaylibFontCreator`, produces `Raylib_cs.Font` |
Each platform package plugs into `CustomSetPropertyOnRenderable.InMemoryFontCreator` (a game project sets this at startup) so Gum rasterizes fonts on the fly instead of loading pre-generated `.fnt`/`.png` files.
## Gotcha
These are opt-in NuGet add-ons a *game project* references directly — Gum does not wire one up by default. If `InMemoryFontCreator` is never set, Gum falls back to the tool's pre-generated bmfont.exe pipeline. Seeing a `KernSmith.*` package reference alongside `Gum.MonoGame`/etc. in a user's `.csproj` is expected, not a conflicting fork.
## Rasterizer backend gotcha (wasm/AOT)
KernSmith picks a glyph rasterizer via `RasterizerBackend`, each backend its own opt-in NuGet package (`KernSmith.Rasterizers.FreeType`/`Gdi`/`DirectWrite.TerraFX`/`StbTrueType`) so a consumer only pays for the one it needs — see the [KernSmith README](https://github.com/kaltinril/KernSmith). Gum's `KernSmith.GumCommon` references only `FreeType` (upstream's default, and native-only). `StbTrueType` is the sole pure-C# backend and the only one that runs on browser-wasm/AOT, but no Gum `KernSmith.*` package references it — a wasm consumer must add `KernSmith.Rasterizers.StbTrueType` themselves, and separately call `RuntimeHelpers.RunClassConstructor(typeof(StbTrueTypeRasterizer).TypeHandle)` before using it, since KernSmith's reflection-based backend auto-discovery is trimmed away under wasm/AOT publish (silent "backend is not registered" failure otherwise). Any fix that wires this into Gum's own packages must condition both the reference and the call on the browser-wasm RID — adding it unconditionally defeats the per-backend package split's whole purpose.
`GumFontGenerator.Generate` throws `PlatformNotSupportedException` when called on browser-wasm with no explicit `backend` argument, instead of leaving the failure to KernSmith or a silent fallback — see `GumFontGenerator.IsBrowserPlatform` (test seam for `OperatingSystem.IsBrowser`).
## Mobile builds and package references
`KernSmith.GumCommon` and `KernSmith.MonoGameGum` add `net9.0-ios` / `net9.0-android` behind the same `IncludeIOS` / `IncludeAndroid` opt-in as `MonoGameGum.csproj`. The mobile builds reference `KernSmith.Rasterizers.StbTrueType` instead of FreeType (its native library does not link on iOS), and `GumFontGenerator.GetPlatformDefaultBackend` makes StbTrueType the default there. `GumFontGenerator` force-runs the StbTrueType static constructor whenever the resolved backend is StbTrueType, passed or defaulted, because trimmed builds drop KernSmith's backend discovery.
A packed project must reference an engine platform package (`MonoGame.Framework.*`, `nkast.*`) with `PrivateAssets="All"`, or every consumer restores a second MonoGame. `Tests/Gum.RepoHygiene.Tests/PackedPlatformPackageTests.cs` enforces it, and `KernSmithMobilePackagingTests.cs` pins the mobile conditions, since the mobile TFMs cannot be built without workloads.
See `docs/code/files-and-fonts/font-strategies.md` for the user-facing font strategy comparison.