Thanks for the replies.

The first thing to realize here is that because we're using old Xaw widgets
and the old X core fonts mechanism, nothing is going to work great.
Everyone's effort for years has been to make the new Xft font mechanism work
well, convert programs to use it, and make nice fonts that work with it.
(BTW, I don't think it's worthwhile thinking about converting the Xaw-based
xboard to use Xft. It would require drawing all text to be done in a
completely different way and I doubt it's even feasible to do with Xaw
widgets. Efforts are better spent on the GTK branch.)

Next... XCreateFontSet is meant to do the kind of thing you've being trying
to do by hand or suggesting we write our own code to do. A little
background: the "iso8859-n" (for some n) or "iso10646-1" or "koi8-r" etc. at
the end of a font name is just an encoding -- it says how character numbers
map to glyphs. iso10646-1 means Unicode, while iso8859-n is one of several
different 8-bit extensions of ASCII that were invented before Unicode.
koi8-r and koi8-u are encodings that were commonly used for Russian and
Ukrainian before Unicode. The encoding doesn't tell you for sure what
characters are actually in the font, but it's a good guess that (for
instance) a font that is encoded in koi8-u will have all the characters you
need for basic Ukrainian. iso10646-1 doesn't tell you a lot because the font
is always only a subset of Unicode, and you don't know how big a subset it
is. In the early days when XCreateFontSet was invented, a lot of X
installations didn't have any iso10646-1 fonts, or the ones they had were
missing a lot of characters that you could find in some of the other fonts.
So XCreateFontSet follows some rules that are encoded in the XLC_LOCALE file
for the locale and tries to find a bunch of fonts that will, collectively
(and hopefully), have all the characters that you may need in your current
locale.

Even though XCreateFontSet doesn't always do a great job, I think it's going
to be futile for us to try to hack around it to do something smarter. There
are too many languages, too many fonts each with their own set of missing
characters and peculiarities, and too many distros that each package the old
X core fonts in different ways and let users install different subsets.

With that preface I'll add some point by point comments.

On Mon, May 30, 2011 at 10:39 AM, Arun Persaud <apers...@lbl.gov> wrote:

> Hi
>
> On 05/29/2011 02:04 PM, Tim Mann wrote:
> > What does the garbage look like?
>
> screenshot attached
>
> > I think it might be just that you don't
> > have a font with the necessary characters.
>
> yes, I think that's the problem...
>

I think it's an Xaw or Xt bug that it puts up garbage characters instead of
the box character. It should "know" that it couldn't find the character it
wanted in any of the fonts in the font set.


>
> > With the change I pushed, we
> > don't show any error messages when XCreateFontSet can't find all the
> > font charsets it wants, because for some reason it seems to want a lot
> > more than it really needs. (You can see the charsets that are missing
> > listed in the xboard.debug file if you run with the -debug flag.)
> > Though if you have the
> > -adobe-helvetica-medium-r-normal--*-*-*-*-*-*-iso10646-1series, I would
> > have expected them to have Ukranian characters.
>

Unfortunately they just don't. Nobody ever extended Adobe Helvetica to have
Cyrillic characters. That's why there is no iso8859-5, koi8-r, koi8-u
encoding of helvetica (because they would be missing all the important
characters for those encodings) and why the iso10646-1 encoding doesn't have
those characters.


>
> I tried to load this one, but in the debug file I get message that KOI8
> is not supported...


I don't understand that. Maybe that's one of several messages you got and
you just thought it was the most important?

As far as I can tell, XCreateFontSet ignores the encoding if you specify it
in your pattern, although that doesn't seem to agree with the documentation.
For example:

Requested font set for list -*-*-*-*-*-*-14-*-*-*-*-*-iso10646-1
 got list -*-*-*-*-*-*-14-*-*-*-*-*-iso10646-1, locale uk_UA.utf8
 got charset -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-1
 got charset -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-1
 got charset -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-2
 got charset -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-3
 got charset -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-4
 got charset -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-5
 got charset -misc-fixed-medium-r-normal--14-130-75-75-c-70-koi8-r
 got charset -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-7
 got charset -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-9
 got charset -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-13
 got charset -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-14
 got charset -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-15
 got charset -misc-fixed-medium-r-normal--14-130-75-75-c-140-jisx0208.1983-0
 got charset
-daewoo-gothic-medium-r-normal--14-101-100-100-c-0-ksc5601.1987-0
 got charset -isas-fangsong
