MUSX Document Model
Loading...
Searching...
No Matches
musx::util::EnigmaTextChunk Struct Reference

A text chunk with the Enigma styles active for that chunk. More...

#include <EnigmaString.h>

Public Member Functions

EnigmaResolvedTextChunk resolve () const
 Creates a document-independent snapshot of the chunk. (See EnigmaStyles::resolve.)
 

Public Attributes

std::string text
 The chunk as valid UTF-8.
 
EnigmaStyles styles
 
std::optional< EnigmaTextInsertinsert
 The insert the chunk was substituted for, when it was.
 

Detailed Description

A text chunk with the Enigma styles active for that chunk.

Member Data Documentation

◆ insert

std::optional<EnigmaTextInsert> musx::util::EnigmaTextChunk::insert

The insert the chunk was substituted for, when it was.

The substituted text of an insert is always its own chunk, never merged with the text around it, so a consumer can replace it as a whole. Text that a recursively parsed insert (such as ^partname) produces carries that insert. Style commands are not inserts.

◆ styles

EnigmaStyles musx::util::EnigmaTextChunk::styles

the styles active for the chunk

◆ text

std::string musx::util::EnigmaTextChunk::text

The chunk as valid UTF-8.

With a symbol font, each Unicode code point is a raw glyph index; call dom::FontInfo::calcIsSymbolFont on the font in styles to identify those chunks.