uniblocks: avoid some problematic glyphs #1285

pull/1293/head
nick black 3 years ago
parent b38b2c9fdb
commit 222d5e722d
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -135,3 +135,15 @@ implementing `rgb` use the 3x8bpc model; XTerm for instance:
Thus emitting `setaf` with an RGB value close to black can result, when
using `xterm-direct`'s `setaf` and `rgb` definitions, in a bright ANSI color.
## Problematic characters
Some characters seem to cause problems with one terminal or another. These
are best avoided until the problems are better understood:
* '­' U+00AD SOFT HYPHEN (some terminals allocate it a cell, some don't)
* '܏' U+070F SYRIAC ABBREVIATION MARK
* '۝' U+06DD ARABIC END OF AYAH
* '࣢' U+08E2 ARABIC DISPUTED END OF AYAH
* '﷽' U+FDFD ARABIC LIGATURE BISMILLAH AR-RAHMAN AR-RAHEEM
'

@ -103,7 +103,10 @@ draw_block(struct ncplane* nn, uint32_t blockstart){
for(z = 0 ; z < CHUNKSIZE ; ++z){
wchar_t w = blockstart + chunk * CHUNKSIZE + z;
char utf8arr[MB_CUR_MAX * 3 + 5];
if(wcwidth(w) >= 1 && iswgraph(w)){
// problematic characters FIXME (see TERMS.md)
if(w == 0x070f || w == 0x08e2 || w == 0x06dd){
strcpy(utf8arr, " ");
}else if(wcwidth(w) >= 1 && iswgraph(w)){
mbstate_t ps;
memset(&ps, 0, sizeof(ps));
int bwc = wcrtomb(utf8arr, w, &ps);

Loading…
Cancel
Save