class

CArcFont

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

Properties

TypeNameDescription
static constexpr floatSTEM_DARKEN_FULL_PXStem darkening for small text, the way browsers and macOS render it: an unhinted outline is widened by this fraction of the em at small device sizes, fading to nothing between STEM_DARKEN_FULL_PX and STEM_DARKEN_NONE_PX, where the stems are wide enough on their own. The advances are untouched, so layout does not move. Default 14.0f.
static constexpr floatSTEM_DARKEN_NONE_PXDefault 24.0f.

Constructors

SignatureNameDescription
CArcFont() = defaultCArcFont
~CArcFont() override~CArcFont

Public functions

ReturnsNameDescription
boolLoadFromFile
boolLoadFromMemory
CArcFont*FromFaceThe CArcFont that owns a FreeType face, or null.
boolIsColorFontA face that paints its own colours (COLR, CBDT or sbix): an emoji face.
voidSetHinting
EArcFontHintingGetHinting
voidSetSyntheticEmboldenSynthetic weight for a weight the family does not ship (Geist Medium): the outline is widened by this fraction of the em before rasterizing.
floatGetSyntheticEmbolden
voidSetStemDarkening
floatGetStemDarkening
floatStemDarkeningFade
voidSetSyntheticObliqueSynthetic italic for a family with no italic face: x += skew * y.
floatGetSyntheticOblique
voidSetAbsoluteStrokeA stroke-built icon font drawn at a fixed stroke whatever its size (Lucide's absoluteStrokeWidth): designStrokeEm is the stroke the outlines carry as a fraction of the em, strokePx the logical stroke wanted.
voidSetPlainCoverageGlyphs that stand for drawings rather than letters (Lucide): the design export draws them as SVG paths, which the browser blends with plain coverage, not through its text gamma.
boolHasPlainCoverage
floatOutlineDeltaPixelsDevice pixels to widen (or thin) every stroke by at a device pixel size on a raster grid: synthetic weight plus the absolute-stroke correction.
FT_FaceGetFace
const std::string&GetFamilyName
const std::string&GetStyleName
uint32_tGetGlyphIndexFreeType char->glyph lookup, cached (fallback-chain probing is hot)
voidGetVerticalMetricsWhole device pixels above and below the baseline at a pixel size: the OS/2 win metrics when the face has them (they bound every glyph the font draws, accented capitals and stacked marks included), else hhea.
boolGetInkBoundsThe outline's ink of one glyph in em units, y up from the baseline: what a centred icon is centred on.
floatGetCapHeightEmCapital height in em units (OS/2 sCapHeight, else the ink of 'H'): the band a centred label is centred on, so a descender does not pull it up and the line box's descent does not push it down.
floatGetOpticalCentreEmThe height above the baseline, in em, that sits in the middle of a line box: half the capital height for a text face, the middle of the face's bounding box for a symbol face (one with neither a cap height nor an 'H'), whose glyphs carry no capitals to centre.
boolIsSymbolFace
voidAddFallback
const std::vector<Ref<CArcFont>>&GetFallbacks

Function details

CArcFont

C++
CArcFont() = default

~CArcFont

C++
~CArcFont() override

LoadFromFile

C++
bool LoadFromFile(const std::string& path)

LoadFromMemory

C++
bool LoadFromMemory(const uint8_t* data, size_t size)

FromFace

C++
static CArcFont* FromFace(FT_Face face)

The CArcFont that owns a FreeType face, or null. The atlas works on faces, and reads the per-font render settings below through this.

IsColorFont

C++
bool IsColorFont() const

A face that paints its own colours (COLR, CBDT or sbix): an emoji face.

SetHinting

C++
void SetHinting(EArcFontHinting hinting)

GetHinting

C++
EArcFontHinting GetHinting() const

SetSyntheticEmbolden

C++
void SetSyntheticEmbolden(float emFraction)

Synthetic weight for a weight the family does not ship (Geist Medium): the outline is widened by this fraction of the em before rasterizing.

GetSyntheticEmbolden

C++
float GetSyntheticEmbolden() const

SetStemDarkening

C++
void SetStemDarkening(float emFraction)

GetStemDarkening

C++
float GetStemDarkening() const

StemDarkeningFade

C++
static float StemDarkeningFade(float devicePixelSize)

SetSyntheticOblique

C++
void SetSyntheticOblique(float skew)

Synthetic italic for a family with no italic face: x += skew * y. 0.2 is about 11 degrees, the slant most sans italics use.

GetSyntheticOblique

C++
float GetSyntheticOblique() const

SetAbsoluteStroke

C++
void SetAbsoluteStroke(float strokePx, float designStrokeEm)

A stroke-built icon font drawn at a fixed stroke whatever its size (Lucide's absoluteStrokeWidth): designStrokeEm is the stroke the outlines carry as a fraction of the em, strokePx the logical stroke wanted. Lucide is 2/24 of the em, so at 12 px it is 1 px, at 16 px 1.33 px; the design draws 1.5 px at every size.

SetPlainCoverage

C++
void SetPlainCoverage(bool plain)

Glyphs that stand for drawings rather than letters (Lucide): the design export draws them as SVG paths, which the browser blends with plain coverage, not through its text gamma. Their quads skip CArcTextContrast; shaped like text, light icons read heavy and dark ones thin.

HasPlainCoverage

C++
bool HasPlainCoverage() const

OutlineDeltaPixels

C++
float OutlineDeltaPixels(float devicePixelSize, float rasterScale) const

Device pixels to widen (or thin) every stroke by at a device pixel size on a raster grid: synthetic weight plus the absolute-stroke correction. 0 when the font asks for neither.

GetFace

C++
FT_Face GetFace() const

GetFamilyName

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

GetStyleName

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

GetGlyphIndex

C++
uint32_t GetGlyphIndex(uint32_t codepoint) const

FreeType char->glyph lookup, cached (fallback-chain probing is hot)

GetVerticalMetrics

C++
void GetVerticalMetrics(uint32_t pixelSize, int32_t& outAscent, int32_t& outDescent) const

Whole device pixels above and below the baseline at a pixel size: the OS/2 win metrics when the face has them (they bound every glyph the font draws, accented capitals and stacked marks included), else hhea. Rounded outwards, so ink never leaves the box they describe.

GetInkBounds

C++
bool GetInkBounds(uint32_t codepoint, float& outXMin, float& outYMin, float& outXMax, float& outYMax) const

The outline's ink of one glyph in em units, y up from the baseline: what a centred icon is centred on. False for a glyph the face lacks.

GetCapHeightEm

C++
float GetCapHeightEm() const

Capital height in em units (OS/2 sCapHeight, else the ink of 'H'): the band a centred label is centred on, so a descender does not pull it up and the line box's descent does not push it down.

GetOpticalCentreEm

C++
float GetOpticalCentreEm() const

The height above the baseline, in em, that sits in the middle of a line box: half the capital height for a text face, the middle of the face's bounding box for a symbol face (one with neither a cap height nor an 'H'), whose glyphs carry no capitals to centre.

IsSymbolFace

C++
bool IsSymbolFace() const

AddFallback

C++
void AddFallback(const Ref<CArcFont>& font)

GetFallbacks

C++
const std::vector<Ref<CArcFont>>& GetFallbacks() const
Generated from Arc/Text/CArcFont.h via arc.json · Nov 5, 2026Version 1.0.0