Showing translated strings in the picture

General discussion about Celestia that doesn't fit into other forums.
Topic author
Franklin
Posts: 4
Joined: 09.08.2009
With us: 15 years 3 months

Showing translated strings in the picture

Post #1by Franklin » 21.08.2009, 00:18

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

Vincent
Developer
Posts: 1356
Joined: 07.01.2005
With us: 19 years 10 months
Location: Nancy, France

Re: Showing translated strings in the picture

Post #2by Vincent » 21.08.2009, 09:23

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.
@+
Vincent

Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3

duds26
Posts: 328
Joined: 05.02.2007
Age: 34
With us: 17 years 9 months
Location: Europe

Re: Showing translated strings in the picture

Post #3by duds26 » 21.08.2009, 20:09

Celestia needs a good free font with a broad Unicode coverage.

Topic author
Franklin
Posts: 4
Joined: 09.08.2009
With us: 15 years 3 months

Re: Showing translated strings in the picture

Post #4by Franklin » 22.08.2009, 03:35

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

Vincent
Developer
Posts: 1356
Joined: 07.01.2005
With us: 19 years 10 months
Location: Nancy, France

Re: Showing translated strings in the picture

Post #5by Vincent » 22.08.2009, 09:49

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
@+
Vincent

Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3

Topic author
Franklin
Posts: 4
Joined: 09.08.2009
With us: 15 years 3 months

Re: Showing translated strings in the picture

Post #6by Franklin » 22.08.2009, 12:22

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

Vincent
Developer
Posts: 1356
Joined: 07.01.2005
With us: 19 years 10 months
Location: Nancy, France

Re: Showing translated strings in the picture

Post #7by Vincent » 22.08.2009, 12:56

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.
@+
Vincent

Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3

Vincent
Developer
Posts: 1356
Joined: 07.01.2005
With us: 19 years 10 months
Location: Nancy, France

Re: Showing translated strings in the picture

Post #8by Vincent » 23.08.2009, 12:02

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.
@+
Vincent

Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3

Markerz
Developer
Posts: 274
Joined: 29.01.2009
Age: 29
With us: 15 years 9 months
Location: Suzhou, China

Re: Showing translated strings in the picture

Post #9by Markerz » 25.08.2009, 03:37

Some words in .cel didn't display using your fonts and .cel files on my translated traditional chinese veriosn of celestia for mac.

Vincent
Developer
Posts: 1356
Joined: 07.01.2005
With us: 19 years 10 months
Location: Nancy, France

Re: Showing translated strings in the picture

Post #10by Vincent » 25.08.2009, 08:05

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?
@+
Vincent

Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3

Markerz
Developer
Posts: 274
Joined: 29.01.2009
Age: 29
With us: 15 years 9 months
Location: Suzhou, China

Re: Showing translated strings in the picture

Post #11by Markerz » 25.08.2009, 09:51

You mean you want a list of the words which are missing while i was testing the .cel scripts or something else ?

Vincent
Developer
Posts: 1356
Joined: 07.01.2005
With us: 19 years 10 months
Location: Nancy, France

Re: Showing translated strings in the picture

Post #12by Vincent » 25.08.2009, 11:07

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?
@+
Vincent

Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3

Markerz
Developer
Posts: 274
Joined: 29.01.2009
Age: 29
With us: 15 years 9 months
Location: Suzhou, China

Re: Showing translated strings in the picture

Post #13by Markerz » 25.08.2009, 12:38

The script of the missing words is in the attachment.
It displays nothing not display ?
And the font size is OK.

Vincent
Developer
Posts: 1356
Joined: 07.01.2005
With us: 19 years 10 months
Location: Nancy, France

Re: Showing translated strings in the picture

Post #14by Vincent » 25.08.2009, 13:03

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?
@+
Vincent

Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3

Markerz
Developer
Posts: 274
Joined: 29.01.2009
Age: 29
With us: 15 years 9 months
Location: Suzhou, China

Re: Showing translated strings in the picture

Post #15by Markerz » 25.08.2009, 13:14

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)

Markerz
Developer
Posts: 274
Joined: 29.01.2009
Age: 29
With us: 15 years 9 months
Location: Suzhou, China

Re: Showing translated strings in the picture

Post #16by Markerz » 25.08.2009, 13:46

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.

Vincent
Developer
Posts: 1356
Joined: 07.01.2005
With us: 19 years 10 months
Location: Nancy, France

Re: Showing translated strings in the picture

Post #17by Vincent » 25.08.2009, 18:16

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)?
Last edited by Vincent on 26.08.2009, 08:04, edited 1 time in total.
@+
Vincent

Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3

Markerz
Developer
Posts: 274
Joined: 29.01.2009
Age: 29
With us: 15 years 9 months
Location: Suzhou, China

Re: Showing translated strings in the picture

Post #18by Markerz » 26.08.2009, 00:02

Sorry one more word missing

?

Vincent
Developer
Posts: 1356
Joined: 07.01.2005
With us: 19 years 10 months
Location: Nancy, France

Re: Showing translated strings in the picture

Post #19by Vincent » 26.08.2009, 08:03

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
@+
Vincent

Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3

Vincent
Developer
Posts: 1356
Joined: 07.01.2005
With us: 19 years 10 months
Location: Nancy, France

Re: Showing translated strings in the picture

Post #20by Vincent » 26.08.2009, 10:06

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.
@+
Vincent

Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3


Return to “Celestia Users”