|
MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
|
| MAYAFLUX_API CopiedText MayaFlux::Portal::Text::copy | ( | std::string_view | text, |
| const LayoutResult & | layout, | ||
| size_t | a, | ||
| size_t | b | ||
| ) |
Copy a byte range: the text it spans, and the quads that render it.
start/end are normalized (min/max) and clamped to [0, text.size()]. Both are assumed to already be codepoint boundaries, the same assumption next_codepoint_offset()/previous_codepoint_offset() maintain for a caller's cursor; this does not re-snap them to one.
Quads are taken from layout, matched by GlyphQuad::byte_offset falling in the normalized range, at whatever position they were laid out at. Shift them yourself if the copy needs to be positioned relative to its own origin rather than the source layout's. layout must be the result of laying out this same text (or one whose byte offsets line up with it); passing a layout for unrelated text returns a meaningless, but not unsafe, quads list.
| text | Source UTF-8 string the byte range indexes into. |
| layout | LayoutResult produced from that same text. |
| a | One end of the byte range. |
| b | The other end of the byte range. |
Definition at line 217 of file TypeSetter.cpp.
References a, b, out, q, MayaFlux::Portal::Text::LayoutResult::quads, and MayaFlux::Portal::Text::CopiedText::start.