Table of Contents

Class BmFontResult

Namespace
KernSmith.Output
Assembly
KernSmith.dll

The result of a BMFont generation pipeline, containing the font model and atlas pages.

public sealed class BmFontResult
Inheritance
BmFontResult
Inherited Members

Properties

FailedCodepoints

Codepoints that were requested but could not be rasterized (missing from the font).

public IReadOnlyList<int> FailedCodepoints { get; }

Property Value

IReadOnlyList<int>

FntBinary

Returns the BMFont descriptor in binary format.

public byte[] FntBinary { get; }

Property Value

byte[]

FntText

Returns the BMFont descriptor in text format.

public string FntText { get; }

Property Value

string

FntXml

Returns the BMFont descriptor in XML format.

public string FntXml { get; }

Property Value

string

Metrics

Pipeline timing metrics. Only populated when CollectMetrics is enabled.

public PipelineMetrics? Metrics { get; }

Property Value

PipelineMetrics

Model

The BMFont descriptor model.

public BmFontModel Model { get; }

Property Value

BmFontModel

Pages

The rendered atlas pages.

public IReadOnlyList<AtlasPage> Pages { get; }

Property Value

IReadOnlyList<AtlasPage>

Methods

GetDdsData()

Encodes all atlas pages as DDS byte arrays.

public byte[][] GetDdsData()

Returns

byte[][]

An array of DDS-encoded byte arrays, one per page.

GetDdsData(int)

Encodes a single atlas page as DDS bytes.

public byte[] GetDdsData(int pageIndex)

Parameters

pageIndex int

Zero-based page index.

Returns

byte[]

DDS-encoded byte array for the specified page.

GetPngData()

Encodes all atlas pages as PNG byte arrays.

public byte[][] GetPngData()

Returns

byte[][]

An array of PNG-encoded byte arrays, one per page.

GetPngData(int)

Encodes a single atlas page as PNG bytes.

public byte[] GetPngData(int pageIndex)

Parameters

pageIndex int

Zero-based page index.

Returns

byte[]

PNG-encoded byte array for the specified page.

GetTgaData()

Encodes all atlas pages as TGA byte arrays.

public byte[][] GetTgaData()

Returns

byte[][]

An array of TGA-encoded byte arrays, one per page.

GetTgaData(int)

Encodes a single atlas page as TGA bytes.

public byte[] GetTgaData(int pageIndex)

Parameters

pageIndex int

Zero-based page index.

Returns

byte[]

TGA-encoded byte array for the specified page.

ToBinary()

Returns the BMFont descriptor in binary format.

public byte[] ToBinary()

Returns

byte[]

ToBmfc()

Serializes this result's source options to a BMFont/AngelCode .bmfc config string. Requires that this result was produced by a generation call (not loaded from disk). See ToHiero() for the libGDX Hiero equivalent.

public string ToBmfc()

Returns

string

The .bmfc config file content.

Exceptions

InvalidOperationException

Thrown when no source options are available.

ToFile(string, OutputFormat)

Writes the BMFont descriptor and atlas page images to disk.

public void ToFile(string outputPath, OutputFormat format = OutputFormat.Text)

Parameters

outputPath string

Base path without extension (e.g., "output/myfont").

format OutputFormat

The output format for the .fnt file.

ToHiero()

Serializes this result's source options to a libGDX Hiero .hiero config string. Requires that this result was produced by a generation call (not loaded from disk). See ToBmfc() for the BMFont/AngelCode equivalent.

public string ToHiero()

Returns

string

The .hiero config file content.

Exceptions

InvalidOperationException

Thrown when no source options are available.

ToString()

Returns the BMFont descriptor in text format.

public override string ToString()

Returns

string

ToXml()

Returns the BMFont descriptor in XML format.

public string ToXml()

Returns

string