NeoKolors.Tui.Fonts.Assets 2026.4.0-preview.4

This is a prerelease version of NeoKolors.Tui.Fonts.Assets.
dotnet add package NeoKolors.Tui.Fonts.Assets --version 2026.4.0-preview.4
                    
NuGet\Install-Package NeoKolors.Tui.Fonts.Assets -Version 2026.4.0-preview.4
                    
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="NeoKolors.Tui.Fonts.Assets" Version="2026.4.0-preview.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NeoKolors.Tui.Fonts.Assets" Version="2026.4.0-preview.4" />
                    
Directory.Packages.props
<PackageReference Include="NeoKolors.Tui.Fonts.Assets" />
                    
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 NeoKolors.Tui.Fonts.Assets --version 2026.4.0-preview.4
                    
#r "nuget: NeoKolors.Tui.Fonts.Assets, 2026.4.0-preview.4"
                    
#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 NeoKolors.Tui.Fonts.Assets@2026.4.0-preview.4
                    
#: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=NeoKolors.Tui.Fonts.Assets&version=2026.4.0-preview.4&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=NeoKolors.Tui.Fonts.Assets&version=2026.4.0-preview.4&prerelease
                    
Install as a Cake Tool

NeoKolors.Tui.Fonts.Assets

Build & Test NuGet Version NuGet Downloads License

NeoKolors.Tui.Fonts.Assets contains the default font definitions and a packaging mechanism for the NeoKolors TUI framework. It provides pre-compiled, out-of-the-box fonts embedded directly into the compiled library and exposes an easy mechanism to load and register them.

Built-in Fonts

The package includes three default NKFont designs:

  1. Bytesized: A clean, compact pixel-art styled font ideal for dense information layouts.
  2. Future: A modern, wide stylized font featuring high-tech and futuristic geometry.
  3. Dummy: A fallback/skeleton font representation used primarily for testing, debugging, and baseline verification.

Additionally, four built-in FIGlet (.flf) fonts with accompanying metadata are embedded:

  1. Standard: Classic FIGlet font designed by Glenn Chappell & Ian Chai.
  2. Shadow: 3D shadowed font designed by Glenn Chappell.
  3. Slant: Slanted FIGlet font designed by Glenn Chappell.
  4. Block: Heavy block FIGlet font designed by Glenn Chappell.

FIGlet font metadata is configured via embedded manifest.xml (located under Figlet/) or per-font sidecar files (<FontName>.meta.xml).

Architecture & Built-in Compilation

Instead of checking in large pre-compiled binary resources, this project structures fonts in human-readable XML format during development.

Font Directory Structure

Each font under the project directory (e.g., Bytesized/) consists of:

  • manifest.nkfont: Links the config file and the map file.
  • Config.xml: Configures variables like letter spacing, word spacing, ligatures, leading, baseline, and alignment markers.
  • Map.xml: Maps character symbols/ligatures to specific .nkg glyph files.
  • .nkg Files: Plain-text files containing ASCII art representations of character glyph layouts and their alignment points.

MSBuild Compilation Pipeline

On building the project, a custom MSBuild Target (CompileBuiltinFonts) executes before PrepareResources:

  1. It dynamically loads the referenced NeoKolors.Tui.Fonts.dll in-memory (avoiding file locks during development).
  2. It invokes CompileFontsTask, passing the configured fonts and output options.
  3. For each font, the task validates timestamps against source files (skipping recompilation if up-to-date), deserializes XML definitions, and compiles them into binary Protobuf (.nkf) assets.
  4. Output .nkf files are emitted into the configured output folder (default: nkf/).
  5. Generated assets are automatically registered as @(EmbeddedResource) with standard logical names (NeoKolors.Tui.Fonts.Assets.<FontName>.nkf) and registered with @(FileWrites) so dotnet clean removes them cleanly.

Configuring Font Compilation

You can control what fonts to compile and where to output them directly inside NeoKolors.Tui.Fonts.Assets.csproj.

1. Setting the Output Directory

Set <FontOutputDir> to change where compiled .nkf assets are placed relative to the project directory:

<PropertyGroup>
    
    <FontOutputDir>nkf</FontOutputDir>
</PropertyGroup>

You can also override this from the command line:

dotnet build -p:FontOutputDir=compiled

2. Selecting Which Fonts to Compile

Declare the fonts to compile inside an <ItemGroup> using <Font> items:

<ItemGroup>
    <Font Include="Bytesized" />
    <Font Include="Future" />
    <Font Include="Dummy" />
</ItemGroup>
  • Add a font: Simply add <Font Include="MyNewFont" />.
  • Exclude a font: Comment out or remove the corresponding <Font Include="..." /> item.
  • Auto-discovery fallback: If <Font> items are omitted or empty, CompileFontsTask automatically detects all subdirectories in the project containing a manifest.nkfont or Config.xml file.

3. Per-Font Customization

Each <Font> item supports metadata attributes to customize output naming or placement individually:

<ItemGroup>
    
    <Font Include="Bytesized" />

    
    <Font Include="Future" OutputPath="custom/folder/Future.nkf" />

    
    <Font Include="Dummy" OutputDir="test_artifacts" />

    
    <Font Include="Fonts/CustomFontFolder" FontName="MyCustomFont" />
</ItemGroup>
Metadata Attribute Description Default
OutputPath / OutputFile / TargetFile Explicit destination file path or directory for the compiled .nkf $(FontOutputDir)/<FontName>.nkf
OutputDir / OutputDirectory Directory override for this font $(FontOutputDir)
FontName / Name Override name used for the font asset and embedded resource Name of source directory

4. Incremental Compilation & Clean Support

  • Up-To-Date Checking: The task inspects file timestamps of all source files in each font directory against the target .nkf file. If no source files have been modified, compilation is skipped.
  • Clean Support: Generated output files are tracked by MSBuild's @(FileWrites). Running dotnet clean automatically removes compiled .nkf files.

Usage

AssetsProvider

The AssetsProvider class provides runtime access to these embedded assets.

1. Automatic Font Registration

If the compiler constant NK_FONTS_ENABLE_AUTO_REGISTRATION is defined in your build configuration, AssetsProvider uses a C# [ModuleInitializer] to automatically register all built-in fonts into the FontAtlas when the assembly is loaded.

2. Manual Registration

To manually load and register these fonts into the global FontAtlas:

using NeoKolors.Tui.Fonts.Assets;

// Registers "Bytesized", "Future", and "Dummy"
AssetsProvider.RegisterFonts();
3. Direct Font Access

You can retrieve the deserialized NKFont instances directly:

using NeoKolors.Tui.Fonts;
using NeoKolors.Tui.Fonts.Assets;

NKFont? futureFont = AssetsProvider.Future;
NKFont? bytesizedFont = AssetsProvider.Bytesized;

if (futureFont != null)
{
    // Ready for measurement or rendering
}
4. Stream Access

Stream access is available via AssetsProvider.GetFontStream(name). It resolves standard manifest resource names (NeoKolors.Tui.Fonts.Assets.<FontName>.nkf) as well as subfolder-prefixed names (*.nkf.<FontName>.nkf).

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.  net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on NeoKolors.Tui.Fonts.Assets:

Package Downloads
NeoKolors.Tui

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2026.4.0-preview.4 57 11/15/2026
2026.4.0-preview.3 69 11/1/2026
2026.4.0-preview.2 65 10/30/2026
2026.4.0-preview.1 74 10/23/2026
2026.2.0-rc2.1 107 6/5/2026
2026.2.0-rc2 78 6/4/2026
2026.2.0-rc1 89 6/2/2026