ascii-chat
Binary v0.15.83-53-gb711d8720
Library lib/v0.3.2-701-gb711d8720
Video chat in your terminal
Loading...
Searching...
No Matches
utf8_palette_t Struct Reference

When code needs to work with utf8 char info, it keeps byte_len, display_width here instead of scattering it across globals. Initialization establishes the handles and sizes; teardown must release any allocation, lock, thread, or callback context recorded in those fields. More...

#include <include/ascii-chat/video/ascii/palette.h>

Data Fields

utf8_char_info_t * chars
 Array of UTF-8 character information.
size_t char_count
 Number of characters (not bytes!).
size_t total_bytes
 Total byte length of palette string.
char * raw_string
 Original palette string (for reference/debugging).

Detailed Description

When code needs to work with utf8 char info, it keeps byte_len, display_width here instead of scattering it across globals. Initialization establishes the handles and sizes; teardown must release any allocation, lock, thread, or callback context recorded in those fields.

Decoded palette text plus lookup data for rendering Unicode glyphs safely.

The palette keeps character boundaries separate from byte offsets, so a renderer can choose by character index without splitting a multibyte code point. Its cached UTF-8 entries also carry byte length and terminal cell width for output sizing.

Note
char_count is the number of characters (not bytes), which is important for proper palette indexing.
total_bytes is the total byte length of the raw string, useful for memory management.

Definition at line 249 of file palette.h.


The documentation for this struct was generated from the following file: