Namespace KernSmith
Classes
- AtlasPackingException
Thrown when glyphs don't fit in the texture atlas. Try a larger max texture size.
- AtlasSizeConstraints
Constraints applied to atlas dimensions after size estimation.
- AtlasTargetRegion
Defines a rectangular region within an existing PNG image where glyphs will be rendered.
- AtlasVariant
Declares an additional character-set rendering, packed into its own atlas region(s) and described by its own BmFontModel, so it can be sampled as an ordinary RGBA glyph with no shader required to unpack it. See phase-181 plan doc (issue #175) for background.
- BatchJob
Describes a single font generation job within a batch. Exactly one font source (FontData, FontPath, or SystemFont) should be specified.
- BatchOptions
Options controlling batch font generation behavior.
- BmFont
The main API for generating and loading BMFont bitmap fonts.
- BmFontBuilder
Fluent builder for configuring and generating bitmap fonts.
- BmFontException
Base error type for all KernSmith operations. Catch this to handle any bitmap font generation error.
- BmFontIncrementalSession
A live glyph-addition session (phase 183): the font is parsed once (unfiltered, so any character the font contains stays addable), the rasterizer stays loaded, and the MaxRects free-rectangle state is held between calls — so each AddGlyphs(string) costs work proportional to the glyphs being added, never to the font or the atlas. Glyphs that are already placed never move ("stable packing"): the caller can blit AddedGlyph bytes straight into a live GPU texture.
- BmfcConfig
Holds the result of reading a font-generation configuration file. This is the shared model for both the BMFont/AngelCode
.bmfcand libGDX Hiero.hieroformats (see ConfigFormatFactory). Combines FontGeneratorOptions with font source and output path information that lives outside the options type.
- BmfcConfigReader
Reads BMFont/AngelCode
.bmfcconfiguration files (flat key=value format) into BmfcConfig. This reader is BMFont-specific; to read either a.bmfcor a libGDX Hiero.hierofile with automatic content-based format detection, use ReadConfig(string) instead.
- BmfcConfigWriter
Serializes BmfcConfig to the standard BMFont/AngelCode
.bmfcflat key=value format. To write the libGDX Hiero.hieroformat use HieroConfigWriter, or let WriteConfig(BmfcConfig, string) pick the writer based on the file extension.
- ChannelConfig
Configures what each RGBA channel contains in the atlas texture. Matches BMFont.exe's per-channel export settings.
- CharacterSet
Defines which Unicode characters to include in the generated bitmap font.
- ConfigFormatFactory
Dispatches config read/write operations to the correct format implementation. ReadConfig(string) auto-detects the format by inspecting the file CONTENT, falling back to the extension only when the content is inconclusive. WriteConfig(BmfcConfig, string) selects by extension (
.hieroselects Hiero; any other extension, including none, selects BMFont).
- CustomGlyph
A custom glyph image that replaces or adds a glyph in the font. You must decode images to raw pixels yourself before passing them here.
- FontCache
Thread-safe cache for font data bytes, supporting file paths, system fonts, and raw data.
- FontFormatException
Thrown when a font file's binary structure is invalid -- for example, a corrupt or truncated table directory, an unsupported sfnt version, or out-of-bounds table offsets.
- FontGeneratorOptions
All the settings for generating a BMFont. Sensible defaults are provided.
- FontParsingException
Thrown when a font file can't be read -- for example, a corrupt or unsupported TTF/OTF.
- HieroConfigReader
Reads Hiero
.hieroconfiguration files (flat key=value format) into BmfcConfig. Maps Hiero properties and effect blocks onto KernSmith FontGeneratorOptions.
- HieroConfigWriter
Serializes BmfcConfig to Hiero
.hieroflat key=value format. Effects are emitted in a fixed canonical order for stable round-trips: ColorEffect, OutlineEffect, GradientEffect, ShadowEffect, DistanceFieldEffect.
- PipelineMetrics
Timing breakdown for each stage of the font generation pipeline. Enable with CollectMetrics or
BmFontBuilder.WithCollectMetrics(), then readBmFontResult.Metrics.Stages are recorded in pipeline order:
- FontParsing — Reading and parsing the TTF/OTF/WOFF font file (tables, metrics, kerning).
- CharsetResolution — Resolving requested characters against the font's available codepoints.
- Rasterization — Rendering each glyph to a bitmap via FreeType (or custom rasterizer).
- EffectsCompositing — Applying layered effects: outline, gradient, and shadow.
- PostProcessing — Running user-supplied IGlyphPostProcessor instances.
- SuperSampleDownscale — Downscaling glyphs rendered at Nx resolution back to target size.
- CellEqualization — Padding glyph cells to equal height when EqualizeCellHeights is enabled.
- AtlasSizeEstimation — Estimating optimal atlas texture dimensions before packing.
- AtlasPacking — Running the packing algorithm (MaxRects or Skyline) to place glyphs on atlas pages.
- AtlasEncoding — Encoding atlas pages to the target format (PNG, TGA, or DDS).
- ModelAssembly — Building the final BmFontModel with character, kerning, and metadata blocks.
Stages that are not applicable (e.g., no effects configured) will report Zero and are omitted from ToString() output.
- RasterizationException
Thrown when a glyph can't be rendered from the font.
Structs
- Padding
Padding around each glyph in the atlas, in pixels.
- Spacing
Gap between glyphs in the atlas, in pixels.
Enums
- AdditionOverflowPolicy
What a BmFontIncrementalSession does when a newly added glyph does not fit in the free space of the existing atlas pages. Existing placements are never moved under any policy.
- AntiAliasMode
How glyphs are anti-aliased when rendered.
- AtlasVariantKind
The kind of additional character-set rendering an AtlasVariant produces.
- BatchAtlasMode
Controls how atlas textures are generated during batch font generation.
- ChannelContent
Specifies what content a single RGBA channel holds in the atlas texture. Values match the BMFont specification for the common block channel fields.
- OutputFormat
Output format for BMFont descriptor files.
- PackingAlgorithm
Which algorithm to use for fitting glyphs into atlas pages.
- PixelFormat
Pixel format for glyph bitmaps and atlas pages.
- RasterizerBackend
Which rasterizer backend to use for glyph rendering.
- TextureFormat
Texture format for atlas output images.