Hello,

I usually use rxvt on some unix systems.  Rxvt can display multibyte
characters well.  However, a look of the height of those fonts are
generally fixed and equal to line's.  So, each lines are displayed
with no spaces or gaps, which results is ugly appearance.

# If you want to look sample images, visit the url
# http://www.asahi-net.or.jp/~tu7k-kbt/unix/rxvt.html, and you colud
# see some images with displaying Japanese Kanji on Rxvt.

It is easy to solve this problem -- insertion of a few pixels of gaps
between lines makes texts much more readable.  Kterm and Eterm already
have this feature.

I wrote a patch for this problem with referring to implementation of
the eterm, and tested on FreeBSD 4.3, NetBSD-1.5.1-BETA and Solaris8
(those systems are x86 platform).

This patch adds:
  o configure option:    --enable-linespace
  o resource:            lineSpace: <num>
  o command line option: -lsp <num>

It can be applied to CVS 2001-05-10.

--------
Kazutoshi Kubota <[EMAIL PROTECTED]>
PGP-Public-Key:
http://pgp.nic.ad.jp:11371/pks/lookup?op=get&search=0x1F8054A8
diff -ruN rxvt-cvs/autoconf/acconfig.h rxvt/autoconf/acconfig.h
--- rxvt-cvs/autoconf/acconfig.h        Wed May  9 01:01:55 2001
+++ rxvt/autoconf/acconfig.h    Wed May  9 11:44:04 2001
@@ -100,6 +100,9 @@
 /* Define if you don't want handling for rarely used features */
 #undef NO_FRILLS
 
+/* Define if you don't want support linespace */
+#undef NO_LINESPACE
+
 /* Define to use a 24 bit visual if the screen has 24 bit mode, even if
  * the default is 8 bit */
 #undef PREFER_24BIT
diff -ruN rxvt-cvs/autoconf/configure.in rxvt/autoconf/configure.in
--- rxvt-cvs/autoconf/configure.in      Wed May  9 01:01:55 2001
+++ rxvt/autoconf/configure.in  Wed May  9 12:38:20 2001
@@ -42,6 +42,7 @@
 MALLOC_TYPE=S
 support_addstrings=no
 support_frills=no
+support_linespace=no
 support_graphics=no
 support_inheritpixmap=no
 support_keepscrolling=no
@@ -73,6 +74,7 @@
   [if test x$enableval = xyes; then
     support_24bit=yes
     support_frills=yes
+    support_linespace=yes
     support_graphics=yes
     support_inheritpixmap=yes
     support_keepscrolling=yes
@@ -230,6 +232,12 @@
     support_frills=$enableval
   fi])
 
