Discussion:
multiple fonts in wmii
Yuval Hager
2009-11-02 06:52:39 UTC
Permalink
Hi there,

Can wmii support multiple fonts? This way if glyphs are not found in the
first font, the next one is being searched.
I am looking for some functionality along the lines of
http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.7.pod#How_does_rxvt_unicode_choose_fonts
(yes, this link actually works).

Most fonts do not contain the glyphs for my native language, so I am ending
up with blank squares instead. If I modify wmii font to one that contains
native glyphs, the latin letters are just ugly..

OTOH, shouldn't fontconfig do this (select matching fonts by language) by
default? it obviously is not the case in my setup, and I couldn't find any
docs on how to make this work the way I expect it to.

--yuval
Kris Maglione
2009-11-02 07:01:15 UTC
Permalink
Post by Yuval Hager
Hi there,
Can wmii support multiple fonts? This way if glyphs are not found in the
first font, the next one is being searched.
I am looking for some functionality along the lines of
http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.7.pod#How_does_rxvt_unicode_choose_fonts
(yes, this link actually works).
Most fonts do not contain the glyphs for my native language, so I am ending
up with blank squares instead. If I modify wmii font to one that contains
native glyphs, the latin letters are just ugly..
OTOH, shouldn't fontconfig do this (select matching fonts by language) by
default? it obviously is not the case in my setup, and I couldn't find any
docs on how to make this work the way I expect it to.
wmii supports multiple fonts in exactly the same way as rxvt.
Just list them separated by commas. If you want fontconfig,
prefix the font string with xft:, otherwise you get regular X11
fontsets, which have atrocious unicode support.
--
Kris Maglione

The tragedy of modern war is not so much that young men die but that
they die fighting each other, instead of their real enemies back home
in the capitals.
--Edward Abbey
Yuval Hager
2009-11-02 12:09:07 UTC
Permalink
Post by Kris Maglione
Post by Yuval Hager
Hi there,
Can wmii support multiple fonts? This way if glyphs are not found in the
first font, the next one is being searched.
I am looking for some functionality along the lines of
http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.7.pod#How_
does_rxvt_unicode_choose_fonts (yes, this link actually works).
Most fonts do not contain the glyphs for my native language, so I am
ending up with blank squares instead. If I modify wmii font to one that
contains native glyphs, the latin letters are just ugly..
OTOH, shouldn't fontconfig do this (select matching fonts by language)
by default? it obviously is not the case in my setup, and I couldn't
find any docs on how to make this work the way I expect it to.
wmii supports multiple fonts in exactly the same way as rxvt.
Just list them separated by commas. If you want fontconfig,
prefix the font string with xft:, otherwise you get regular X11
fontsets, which have atrocious unicode support.
I've tried this, and it looks like it is not working.
Running
$ wmiir xwrite /ctl font 'xft:Arial'
presents the Hebrew characters correctly (in windows title, and mpd status area), while
$ wmiir xwrite /ctl font 'xft:terminus-10'
presents just white boxes instead.

So I try:
$ wmiir xwrite /ctl font 'xft:terminus-10,xft:Arial'
but no change from previous (white boxes).

I also tried not using xft for the first font:
$ wmiir xwrite /ctl font '-*-terminus-*-*-*-*-12-*-*-*-*-*-iso8859-1,xft:Arial'

but they all give the same result.

I've tried to run urxvt with the same settings, and it seem to work fine:
$ urxvt -fn '-*-fixed-medium-r-*-*-14-*-*-*-*-*-*-*,xft:Miriam Mono CLM'

(in testing the terminal, I used a mono-spaced font - but all fonts give the same result).

I must be missing something?

my wmii version is hg2582, and I am using rumai on top.
ן,
--yuval
Kris Maglione
2009-11-04 02:54:08 UTC
Permalink
Post by Yuval Hager
I've tried this, and it looks like it is not working.
Running
$ wmiir xwrite /ctl font 'xft:Arial'
presents the Hebrew characters correctly (in windows title, and mpd status area), while
$ wmiir xwrite /ctl font 'xft:terminus-10'
presents just white boxes instead.
$ wmiir xwrite /ctl font 'xft:terminus-10,xft:Arial'
but no change from previous (white boxes).
$ wmiir xwrite /ctl font '-*-terminus-*-*-*-*-12-*-*-*-*-*-iso8859-1,xft:Arial'
but they all give the same result.
$ urxvt -fn '-*-fixed-medium-r-*-*-14-*-*-*-*-*-*-*,xft:Miriam Mono CLM'
(in testing the terminal, I used a mono-spaced font - but all fonts give the same result).
I must be missing something?
Well, first of all, you can only specify xft: once, at the
begining of the spec. You either get Xft or you don't, you can't
mix them. Second, it seems that Xft isn't as smart as I thought
it was. As far as I can tell, the only thing I can do is query
the fonts myself with fontconfig and render the individual
glyphs myself. Given the general bulk of code required to do
that, and the likelihood of errors, I'm not especially willing
to add it, but I may consider it if anyone has suggestions on
how to do it cleanly. I'm not willing to link in Pango or Cairo,
for very obvious reasons.

There is another option, which is to generate the composite
fonts externally. I'm sure there must be apps to do this, but I
can't name any names off hand.
--
Kris Maglione

I had a running compiler and nobody would touch it. They told me
computers could only do arithmetic.
--Rear Admiral Grace Hopper
Yuval Hager
2009-11-04 12:18:57 UTC
Permalink
Post by Kris Maglione
Post by Yuval Hager
I've tried this, and it looks like it is not working.
Running
$ wmiir xwrite /ctl font 'xft:Arial'
presents the Hebrew characters correctly (in windows title, and mpd
status area), while $ wmiir xwrite /ctl font 'xft:terminus-10'
presents just white boxes instead.
$ wmiir xwrite /ctl font 'xft:terminus-10,xft:Arial'
but no change from previous (white boxes).
$ wmiir xwrite /ctl font
'-*-terminus-*-*-*-*-12-*-*-*-*-*-iso8859-1,xft:Arial'
but they all give the same result.
I've tried to run urxvt with the same settings, and it seem to work
fine: $ urxvt -fn '-*-fixed-medium-r-*-*-14-*-*-*-*-*-*-*,xft:Miriam
Mono CLM'
(in testing the terminal, I used a mono-spaced font - but all fonts give
the same result).
I must be missing something?
Well, first of all, you can only specify xft: once, at the
begining of the spec. You either get Xft or you don't, you can't
mix them.
so how on earth can you specify a list of fonts? I don't know much about
xft, but readin http://fontconfig.org/fontconfig-user.html, it mentions
that commas are used to specify lists of values,
like 'xft:terminus-10:lang=en,ja'.
If someone knows how to specify a list of fonts to xft (maybe even a font
per language?), it might help - I couldn't get it from the docs.
Post by Kris Maglione
Second, it seems that Xft isn't as smart as I thought
it was. As far as I can tell, the only thing I can do is query
the fonts myself with fontconfig and render the individual
glyphs myself. Given the general bulk of code required to do
that, and the likelihood of errors, I'm not especially willing
to add it, but I may consider it if anyone has suggestions on
how to do it cleanly. I'm not willing to link in Pango or Cairo,
for very obvious reasons.
Thanks for looking into this.
I glanced at urxvt's code, and it does seem it goes to great length to
display the correct characters (well, as much as you can understand from
reading C++ code), and I understand your rejection from this amount of code
and complexity. it does not have a good gain/effort ratio.

I haven't even asked about right-to-left support, but I am going to give up
before that :)

--y

Loading...