FOnline Engine
Current 2026.1.182-dev GitHub
Documentation Docs/en/reference/font-format/rendering.md

Font Rendering Contract

Generated reference. Do not edit directly. Update BuildTools/FontFormatInterface.json, then run python BuildTools/docs_font_format.py --write.

Index Formats Binding Authoring Layout Rendering Validation Canonical JSON Guide
Stable ID Rule Requirement Why Source
font-format.rendering.one-pixel-cell-border One-pixel glyph cell border Expect every glyph cell to hold the letter plus a transparent border at least one pixel wide, which grows to the outline width for an outlined font; the drawn quad is the letter rectangle grown by one pixel. The sheet reserves the border so antialiased edges and the outline never bleed into a neighboring cell, and drawing samples the whole cell. Source/Client/FontManager.cpp
font-format.rendering.neutral-glyph-tint Neutral glyph color and tint Expect an ordinary glyph to be stored as neutral grey 128 with its coverage as alpha, so the font shader draws it in the text color; do not bake a color into an ordinary face. The sheet writes the neutral grey for every pixel of a one-color glyph and keeps coverage in the alpha channel. Source/Client/FontManager.cpp
font-format.rendering.colored-glyphs Colored glyph rendering Expect a colored face to render with FT_LOAD_COLOR and no hinting, always antialiased, ignoring the Monochrome, Hinting, ForceAutoHint, and Embolden options; its glyph colors reach the sheet as straight alpha and are multiplied by the text color. FreeType blends color layers into a premultiplied BGRA bitmap that exists only antialiased; the rasterizer un-premultiplies it into RasterizedGlyph::Colors and the sheet keeps those colors. Source/Client/FontRasterizer.cpp, Source/Client/FontRasterizer.h, Source/Client/FontManager.cpp
font-format.rendering.bordered-variant Outlined glyph variant Set FontOptions.OutlineWidth above zero for FontFlag::Bordered to draw a black outline; a colored glyph keeps its own colors under the outline, and a zero width draws the plain glyphs for that flag. The sheet builds a second texture in which the glyph coverage is spread over a disc of the outline radius and laid black under the glyph. Source/Client/FontManager.cpp
font-format.rendering.font-effect Shared and per-slot font effect Fonts start with the Engine shared font effect; a per-slot EffectType::Font override replaces it and a null override returns to the shared effect. Draw batching keys include the selected texture and RenderEffect pointer. Source/Client/FontManager.cpp, Source/Client/Client.cpp
font-format.rendering.inline-color Inline color tags Use @color:BBGGRR@ or @color:AABBGGRR@, optionally with a 0x prefix, to push a color and @color@ to restore the previous color; NoColorize strips valid tags without applying them. Formatting removes valid markers before wrapping and records color transitions by output byte offset. Source/Client/FontManager.cpp
font-format.rendering.layout-cache Three-frame layout cache Do not depend on cached layout identity or lifetime; the cache key includes text, font, flags, skips, rectangle size, color, and mode and expires after three unused frames. The cache is a client implementation detail and is cleared whenever fonts are stored or cleared. Source/Client/FontManager.cpp
font-format.rendering.truetype-on-demand Letters rasterize on first use Preload the codepoint ranges that must not stall the first frame; every other letter is rasterized when a text containing it is first measured or drawn, so measuring queries may update the font. EnsureLetters adds the missing letters of a string to the font’s sheet before layout; a letter no face carries is drawn as the first face’s missing-glyph box. Source/Client/FontManager.cpp
font-format.rendering.truetype-sheet Glyph sheet per font Plan for one glyph sheet per font, plus one for the outlined variant, capped at 2048 by 2048 pixels; a full sheet doubles and is uploaded as a new atlas sprite. Cells are packed in shelves with a transparent gap, and the sheet is replaced rather than patched when it grows. Source/Client/FontManager.cpp
Start typing to search.