53 glm::vec4
color { 1.F, 1.F, 1.F, 1.F };
85 std::span<const GlyphQuad> quads,
112 const std::shared_ptr<Buffers::TextBuffer>& target,
113 std::span<const GlyphQuad> quads,
128[[nodiscard]] MAYAFLUX_API std::shared_ptr<Buffers::TextBuffer>
press(
129 std::string_view text,
130 const PressParams& params = {});
147 const std::shared_ptr<Buffers::TextBuffer>& target,
148 std::string_view text,
149 glm::vec4
color = { 1.F, 1.F, 1.F, 1.F },
178 const std::shared_ptr<Buffers::TextBuffer>& target,
179 std::string_view text,
180 glm::vec4
color = { 1.F, 1.F, 1.F, 1.F });
std::optional< glm::vec3 > color
Rasterizes and packs glyphs from a FontFace into a TextureContainer.
ImpressResult impress(const std::shared_ptr< Buffers::TextBuffer > &target, std::string_view text, glm::vec4 color)
Append a UTF-8 string into an existing TextBuffer at the current cursor.
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.
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.
ImpressResult
Result of an impress() call.
@ Overflow
Vertical budget exceeded. Texture reallocated. Previous content cleared.
@ Ok
Run composited at cursor. No GPU state change.
void ink_quads(const std::shared_ptr< Buffers::TextBuffer > &target, std::span< const GlyphQuad > quads, glm::vec4 color)
Rasterize a mutated quad span into an existing TextBuffer.
bool repress(const std::shared_ptr< Buffers::TextBuffer > &target, std::string_view text, glm::vec4 color, RedrawPolicy policy)
Re-composite a UTF-8 string into an existing TextBuffer.
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.
uint32_t budget_h
Initial vertical budget in pixels. Zero applies the grow heuristic.
glm::uvec2 render_bounds
Hard render bounds in pixels.
Construction parameters for press().