Re: Unix font warning -- CJK-related...


Subject: Re: Unix font warning -- CJK-related...
From: Anthony Fok (anthony@thizlinux.com)
Date: Wed Dec 12 2001 - 17:08:08 CST


Hello Tomas,

On Wed, Dec 12, 2001 at 10:02:31PM -0000, Tomas Frydrych wrote:
> > For CJK users with properly configured system, such warning is a false
> > alarm. Yes, turning this warning message off in the Preferences dialogue
> > would get rid of it, but then AbiWord can't catch real problems then,
> > say, after the user upgraded his/her system and something broke.
> I accept that it can be a false alarm, not just for CJK users, but for
> instance, for all RedHat 7 users. But I would rather issue a false
> warning the first time AW is run, then no-warning if one was
> needed. We can rephrase and expand the message so that it is
> clear that this is a potential problem rather than an existing one,
> and expand the instructions in the helpfile.

Hehe, good idea! :-)

> To the pseudocode: my concern about merely the contents of the
> fonts.dir file under the CJK locales is that it does not guarantee
> that the fonts are in the path, it only makes it probable, i.e., there
> is a possibility that there could be a problem, and by warning the
> user, we avoid panic if there is. Even if the possibility is small, I
> would still prefer erring on the side of caution, because our
> experience shows that very few users can deal with the situation
> when it does not work.

Actually, besides just testing the contents, I suggested using
XLoadFont or similar functions to test each entry in the CJK fonts.dir.
If X can't load any one of the entries for whatever, then warn:

    The font "-Arphic-AR PL Mingti2L Big5-medium-r-normal--0-0-0-0-c-0-big5-0"
    cannot be loaded by your X server! Please check your font settings.

Otherwise, go on merrily without warning. :-) I am not sure if there
is a performance penalty in calling XLoadFont multiple times to check the
fonts, but that should be safe enough, right? :-) (I have hardly ever
written programs that use X functions, so I am not 100% sure. :-)

> Now, I agree that the present way it works is not 100%
> satisfactory; if you can come up with a solution that will make it
> possible to ascertain that the fonts we need are available, and even
> better one that would work for non-CJK locales too, then I would be
> more than happy to comit it, because I do not like popping false
> warnings either.

Great! I'll try to find some time to write it, perhaps in between long
stretches of mozilla/anaconda/kernel/glibc compilations. :-)

> > It would be ideal if this warning message could show _which_ fontpath
> > is causing the error. Is it an easy thing to do? :-)
> > (I didn't examine the source code in detail.)
> That is not that easy -- we could dump the whole of the original font
> path, and we could print the offending entry if we detected it
> ourselves, but if the problem is that some of the directories contain
> fonts that the X server does not support, we have no way of telling
> which directory it is, and I am not sure that this information would
> be particularly useful to the user. I think improving the instructions
> what to do when this appears is a better alternative. The procedure
> is like this:
>
> (1) Ignore the warning, and if things work fine, just turn it off in the
> preferences.
> (2) If there is problem with the fonts do this ....

Yes, that would be a good solution for the time being. :-)

> I appreciate your feedback and contributions.

And I appreciate your patience and detail explanations too.
You have been a great help! :-)

Oh, BTW, I have been testing AbiWord under several different locales
(LANG=C, LANG=zh_TW.Big5, LANG=zh_CN.GB2312, etc.) and briefly glancing
through the source code. Currently, AbiWord can only display text that is
within the locale in which AbiWord is started, otherwise it is replaced by
\xBO. However, since AbiWord already stores all text as Unicode internally,
what strikes me is that AbiWord is *so-close* to actually be able to display
_all_ text in the document regardless of the locale it was started in,
just like OpenOffice and Microsoft Word.

What I mean is this: instead of just reading the font subdir of the current
locale, let's read them all in (e.g. zh-TW, zh-CN, ja, ko). A character
cannot be found in the Big5 encoding? Let's try GB2312. Not there? Let's
try ja-JP. Good, it's there, so let's get that glyph from that Japanese
font. Is it possible? (Or is it already on your todo list? :-)

Cheers,

Anthony

-- 
Anthony Fok Tung-Ling
ThizLinux Laboratory   <anthony@thizlinux.com> http://www.thizlinux.com/
Debian Chinese Project <foka@debian.org>       http://www.debian.org/intl/zh/
Come visit Our Lady of Victory Camp!           http://www.olvc.ab.ca/



This archive was generated by hypermail 2b25 : Wed Dec 12 2001 - 17:04:54 CST