From 16767ef3ff0ad57ae6fdf8132afaf7f3bd15da3d Mon Sep 17 00:00:00 2001 From: gryf Date: Mon, 30 Oct 2023 18:24:11 +0100 Subject: [PATCH] Added updated patches for rxvt unicode --- ...-9.31-add-space-to-extent-test-chars.patch | 153 ++++++++++ ...rxvt-unicode-9.31-enable-wide-glyphs.patch | 264 ++++++++++++++++++ .../rxvt-unicode-9.31-font-width-fix.patch | 164 +++++++++++ .../rxvt-unicode-9.31-line-spacing-fix.patch | 163 +++++++++++ .../files/rxvt-unicode-9.31-perl5.38.patch | 13 + 5 files changed, 757 insertions(+) create mode 100644 x11-terms/rxvt-unicode/files/rxvt-unicode-9.31-add-space-to-extent-test-chars.patch create mode 100644 x11-terms/rxvt-unicode/files/rxvt-unicode-9.31-enable-wide-glyphs.patch create mode 100644 x11-terms/rxvt-unicode/files/rxvt-unicode-9.31-font-width-fix.patch create mode 100644 x11-terms/rxvt-unicode/files/rxvt-unicode-9.31-line-spacing-fix.patch create mode 100644 x11-terms/rxvt-unicode/files/rxvt-unicode-9.31-perl5.38.patch diff --git a/x11-terms/rxvt-unicode/files/rxvt-unicode-9.31-add-space-to-extent-test-chars.patch b/x11-terms/rxvt-unicode/files/rxvt-unicode-9.31-add-space-to-extent-test-chars.patch new file mode 100644 index 0000000..fbb20e8 --- /dev/null +++ b/x11-terms/rxvt-unicode/files/rxvt-unicode-9.31-add-space-to-extent-test-chars.patch @@ -0,0 +1,153 @@ +diff --git a/config.h.in b/config.h.in +index b9c7e0c..ead1f1f 100644 +--- a/config.h.in ++++ b/config.h.in +@@ -24,6 +24,9 @@ + /* Define if you want your background to use the parent window background */ + #undef ENABLE_TRANSPARENCY + ++/* Define if you want add space when testing character width */ ++#undef ENABLE_USE_SPACE ++ + /* Define if you want to display wide glyphs */ + #undef ENABLE_WIDE_GLYPHS + +diff --git a/configure b/configure +index 6b50a6b..a89170f 100755 +--- a/configure ++++ b/configure +@@ -741,6 +741,7 @@ enable_font_styles + enable_wide_glyphs + enable_font_width + enable_line_spacing ++enable_use_space + enable_pixbuf + enable_startup_notification + enable_transparency +@@ -1418,6 +1419,7 @@ Optional Features: + --enable-wide-glyphs enable displaying of wide glyphs + --enable-font-width enable proper way to calculate character width + --enable-line-spacing enable line spacing fix ++ --enable-use-space enable add space to extent test characters + --enable-pixbuf enable integration with gdk-pixbuf for background images + --enable-startup-notification enable freedesktop startup notification support + --enable-transparency enable transparent backgrounds +@@ -5001,6 +5003,7 @@ support_iso14755=yes + support_styles=yes + support_font_width=no + support_line_spacing=no ++support_use_space=no + support_perl=yes + codesets=all + +@@ -5034,6 +5037,7 @@ then : + support_wide_glyphs=no + support_font_width=no + support_line_spacing=no ++ support_use_space=no + support_perl=no + codesets= + fi +@@ -5062,6 +5066,7 @@ then : + support_wide_glyphs=yes + support_font_width=yes + support_line_spacing=yes ++ support_use_space=yes + support_perl=yes + codesets=all + fi +@@ -5205,6 +5210,15 @@ then : + fi + + ++# Check whether --enable-use-space was given. ++if test ${enable_use_space+y} ++then : ++ enableval=$enable_use_space; if test x$enableval = xyes -o x$enableval = xno; then ++ support_use_space=$enableval ++ fi ++fi ++ ++ + # Check whether --enable-pixbuf was given. + if test ${enable_pixbuf+y} + then : +@@ -7719,6 +7733,11 @@ if test x$support_line_spacing = xyes; then + + printf "%s\n" "#define ENABLE_LINE_SPACING 1" >>confdefs.h + ++fi ++if test x$support_use_space = xyes; then ++ ++printf "%s\n" "#define ENABLE_USE_SPACE 1" >>confdefs.h ++ + fi + if test x$support_iso14755 = xyes; then + +diff --git a/configure.ac b/configure.ac +index 1cffda6..f623818 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -92,6 +92,7 @@ support_iso14755=yes + support_styles=yes + support_font_width=no + support_line_spacing=no ++support_use_space=no + support_perl=yes + codesets=all + +@@ -128,6 +129,7 @@ AC_ARG_ENABLE(everything, + support_wide_glyphs=no + support_font_width=no + support_line_spacing=no ++ support_use_space=no + support_perl=no + codesets= + fi +@@ -156,6 +158,7 @@ AC_ARG_ENABLE(everything, + support_wide_glyphs=yes + support_font_width=yes + support_line_spacing=yes ++ support_use_space=yes + support_perl=yes + codesets=all + fi +@@ -247,6 +250,12 @@ AC_ARG_ENABLE(line-spacing, + support_line_spacing=$enableval + fi]) + ++AC_ARG_ENABLE(use-space, ++ [ --enable-use-space enable add space to extent test characters], ++ [if test x$enableval = xyes -o x$enableval = xno; then ++ support_use_space=$enableval ++ fi]) ++ + AC_ARG_ENABLE(pixbuf, + [ --enable-pixbuf enable integration with gdk-pixbuf for background images], + [if test x$enableval = xyes -o x$enableval = xno; then +@@ -678,6 +687,9 @@ fi + if test x$support_line_spacing = xyes; then + AC_DEFINE(ENABLE_LINE_SPACING, 1, Define if you want line spacing fix) + fi ++if test x$support_use_space = xyes; then ++ AC_DEFINE(ENABLE_USE_SPACE, 1, Define if you want add space when testing character width) ++fi + if test x$support_iso14755 = xyes; then + AC_DEFINE(ISO_14755, 1, Define if you want ISO 14755 extended support) + fi +diff --git a/src/rxvtfont.C b/src/rxvtfont.C +index 9420a22..27b0958 100644 +--- a/src/rxvtfont.C ++++ b/src/rxvtfont.C +@@ -155,7 +155,11 @@ static const struct rxvt_fallback_font { + // these characters are used to guess the font height and width + // pango uses a similar algorithm and doesn't trust the font either. + static uint16_t extent_test_chars[] = { ++#ifdef ENABLE_USE_SPACE ++ ' ', '0', '1', '8', 'a', 'd', 'x', 'm', 'y', 'g', 'W', 'X', '\'', '_', ++#else + '0', '1', '8', 'a', 'd', 'x', 'm', 'y', 'g', 'W', 'X', '\'', '_', ++#endif + 0x00cd, 0x00d5, 0x0114, 0x0177, 0x0643, // ÍÕĔŷﻙ + 0x304c, 0x672c, // が本 + }; diff --git a/x11-terms/rxvt-unicode/files/rxvt-unicode-9.31-enable-wide-glyphs.patch b/x11-terms/rxvt-unicode/files/rxvt-unicode-9.31-enable-wide-glyphs.patch new file mode 100644 index 0000000..4cbd8ae --- /dev/null +++ b/x11-terms/rxvt-unicode/files/rxvt-unicode-9.31-enable-wide-glyphs.patch @@ -0,0 +1,264 @@ +--- a/config.h.in ++++ b/config.h.in +@@ -18,6 +18,9 @@ + /* Define if you want your background to use the parent window background */ + #undef ENABLE_TRANSPARENCY + ++/* Define if you want to display wide glyphs */ ++#undef ENABLE_WIDE_GLYPHS ++ + /* Define if you want european extended codesets */ + #undef ENCODING_EU + +--- a/configure ++++ b/configure +@@ -739,6 +739,7 @@ + enable_combining + enable_xft + enable_font_styles ++enable_wide_glyphs + enable_pixbuf + enable_startup_notification + enable_transparency +@@ -1414,6 +1415,7 @@ + --enable-combining enable composition of base and combining characters + --enable-xft enable xft support on systems that have it + --enable-font-styles enable bold and italic support ++ --enable-wide-glyphs enable displaying of wide glyphs + --enable-pixbuf enable integration with gdk-pixbuf for background images + --enable-startup-notification enable freedesktop startup notification support + --enable-transparency enable transparent backgrounds +@@ -5025,6 +5027,7 @@ + support_8bitctrls=no + support_iso14755=no + support_styles=no ++ support_wide_glyphs=no + support_perl=no + codesets= + fi +@@ -5050,6 +5053,7 @@ + #support_8bitctrls=yes + support_iso14755=yes + support_styles=yes ++ support_wide_glyphs=yes + support_perl=yes + codesets=all + fi +@@ -5182,6 +5186,14 @@ + fi + + ++# Check whether --enable-wide-glyphs was given. ++if test "${enable_wide_glyphs+set}" = set; then : ++ enableval=$enable_wide_glyphs; if test x$enableval = xyes -o x$enableval = xno; then ++ support_wide_glyphs=$enableval ++ fi ++fi ++ ++ + # Check whether --enable-pixbuf was given. + if test ${enable_pixbuf+y} + then : +@@ -7727,6 +7739,11 @@ + printf "%s\n" "#define MOUSE_SLIP_WHEELING 1" >>confdefs.h + + fi ++if test x$support_wide_glyphs = xyes; then ++ ++printf "%s\n" "#define ENABLE_WIDE_GLYPHS 1" >>confdefs.h ++ ++fi + + scrolltypes=plain + +--- a/configure.ac ++++ b/configure.ac +@@ -123,6 +123,7 @@ + support_8bitctrls=no + support_iso14755=no + support_styles=no ++ support_wide_glyphs=no + support_perl=no + codesets= + fi +@@ -148,6 +149,7 @@ + #support_8bitctrls=yes + support_iso14755=yes + support_styles=yes ++ support_wide_glyphs=yes + support_perl=yes + codesets=all + fi +@@ -231,6 +233,12 @@ + support_styles=$enableval + fi]) + ++AC_ARG_ENABLE(wide-glyphs, ++ [ --enable-wide-glyphs enable displaying of wide glyphs], ++ [if test x$enableval = xyes -o x$enableval = xno; then ++ support_wide_glyphs=$enableval ++ fi]) ++ + AC_ARG_ENABLE(pixbuf, + [ --enable-pixbuf enable integration with gdk-pixbuf for background images], + [if test x$enableval = xyes -o x$enableval = xno; then +@@ -653,6 +661,9 @@ + if test x$support_styles = xyes; then + AC_DEFINE(ENABLE_STYLES, 1, Define if you want bold and italic support) + fi ++if test x$support_wide_glyphs = xyes; then ++ AC_DEFINE(ENABLE_WIDE_GLYPHS, 1, Define if you want to display wide glyphs) ++fi + if test x$support_iso14755 = xyes; then + AC_DEFINE(ISO_14755, 1, Define if you want ISO 14755 extended support) + fi +--- a/src/command.C ++++ b/src/command.C +@@ -237,7 +237,9 @@ + # endif + scr_overlay_set (11, y + 1, ch, r); + ++#if !ENABLE_WIDE_GLYPHS + if (WCWIDTH (ch) >= 2) ++#endif + scr_overlay_set (12, y + 1, NOCHAR, r); + } + +--- a/src/rxvtfont.C ++++ b/src/rxvtfont.C +@@ -471,6 +471,7 @@ + else + switch (t) + { ++ case ' ': + case '\t': + case ZERO_WIDTH_CHAR: + case NOCHAR: +@@ -1038,8 +1039,10 @@ + + careful = xcs->lbearing < 0 || xcs->rbearing > prop->width * wcw; + ++#if !ENABLE_WIDE_GLYPHS + if (careful && !OVERLAP_OK (w, wcw, prop)) + return false; ++#endif + + return true; + } +@@ -1410,12 +1413,14 @@ + + careful = g.x > 0 || w > cwidth; + ++#if !ENABLE_WIDE_GLYPHS + if (careful && !OVERLAP_OK (w, wcw, prop)) + return false; + + // this weeds out _totally_ broken fonts, or glyphs + if (!OVERLAP_OK (g.xOff, wcw, prop)) + return false; ++#endif + + return true; + } +@@ -1496,6 +1501,10 @@ + + ep->glyph = glyph; + ep->x = x_; ++#if ENABLE_WIDE_GLYPHS ++ /* Left-align to bounding box, do not overlap to the left. */ ++ max_it(ep->x, x_); ++#endif + ep->y = y_ + ascent; + + // the xft font cell might differ from the terminal font cell, +--- a/src/screen.C ++++ b/src/screen.C +@@ -976,7 +976,61 @@ + # endif + #endif + +- rend_t rend = SET_FONT (rstyle, FONTSET (rstyle)->find_font (c)); ++ rend_t rend; ++#if ENABLE_WIDE_GLYPHS ++ // Re-use previous font for space characters. ++ // This allows for better display of wider chars with regard to ++ // backtracking (which uses RS_SAME). ++ if (c != ' ') ++ { ++#endif ++ rend = SET_FONT (rstyle, FONTSET (rstyle)->find_font (c)); ++#if ENABLE_WIDE_GLYPHS ++ ++ } ++ else ++ { ++ // Code taken from ENABLE_COMBINING - might get refactored. ++ line_t *linep; ++ text_t *tp; ++ rend_t *rp = NULL; ++ ++ if (screen.cur.col > 0) ++ { ++ linep = line; ++ tp = line->t + screen.cur.col - 1; ++ rp = line->r + screen.cur.col - 1; ++ } ++ else if (screen.cur.row > 0 ++ && ROW(screen.cur.row - 1).is_longer ()) ++ { ++ linep = &ROW(screen.cur.row - 1); ++ tp = linep->t + ncol - 1; ++ rp = linep->r + ncol - 1; ++ } ++ ++ if (rp) ++ { ++ // XXX: this font does not show up in iso-14755 mode for the space!? ++ if (*tp == NOCHAR) ++ { ++ while (*tp == NOCHAR && tp > linep->t) ++ tp--, rp--; ++ ++ // first try to find a precomposed character ++ unicode_t n = rxvt_compose (*tp, c); ++ if (n == NOCHAR) ++ n = rxvt_composite.compose (*tp, c); ++ ++ *tp = n; ++ *rp = SET_FONT (*rp, FONTSET (*rp)->find_font (*tp)); ++ } ++ rend = SET_FONT (rstyle, GET_FONT(*rp)); ++ } ++ else ++ rend = SET_FONT (rstyle, FONTSET (rstyle)->find_font (c)); ++ } ++#endif + + // if the character doesn't fit into the remaining columns... + if (ecb_unlikely (screen.cur.col > ncol - width && ncol >= width)) +@@ -2435,7 +2489,12 @@ + text--, count++, xpixel -= fwidth; + + // force redraw after "careful" characters to avoid pixel droppings +- for (int i = 0; srp[col + i] & RS_Careful && col + i < ncol - 1; i++) ++ for (int i = 0; srp[col + i] & RS_Careful && col + i < ncol - 1 ++#if ENABLE_WIDE_GLYPHS ++ // But not for spaces. ++ && stp[col + i + 1] != ' ' ++#endif ++ ; i++) + drp[col + i + 1] = srp[col + i + 1] ^ RS_redraw; + + // force redraw before "careful" characters to avoid pixel droppings +--- a/src/xdefaults.C ++++ b/src/xdefaults.C +@@ -299,6 +299,9 @@ + #if ENABLE_STYLES + "styles," + #endif ++#if ENABLE_WIDE_GLYPHS ++ "wide-glyphs," ++#endif + #if ENABLE_COMBINING + "combining," + #endif diff --git a/x11-terms/rxvt-unicode/files/rxvt-unicode-9.31-font-width-fix.patch b/x11-terms/rxvt-unicode/files/rxvt-unicode-9.31-font-width-fix.patch new file mode 100644 index 0000000..56e9ef3 --- /dev/null +++ b/x11-terms/rxvt-unicode/files/rxvt-unicode-9.31-font-width-fix.patch @@ -0,0 +1,164 @@ +diff --git a/config.h.in b/config.h.in +index b50ab85..51e6d76 100644 +--- a/config.h.in ++++ b/config.h.in +@@ -6,6 +6,9 @@ + /* Define if you want to automatically compose combining characters */ + #undef ENABLE_COMBINING + ++/* Define if you want proper way to calculate character width */ ++#undef ENABLE_FONT_WIDTH ++ + /* Define if you want handling for rarely used but handy features */ + #undef ENABLE_FRILLS + +diff --git a/configure b/configure +index ed2f2b2..1b72b89 100755 +--- a/configure ++++ b/configure +@@ -739,6 +739,7 @@ enable_combining + enable_xft + enable_font_styles + enable_wide_glyphs ++enable_font_width + enable_pixbuf + enable_startup_notification + enable_transparency +@@ -1414,6 +1415,7 @@ Optional Features: + --enable-xft enable xft support on systems that have it + --enable-font-styles enable bold and italic support + --enable-wide-glyphs enable displaying of wide glyphs ++ --enable-font-width enable proper way to calculate character width + --enable-pixbuf enable integration with gdk-pixbuf for background images + --enable-startup-notification enable freedesktop startup notification support + --enable-transparency enable transparent backgrounds +@@ -4995,6 +4997,7 @@ support_combining=yes + support_8bitctrls=no + support_iso14755=yes + support_styles=yes ++support_font_width=no + support_perl=yes + codesets=all + +@@ -5026,6 +5029,7 @@ then : + support_iso14755=no + support_styles=no + support_wide_glyphs=no ++ support_font_width=no + support_perl=no + codesets= + fi +@@ -5052,6 +5056,7 @@ then : + support_iso14755=yes + support_styles=yes + support_wide_glyphs=yes ++ support_font_width=yes + support_perl=yes + codesets=all + fi +@@ -5177,6 +5182,15 @@ if test "${enable_wide_glyphs+set}" = set; then : + fi + + ++# Check whether --enable-font-width was given. ++if test ${enable_font_width+y} ++then : ++ enableval=$enable_font_width; if test x$enableval = xyes -o x$enableval = xno; then ++ support_font_width=$enableval ++ fi ++fi ++ ++ + # Check whether --enable-pixbuf was given. + if test ${enable_pixbuf+y} + then : +@@ -7681,6 +7695,11 @@ if test x$support_styles = xyes; then + + printf "%s\n" "#define ENABLE_STYLES 1" >>confdefs.h + ++fi ++if test x$support_font_width = xyes; then ++ ++printf "%s\n" "#define ENABLE_FONT_WIDTH 1" >>confdefs.h ++ + fi + if test x$support_iso14755 = xyes; then + +diff --git a/configure.ac b/configure.ac +index 510fa44..54ab35b 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -90,6 +90,7 @@ support_combining=yes + support_8bitctrls=no + support_iso14755=yes + support_styles=yes ++support_font_width=no + support_perl=yes + codesets=all + +@@ -124,6 +125,7 @@ AC_ARG_ENABLE(everything, + support_iso14755=no + support_styles=no + support_wide_glyphs=no ++ support_font_width=no + support_perl=no + codesets= + fi +@@ -150,6 +152,7 @@ AC_ARG_ENABLE(everything, + support_iso14755=yes + support_styles=yes + support_wide_glyphs=yes ++ support_font_width=yes + support_perl=yes + codesets=all + fi +@@ -229,6 +232,12 @@ AC_ARG_ENABLE(wide-glyphs, + support_wide_glyphs=$enableval + fi]) + ++AC_ARG_ENABLE(font-width, ++ [ --enable-font-width enable proper way to calculate character width], ++ [if test x$enableval = xyes -o x$enableval = xno; then ++ support_font_width=$enableval ++ fi]) ++ + AC_ARG_ENABLE(pixbuf, + [ --enable-pixbuf enable integration with gdk-pixbuf for background images], + [if test x$enableval = xyes -o x$enableval = xno; then +@@ -654,6 +663,9 @@ fi + if test x$support_wide_glyphs = xyes; then + AC_DEFINE(ENABLE_WIDE_GLYPHS, 1, Define if you want to display wide glyphs) + fi ++if test x$support_font_width = xyes; then ++ AC_DEFINE(ENABLE_FONT_WIDTH, 1, Define if you want proper way to calculate character width) ++fi + if test x$support_iso14755 = xyes; then + AC_DEFINE(ISO_14755, 1, Define if you want ISO 14755 extended support) + fi +diff --git a/src/rxvtfont.C b/src/rxvtfont.C +index 5d51eea..50f629f 100644 +--- a/src/rxvtfont.C ++++ b/src/rxvtfont.C +@@ -1307,12 +1307,22 @@ rxvt_font_xft::load (const rxvt_fontprop &prop, bool force_prop) + XGlyphInfo g; + XftTextExtents16 (disp, f, &ch, 1, &g); + ++#if ENABLE_FONT_WIDTH ++/* ++ * bukind: don't use g.width as a width of a character! ++ * instead use g.xOff, see e.g.: http://keithp.com/~keithp/render/Xft.tutorial ++ */ ++ int wcw = WCWIDTH (ch); ++ if (wcw > 1) g.xOff = g.xOff / wcw; ++ if (width < g.xOff) width = g.xOff; ++#else + g.width -= g.x; + + int wcw = WCWIDTH (ch); + if (wcw > 0) g.width = (g.width + wcw - 1) / wcw; + + if (width < g.width ) width = g.width; ++#endif + if (height < g.height ) height = g.height; + if (glheight < g.height - g.y) glheight = g.height - g.y; + } diff --git a/x11-terms/rxvt-unicode/files/rxvt-unicode-9.31-line-spacing-fix.patch b/x11-terms/rxvt-unicode/files/rxvt-unicode-9.31-line-spacing-fix.patch new file mode 100644 index 0000000..b6a7ef1 --- /dev/null +++ b/x11-terms/rxvt-unicode/files/rxvt-unicode-9.31-line-spacing-fix.patch @@ -0,0 +1,163 @@ +diff --git a/config.h.in b/config.h.in +index 51e6d76..b9c7e0c 100644 +--- a/config.h.in ++++ b/config.h.in +@@ -12,6 +12,9 @@ + /* Define if you want handling for rarely used but handy features */ + #undef ENABLE_FRILLS + ++/* Define if you want line spacing fix */ ++#undef ENABLE_LINE_SPACING ++ + /* Define if you can embed a perl interpreter */ + #undef ENABLE_PERL + +diff --git a/configure b/configure +index 1b72b89..6b50a6b 100755 +--- a/configure ++++ b/configure +@@ -740,6 +740,7 @@ enable_xft + enable_font_styles + enable_wide_glyphs + enable_font_width ++enable_line_spacing + enable_pixbuf + enable_startup_notification + enable_transparency +@@ -1416,6 +1417,7 @@ Optional Features: + --enable-font-styles enable bold and italic support + --enable-wide-glyphs enable displaying of wide glyphs + --enable-font-width enable proper way to calculate character width ++ --enable-line-spacing enable line spacing fix + --enable-pixbuf enable integration with gdk-pixbuf for background images + --enable-startup-notification enable freedesktop startup notification support + --enable-transparency enable transparent backgrounds +@@ -4998,6 +5000,7 @@ support_8bitctrls=no + support_iso14755=yes + support_styles=yes + support_font_width=no ++support_line_spacing=no + support_perl=yes + codesets=all + +@@ -5030,6 +5033,7 @@ then : + support_styles=no + support_wide_glyphs=no + support_font_width=no ++ support_line_spacing=no + support_perl=no + codesets= + fi +@@ -5057,6 +5061,7 @@ then : + support_styles=yes + support_wide_glyphs=yes + support_font_width=yes ++ support_line_spacing=yes + support_perl=yes + codesets=all + fi +@@ -5191,6 +5196,15 @@ then : + fi + + ++# Check whether --enable-line-spacing was given. ++if test ${enable_line_spacing+y} ++then : ++ enableval=$enable_line_spacing; if test x$enableval = xyes -o x$enableval = xno; then ++ support_line_spacing=$enableval ++ fi ++fi ++ ++ + # Check whether --enable-pixbuf was given. + if test ${enable_pixbuf+y} + then : +@@ -7700,6 +7714,11 @@ if test x$support_font_width = xyes; then + + printf "%s\n" "#define ENABLE_FONT_WIDTH 1" >>confdefs.h + ++fi ++if test x$support_line_spacing = xyes; then ++ ++printf "%s\n" "#define ENABLE_LINE_SPACING 1" >>confdefs.h ++ + fi + if test x$support_iso14755 = xyes; then + +diff --git a/configure.ac b/configure.ac +index 54ab35b..1cffda6 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -91,6 +91,7 @@ support_8bitctrls=no + support_iso14755=yes + support_styles=yes + support_font_width=no ++support_line_spacing=no + support_perl=yes + codesets=all + +@@ -126,6 +127,7 @@ AC_ARG_ENABLE(everything, + support_styles=no + support_wide_glyphs=no + support_font_width=no ++ support_line_spacing=no + support_perl=no + codesets= + fi +@@ -153,6 +155,7 @@ AC_ARG_ENABLE(everything, + support_styles=yes + support_wide_glyphs=yes + support_font_width=yes ++ support_line_spacing=yes + support_perl=yes + codesets=all + fi +@@ -238,6 +241,12 @@ AC_ARG_ENABLE(font-width, + support_font_width=$enableval + fi]) + ++AC_ARG_ENABLE(line-spacing, ++ [ --enable-line-spacing enable line spacing fix], ++ [if test x$enableval = xyes -o x$enableval = xno; then ++ support_line_spacing=$enableval ++ fi]) ++ + AC_ARG_ENABLE(pixbuf, + [ --enable-pixbuf enable integration with gdk-pixbuf for background images], + [if test x$enableval = xyes -o x$enableval = xno; then +@@ -666,6 +675,9 @@ fi + if test x$support_font_width = xyes; then + AC_DEFINE(ENABLE_FONT_WIDTH, 1, Define if you want proper way to calculate character width) + fi ++if test x$support_line_spacing = xyes; then ++ AC_DEFINE(ENABLE_LINE_SPACING, 1, Define if you want line spacing fix) ++fi + if test x$support_iso14755 = xyes; then + AC_DEFINE(ISO_14755, 1, Define if you want ISO 14755 extended support) + fi +diff --git a/src/rxvtfont.C b/src/rxvtfont.C +index 50f629f..9420a22 100644 +--- a/src/rxvtfont.C ++++ b/src/rxvtfont.C +@@ -1279,10 +1279,21 @@ rxvt_font_xft::load (const rxvt_fontprop &prop, bool force_prop) + break; + } + ++#ifdef ENABLE_LINE_SPACING ++/* ++ * use ascent, descent and height from XftFont *f instead of FT_Face face. ++ * this somehow reproduces the behaviour of the line height as seen on xterm. ++ */ ++ ascent = f->ascent; ++ descent = f->descent; ++ height = max (ascent + descent, f->height); ++ width = 0; ++#else + ascent = (face->size->metrics.ascender + 63) >> 6; + descent = (-face->size->metrics.descender + 63) >> 6; + height = max (ascent + descent, (face->size->metrics.height + 63) >> 6); + width = 0; ++#endif + + bool scalable = face->face_flags & FT_FACE_FLAG_SCALABLE; + diff --git a/x11-terms/rxvt-unicode/files/rxvt-unicode-9.31-perl5.38.patch b/x11-terms/rxvt-unicode/files/rxvt-unicode-9.31-perl5.38.patch new file mode 100644 index 0000000..c5cb346 --- /dev/null +++ b/x11-terms/rxvt-unicode/files/rxvt-unicode-9.31-perl5.38.patch @@ -0,0 +1,13 @@ +Perl 5.38 does not handle empty locale names. Backported upstream fix. + +--- a/src/rxvtperl.xs ++++ b/src/rxvtperl.xs +@@ -399,7 +399,7 @@ rxvt_perl_interp::init () + { + if (!perl) + { +- rxvt_push_locale (""); // perl init destroys current locale ++ rxvt_push_locale ("C"); // perl init destroys current locale + + { + perl_environ = rxvt_environ;