From d23bd555ee61d82b7c41efe4bc0964125a3a9eb6 Mon Sep 17 00:00:00 2001 From: Jan S Date: Sun, 2 Feb 2014 23:01:31 +0100 Subject: [PATCH 1/5] rxvt-unicode: added build option font_patches. --- .../rxvt-unicode/files/font-width-fix.patch | 26 +++++++++++++++++++ .../rxvt-unicode/files/line-spacing-fix.patch | 25 ++++++++++++++++++ srcpkgs/rxvt-unicode/template | 11 +++++++- 3 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/rxvt-unicode/files/font-width-fix.patch create mode 100644 srcpkgs/rxvt-unicode/files/line-spacing-fix.patch 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 From 6ae919d96ffae43700128ca8cd012886a3c4ce49 Mon Sep 17 00:00:00 2001 From: Jan S Date: Mon, 3 Feb 2014 09:25:08 +0100 Subject: [PATCH 2/5] Removed build option font_patches. Apply patches without option. --- srcpkgs/rxvt-unicode/template | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/srcpkgs/rxvt-unicode/template b/srcpkgs/rxvt-unicode/template index 1f8db402bd2..6da0f000cb4 100644 --- a/srcpkgs/rxvt-unicode/template +++ b/srcpkgs/rxvt-unicode/template @@ -1,7 +1,7 @@ # Template build file for 'rxvt-unicode'. pkgname=rxvt-unicode version=9.19 -revision=1 +revision=2 build_style=gnu-configure configure_args=" --with-terminfo=/usr/share/terminfo --enable-256-color @@ -23,6 +23,10 @@ long_desc=" locale-correct input and output. It also supports mixing multiple fonts at the same time, including Xft fonts." +pre_configure() { + patch -p0 -i ${FILESDIR}/font-width-fix.patch + patch -p0 -i ${FILESDIR}/line-spacing-fix.patch +} post_install() { vinstall ${FILESDIR}/${pkgname}.desktop 644 usr/share/applications @@ -59,10 +63,3 @@ 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 From 516dcf8c752eefbe2a11c0ebfef85f6f5519a892 Mon Sep 17 00:00:00 2001 From: Jan S Date: Mon, 3 Feb 2014 09:28:07 +0100 Subject: [PATCH 3/5] Removed unneeded lines. --- srcpkgs/rxvt-unicode/template | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/srcpkgs/rxvt-unicode/template b/srcpkgs/rxvt-unicode/template index 6da0f000cb4..3b6e83c11ae 100644 --- a/srcpkgs/rxvt-unicode/template +++ b/srcpkgs/rxvt-unicode/template @@ -34,11 +34,10 @@ post_install() { } # Package build options -build_options="gdk_pixbuf perl startup_notification font_patches" +build_options="gdk_pixbuf perl startup_notification" 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" From 033fbfad65134664bb812c92e5e3cae288f4f104 Mon Sep 17 00:00:00 2001 From: Jan S Date: Mon, 3 Feb 2014 09:30:34 +0100 Subject: [PATCH 4/5] don't apply patches by hand. let XBPS handle it. --- srcpkgs/rxvt-unicode/template | 5 ----- 1 file changed, 5 deletions(-) diff --git a/srcpkgs/rxvt-unicode/template b/srcpkgs/rxvt-unicode/template index 3b6e83c11ae..4ef0c89515e 100644 --- a/srcpkgs/rxvt-unicode/template +++ b/srcpkgs/rxvt-unicode/template @@ -23,11 +23,6 @@ long_desc=" locale-correct input and output. It also supports mixing multiple fonts at the same time, including Xft fonts." -pre_configure() { - patch -p0 -i ${FILESDIR}/font-width-fix.patch - patch -p0 -i ${FILESDIR}/line-spacing-fix.patch -} - post_install() { vinstall ${FILESDIR}/${pkgname}.desktop 644 usr/share/applications vinstall ${FILESDIR}/${pkgname}.png 644 usr/share/pixmaps From e6b9cd95608de13418c8010a73ceee5bde83d626 Mon Sep 17 00:00:00 2001 From: Jan S Date: Mon, 3 Feb 2014 09:36:36 +0100 Subject: [PATCH 5/5] moved patches into the right dir. --- srcpkgs/rxvt-unicode/{files => patches}/font-width-fix.patch | 0 srcpkgs/rxvt-unicode/{files => patches}/line-spacing-fix.patch | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename srcpkgs/rxvt-unicode/{files => patches}/font-width-fix.patch (100%) rename srcpkgs/rxvt-unicode/{files => patches}/line-spacing-fix.patch (100%) diff --git a/srcpkgs/rxvt-unicode/files/font-width-fix.patch b/srcpkgs/rxvt-unicode/patches/font-width-fix.patch similarity index 100% rename from srcpkgs/rxvt-unicode/files/font-width-fix.patch rename to srcpkgs/rxvt-unicode/patches/font-width-fix.patch diff --git a/srcpkgs/rxvt-unicode/files/line-spacing-fix.patch b/srcpkgs/rxvt-unicode/patches/line-spacing-fix.patch similarity index 100% rename from srcpkgs/rxvt-unicode/files/line-spacing-fix.patch rename to srcpkgs/rxvt-unicode/patches/line-spacing-fix.patch