+AC_ARG_ENABLE(linespace,
+  [  --enable-linespace      enable support for linespace                        *],
+  [if test x$enableval = xyes -o x$enableval = xno; then
+    support_linespace=$enableval
+  fi])
+
 AC_ARG_ENABLE(24bit,
   [  --enable-24bit          enable support for using 24bit visuals if available *],
   [if test x$enableval = xyes -o x$enableval = xno; then
@@ -982,6 +990,9 @@
 fi
 if test x$support_frills = xno; then
   AC_DEFINE(NO_FRILLS)
+fi
+if test x$support_linespace = xno; then
+  AC_DEFINE(NO_LINESPACE)
 fi
 if test x$support_24bit = xyes; then
   AC_DEFINE(PREFER_24BIT)
diff -ruN rxvt-cvs/src/feature.h rxvt/src/feature.h
--- rxvt-cvs/src/feature.h      Wed May  9 01:01:56 2001
+++ rxvt/src/feature.h  Wed May  9 12:21:48 2001
@@ -411,6 +411,11 @@
 #define EXTERNALBORDERWIDTH    0
 
 /*
+ * Default number of extra dots between lines
+ */
+#define LINESPACE      0
+
+/*
  * Default number of lines in the scrollback buffer
  */
 #define SAVELINES      64
diff -ruN rxvt-cvs/src/init.c rxvt/src/init.c
--- rxvt-cvs/src/init.c Wed May  9 01:01:56 2001
+++ rxvt/src/init.c     Wed May  9 12:44:14 2001
@@ -163,6 +163,7 @@
     r->TermWin.nrow = 24;
     r->TermWin.int_bwidth = INTERNALBORDERWIDTH;
     r->TermWin.ext_bwidth = EXTERNALBORDERWIDTH;
+    r->TermWin.lineSpace = LINESPACE;
     r->TermWin.saveLines = SAVELINES;
     r->numPixColors = TOTAL_COLORS;
 #ifndef NO_NEW_SELECTION
@@ -313,6 +314,10 @@
        r->TermWin.int_bwidth = min(i, 100);    /* arbitrary limit */
     if (rs[Rs_ext_bwidth] && (i = atoi(rs[Rs_ext_bwidth])) >= 0)
        r->TermWin.ext_bwidth = min(i, 100);    /* arbitrary limit */
+#endif
+#ifndef NO_LINESPACE
+    if (rs[Rs_lineSpace] && (i = atoi(rs[Rs_lineSpace])) >= 0)
+       r->TermWin.lineSpace = (u_int16_t)((int)(u_int16_t) i < i ? 0 : i);
 #endif
 
 /* no point having a scrollbar without having any scrollback! */
diff -ruN rxvt-cvs/src/main.c rxvt/src/main.c
--- rxvt-cvs/src/main.c Wed May  9 01:01:56 2001
+++ rxvt/src/main.c     Wed May  9 12:27:43 2001
@@ -631,7 +631,7 @@
 
 /* set the sizes */
     fw = rxvt_get_fontwidest(r->TermWin.font);
-    fh = r->TermWin.font->ascent + r->TermWin.font->descent;
+    fh = r->TermWin.font->ascent + r->TermWin.font->descent + r->TermWin.lineSpace;
     if (fw == r->TermWin.font->min_bounds.width)
        r->TermWin.fprop = 0;   /* Mono-spaced (fixed width) font */
     else
diff -ruN rxvt-cvs/src/rxvt.h rxvt/src/rxvt.h
--- rxvt-cvs/src/rxvt.h Wed May  9 01:01:56 2001
+++ rxvt/src/rxvt.h     Wed May  9 12:29:35 2001
@@ -518,6 +518,9 @@
     Rs_ext_bwidth,
     Rs_int_bwidth,
 #endif
+#ifndef NO_LINESPACE
+    Rs_lineSpace,
+#endif
     Rs_cutchars,
     Rs_modifier,
     Rs_answerbackstring,
diff -ruN rxvt-cvs/src/rxvtlib.h.in rxvt/src/rxvtlib.h.in
--- rxvt-cvs/src/rxvtlib.h.in   Wed May  9 01:01:56 2001
+++ rxvt/src/rxvtlib.h.in       Wed May  9 12:36:01 2001
@@ -218,6 +218,7 @@
                     mapped,    /* window state mapped?                     */
                     int_bwidth, /* internal border width                    */
                    ext_bwidth, /* external border width                    */
+                   lineSpace,  /* number of extra dots between lines       */
                    saveLines,  /* number of lines that fit in scrollback   */
                    nscrolled,  /* number of line actually scrolled         */
                     view_start;        /* scrollback view starts here              */
diff -ruN rxvt-cvs/src/screen.c rxvt/src/screen.c
--- rxvt-cvs/src/screen.c       Wed May  9 01:01:56 2001
+++ rxvt/src/screen.c   Wed May  9 12:32:27 2001
@@ -2443,8 +2443,8 @@
                    gcvalue.foreground = gcvalue.background;
                    XChangeGC(r->Xdisplay, r->TermWin.gc, gcmaskf, &gcvalue);
                    XFillRectangle(r->Xdisplay, drawBuffer, r->TermWin.gc,
-                                  xpixel, ypixelc,
-                                  Width2Pixel(len), Height2Pixel(1));
+                                  xpixel, ypixelc, Width2Pixel(len),
+                                  Height2Pixel(1) - r->TermWin.lineSpace);
                    gcvalue.foreground = ltmp;
                    XChangeGC(r->Xdisplay, r->TermWin.gc, gcmaskf, &gcvalue);
                    DRAW_STRING(draw_string, xpixel, ypixel, buffer, wlen);
@@ -2502,7 +2502,8 @@
 #endif
            XDrawRectangle(r->Xdisplay, drawBuffer, r->TermWin.gc,
                           Col2Pixel(col), Row2Pixel(r->h->oldcursor.row),
-                          Width2Pixel(1 + wbyte) - 1, Height2Pixel(1) - 1);
+                          Width2Pixel(1 + wbyte) - 1,
+                          Height2Pixel(1) - r->TermWin.lineSpace - 1);
 #ifndef NO_CURSORCOLOR
            if (gcmask)         /* restore normal colours */
                XChangeGC(r->Xdisplay, r->TermWin.gc, gcmask, &gcvalue);
diff -ruN rxvt-cvs/src/xdefaults.c rxvt/src/xdefaults.c
--- rxvt-cvs/src/xdefaults.c    Wed May  9 01:01:56 2001
+++ rxvt/src/xdefaults.c        Wed May  9 12:33:58 2001
@@ -257,6 +257,10 @@
     STRG(Rs_int_bwidth, "internalBorder", "b", "number",
         "internal border in pixels"),
 #endif
+#ifndef NO_LINESPACE
+    STRG(Rs_lineSpace, "lineSpace", "lsp", "number",
+        "number of extra dots between lines"),
+#endif
 #ifndef NO_BACKSPACE_KEY
     RSTRG(Rs_backspace_key, "backspacekey", "string"),
 #endif
@@ -305,6 +309,9 @@
 #endif
 #if !defined(NO_FRILLS)
     "frills,"
+#endif
+#if !defined(NO_LINESPACE)
+    "linespace,"
 #endif
 #if defined(PREFER_24BIT)
     "24bit,"

Reply via email to