- vendor stb_textedit and add the textedit core with canonical text
- map edit indices to pd_text layout for caret, selection and hit testing
- support caret movement, selection, clipboard, undo/redo, password,
read-only and multiline editing
- render selections with the accent color and configurable text color
- fix caret scaling, input-group repaint and zero-size reflow regressions
- add integration tests, a preview page and internals notes
lcui_fc_fonts_init used the candidate name for aliases. When fontconfig falls back (for example no Ubuntu Mono on CI), the alias pointed at a family that was never loaded, so monospace/sans-serif/serif resolved to -2 and text rendering was empty. Query FC_FAMILY and use the actual loaded family.
pd_font_try_load_file() reports failures at debug level so platform probes, test candidates and CSS @font-face no longer spam errors for missing system fonts. pd_font_load_file() and XML font resources still report errors, and initialization warns once when no usable default font exists.
Expand variable fonts into static weight instances via the wght axis so font-weight resolves to a real face.
Add pd_font_get_glyph_index and skip faces lacking a glyph during family fallback, so a missing glyph keeps falling back instead of stopping at a cached .notdef.
Fix an off-by-one in find_bolder_weight/find_lighter_weight (must index weights[weight-1]), which dereferenced NULL and crashed on sparse-weight families.
Cover these with variable-font, CJK-fallback and weight-fallback tests.
Split lib/pandagl/src/text/text.c into four cohesive units backed
by a library-private header:
- text.c : type lifecycle, line storage, geometry,
dirty-rect bookkeeping, top-level update
- text_typeset.c : line breaking, merging, autowrap, alignment
- text_render.c : per-char bitmap refresh and drawing
- text_edit.c : caret, insert/delete/backspace, text I/O
- text_internal.h : library-private cross-file helpers
(not installed)
Drop the 'insert' overload that conflated 'cursor' with 'insertion
point' and align the field/API names with the cursor concept used
in mainstream GUI toolkits:
insert_x, insert_y -> caret.x, caret.y
(new pd_text_caret_t sub-struct)
pd_text_set_insert_position -> pd_text_set_caret
pd_text_set_insert_pixel_position -> pd_text_set_caret_pixel
pd_text_get_insert_pixel_position -> pd_text_get_caret_pixel
pd_text_get_char_pixel_position -> pd_text_get_char_pixel
Make text I/O symmetric and intent-revealing:
pd_text_dump -> pd_text_read
(mirrors pd_text_write)
pd_text_empty -> pd_text_clear
(the previous static helper
is renamed to pd_text_reset_lines)
pd_text_set_typeset_task -> pd_text_request_typeset
Add pd_text_to_wcs(text), which allocates and returns the full
buffer contents including line endings. It complements the
range-based pd_text_read for callers that just want the whole
text as a wide string.
Fix the mulitiline_enabled -> multiline_enabled typo while at it.
All call sites in lib/pandagl, src/widgets and the tests are
updated. test_text_edit.c gains two cases for pd_text_to_wcs
covering full-text round-trip and the empty-text edge case.
The previous bitmap cache was a three-level rbtree keyed by
(wchar_t, font_id, size), which had two problems:
1. The wchar_t key collapses Unicode codepoints that map to the
same glyph in a given face into separate cache slots, missing
real reuse opportunities and bloating memory under text-heavy
workloads.
2. There was no upper bound; long-running apps would grow the
cache without limit until pd_font_library_destroy.
Replace it with a flat hash table keyed by a packed 64-bit
(face_id, glyph_index, size) tuple, plus a doubly-linked LRU list
for O(1) eviction.
- pd_font_engine gets a new get_glyph_index hook; FreeType maps
via FT_Get_Char_Index, the in-core engine treats codepoints as
identity (no cmap).
- pd_font_cache_add_bitmap / pd_font_cache_get_bitmap now resolve
the glyph index via the engine before keying the cache, so the
same glyph reused across composed sequences hits the same entry.
- pd_font_cache_set_capacity / pd_font_cache_count expose the LRU
bound (default 8192 entries, 0 = unlimited) for runtime tuning
and tests. Shrinking the capacity evicts immediately.
- list_t is used with append at tail / evict from head so the
yutil tail.prev pointer stays consistent (list_link does not
update it).
Adds lib/pandagl/tests/test_font_cache.c covering hit identity,
size differentiation, unknown-codepoint fallback, and LRU eviction.
* refactor: redesign PandaGL library
* refactor: update rect and canvas API
* refactor(pandagl): renames the line drawing function
* refactor(pandagl): replace pd_painter_t with pd_context_t
* fixup! refactor: update rect and canvas API
* test(pandagl): add tests
* fixup! refactor: update rect and canvas API
* fixup! refactor: update rect and canvas API
* fixup! refactor: update rect and canvas API
* fixup! refactor: update rect and canvas API