mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-10-31 15:20:13 +00:00
mojibake: don't stomp right side of boxes
This commit is contained in:
parent
8afd25fef6
commit
da765ebdaa
15
TERMS.md
Normal file
15
TERMS.md
Normal file
@ -0,0 +1,15 @@
|
||||
# Terminals and `TERM`
|
||||
|
||||
| Terminal | Recommended `TERM` | Notes |
|
||||
| -------- | ------ | ----- |
|
||||
| Linux console | `linux` | 8 (512 glyph fonts) or 16 (256 glyph fonts) colors max. |
|
||||
| FBterm | | |
|
||||
| kmscon | | |
|
||||
| XTerm | | |
|
||||
| XFCE4 Terminal | | |
|
||||
| Gnome Terminal | | |
|
||||
| Konsole | | |
|
||||
| Alacritty | | |
|
||||
| Kitty | | |
|
||||
| GNU Screen | `screen-256colors` | Must be compiled with `--enable-256color`. |
|
||||
| tmux | | |
|
@ -3458,7 +3458,7 @@ unicode52(struct ncplane* title, int y){
|
||||
"\xf0\x9f\x85\xbf \xf0\x9f\x85\xbf\ufe0f"
|
||||
"\xf0\x9f\x88\xaf \xf0\x9f\x88\xaf\ufe0f"
|
||||
"\xf0\x9f\x88\x9a \xf0\x9f\x88\x9a\ufe0f"
|
||||
"\u3299 \u3299\ufe0f \U0001F41D");
|
||||
"\u3299 \u3299\ufe0f");
|
||||
return n;
|
||||
}
|
||||
|
||||
@ -3511,10 +3511,10 @@ unicode7emoji2(struct ncplane* title, int y){
|
||||
struct ncplane*
|
||||
makegroup(struct ncplane* title, int y, const char* emoji, const char* name){
|
||||
int cols = mbswidth(emoji);
|
||||
if(cols < 0){
|
||||
cols = 1;
|
||||
if(cols < 0){ // take a wild guess on mbswidth() error.
|
||||
cols = strlen(emoji) * 3 / 5; // best by test
|
||||
}
|
||||
struct ncplane* n = mojiplane(title, y, 2 + (cols + (planewidth - 1)) / planewidth, name);
|
||||
struct ncplane* n = mojiplane(title, y, 2 + (cols + (planewidth - 3)) / (planewidth - 2), name);
|
||||
if(n == NULL){
|
||||
return NULL;
|
||||
}
|
||||
@ -3537,7 +3537,7 @@ makegroup(struct ncplane* title, int y, const char* emoji, const char* name){
|
||||
}
|
||||
emoji += bytes;
|
||||
x += w;
|
||||
if(x >= planewidth - 1){
|
||||
if(x >= planewidth - 2){
|
||||
++y;
|
||||
x = 1;
|
||||
}
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include <stddef.h>
|
||||
#include "internal.h"
|
||||
|
||||
static const unsigned char zeroes[] = "\x00\x00\x00\x00";
|
||||
|
Loading…
Reference in New Issue
Block a user