The same makes sense for the overlay used in the Perl bindings (e.g. for
scrollback search):

```diff
diff --git a/src/rxvtperl.xs b/src/rxvtperl.xs
index 3144b951..6abdaca8 100644
--- a/src/rxvtperl.xs
+++ b/src/rxvtperl.xs
@@ -227,16 +227,17 @@ overlay::overlay (rxvt_term *THIS, int x_, int y_, int 
w_, int h_, rend_t rstyle
             t0 = 0x255a, t1 = 0x2550, t2 = 0x255d;
 
           *tp++ = t0;
-          *rp++ = r;
+          *rp++ = SET_FONT (r, THIS->fontset [GET_STYLE (r)]->find_font (t0));
 
+          rend_t r_t1 = SET_FONT (r, THIS->fontset [GET_STYLE (r)]->find_font 
(t1));
           for (int x = w - 2; x-- > 0; )
             {
               *tp++ = t1;
-              *rp++ = r;
+              *rp++ = r_t1;
             }
 
           *tp = t2;
-          *rp = r;
+          *rp = SET_FONT (r, THIS->fontset [GET_STYLE (r)]->find_font (t2));
         }
       else
         for (int x = w; x-- > 0; )
@@ -326,7 +327,7 @@ void overlay::swap ()
       for (int x = ov_w; x--; )
         {
           text_t t = *t1; *t1++ = *t2; *t2++ = t;
-          rend_t r = *r1; *r1++ = *r2; *r2++ = SET_FONT (r, THIS->fontset 
[GET_STYLE (r)]->find_font (t));
+          rend_t r = *r1; *r1++ = *r2; *r2++ = r;
         }
     }
```


Regards,
Daniel.


On 10.12.2017 17:47, Daniel Hahler wrote:
> From: Daniel Hahler <[email protected]>
> 
> This keeps the existing font when `rxvt_term::scr_swap_overlay` is used,
> instead of setting it anew.
> 
> While this appears to be good in general, it is important for when the
> font has been explicitly set to match the previous one, like I am doing
> for spaces in my wide-glyphs patchset.
> ---
>  src/screen.C | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/src/screen.C b/src/screen.C
> index f3c6d576..85014e40 100644
> --- a/src/screen.C
> +++ b/src/screen.C
> @@ -3598,16 +3598,17 @@ rxvt_term::scr_overlay_new (int x, int y, int w, int 
> h) NOTHROW
>          t0 = 0x255a, t1 = 0x2550, t2 = 0x255d;
>  
>        *tp++ = t0;
> -      *rp++ = r;
> +      *rp++ = SET_FONT (r, FONTSET (r)->find_font (t0));
>  
> +      rend_t r_t1 = SET_FONT (r, FONTSET (r)->find_font (t1));
>        for (x = w - 2; x > 0; --x)
>          {
>            *tp++ = t1;
> -          *rp++ = r;
> +          *rp++ = r_t1;
>          }
>  
>        *tp = t2;
> -      *rp = r;
> +      *rp = SET_FONT (r, FONTSET (r)->find_font (t2));
>      }
>  }
>  
> @@ -3638,7 +3639,7 @@ rxvt_term::scr_overlay_set (int x, int y, text_t text, 
> rend_t rend) NOTHROW
>    x++, y++;
>  
>    ov.text[y][x] = text;
> -  ov.rend[y][x] = rend;
> +  ov.rend[y][x] = SET_FONT (rend, FONTSET (rend)->find_font (text));
>  }
>  
>  void
> @@ -3687,7 +3688,7 @@ rxvt_term::scr_swap_overlay () NOTHROW
>        for (int x = ov.w; x--; )
>          {
>            text_t t = *t1; *t1++ = *t2; *t2++ = t;
> -          rend_t r = *r1; *r1++ = *r2; *r2++ = SET_FONT (r, FONTSET 
> (r)->find_font (t));
> +          rend_t r = *r1; *r1++ = *r2; *r2++ = r;
>          }
>      }
>  }
> 


Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
rxvt-unicode mailing list
[email protected]
http://lists.schmorp.de/mailman/listinfo/rxvt-unicode

Reply via email to