class

CArcTextEditing

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

Constructors

SignatureNameDescription
CArcTextEditing() = deleteCArcTextEditing

Public functions

ReturnsNameDescription
int32_tNextGrapheme
int32_tPrevGrapheme
int32_tSnapToGraphemeThe cluster boundary at or before pos — where a hit test that landed inside a cluster belongs.
int32_tCountGraphemes
voidGraphemeBoundariesByte offset of every cluster start, plus text.size() at the end.
int32_tNextWordStartCtrl+Right: past the word (or punctuation run) the caret is in, then past the whitespace after it.
int32_tPrevWordStartCtrl+Left: back over whitespace, then to the start of the word before it.
voidWordAtThe word, punctuation run or whitespace run under pos — what a double-click selects.
std::stringToSingleLineLine breaks of every flavour (CRLF, CR, LF, U+2028/2029) become one space each: what a paste into a single-line field must do, or a name field turns into a multi-line string.
std::stringMaskPasswordOne mask glyph per grapheme.
voidSelectionRectsHighlight rectangles, in layout space, for the logical byte range [lo, hi).

Function details

CArcTextEditing

C++
CArcTextEditing() = delete

NextGrapheme

C++
static int32_t NextGrapheme(const std::string& text, int32_t pos)

PrevGrapheme

C++
static int32_t PrevGrapheme(const std::string& text, int32_t pos)

SnapToGrapheme

C++
static int32_t SnapToGrapheme(const std::string& text, int32_t pos)

The cluster boundary at or before pos — where a hit test that landed inside a cluster belongs.

CountGraphemes

C++
static int32_t CountGraphemes(const std::string& text)

GraphemeBoundaries

C++
static void GraphemeBoundaries(const std::string& text, std::vector<int32_t>& outBoundaries)

Byte offset of every cluster start, plus text.size() at the end.

NextWordStart

C++
static int32_t NextWordStart(const std::string& text, int32_t pos, EArcWordTailoring tailoring = EArcWordTailoring::DotIsBoundary)

Ctrl+Right: past the word (or punctuation run) the caret is in, then past the whitespace after it.

PrevWordStart

C++
static int32_t PrevWordStart(const std::string& text, int32_t pos, EArcWordTailoring tailoring = EArcWordTailoring::DotIsBoundary)

Ctrl+Left: back over whitespace, then to the start of the word before it.

WordAt

C++
static void WordAt(const std::string& text, int32_t pos, int32_t& outStart, int32_t& outEnd, EArcWordTailoring tailoring = EArcWordTailoring::DotIsBoundary)

The word, punctuation run or whitespace run under pos — what a double-click selects.

ToSingleLine

C++
static std::string ToSingleLine(const std::string& text)

Line breaks of every flavour (CRLF, CR, LF, U+2028/2029) become one space each: what a paste into a single-line field must do, or a name field turns into a multi-line string.

MaskPassword

C++
static std::string MaskPassword(const std::string& text, const char* maskUtf8, std::vector<int32_t>& outSourceOffsets)

One mask glyph per grapheme. outSourceOffsets gets, for every mask glyph index, the source byte offset it stands for (plus the end), so a hit on the mask maps back to a cluster boundary in the source.

SelectionRects

C++
static void SelectionRects(const CArcTextLayout& layout, uint32_t lo, uint32_t hi, std::vector<ArcRect>& outRects)

Highlight rectangles, in layout space, for the logical byte range [lo, hi). Glyphs are visited in visual order and every selected run becomes its own rect, so a selection across a direction change paints the glyphs that are actually selected instead of one span from the first caret to the last.

Generated from Arc/Text/CArcTextEditing.h via arc.json · Nov 5, 2026Version 1.0.0