70 glm::vec4
color { 1.F, 1.F, 1.F, 1.F };
124 std::span<const GlyphQuad> quads,
162 const std::shared_ptr<Buffers::TextBuffer>& target,
163 std::span<const GlyphQuad> quads,
179[[nodiscard]] MAYAFLUX_API std::shared_ptr<Buffers::TextBuffer>
press(
180 std::string_view text,
202[[nodiscard]] MAYAFLUX_API std::shared_ptr<Core::VKImage>
press(
203 std::string_view text,
204 glm::uvec2 render_bounds,
205 const PressParams& params = {},
206 const std::shared_ptr<Buffers::VKBuffer>& staging =
nullptr);
224 const std::shared_ptr<Buffers::TextBuffer>& target,
225 std::string_view text,
226 glm::vec4
color = { 1.F, 1.F, 1.F, 1.F },
228 std::span<const StyleSpan> spans = {});
248 std::shared_ptr<Core::VKImage>& target,
249 std::string_view text,
250 const PressParams& params = {},
251 const std::shared_ptr<Buffers::VKBuffer>& staging =
nullptr);
286 const std::shared_ptr<Buffers::TextBuffer>& target,
287 std::string_view text,
288 glm::vec4
color = { 1.F, 1.F, 1.F, 1.F },
289 std::span<const StyleSpan> spans = {});
Rasterizes and packs glyphs from a FontFace into a TextureContainer.
void rasterize_quads(std::span< const GlyphQuad > quads, GlyphAtlas &atlas, glm::vec4 color, uint8_t *dst, uint32_t buf_w, uint32_t buf_h)
Write glyph quads into a caller-provided RGBA8 pixel buffer.
void ink_quads(const std::shared_ptr< Buffers::TextBuffer > &target, std::span< const GlyphQuad > quads, glm::vec4 color, GlyphAtlas *atlas_hint)
Rasterize a mutated quad span into an existing TextBuffer.
RedrawPolicy
Policy controlling TextBuffer reuse behaviour in repress().
@ Fit
Replace content. Reallocate GPU texture if text exceeds existing budget.
@ Clip
Replace content. Truncate to existing budget bounds if text exceeds them.
bool repress(const std::shared_ptr< Buffers::TextBuffer > &target, std::string_view text, glm::vec4 color, RedrawPolicy policy, std::span< const StyleSpan > spans)
Re-composite a UTF-8 string into an existing TextBuffer.
ImpressResult
Result of an impress() call.
@ Overflow
Vertical budget exceeded. Texture reallocated. Previous content cleared.
@ Ok
Run composited at cursor. No GPU state change.
ImpressResult impress(const std::shared_ptr< Buffers::TextBuffer > &target, std::string_view text, glm::vec4 color, std::span< const StyleSpan > spans)
Append a UTF-8 string into an existing TextBuffer at the current cursor.
std::shared_ptr< Buffers::TextBuffer > press(std::string_view text, const PressParams ¶ms)
Composite a UTF-8 string into a new TextBuffer.
GlyphAtlas * atlas
Glyph atlas to use. Null selects the TypeFaceFoundry default at call time.
glm::vec4 color
RGBA color applied to all glyphs not covered by a span in spans.
uint32_t budget_h
Initial vertical budget in pixels. Zero applies the grow heuristic.
std::vector< StyleSpan > spans
Optional per-byte-range color overrides. Empty applies color uniformly.
glm::uvec2 render_bounds
Hard render bounds in pixels.
glm::vec4 background
RGBA fill composited beneath every glyph.
Construction parameters for press().
A colored byte range within the text passed to a composite call.