Re: [dev] [st] fonts and diacriticals
Yo Nick: I moved because I wanted to catch the action in tip -- last change in xft was 7 months ago via me. My font line in config.h is precisely what you have. I'm a little confused why broken default X font stuff (if that's the case) would be the culprit here and yet cause no headaches in dwm. Maybe I'll just go back to xft branch. 2012/9/17 Nick suckless-...@njw.me.uk: Morning Peter, st-0.2.1 works fine for simple diacritics (such as those in your email signature), at least with font: -*-terminus-medium-r-*-*-*-220-*-*-*-*-iso10646-* I'd guess it's the default x / st font settings working against you. I know that isn't much of an answer. Why have you moved off the xft branch? I've been working with rather more complex characters than accented latin, and st-xft has been a godsend. Nick On Mon, Sep 17, 2012 at 10:47:39AM -0400, Peter Hartman wrote: Comrades: I recently moved to Quebec and now need accents and all that fun stuff. I also recently moved off the xft branch of st and to the standing tip, and I've noticed that I can't for the life of me get diacriticals to display. They display fine in dwm and dmenu, urxvt, and xft version of st. So, what am I missing? My config.h is config.def.h. Considering the manpage contains an accent in the name of the author, I'm guessing it is ME and not ST. Peter -- sic dicit magister P Université du Québec à Montréal / Loyola University Chicago http://individual.utoronto.ca/peterjh gpg 1024D/ED6EF59B (7D1A 522F D08E 30F6 FA42 B269 B860 352B ED6E F59B) gpg --keyserver pgp.mit.edu --recv-keys ED6EF59B -- sic dicit magister P Université du Québec à Montréal / Loyola University Chicago http://individual.utoronto.ca/peterjh gpg 1024D/ED6EF59B (7D1A 522F D08E 30F6 FA42 B269 B860 352B ED6E F59B) gpg --keyserver pgp.mit.edu --recv-keys ED6EF59B
Re: [dev] [st] fonts and diacriticals
To confirm, I just tried st tip (main branch), and the diacritics from this email displayed without issue. Hopefully somebody with more skill than being able to type works for me may be able to help you. Nick
Re: [dev] [st] fonts and diacriticals
I should add that when I launch st I get: peterjh@trilx220 st $ st erresc: unknown csi ESC[?17;0;64c 2012/9/17 Nick suckless-...@njw.me.uk: To confirm, I just tried st tip (main branch), and the diacritics from this email displayed without issue. Hopefully somebody with more skill than being able to type works for me may be able to help you. Nick -- sic dicit magister P Université du Québec à Montréal / Loyola University Chicago http://individual.utoronto.ca/peterjh gpg 1024D/ED6EF59B (7D1A 522F D08E 30F6 FA42 B269 B860 352B ED6E F59B) gpg --keyserver pgp.mit.edu --recv-keys ED6EF59B
Re: [dev] [st] fonts and diacriticals
On Mon, Sep 17, 2012 at 11:17:54AM -0400, Peter Hartman wrote: I should add that when I launch st I get: peterjh@trilx220 st $ st erresc: unknown csi ESC[?17;0;64c I don't. Did you do make install, or the tic command it would run, with st.info?
Re: [dev] [st] fonts and diacriticals
Yes, and ls -la ~/.termcap/s/ has st and st-256colors, as it should (and I nuked the old ones). 2012/9/17 Nick suckless-...@njw.me.uk: On Mon, Sep 17, 2012 at 11:17:54AM -0400, Peter Hartman wrote: I should add that when I launch st I get: peterjh@trilx220 st $ st erresc: unknown csi ESC[?17;0;64c I don't. Did you do make install, or the tic command it would run, with st.info? -- sic dicit magister P Université du Québec à Montréal / Loyola University Chicago http://individual.utoronto.ca/peterjh gpg 1024D/ED6EF59B (7D1A 522F D08E 30F6 FA42 B269 B860 352B ED6E F59B) gpg --keyserver pgp.mit.edu --recv-keys ED6EF59B
Re: [dev] [st] fonts and diacriticals
I use also the tip and I can use diacritics (I usually have to write a lot of them in spanish). The font I use is -*-terminus-medium-r-*-*-*-160-72-72-*-80-*-*. Could you use the -f option and sent the session to us?.
[dev] [st] Patches
Some new patches for st. From 17025c9ab88bb8560bac3896c2384ad060c6e8d9 Mon Sep 17 00:00:00 2001 From: Roberto E. Vargas Caballero k...@shike2.com Date: Mon, 17 Sep 2012 19:03:35 +0200 Subject: Add xcalloc wrapper malloc and realloc are called through xmalloc and xrealloc, so calloc should be called through xcalloc. --- st.c | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/st.c b/st.c index d5ecf61..df7f8d8 100644 --- a/st.c +++ b/st.c @@ -324,6 +324,7 @@ static int isfullutf8(char *, int); static void *xmalloc(size_t); static void *xrealloc(void *, size_t); +static void *xcalloc(size_t nmemb, size_t size); static void (*handler[LASTEvent])(XEvent *) = { [KeyPress] = kpress, @@ -373,6 +374,14 @@ xrealloc(void *p, size_t len) { return p; } +void * +xcalloc(size_t nmemb, size_t size) { + void *p = calloc(nmemb, size); + if(!p) + die(Out of memory\n); + return p; +} + int utf8decode(char *s, long *u) { uchar c; @@ -1801,8 +1810,8 @@ tresize(int col, int row) { /* allocate any new rows */ for(/* i == minrow */; i row; i++) { term.dirty[i] = 1; - term.line[i] = calloc(col, sizeof(Glyph)); - term.alt [i] = calloc(col, sizeof(Glyph)); + term.line[i] = xcalloc(col, sizeof(Glyph)); + term.alt [i] = xcalloc(col, sizeof(Glyph)); } if(col term.col) { bool *bp = term.tabs + term.col; -- 1.7.10.4 From cd17e65b475b1eaccc73a2668f67953ac1e4 Mon Sep 17 00:00:00 2001 From: Roberto E. Vargas Caballero k...@shike2.com Date: Mon, 17 Sep 2012 19:05:06 +0200 Subject: Add newline in error messages --- st.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/st.c b/st.c index df7f8d8..c408ca9 100644 --- a/st.c +++ b/st.c @@ -363,14 +363,14 @@ void * xmalloc(size_t len) { void *p = malloc(len); if(!p) - die(Out of memory); + die(Out of memory\n); return p; } void * xrealloc(void *p, size_t len) { if((p = realloc(p, len)) == NULL) - die(Out of memory); + die(Out of memory\n); return p; } -- 1.7.10.4 From b13844523254ef2e05a8c3d81b89b8aba09e3513 Mon Sep 17 00:00:00 2001 From: Roberto E. Vargas Caballero k...@shike2.com Date: Mon, 17 Sep 2012 20:19:48 +0200 Subject: Copy non set positions as spaces st selection don't insert in the selection position whose value is not set. This is correct for the positions in the end of the line, but cause some problems in the beginning. For example echo -e 'a\tb' will print in the screen: a b but after selecting and copying in some place you get: ab because positions from 1 to 7 don't have any value. This patch deals all positions without value as blank (even at the end of the line). --- st.c | 17 ++--- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/st.c b/st.c index c408ca9..b2e5e22 100644 --- a/st.c +++ b/st.c @@ -596,14 +596,17 @@ selcopy(void) { /* append every set selected glyph to the selection */ for(y = 0; y term.row; y++) { for(x = 0; x term.col; x++) { -is_selected = selected(x, y); -if((term.line[y][x].state GLYPH_SET) is_selected) { - int size = utf8size(term.line[y][x].c); - memcpy(ptr, term.line[y][x].c, size); - ptr += size; -} +int size; +char *p; +Glyph *gp = term.line[y][x]; + +if(!(is_selected = selected(x, y))) + continue; +p = (gp-state GLYPH_SET) ? gp-c : ; +size = utf8size(p); +memcpy(ptr, p, size); +ptr += size; } - /* \n at the end of every selected line except for the last one */ if(is_selected y sel.e.y) *ptr++ = '\n'; -- 1.7.10.4 From b6a73e21dfe968a8dbc8736799175a58cd8dfd8b Mon Sep 17 00:00:00 2001 From: Roberto E. Vargas Caballero k...@shike2.com Date: Mon, 17 Sep 2012 20:24:19 +0200 Subject: Clean windows display after resizing Some times the size after a resizing is not an exact multiply of a number of characters, so redrawn the screen using the lines and columns of the neww size can cause that some old graphics keep in the screen. Solution is clean all the windows with the background color. --- st.c |3 +++ 1 file changed, 3 insertions(+) diff --git a/st.c b/st.c index b2e5e22..20e4512 100644 --- a/st.c +++ b/st.c @@ -1839,6 +1839,9 @@ void xresize(int col, int row) { xw.w = MAX(1, 2*BORDER + col * xw.cw); xw.h = MAX(1, 2*BORDER + row * xw.ch); + XFillRectangle(xw.dpy, xw.buf, dc.gc, 0, 0, + DisplayWidth(xw.dpy, xw.scr), + DisplayHeight(xw.dpy, xw.scr)); } void -- 1.7.10.4
Re: [dev] [st] fonts and diacriticals
TERM inside st = st-256color TERM outside st (i.e. in urxvt where I launch it) is = screen xlsfonts indicates terminus is there, etc. xset q also indicates it is there. Here's the st -f output: http://sprunge.us/IfXW 2012/9/17 Roberto E. Vargas Caballero k...@shike2.com: peterjh@trilx220 st $ st erresc: unknown csi ESC[?17;0;64c st doesn't implement this sequence, so it is a bit strange that you receive always this sequence only for starting it. Can you say me what value do you have in TERM?. -- sic dicit magister P Université du Québec à Montréal / Loyola University Chicago http://individual.utoronto.ca/peterjh gpg 1024D/ED6EF59B (7D1A 522F D08E 30F6 FA42 B269 B860 352B ED6E F59B) gpg --keyserver pgp.mit.edu --recv-keys ED6EF59B
Re: [dev] [st] fonts and diacriticals
http://sprunge.us/IfXW Note the first command I type in that is é ENTER -- sic dicit magister P Université du Québec à Montréal / Loyola University Chicago http://individual.utoronto.ca/peterjh gpg 1024D/ED6EF59B (7D1A 522F D08E 30F6 FA42 B269 B860 352B ED6E F59B) gpg --keyserver pgp.mit.edu --recv-keys ED6EF59B
Re: [dev] [st] fonts and diacriticals
2012/9/17 Peter Hartman peterjohnhart...@gmail.com: http://sprunge.us/IfXW Note the first command I type in that is é ENTER peterjh@trilx220 st $ locale LANG=fr_FR@euro LC_CTYPE=fr_FR LC_NUMERIC=fr_FR LC_TIME=fr_FR LC_COLLATE=fr_FR LC_MONETARY=fr_FR LC_MESSAGES=fr_FR LC_PAPER=fr_FR LC_NAME=fr_FR LC_ADDRESS=fr_FR LC_TELEPHONE=fr_FR LC_MEASUREMENT=fr_FR LC_IDENTIFICATION=fr_FR LC_ALL=fr_FR If that helps. -- sic dicit magister P Université du Québec à Montréal / Loyola University Chicago http://individual.utoronto.ca/peterjh gpg 1024D/ED6EF59B (7D1A 522F D08E 30F6 FA42 B269 B860 352B ED6E F59B) gpg --keyserver pgp.mit.edu --recv-keys ED6EF59B
Re: [dev] [st] fonts and diacriticals
TERM inside st = st-256color Can you send the output of 'infocmp st-256color'? Here's the st -f output: http://sprunge.us/IfXW Uhmmm, but in this file there isn't any diacritic :S. I need some of them in order to try see where can be the problem.
Re: [dev] [st] fonts and diacriticals
On Mon, Sep 17, 2012 at 02:37:44PM -0400, Peter Hartman wrote: http://sprunge.us/IfXW Note the first command I type in that is é ENTER Interesting, because I can't see the 'è' in the file, so it is not a problem of the fonts. I don't know why but st if doing something strange with the character.
[dev] [st] fonts and diacriticals
Change all those little LC_ and LANG vars over now convinces st to behave. The problem seems that st suppouse the input keyboard is a utf8 device, and in the case you use a non utf8 locale it detects non ascii characters as first byte of a multibyte utf8 character (if you have good luck, because it is possible it detects it as an incorrect utf8 number). This is a new bug in st (at least the temporary work around is easy).