mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-09 09:09:03 -04:00
uniblocks: avoid some problematic glyphs #1285
This commit is contained in:
parent
b38b2c9fdb
commit
222d5e722d
12
TERMS.md
12
TERMS.md
@ -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…
x
Reference in New Issue
Block a user