rxvt-unicode: added build option font_patches.

This commit is contained in:
Jan S 2014-02-02 23:01:31 +01:00
parent 0837fd47f5
commit d23bd555ee
3 changed files with 61 additions and 1 deletions

View File

@ -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;
}

View File

@ -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);

View File

@ -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