Subject: FVWM: Alternative DefaultFont feature

From: Johan Svedberg <[email-masked]>
Date: Sun, 15 Feb 2004 17:21:51 +0100

Hi!

Basically what I would like to do is something like this:

    DefaultFont foo bar

Where FVWM would use bar if foo is not availible on the system. Very
similar to the way it falls back on 'fixed'.

Another nice thing would be to be able to say something like this in the
configuration file:

    +    "XTerm"    Exec exec xterm -fn $[DefaultFont] &

Or is there currently some way to accomplish what I'm trying to do here?

-- 
Johan Svedberg, [email-masked], http://johan.svedberg.pp.se/
--
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: Sun, 15 Feb 2004 11:46:50 -0500

> Or is there currently some way to accomplish what I'm trying to do here?

You could PipeRead a shell that does something like this:

xlsfonts -fn $1 2>&1 | grep unmatched >/dev/null 2>&1
if [ $? = 0 ] ; then
  printf "SetEnv DefaultFont $2"
else
  printf "SetEnv DefaultFont $1"
fi

In the 2.5.x releases, there is the TestRc commmand.
It's possible that you could directly do this in Fvwm
using "Silent", "DefaultFont" and "TestRc" but I haven't tried it.

-- 
Dan Espen                           E-mail: [email-masked]

---

From: Johan Svedberg <[email-masked]>
Date: Sun, 15 Feb 2004 18:22:13 +0100

* Feb 15 17:49 Dan Espen <[email-masked]>:
> > Another nice thing would be to be able to say something like this in
> > the configuration file:
> >
> xlsfonts -fn $1 2>&1 | grep unmatched >/dev/null 2>&1 if [ $? = 0 ] ;
> then printf "SetEnv DefaultFont $2" else printf "SetEnv DefaultFont
> $1" fi

Yeah, I thought about doing something like that. The problem I had was
that xlsfonts won't show FreeType fonts, you don't happend to know a
good way to list those?

[...]

---

From: Dan Espen <[email-masked]>
Date: Sun, 15 Feb 2004 12:31:49 -0500

> that xlsfonts won't show FreeType fonts, you don't happend to know a

Google led me to this answer:

Test whether the font can be displayed with a FreeType 2 demo program,
e.g. ftview.  Chances are high that it is not an FT2 problem if that
works...

I have an older X server so I can't test it out.
I don't know if that's a GUI or not.
Maybe you should try freetype.org.
I'd say xlsfonts is broken if it doesn't handle FreeType.

---

From: Tavis Ormandy <[email-masked]>
Date: Sun, 15 Feb 2004 18:09:37 +0000

> that xlsfonts won't show FreeType fonts, you don't happend to know a

fc-list from the fontconfig package?

$ apropos fc-list
fc-list              (1)  - list available fonts

-- 
-------------------------------------
[email-masked] | finger me for my gpg key.
-------------------------------------------------------
--
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: Johan Svedberg <[email-masked]>
Date: Sun, 15 Feb 2004 19:12:40 +0100

* Feb 15 19:10 Tavis Ormandy <[email-masked]>:
> > Yeah, I thought about doing something like that. The problem I had
> > was that xlsfonts won't show FreeType fonts, you don't happend to
> > know a good way to list those?
>

Thanks. Time to start putting something together then... :-)

[...]

---

From: Mikhael Goikhman <[email-masked]>
Date: Sun, 15 Feb 2004 18:41:47 +0000

> similar to the way it falls back on 'fixed'.

This is already possible in 2.5.x. Use "DefaultFont foo;bar", like:

  DefaultFont "xft:Luxi Mono;-adobe-courier-bold-r-normal--12-*-iso8859-*"

> Or is there currently some way to accomplish what I'm trying to do here?

Keep in mind that the fvwm font specification is richer than the one
supported by xterm and other programs, see "FONT NAMES" in the man page.

Regards,
Mikhael.