"Unable to create font set"

Discussions about the WinBoard protocol. Here you can also report bugs and request new features.

Moderators: hgm, Andres Valverde

"Unable to create font set"

Postby burunduk » 12 May 2011, 01:10

This is about "unable to create font set" bug. I ran into this problem when trying to compile XBoard from master-20110507 on Puppy Wary-511. The bug went away by itself after the (tiny) system language pack was installed, I was since unable to reproduce it neither without that package nor on a fresh save file (= fresh linux installation). So, this probably happend due to some remnants of previous XBoard versions. Now XBoard runs and only shows this warning in the terminal: Missing charsets in String to FontSet conversion.

It's still impossible to use localized version, though. For example, the Russian word Файл appears this way: Файл
burunduk
 
Posts: 11
Joined: 14 Apr 2011, 02:54

Re: "Unable to create font set"

Postby H.G.Muller » 12 May 2011, 09:30

I think the master-20110507 version contains the wrongly recoded po files. You would have to run lng2po yourself, with CP1251 as argument, to get a properly encoded version:

cd po
./lng2po.sh -e CP1251 "../winboard/language/russian.lng"
mv language.po ru.po

Perhaps the same thing could be acheived by simply recoding the included ru.po from CP1251 to UTF-8. I redid all the lng2po conversions for languages with foreign charsets, and committed them to my hgm.nubati.net repository, from which they should be committed to GNU-Savannah master.

I will forward your remarks about the font-set bug.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: "Unable to create font set"

Postby burunduk » 12 May 2011, 19:44

H.G.Muller wrote:You would have to run lng2po yourself


I did it already.

H.G.Muller wrote:I redid all the lng2po conversions for languages with foreign charsets, and committed them to my hgm.nubati.net repository


Unfortunately, this ru.po will produce an error during the compilation. Would you please update the file?

---Edit---

OK, I can reproduce it now, but this didn't help here (different bugs?)

If XBoard-20110507 finds the ~/.xboardrc file of XBoard-4.5.2 which reads like this:

Code: Select all
-clockFont "size64:-adobe-helvetica-bold-r-normal--34-0-75-75-p-0-iso8859-1"
-font "size64:-adobe-helvetica-medium-r-normal--12-120-75-75-p-67-iso8859-1"


– it exits with the "Unable to create font set" error message.

If there is no such file, it creates the new one which reads like this:

Code: Select all
-clockFont "size64:-adobe-helvetica-bold-r-normal--34-328-75-75-p-0-iso8859-1"
-font "size64:-adobe-helvetica-medium-r-normal--14-135-75-75-p-0-iso8859-1"


– and shows me this:

Image

Please note that the dialog windows captions appear as they should.

The iso8859-1 part seems strange here, but attempts to change the lines manually result in "Unable to create font set" or do nothing.
burunduk
 
Posts: 11
Joined: 14 Apr 2011, 02:54

Re: "Unable to create font set"

Postby H.G.Muller » 13 May 2011, 10:39

Do the corresponding messages in the ru.po file display correctly when you, for instance, load that file into gedit?

If so, it seems that the Xaw library we (you?) are using is not UTF-8 compliant. We clearly send translated strings to the widgets (or the texts would not show up as gibberish), and this is done both for setting the title of a window as well as for setting a labels in a dialog. But the string for a title is likely simply handed to the window manager, which apparently does interpret it as UTF-8, rendering the titles correctly. But the inside of the dialogs is no concern of the window manager, and has to be rendered by Xaw itself. And apparently that interprets it not as UTF-8, but as some code page.

I am not sure what could be the remedy here. Perhaps some call to Xaw is needed during initialization, to inform it all strings offered to it for rendering should be interpreted as UTF-8. Or, if that is not supported, we should link to another version of Xaw, that does support UTF-8. Finally it could be that there is a link-time option with which one should set this.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: "Unable to create font set"

Postby burunduk » 15 May 2011, 22:29

Yes, all the characters (including Chinese) are displayed correctly in the default text editor (Geany). Which version of Xaw is expected by XBoard? I have Xaw7, also Xaw6 and 8, installed by default. Linux distros don't differ much at this point. As I've told you before[1], I have seen exactly the same problem on Ubuntu 11.04. The Athena Widget set is even older than my computer. As far as I know, Xaw and Xaw3d have no support for UTF-8. Xaw3dxft has but XBoard doesn't use it. Am I right?

It seems nobody needs XBoard to be translated into Russian or Chinese. But I'm just curious what about German? Some German characters need 2 bytes in UTF-8. So, for example the word Zurück appears like Zurück. Is there any solution for this? If yes, it could be useful for other languages too.

Maybe it is not necessary to feed Unicode strings to the old library. Can the bind_textdomain_codeset function be used to make the gettext provide strings in the supported by Xaw encodings?
burunduk
 
Posts: 11
Joined: 14 Apr 2011, 02:54

Re: "Unable to create font set"

Postby arun » 16 May 2011, 21:45

Hi

according to http://www.gentoo.org/doc/en/utf-8.xml it might be related to the font you are using (see paragraph "KDE, GNOME and Xfce")... can you try to use a iso10646 one as suggested in the post (that is a -misc-fixed-*-*-*-*-*-*-*-*-*-*-iso10646-1)

cheers
ARUN
arun
 
Posts: 6
Joined: 16 May 2011, 17:59

Re: "Unable to create font set"

Postby burunduk » 18 May 2011, 04:21

Hello,

I don't know much about Linux (about Gentoo especially :?) and don't really know how to follow your recommendation. I chose several fonts with xfontsel and tried to change the font options in the ~/.xboardrc file, this resulted or in Nicht in der Lage Schriftsatz zu generieren or even in Segmentation fault.

Also I tried to place these options in the file /etc/X11/app-defaults/XBoard:

Code: Select all
*MenuButton*Font: -misc-fixed-medium-r-normal--12-120-75-75-c-0-iso10646-1
*SimpleMenu*Font: -misc-fixed-medium-r-normal--12-120-75-75-c-0-iso10646-1
*Label*Font: -misc-fixed-medium-r-normal--12-120-75-75-c-0-iso10646-1


It actually changed the typeface but no umlauts anyway. Does the program render the German strings properly on your machine (with de_DE.utf8 locale)?
burunduk
 
Posts: 11
Joined: 14 Apr 2011, 02:54

Re: "Unable to create font set"

Postby H.G.Muller » 18 May 2011, 10:14

Did you sbscribe to the Bug-XBoard mailing list? The problem is being discussed there as well, and the latest input was:

Tim Mann wrote:After some more random googling and flailing, I have learned that setting the resource "*international: True" in Xaw widgets makes them do something more nearly correct. Try this:

env LANG=de_DE.utf8 xboard -xrm '*international: True'

When I do that, I get correct umlauts and the ß character in Weiß (=White). But I don't get the right font -- it looks like all the characters are coming from the "fixed" font; they are all small and fixed-width.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: "Unable to create font set"

Postby burunduk » 20 May 2011, 02:05

Thank you for pointing this out. For some reason I was able to use only one font but it is far more than nothing.
burunduk
 
Posts: 11
Joined: 14 Apr 2011, 02:54


Return to WinBoard development and bugfixing

Who is online

Users browsing this forum: No registered users and 10 guests