ti-medium-r-normal--14-101-100-100-c-0-gb2312.1980-0
 got charset -misc-fixed-medium-r-normal--14-130-75-75-c-70-jisx0201.1976-0
 got charset -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso10646-1


Requested font set for list -*-*-*-*-*-*-14-*-*-*-*-*-total-garbage
 got list -*-*-*-*-*-*-14-*-*-*-*-*-total-garbage, locale uk_UA.utf8
 got charset -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-1
 got charset -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-1
 got charset -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-2
 got charset -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-3
 got charset -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-4
 got charset -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-5
 got charset -misc-fixed-medium-r-normal--14-130-75-75-c-70-koi8-r
 got charset -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-7
 got charset -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-9
 got charset -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-13
 got charset -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-14
 got charset -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-15
 got charset -misc-fixed-medium-r-normal--14-130-75-75-c-140-jisx0208.1983-0
 got charset
-daewoo-gothic-medium-r-normal--14-101-100-100-c-0-ksc5601.1987-0
 got charset -isas-fangsong
ti-medium-r-normal--14-101-100-100-c-0-gb2312.1980-0
 got charset -misc-fixed-medium-r-normal--14-130-75-75-c-70-jisx0201.1976-0
 got charset -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso10646-1

Requested font set for list -*-*-*-*-*-*-14-*-*-*-*-*-koi8-u
 got list -*-*-*-*-*-*-14-*-*-*-*-*-koi8-u, locale uk_UA.utf8
 got charset -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-1
 got charset -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-1
 got charset -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-2
 got charset -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-3
 got charset -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-4
 got charset -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-5
 got charset -misc-fixed-medium-r-normal--14-130-75-75-c-70-koi8-r
 got charset -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-7
 got charset -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-9
 got charset -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-13
 got charset -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-14
 got charset -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-15
 got charset -misc-fixed-medium-r-normal--14-130-75-75-c-140-jisx0208.1983-0
 got charset
-daewoo-gothic-medium-r-normal--14-101-100-100-c-0-ksc5601.1987-0
 got charset -isas-fangsong
ti-medium-r-normal--14-101-100-100-c-0-gb2312.1980-0
 got charset -misc-fixed-medium-r-normal--14-130-75-75-c-70-jisx0201.1976-0
 got charset -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso10646-1

It gets the same list regardless.


> I then tried to load some with "-*...-koi8-uni", but
> they don't show up in the debug file (I do see them via xlsfonts) and
> xboard load the same files as before... perhaps we can trigger on things
> like "missing charset KOI8-U" (from xboard.debug) and reset the locale
> to english and output a warning in case the correct font can't be found?
>

Missing koi8-u isn't necessarily a failure. The characters for Ukrainian
might be found in an iso10646-1 font (some do have them, though helvetica
doesn't), iso8859-5, koi8-r, or others.


>
> I also noticed that the xboardrc file shows several lines of font
> messages and not just the last one... and the latest ones that I used
> are listed on top and therefor when I load the xboardrc file might get
> overwritten by the ones below? I haven't looked that much into it yet
> though...
>

That's a feature that HG ported from winboard. The "sizeNNN:" in front says
"use this font only for square size NNN".  If you don't have the "sizeNNN:"
there, xboard will use the font for whatever the current square size is. But
when it saves settings, it saves the fonts only for the current square size.
This feature is more important in WinBoard where there is a font selection
dialog and you can change the fonts (and the square size too) without
exiting and restarting the program.


>
> As for other po files: only de tr and uk should work... the other ones
> are just are generated by a script from winboard files and will probably
> need adjusting by the TP project...
>

The uk one is missing a lot of translations. The ru, it, and es ones are a
lot more complete, though I don't read those languages so I don't know how
accurate they are. Maybe we should hack them all up to where they will build
and let folks use them. They are probably better than the uk translation
already.

BTW: I am thinking we should remove the _( ) from strings that are just
debug messages that get printed to debugFP (the xboard.debug file). Two
reasons for that: (1) reduce the burden on the translation team -- let them
focus on the messages that users really see, (2) xboard.debug is mostly to
help us debug problems and it will be easier for us to read files people
send us if they are in English.


>
> There is a file po/LINGUAS where you need to add the translations you
> want make to build... at the moment I only have de tr and uk in there,
> since the other ones resulted in errors.
>

I did find that and edit it... but your other message gives the step I was
missing.

>
> cheers
>        ARUN
>
_______________________________________________
Bug-XBoard mailing list
Bug-XBoard@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-xboard

Reply via email to