Hi, Per!
* Per Olofsson <[EMAIL PROTECTED]> [2003-10-17 21:12]:
> You're talking about the strange font now, right? "fixed" works?
Yup. But only in the non-UTF version...
> > I guess one could live with this and I don't even know if there's a way
> > ion could check the encoding of the font to make sure it matches the
> > locale.
>
> I thought that was X's responsibility.
I don't know. But if I start xterm with the strange font there's no
error from X11.
> But that's not a unicode font. Shouldn't you use
> "-misc-fixed-bold-r-normal--18-120-100-100-c-90-iso10646-1"?
Ah well, I didn't realize that I *have* to use UTF-8 if support for it
is enabled in ion. Is that what you're saying? If so then I really would
suggest taking out the UTF support as you can't expect from anyone
installing ion that he switches to using UTF-8 fonts and all...
(After writing this mail I don't think it works this way).
But anyway I tried your font and ironically I get an error message:
----snip----
>> Could not load font
>> "-misc-fixed-bold-r-normal--18-120-100-100-c-90-iso10646-1", trying
"fixed"
>> Failed loading fallback font.
>> Stack trace:
0 [C]: in 'de_do_define_style'
1 /usr/share/ion-devel/delib.lua:68: in 'de_define_style'
2 /home/mfischer/.ion-devel/draw.lua:85
[Skipping unnamed C functions.]
----snip----
Now, I *have* checked that the font exists and it works in an xterm too.
I get the same error message when starting ion by "LC_ALL=de_DE
ion-devel" only this time ion succeeds in loading the fallback font.
Using "-misc-fixed-bold-r-normal--18-120-100-100-c-90-*-*" succeeds for
"LC_ALL=de_DE" and results in invisible fonts for "[EMAIL PROTECTED]"
but this time without the error message...
Looking at the code it's this function that fails:
XCreateFontSet(wglobal.dpy, fontname, &dummy_missing,
&dummy_missing_n, &dummy_def);
The manpage says:
----snip----
If XCreateFontSet is unable to create the font set, either because
there is insufficient memory or because the current locale is not sup-
ported, XCreateFontSet returns NULL, missing_charset_list_return is
set to NULL, and missing_charset_count_return is set to zero.
[...]
If no font exists for any of the required charsets or if the locale
definition in Xlib requires that a font exist for a particular charset
and a font is not found for that charset, XCreateFontSet returns NULL.
Otherwise, XCreateFontSet returns a valid XFontSet to font_set.
----snip----
So it seems that LC_ALL set to de_DE or [EMAIL PROTECTED] requires ISO8559-1
and ISO8859-15 fonts respectively. (And we also see X enforcing that,
what an irony :))
Ah well, I'll go playing a bit with the code - hopefully learning a bit
about X11 and fonts along the way... :)
I'll be back when I know a bit more...
Cheers,
Mika