Page 1 of 1

Showing translated strings in the picture

Posted: 21.08.2009, 00:18
by Franklin
Hi,

We just completed our zh_TW translations for celestia. The interfaces were good, but the translated string in the picture became a lot of '?', like "Jupiter ??", "???99,064km" . Is it because of OpenGL font rendering? How to solve this problem?


Thanks,
Franklin

Re: Showing translated strings in the picture

Posted: 21.08.2009, 09:23
by Vincent
Franklin,

Celestia uses its own txf font textures to display the OpenGL overlay text.
So, you'll need to build the *_zh_TW.txf files which will contain Chinese Traditional glyphs.
This can be done using ttf2txf and the codepoints_zh_TW.txt file which is generated in the
po/ dir when running the translate_resources.pl perl script.

You'll find a link to the txf utilities along with some more information about
how to build txf font textures in this thread: viewtopic.php?t=6814

I'll add this information to the Celestia Wiki i18n page ASAP.

Re: Showing translated strings in the picture

Posted: 21.08.2009, 20:09
by duds26
Celestia needs a good free font with a broad Unicode coverage.

Re: Showing translated strings in the picture

Posted: 22.08.2009, 03:35
by Franklin
Vincent wrote:Franklin,

Celestia uses its own txf font textures to display the OpenGL overlay text.
So, you'll need to build the *_zh_TW.txf files which will contain Chinese Traditional glyphs.
This can be done using ttf2txf and the codepoints_zh_TW.txt file which is generated in the
po/ dir when running the translate_resources.pl perl script.

You'll find a link to the txf utilities along with some more information about
how to build txf font textures in this thread: viewtopic.php?t=6814

I'll add this information to the Celestia Wiki i18n page ASAP.

Thanks for your help. I'll need to run the translate_resources.pl on a Windows box, right?
And it looks like I need rc.exe, link.exe also. Well, I'm not familiar with Windows platform. For msgfmt.exe I know in the Windows version of gettext, which seems to be a bit old (I could find 0.14 or 0.15 only). But rc.exe and link.exe, where can I get it?

Thanks for your help again.

Franklin

Re: Showing translated strings in the picture

Posted: 22.08.2009, 09:49
by Vincent
Franklin wrote:I'll need to run the translate_resources.pl on a Windows box, right?
And it looks like I need rc.exe, link.exe also. Well, I'm not familiar with Windows platform. For msgfmt.exe I know in the Windows version of gettext, which seems to be a bit old (I could find 0.14 or 0.15 only). But rc.exe and link.exe, where can I get it?
Franklin,

You'll find some help on the Celestia Wiki i18n page: http://en.wikibooks.org/w/index.php?tit ... MS_Windows

rc.exe is part of the Windows SDK in and link.exe is included in MS Visual C++ 2008 Express edition.
So both should be already on your system if you compile Celestia on Windows using MS Visual C++ 2008.
If not, please see http://en.wikibooks.org/wiki/Celestia/D ... 2_platform for step by step
instructions. Then, you'll simply need to add perl.exe, rc.exe, link.exe and msgfmt.exe to your PATH.

Anyway, since you're not familiar with Windows, and unless you wish to regularly build Celestia on it,
I can simply send you the codepoints_zh_TW.txt file. Just let me know...

Then, you'll be able to build your font textures with ttf2txf doing something like:

Code: Select all

ttf2txf -w 512 -h 512 -f codepoints_zh_TW.txt -s 12 -o font.txf font.ttf

Re: Showing translated strings in the picture

Posted: 22.08.2009, 12:22
by Franklin
Vincent wrote:Franklin,

You'll find some help on the Celestia Wiki i18n page: http://en.wikibooks.org/w/index.php?tit ... MS_Windows

rc.exe is part of the Windows SDK in and link.exe is included in MS Visual C++ 2008 Express edition.
So both should be already on your system if you compile Celestia on Windows using MS Visual C++ 2008.
If not, please see http://en.wikibooks.org/wiki/Celestia/D ... 2_platform for step by step
instructions. Then, you'll simply need to add perl.exe, rc.exe, link.exe and msgfmt.exe to your PATH.

Anyway, since you're not familiar with Windows, and unless you wish to regularly build Celestia on it,
I can simply send you the codepoints_zh_TW.txt file. Just let me know...

Then, you'll be able to build your font textures with ttf2txf doing something like:

Code: Select all

ttf2txf -w 512 -h 512 -f codepoints_zh_TW.txt -s 12 -o font.txf font.ttf

Hi Vincent,

I use Linux all the time, and I don't have Windows system on my computers, not to mention Visual C++ or Windows SDK.

I'll really appreciate if you can help me to create codepoints_zh_TW.txt.
It will be very useful for us to promote celestia to elementary and high schools in Taiwan.

Thanks,
Franklin

Re: Showing translated strings in the picture

Posted: 22.08.2009, 12:56
by Vincent
Franklin,

I just sent you an e-mail with the codepoints_zh_TW.txt file.
As to the next steps, you'll find some help on the Celestia Wiki i18n page.
I've updated it with some instructions about how to build the .txf font texture files.
Of course, you can still ask here if you need some more help.

Re: Showing translated strings in the picture

