mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-20 05:33:47 -04:00
wcwidth: provide our own implementation of wcwidth() and wcswidth()
This commit adds a new script, generate-wcwidth.py, that generates wcwidth tables from the bundled files (Unicode 14.0): * DerivedGeneralCategory.txt * EastAsianWidth.txt This commit also adds the functions my_wcwidth() and my_wcswidth() that replaces the system’s wcwidth()+wcswidth(), and uses the generated tables to map Unicode codepoints to widths. This is inspired by both XTerm’s wcwidth implementation, as well as https://github.com/jquast/wcwidth. Both of those are based on/inspired by https://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c
This commit is contained in:
parent
99ebff5a51
commit
c758949145
7 changed files with 7123 additions and 0 deletions
4192
unicode/DerivedGeneralCategory.txt
Normal file
4192
unicode/DerivedGeneralCategory.txt
Normal file
File diff suppressed because it is too large
Load diff
2587
unicode/EastAsianWidth.txt
Normal file
2587
unicode/EastAsianWidth.txt
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue