-- Leo's gemini proxy

-- Connecting to git.thebackupbox.net:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini

repo: rxvt-unicode-sixel
action: commit
revision:
path_from:
revision_from: 6617d84b36252e1919fc372b165bb989f0adcae4:
path_to:
revision_to:

git.thebackupbox.net

rxvt-unicode-sixel

git://git.thebackupbox.net/rxvt-unicode-sixel

commit 6617d84b36252e1919fc372b165bb989f0adcae4
Author: Emanuele Giaquinta <emanuele.giaquinta@gmail.com>
Date:   Wed Feb 10 16:05:42 2010 +0000

    Extend ISO 14755 5.4 mode to also print the font name of the characters other
    than the first one in the selected cell.

diff --git a/src/command.C b/src/command.C

index c58e75090700d1b4fdaa0e52f6b717d2f21c8b2b..

index ..efc6f688f867a23f1f359a8b892e10c4608ade5c 100644

--- a/src/command.C
+++ b/src/command.C
@@ -164,12 +164,9 @@ void
 rxvt_term::iso14755_51 (unicode_t ch, rend_t r, int x, int y)
 {
   rxvt_fontset *fs = FONTSET (r);
-  rxvt_font *f = (*fs)[fs->find_font (ch)];
-  wchar_t *chr, *alloc, ch2, *fname;
+  wchar_t *chr, *alloc, ch2, **fname;
   int len;

-  fname = rxvt_utf8towcs (f->name);
-
 # if ENABLE_COMBINING
   if (IS_COMPOSE (ch))
     {
@@ -199,7 +196,14 @@ rxvt_term::iso14755_51 (unicode_t ch, rend_t r, int x, int y)
            r & RS_Uline   ? " uline"   : "",
            r & RS_Careful ? " careful" : "");

-  int width = wcswidth (fname, wcslen (fname));
+  int width = 0;
+  fname = rxvt_temp_buf<wchar_t *> (len);
+  for (int i = 0; i < len; i++)
+    {
+      rxvt_font *f = (*fs)[fs->find_font (chr[i])];
+      fname[i] = rxvt_utf8towcs (f->name);
+      max_it (width, wcswidth (fname[i], wcslen (fname[i])));
+    }

   max_it (width, 8+5); // for char + hex
   max_it (width, strlen (attr));
@@ -210,7 +214,7 @@ rxvt_term::iso14755_51 (unicode_t ch, rend_t r, int x, int y)
       x = 0;
     }

-  scr_overlay_new (x, y, width, len + 2);
+  scr_overlay_new (x, y, width, len * 2 + 1);

   r = SET_STYLE (OVERLAY_RSTYLE, GET_STYLE (r));

@@ -239,9 +243,11 @@ rxvt_term::iso14755_51 (unicode_t ch, rend_t r, int x, int y)
 //    scr_overlay_set (0, 0, buf);
 //  }
   scr_overlay_set (0, len    , attr);
-  scr_overlay_set (0, len + 1, fname);
-
-  free (fname);
+  for (int i = 0; i < len; i++)
+    {
+      scr_overlay_set (0, len + 1 + i, fname[i]);
+      free (fname[i]);
+    }

 # if ENABLE_COMBINING
   if (alloc)

-----END OF PAGE-----

-- Response ended

-- Page fetched on Sun Jun 2 09:29:38 2024