class
CArcTextLayout
- Module
- Arc
- Header
#include "Arc/Text/CArcTextLayout.h"- Namespace
Arcf
Properties
| Type | Name | Description |
|---|---|---|
std::vector<CArcShapedGlyph> | Glyphs | |
std::vector<CArcShapedLine> | Lines | |
ArcVec2 | Size | |
float | FontSize | Default 0.0f. |
float | LineAdvance | vertical distance between line origins Default 0.0f. |
float | FirstLineHeight | Default 0.0f. |
float | Baseline | baseline offset from a line's top: the face's ascent plus any half-leading Default 0.0f. |
bool | Elided | an ellipsis replaced part of the text Default false. |
bool | Shaped | Default false. |
float | RasterScale | The 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> | PaintQuads | Glyph 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_t | PaintQuadsAtlasGeneration | Default 0. |
mutable float | PaintQuadsDensity | Quad 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 bool | PaintHasTofu | Default false. |
mutable uint64_t | LastUsedFrame | Lives 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
| Returns | Name | Description |
|---|---|---|
int32_t | LineIndexForByte | Caret/hit-test helpers - byte offsets are into the SOURCE string. |
ArcVec2 | CaretPosition | top-left of the caret |
uint32_t | ByteAtPoint | half-advance caret rule |
float | LineTop |
Function details
LineIndexForByte
C++
int32_t LineIndexForByte(uint32_t byteOffset, EArcCaretAffinity affinity = EArcCaretAffinity::Downstream) constCaret/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) consttop-left of the caret
ByteAtPoint
C++
uint32_t ByteAtPoint(const ArcVec2& localPos, EArcCaretAffinity* outAffinity = nullptr) consthalf-advance caret rule
LineTop
C++
float LineTop(int32_t lineIndex) constGenerated from Arc/Text/CArcTextLayout.h via arc.json · Nov 5, 2026Version 1.0.0