95[[nodiscard]] MAYAFLUX_API LayoutResult
lay_out(
96 std::string_view text,
101 uint32_t tab_width = 4);
116[[nodiscard]] MAYAFLUX_API
bool is_control(uint32_t codepoint)
noexcept;
127[[nodiscard]] MAYAFLUX_API std::string
encode_utf8(uint32_t codepoint);
189 std::string_view text,
233[[nodiscard]] MAYAFLUX_API
size_t index_at(
234 std::string_view text,
235 const LayoutResult& layout,
242 uint32_t tab_width = 4);
269[[nodiscard]] MAYAFLUX_API PenPosition
x_at(
270 std::string_view text,
276 uint32_t tab_width = 4);
size_t previous_codepoint_offset(std::string_view text, size_t byte_offset)
Byte offset of the codepoint boundary before byte_offset.
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.
size_t next_codepoint_offset(std::string_view text, size_t byte_offset)
Byte offset of the codepoint boundary after byte_offset.
PenPosition x_at(std::string_view text, GlyphAtlas &atlas, size_t byte_offset, float pen_x, float pen_y, uint32_t wrap_w, uint32_t tab_width)
Pen position immediately before byte_offset, in lay_out()'s space.
CopiedText 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.
LayoutResult lay_out(std::string_view text, GlyphAtlas &atlas, float pen_x, float pen_y, uint32_t wrap_w, uint32_t tab_width)
Lay out a UTF-8 string into a sequence of screen-space quads.
size_t index_at(std::string_view text, const LayoutResult &layout, GlyphAtlas &atlas, float x, float y, float pen_x, float pen_y, uint32_t wrap_w, uint32_t tab_width)
Byte offset of the codepoint boundary nearest a screen-space point.
std::string text
Substring of the source text in [start, end).
size_t start
Normalized, clamped byte range actually used.
std::vector< GlyphQuad > quads
Matching quads, at their original layout positions.
Result of copy(): a byte range's text plus the quads that render it.
float y0
Top-left pixel position.
float uv_y1
Bottom-right UV in atlas space.
float uv_y0
Top-left UV in atlas space.
size_t byte_offset
Byte offset of codepoint's first byte in the source text passed to lay_out().
float y1
Bottom-right pixel position.
uint32_t codepoint
Unicode codepoint that produced this quad.
Screen-space quad for one rasterized glyph.
std::vector< GlyphQuad > quads
Result of lay_out(), carrying the quads and the final pen position.
Pen coordinates returned by x_at(), in the same space as GlyphQuad.