diff --git a/srcpkgs/rxvt-unicode/files/font-width-fix.patch b/srcpkgs/rxvt-unicode/files/font-width-fix.patch new file mode 100644 index 00000000000..811d9e615ab --- /dev/null +++ b/srcpkgs/rxvt-unicode/files/font-width-fix.patch @@ -0,0 +1,26 @@ +--- src/rxvtfont.C.bukind 2007-11-30 14:36:33.000000000 +0600 ++++ src/rxvtfont.C 2007-11-30 14:39:29.000000000 +0600 +@@ -1171,12 +1171,21 @@ + XGlyphInfo g; + XftTextExtents16 (disp, f, &ch, 1, &g); + ++/* ++ * 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 ++ + 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; ++ */ ++ int wcw = WCWIDTH (ch); ++ if (wcw > 1) g.xOff = g.xOff / wcw; ++ if (width < g.xOff) width = g.xOff; ++ + if (height < g.height ) height = g.height; + if (glheight < g.height - g.y) glheight = g.height - g.y; + } + + diff --git a/srcpkgs/rxvt-unicode/files/line-spacing-fix.patch b/srcpkgs/rxvt-unicode/files/line-spacing-fix.patch new file mode 100644 index 00000000000..8431c4fa0cb --- /dev/null +++ b/srcpkgs/rxvt-unicode/files/line-spacing-fix.patch @@ -0,0 +1,25 @@ +--- src/rxvtfont.C.orig 2011-07-20 22:19:29.878012201 -0300 ++++ src/rxvtfont.C 2011-07-20 22:19:33.634671723 -0300 +@@ -1237,11 +1237,22 @@ + + FT_Face face = XftLockFace (f); + ++/* ++ * 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 = (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; + ++ */ ++ ++ ascent = f->ascent; ++ descent = f->descent; ++ height = max (ascent + descent, f->height); ++ width = 0; ++ + bool scalable = face->face_flags & FT_FACE_FLAG_SCALABLE; + + XftUnlockFace (f); diff --git a/srcpkgs/rxvt-unicode/template b/srcpkgs/rxvt-unicode/template index b6cc3849749..1f8db402bd2 100644 --- a/srcpkgs/rxvt-unicode/template +++ b/srcpkgs/rxvt-unicode/template @@ -23,16 +23,18 @@ long_desc=" locale-correct input and output. It also supports mixing multiple fonts at the same time, including Xft fonts." + post_install() { vinstall ${FILESDIR}/${pkgname}.desktop 644 usr/share/applications vinstall ${FILESDIR}/${pkgname}.png 644 usr/share/pixmaps } # Package build options -build_options="gdk_pixbuf perl startup_notification" +build_options="gdk_pixbuf perl startup_notification font_patches" desc_option_gdk_pixbuf="Enable support to use transparency via gdk-pixbuf" desc_option_perl="Enable support for perl bindings" desc_option_startup_notification="Enable support for desktop notification" +desc_option_font_patches="Enable font width settings" # Enable startup-notification by default. build_options_default="startup_notification" @@ -57,3 +59,10 @@ if [ "$build_option_startup_notification" ]; then else configure_args+=" --disable-startup-notification" fi + +if [ "$build_option_font_patches" ]; then + pre_configure() { + patch -p0 -i ${FILESDIR}/font-width-fix.patch + patch -p0 -i ${FILESDIR}/line-spacing-fix.patch + } + fi