Subject: FVWM: making a shadowed title bar text

From: "Riswick, J.G.A. van" <[email-masked]>
Date: Sat, 17 Nov 2001 21:14:45 +0100

HI

I'm trying to make a 'shadowed' title bar text for fvwm2
which should look like so:

http://www.xs4all.nl/~josvanr/shadowtext.png

So I first want to draw the text in a dark color, and 
then shifted over one pixel diagonally, draw it in a light color.
I tried to use the shadow gc for this:

    if(t->name != (char *)NULL) {

      XDrawString(dpy, t->title_w, sgc, hor_off+1,
                  t->title_font.y + 2, t->name, strlen(t->name));

      XDrawString(dpy, t->title_w, Scr.TitleGC, hor_off,
                  t->title_font.y + 1, t->name, strlen(t->name));
    }

(border.c, line 1337)

but it doesn't display correctly, the shadow gc seems to have
the wrong font:

http://www.xs4all.nl/~josvanr/oops.png

how should I correct this?

best regards

jos
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Dan Espen <[email-masked]>
Date: Mon, 19 Nov 2001 09:48:24 -0500

> but it doesn't display correctly, the shadow gc seems to have

I believe the problem is that "sgc" hasn't been prepared to
use the titlebar font.

I was able to get this to work by storing the shadow color
in the common_decorations_type structure in
get_common_decorations and then using this:

      XSetForeground(dpy, Scr.TitleGC, cd->shadow_color);
      XDrawString(dpy, t->title_w, Scr.TitleGC, hor_off+1,
                  t->title_font.y + 2, t->name, strlen(t->name));
      XSetForeground(dpy, Scr.TitleGC, cd->fore_color);
      XDrawString(dpy, t->title_w, Scr.TitleGC, hor_off,
		  t->title_font.y + 1, t->name, strlen(t->name));

-- 
Dan Espen
444 Hoes Lane  Room RRC 1C-214           E-mail: [email-masked]
Piscataway, NJ 08854                     Phone: (732) 699-5570
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].