MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ insert_codepoint()

MAYAFLUX_API void MayaFlux::Portal::Text::insert_codepoint ( EditableText &  s,
uint32_t  codepoint 
)

Insert one codepoint at the cursor, advancing it past the insert.

No-op if is_control(codepoint) is true.

Definition at line 5 of file TextEdit.cpp.

6{
7 if (is_control(codepoint))
8 return;
9 const std::string encoded = encode_utf8(codepoint);
10 s.text.insert(s.cursor, encoded);
11 s.cursor += encoded.size();
12}
std::string encode_utf8(uint32_t codepoint)
Encode a Unicode codepoint as a UTF-8 byte sequence.
bool is_control(uint32_t codepoint) noexcept
True if a codepoint must never be rasterized or treated as printable content.
Definition TypeSetter.cpp:9

References MayaFlux::Portal::Text::EditableText::cursor, encode_utf8(), is_control(), and MayaFlux::Portal::Text::EditableText::text.

Referenced by MayaFlux::Portal::Forma::TextField::wire().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: