|
RMGui 0.15.0
C11 retained-mode UI library: layout kernel, style schema, widget painters, fonts, software framebuffer
|
bidi.h — Unicode 17.0.0 / UAX #9 revision 51, integer-only and allocation-free. More...
#include <stddef.h>#include <stdint.h>Data Structures | |
| struct | rmgui_bidi_work_t |
| Caller-owned scratch, one entry per codepoint. More... | |
Enumerations | |
| enum | rmgui_bidi_paragraph_t { RMGUI_BIDI_AUTO = 0 , RMGUI_BIDI_LTR , RMGUI_BIDI_RTL } |
Functions | |
| int | rmgui_bidi_resolve (const uint32_t *codepoints, size_t count, rmgui_bidi_paragraph_t paragraph, rmgui_bidi_work_t *work, size_t work_capacity, uint8_t *levels, size_t level_capacity, uint8_t *out_paragraph_level) |
| Resolve one paragraph (a B character is permitted only at its end). | |
| int | rmgui_bidi_reorder (rmgui_bidi_work_t *work, const uint8_t *levels, size_t count, uint8_t paragraph_level, size_t *visual_indices, size_t visual_capacity) |
| Apply L1 and L2 to a single line: pass corresponding slices of work/levels. | |
| uint32_t | rmgui_bidi_mirror (uint32_t codepoint) |
| Bidi_Mirroring_Glyph, or the original scalar if no mapping exists. | |
bidi.h — Unicode 17.0.0 / UAX #9 revision 51, integer-only and allocation-free.
| int rmgui_bidi_resolve | ( | const uint32_t * | codepoints, |
| size_t | count, | ||
| rmgui_bidi_paragraph_t | paragraph, | ||
| rmgui_bidi_work_t * | work, | ||
| size_t | work_capacity, | ||
| uint8_t * | levels, | ||
| size_t | level_capacity, | ||
| uint8_t * | out_paragraph_level ) |
Resolve one paragraph (a B character is permitted only at its end).
Input must contain Unicode scalar values. A zero-length paragraph is valid. Returns 0, or -1 for invalid input/storage; on refusal levels and paragraph output are unchanged, but scratch may change. All arrays must be disjoint. X9 controls receive the preceding character's level (paragraph level at start); retain their original logical positions but do not paint them.
| int rmgui_bidi_reorder | ( | rmgui_bidi_work_t * | work, |
| const uint8_t * | levels, | ||
| size_t | count, | ||
| uint8_t | paragraph_level, | ||
| size_t * | visual_indices, | ||
| size_t | visual_capacity ) |
Apply L1 and L2 to a single line: pass corresponding slices of work/levels.
Output is count line-relative logical indices in visual order, including zero-width X9 controls. Input levels stay unchanged; work is scratch. Returns 0 or -1; refusal leaves visual_indices unchanged. Empty lines valid. The work slice must be from resolve; paragraph_level must be 0 or 1.
| uint32_t rmgui_bidi_mirror | ( | uint32_t | codepoint | ) |
Bidi_Mirroring_Glyph, or the original scalar if no mapping exists.
The caller applies this to glyph selection at odd resolved levels (L4).