|
MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
|
| MAYAFLUX_API ImpressResult MayaFlux::Portal::Text::impress | ( | const std::shared_ptr< Buffers::TextBuffer > & | target, |
| std::string_view | text, | ||
| glm::vec4 | color = { 1.F, 1.F, 1.F, 1.F }, |
||
| std::span< const StyleSpan > | spans = {} |
||
| ) |
Append a UTF-8 string into an existing TextBuffer at the current cursor.
Does not clear existing content. Composites the new run into the pre-allocated budget region and advances the cursor. No VKImage reallocation occurs while the run fits within the vertical budget.
When the run would push the cursor past the vertical budget the texture is grown by k_grow_height_multiplier, the full accumulated text is recomposited against target->get_background(), and ImpressResult::Overflow is returned. The caller is responsible for rebuilding prior content after an overflow if accumulated state is not sufficient.
When the cursor would exceed render_bounds_h the run is rejected and ImpressResult::Overflow is returned without reallocation.
The atlas is always the TypeFaceFoundry default. If a non-default atlas was used at press() time, impress() will use the default instead. Mixing atlases on the same TextBuffer is undefined behaviour.
spans is offsets into this call's text, matching the byte_offset lay_out() assigns for this run. On the Overflow-and-regrow path the full accumulated text is recomposited using color and spans from this call alone; prior runs' own colors/spans are not retained, the same pre-existing limitation color already has on that path.
| target | Existing TextBuffer to append into. |
| text | UTF-8 string to composite. |
| color | RGBA glyph color for any byte not covered by spans. |
| spans | Optional per-byte-range color overrides, offsets into text. |
Definition at line 582 of file InkPress.cpp.
References MayaFlux::Journal::API, color, MayaFlux::Portal::Text::LayoutResult::final_pen_x, MayaFlux::Portal::Text::LayoutResult::final_pen_y, lay_out(), MayaFlux::Portal::Text::GlyphAtlas::line_height(), MF_DEBUG, MF_ERROR, Ok, Overflow, pixels, MayaFlux::Journal::Portal, and MayaFlux::Portal::Text::LayoutResult::quads.
Here is the call graph for this function: