xmenu \- menu utility for X
.SH SYNOPSIS
.B xmenu
-.RB [ \-iw ]
+.RB [ \-fiw ]
.RB [ -p
.IR position ]
.RI [ title ]
.PP
The options are as follows:
.TP
+.B -f
+Make glyphs align based solely on the first font specified.
+Without this option, glyphs are aligned based on the font in which they are found.
+This option may correct alignment of CJK glyphs
+if a CJK font is specified after a Latin font,
+but may break the alignment of other glyphs in some cases.
+.TP
.B -i
Disable icons.
This makes xmenu loading faster when not using icons.
static Atom netatom[NetLast];
/* flags */
+static int fflag = 0; /* whether glyphs should align based on the first font */
static int iflag = 0; /* whether to disable icons */
static int mflag = 0; /* whether the user specified a monitor with -p */
static int pflag = 0; /* whether the user specified a position with -p */
XClassHint classh;
int ch;
- while ((ch = getopt(argc, argv, "ip:w")) != -1) {
+ while ((ch = getopt(argc, argv, "fip:w")) != -1) {
switch (ch) {
+ case 'f':
+ fflag = 1;
+ break;
case 'i':
iflag = 1;
break;
FcChar32 ucode;
XftFont *currfont;
int textlen = 0;
+ int texty;
+
+ texty = y + (h - (dc.fonts[0]->ascent + dc.fonts[0]->descent))/2 + dc.fonts[0]->ascent;
s = text;
while (*s) {
textlen += ext.xOff;
if (draw) {
- int texty;
-
- texty = y + (h - (currfont->ascent + currfont->descent))/2 + currfont->ascent;
+ if (!fflag)
+ texty = y + (h - (currfont->ascent + currfont->descent))/2 + currfont->ascent;
XftDrawStringUtf8(draw, color, currfont, x, texty,
(XftChar8 *)s, len);
x += ext.xOff;
static void
usage(void)
{
- (void)fprintf(stderr, "usage: xmenu [-iw] [-p position] [title]\n");
+ (void)fprintf(stderr, "usage: xmenu [-fiw] [-p position] [title]\n");
exit(1);
}