class

CArcTextLayout

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

Properties

TypeNameDescription
std::vector<CArcShapedGlyph>Glyphs
std::vector<CArcShapedLine>Lines
ArcVec2Size
floatFontSizeDefault 0.0f.
floatLineAdvancevertical distance between line origins Default 0.0f.
floatFirstLineHeightDefault 0.0f.
floatBaselinebaseline offset from a line's top: the face's ascent plus any half-leading Default 0.0f.
boolElidedan ellipsis replaced part of the text Default false.
boolShapedDefault false.
floatRasterScaleThe device-pixel grid every advance, offset, baseline and line advance above was quantized onto. Part of the cache key, so a holder that memoized this layout has to re-resolve when the window it paints into changes density. Default 1.0f.
mutable std::vector<CArcGlyphQuad>PaintQuadsGlyph rects resolved against the bitmap atlas, relative to the paint origin with each line's Y already folded in. Built on first paint and reused until the atlas rebuild bumps its generation, so a steady-state frame never re-walks the glyph list or re-hits the atlas hash. Justification is NOT baked in — LineFirstQuad lets the per-line offset be applied at emission.
mutable std::vector<uint32_t>PaintLineFirstQuad
mutable uint32_tPaintQuadsAtlasGenerationDefault 0.
mutable floatPaintQuadsDensityQuad positions are quantized to the device-pixel grid of the renderer that built them; a renderer with a different density (world-widget RTT vs window UI) forces a rebuild. Default 0.0f.
mutable boolPaintHasTofuDefault false.
mutable uint64_tLastUsedFrameLives on the layout rather than on the cache entry so a holder that memoized this layout can keep it alive (CArcTextLayoutCache::Touch) without going back through the string key. Default 0.

Public functions

ReturnsNameDescription
int32_tLineIndexForByteCaret/hit-test helpers - byte offsets are into the SOURCE string.
ArcVec2CaretPositiontop-left of the caret
uint32_tByteAtPointhalf-advance caret rule
floatLineTop

Function details

LineIndexForByte

C++
int32_t LineIndexForByte(uint32_t byteOffset, EArcCaretAffinity affinity = EArcCaretAffinity::Downstream) const

Caret/hit-test helpers - byte offsets are into the SOURCE string. At a soft wrap one byte offset is both the end of a line and the start of the next, so the offset alone cannot say where the caret is. The affinity says: Downstream (the default) puts it at the start of the later line — Home, a click at the left edge, typing — and Upstream at the end of the earlier one — End, a click past the end. Resolving every such offset to the earlier line drew the caret after Home at the end of the line above.

CaretPosition

C++
ArcVec2 CaretPosition(uint32_t byteOffset, EArcCaretAffinity affinity = EArcCaretAffinity::Downstream) const

top-left of the caret

ByteAtPoint

C++
uint32_t ByteAtPoint(const ArcVec2& localPos, EArcCaretAffinity* outAffinity = nullptr) const

half-advance caret rule

LineTop

C++
float LineTop(int32_t lineIndex) const
Generated from Arc/Text/CArcTextLayout.h via arc.json · Nov 5, 2026Version 1.0.0