class

CArcFontManager

Module
Arc
Header
#include "Arc/Text/CArcFont.h"
Namespace
Arcf

Properties

TypeNameDescription
static constexpr floatICON_STROKE_PXThe design's icon rendering (Lucide at 12/14/16 px with an absolute 1.5 px stroke, unhinted). One definition, used by the bridge and by the row that measures the strokes. Default 1.5f.
static constexpr floatLUCIDE_DESIGN_STROKE_EMDefault 2.0f / 24.0f.
static constexpr floatTEXT_STEM_DARKEN_EMThe design's text rendering, matched to the export's browser captures: unhinted outlines (advances and stems at their true fractional positions) with TEXT_STEM_DARKEN_EM of stem darkening below 14 device px, then the browser's luminance blend (CArcTextContrast). Fitted pixel by pixel to the menu bar of all three themes' references: 0.025 em with the old contrast curve put 1.23x the reference's ink into the light theme; 0.01 em with the gamma blend lands every theme within 2 %. Default 0.01f.

Public functions

ReturnsNameDescription
CArcFontManager&Get
boolInitialize
voidShutdown
voidRegisterFamily
CArcFont*GetFont
voidAddFallbackFontComposite-font fallback chain: fonts probed in order when the primary face has no glyph for a codepoint (CJK, emoji, symbols).
voidClearFallbackFonts
const std::vector<Ref<CArcFont>>&GetFallbackFonts
CArcFont*ResolveFontForCodepointResolve the face that carries a codepoint: primary, then the fallback chain.
CArcFont*ResolveFontForClusterResolve the face for a whole grapheme cluster, so every codepoint of it shapes in one run: a ZWJ family, a keycap, a flag or a letter with its marks.
voidSetTextLanguageThe language of the text being laid out (BCP 47: "en", "zh-CN", "sr-Cyrl").
const std::string&GetTextLanguage
floatGetKerningKerning between two glyph indices of the same face at a pixel size, cached.
voidSetTextRasterScaleThe device-pixel grid text is currently laid out for.
floatGetTextRasterScale
floatDeviceFontSizeThe integer FreeType pixel size a logical size maps to on that grid.
floatQuantizeToDeviceGridRounds a logical measurement onto whole device pixels.
voidAdvanceAtlasFrameFrame boundary for every atlas (see CArcFontAtlas::AdvanceFrame).
voidConfigureIconFont
voidConfigureTextFont
CArcFontAtlas&GetSDFAtlas
CArcFontAtlas&GetBitmapAtlas
CArcFontAtlas&GetTextAtlasThe atlas the ordinary text path paints from: the bitmap atlas.
CArcFontAtlas*GetColorAtlasThe text atlas's colour companion (emoji), or null before Initialize.
FT_LibraryGetFTLibrary

Function details

Get

C++
static CArcFontManager& Get()

Initialize

C++
bool Initialize(IArcRHIDevice* device)

Shutdown

C++
void Shutdown()

RegisterFamily

C++
void RegisterFamily(const CArcFontFamily& family)

GetFont

C++
CArcFont* GetFont(const std::string& family, bool bold = false, bool italic = false) const

AddFallbackFont

C++
void AddFallbackFont(const Ref<CArcFont>& font, const std::string& language = std::string())

Composite-font fallback chain: fonts probed in order when the primary face has no glyph for a codepoint (CJK, emoji, symbols). language tags the face for the Han characters several CJK languages share ("zh-Hans", "zh-Hant", "ja", "ko"): with the text language set to one of them, its face is tried first for Han, so Simplified Chinese stops being drawn with Japanese glyph forms.

ClearFallbackFonts

C++
void ClearFallbackFonts()

GetFallbackFonts

C++
const std::vector<Ref<CArcFont>>& GetFallbackFonts() const

ResolveFontForCodepoint

C++
CArcFont* ResolveFontForCodepoint(CArcFont* primary, uint32_t codepoint) const

Resolve the face that carries a codepoint: primary, then the fallback chain. Returns nullptr when no registered face has it (tofu).

ResolveFontForCluster

C++
CArcFont* ResolveFontForCluster(CArcFont* primary, const uint32_t* codepoints, size_t count) const

Resolve the face for a whole grapheme cluster, so every codepoint of it shapes in one run: a ZWJ family, a keycap, a flag or a letter with its marks. Picking per codepoint split "family" into three emoji and a ZWJ from a text face that never ligated. Emoji presentation (VS16, ZWJ, regional indicators, keycaps, pictographs) tries colour faces first; Han tries the text language's tagged face first; then the first face covering every non-ignorable codepoint; then the base.

SetTextLanguage

C++
void SetTextLanguage(const std::string& language)

The language of the text being laid out (BCP 47: "en", "zh-CN", "sr-Cyrl"). Picks the Han face, and tells HarfBuzz which localized forms to use (Serbian Cyrillic, Turkish i, Romanian s-comma). The localization manager's culture switch sets it. Changing it drops every cached layout.

GetTextLanguage

C++
const std::string& GetTextLanguage() const

GetKerning

C++
float GetKerning(CArcFont* font, float fontSize, float rasterScale, uint32_t leftGlyphIndex, uint32_t rightGlyphIndex)

Kerning between two glyph indices of the same face at a pixel size, cached. Legacy (arc.Shaping=0) path only — returns 0 for faces without a kern table; the shaped path gets GPOS kerning from HarfBuzz instead.

SetTextRasterScale

C++
void SetTextRasterScale(float scale)

The device-pixel grid text is currently laid out for. The renderer publishes its window's pixel density here before arranging and painting, so shaping, kerning and rasterization all describe the same outlines: advances hinted at the logical size land off the device grid on any fractional scale, and the glyph bitmaps they position were hinted at the device size. Layouts are cached per value, so a second window on a differently scaled monitor keeps its own set instead of thrashing this one.

GetTextRasterScale

C++
float GetTextRasterScale() const

DeviceFontSize

C++
static float DeviceFontSize(float logicalSize, float rasterScale)

The integer FreeType pixel size a logical size maps to on that grid.

QuantizeToDeviceGrid

C++
static float QuantizeToDeviceGrid(float logicalValue, float rasterScale)

Rounds a logical measurement onto whole device pixels.

AdvanceAtlasFrame

C++
void AdvanceAtlasFrame()

Frame boundary for every atlas (see CArcFontAtlas::AdvanceFrame).

ConfigureIconFont

C++
static void ConfigureIconFont(CArcFont& font)

ConfigureTextFont

C++
static void ConfigureTextFont(CArcFont& font, float stemDarkeningEm = TEXT_STEM_DARKEN_EM)

GetSDFAtlas

C++
CArcFontAtlas& GetSDFAtlas()

GetBitmapAtlas

C++
CArcFontAtlas& GetBitmapAtlas()

GetTextAtlas

C++
CArcFontAtlas& GetTextAtlas()

The atlas the ordinary text path paints from: the bitmap atlas. The multi-channel distance-field path was removed — it read worse at the 10-13 px sizes the UI actually uses.

GetColorAtlas

C++
CArcFontAtlas* GetColorAtlas()

The text atlas's colour companion (emoji), or null before Initialize.

GetFTLibrary

C++
FT_Library GetFTLibrary() const
Generated from Arc/Text/CArcFont.h via arc.json · Nov 5, 2026Version 1.0.0