Posted: 23.08.2009, 12:02
by Vincent
I managed to successfully build the Chinese Traditional font textures, and they're looking great on
my system :) (see screengrab below). However, before commiting the files to SVN, I'd like them
to be tested on Windows by any user who is natively using the zh_TW locale - Franklin is using gtk.
The translation files can be found at: http://vincent.giangiulio.perso.sfr.fr/ ... _zh_TW.zip

Thanks in advance.

Re: Showing translated strings in the picture

Posted: 25.08.2009, 03:37
by Markerz
Some words in .cel didn't display using your fonts and .cel files on my translated traditional chinese veriosn of celestia for mac.

Re: Showing translated strings in the picture

Posted: 25.08.2009, 08:05
by Vincent
Markerz wrote:Some words in .cel didn't display using your fonts and .cel files on my translated traditional chinese veriosn of celestia for mac.
Markerz,

Many thanks for testing.
Could you please send me an example of .cel script from which you have missing words?
I've built an alternative set of texture fonts using the Micro Hei font package.
I'd like to test it with your .cel script.

Also, what about the size of the characters? Are they OK for you to read or should I make them a little bit bigger?

Re: Showing translated strings in the picture

Posted: 25.08.2009, 09:51
by Markerz
You mean you want a list of the words which are missing while i was testing the .cel scripts or something else ?

Re: Showing translated strings in the picture

Posted: 25.08.2009, 11:07
by Vincent
Markerz wrote:You mean you want a list of the words which are missing while i was testing the .cel scripts or something else ?
Please, send me the .cel script itself so that I can test it on my system.
Does celestia display any question marks "?" for the missing characters?

Re: Showing translated strings in the picture

Posted: 25.08.2009, 12:38
by Markerz
The script of the missing words is in the attachment.
It displays nothing not display ?
And the font size is OK.

Re: Showing translated strings in the picture

Posted: 25.08.2009, 13:03
by Vincent
Markerz wrote:The script of the missing words is in the attachment.
It displays nothing not display ?
And the font size is OK.
Markerz,

Thanks.
Below is the list of glyphs which are included in the zh_TW font textures I've built.
Could you please tell me if some of the characters which are used in the script are missing from this list?

Re: Showing translated strings in the picture

Posted: 25.08.2009, 13:14
by Markerz
Vincent wrote:
Markerz wrote:The script of the missing words is in the attachment.
It displays nothing not display ?
And the font size is OK.
Markerz,

Thanks.
Below is the list of glyphs which are included in the zh_TW font textures I've built.
Could you please tell me if some of the characters which are used in the script are missing from this list?
Is this list for the font that you have posted. (http://vincent.giangiulio.perso.sfr.fr/ ... _zh_TW.zip)

Re: Showing translated strings in the picture

Posted: 25.08.2009, 13:46
by Markerz
if it is. There are a lot of characters (in demo.cel and start.cel) that do not display with the font.

Chinese character

???????????????????????????????????????????????????????

other

the exclamation mark ( ! or ?)


Can forum display Chinese character?

and it should be my last post today.

Re: Showing translated strings in the picture

Posted: 25.08.2009, 18:16
by Vincent
Markerz wrote:if it is. There are a lot of characters (in demo.cel and start.cel) that do not display with the font.

Chinese character

???????????????????????????????????????????????????????

other

the exclamation mark ( ! or ?)
OK, I've added these characters to the font texture files,
and now they're correctly displayed when running the script.
You can grab the revised *_zh_TW.txf files here:
http://vincent.giangiulio.perso.sfr.fr/ ... _zh_TW.zip

Actually, the codepoints.txt files which are generated when running the
translate_resources.pl script only includes the codes for characters that
are used in the standard celestia package. That's why extra-characters
used in scripts are not displayed.

So, we'd need a more complete list of code-points for the zh_TW locale,
as described here: http://en.wikipedia.org/wiki/CJK_Unified_Ideographs
Can anybody point me to a text file that includes all the hexadecimal
code-points for the CJK Unified Ideographs standard package (no extension)?

Re: Showing translated strings in the picture

Posted: 26.08.2009, 00:02
by Markerz
Sorry one more word missing

?

Re: Showing translated strings in the picture

Posted: 26.08.2009, 08:03
by Vincent
Markerz wrote:Sorry one more word missing

?
Markerz,

Many thanks for your contribution.

The revised font textures package can be grabbed here:
http://vincent.giangiulio.perso.sfr.fr/ ... _zh_TW.zip

And the whole translation files package for Windows there:
http://vincent.giangiulio.perso.sfr.fr/ ... _zh_TW.zip

Re: Showing translated strings in the picture

Posted: 26.08.2009, 10:06
by Vincent
duds26 wrote:Celestia needs a good free font with a broad Unicode coverage.
That's an interesting point, indeed. As an example, GNU Unifont provides support for more than 40000 characters:
http://www.lgm.cl/trabajos/unifont/index.en.html
http://unifoundry.com/unifont.html

I've given a try at building the corresponding txf files. Each file includes 43114 glyphs and required a 4096 x 4096 texture, though.
So, I can see at least two issues with using Unifont:
- The font/ dir would get significantly larger: from ~33 Mo up to ~51 Mo
- I'm not sure it would be relevant to load 4096x4096 texture fonts for all languages that only use a restricted set of characters.