Browse Source

xap/dmenu: Added UTF-8 support.

slackware-14.2
Damien Goutte-Gattat 13 years ago
parent
commit
8b6d555967
  1. 21
      xap/dmenu/dmenu-4.0-utf8.diff
  2. 5
      xap/dmenu/dmenu.SlackBuild

21
xap/dmenu/dmenu-4.0-utf8.diff

@ -0,0 +1,21 @@
diff -Naur dmenu-4.0.orig/dmenu.c dmenu-4.0.mod/dmenu.c
--- dmenu-4.0.orig/dmenu.c 2009-04-18 13:50:04.000000000 +0200
+++ dmenu-4.0.mod/dmenu.c 2010-02-08 11:08:19.986605992 +0100
@@ -234,7 +234,7 @@
for(i = len; i && i > len - 3; buf[--i] = '.');
XSetForeground(dpy, dc.gc, col[ColFG]);
if(dc.font.set)
- XmbDrawString(dpy, dc.drawable, dc.font.set, dc.gc, x, y, buf, len);
+ Xutf8DrawString(dpy, dc.drawable, dc.font.set, dc.gc, x, y, buf, len);
else
XDrawString(dpy, dc.drawable, dc.gc, x, y, buf, len);
}
@@ -652,7 +652,7 @@
XRectangle r;
if(dc.font.set) {
- XmbTextExtents(dc.font.set, text, len, NULL, &r);
+ Xutf8TextExtents(dc.font.set, text, len, NULL, &r);
return r.width;
}
return XTextWidth(dc.font.xfont, text, len);

5
xap/dmenu/dmenu.SlackBuild

@ -1,6 +1,6 @@
#!/bin/bash
# Build script for Slackware
# Copyright (C) 2008,2009 Damien Goutte-Gattat
# Copyright (C) 2008,2009,2010 Damien Goutte-Gattat
#
# Redistribution and use of this script, with or without modifications,
# is permitted provided that the following conditions are met:
@ -32,7 +32,7 @@ WGET=${WGET:-http://code.suckless.org/dl/tools/$ARCHIVE}
# Built package infos
NAMEPKG=${NAMEPKG:-dmenu}
BUILD=${BUILD:-2GGD}
BUILD=${BUILD:-3GGD}
ARCH=${ARCH:-i486}
EXT=${EXT:-txz}
@ -83,6 +83,7 @@ echo "Building $ARCHIVE..."
tar xf $CWD/$ARCHIVE
cd $NAME
patch -p 1 < $CWD/dmenu-4.0-vertical_meillo.diff
patch -p 1 < $CWD/dmenu-4.0-utf8.diff
sed -i "s,/lib,/lib$LIBDIRSUFFIX,
s,^CFLAGS =,CFLAGS = $CPUOPT," config.mk
make

Loading…
Cancel
Save