A proposal for replacing the default CJK font

Discuss and coordinate development of mainline and user-made content translations.

Moderator: Forum Moderators

User avatar
AxalaraFlame
Posts: 690
Joined: December 4th, 2011, 1:07 pm
Location: Pasadina, Caltech

Re: A proposal for replacing the default CJK font

Post by AxalaraFlame »

Cloudi, this is what I have found. I do not know any techniques to fix it. Please reply
未命名.JPG
CloudiDust
Translator
Posts: 34
Joined: May 1st, 2010, 10:25 am

Re: A proposal for replacing the default CJK font

Post by CloudiDust »

AxalaraFlame wrote:Cloudi, this is what I have found. I do not know any techniques to fix it. Please reply
未命名.JPG
Sorry for this late reply.

When you play the game in English, the Japanese font (Droid Sans Japanese) takes precedence over the Chinese font (Droid Sans Fallback), and some Chinese characters are displayed as 'blank'. It is preferable to use Chinese saved games in Chinese mode only.

The game has some weird behaviours regarding text rendering, and the devs are working on it (rewriting the old codes to utilize GUI2).
CloudiDust, the Simplified Chinese translation maintainer.
User avatar
AxalaraFlame
Posts: 690
Joined: December 4th, 2011, 1:07 pm
Location: Pasadina, Caltech

Re: A proposal for replacing the default CJK font

Post by AxalaraFlame »

Thank you bro. Does not bother. As you can see in the screenshot, I use english version. I tested chinese version in a whim and stumble upon with this displaying bug. If you can solve it then all is well; if not that is still ok.

Just out of curiosity: why does Japanese fonts have displaying priority over chinese?


BR
Axalara
:)
Last edited by AxalaraFlame on January 4th, 2013, 11:42 am, edited 2 times in total.
User avatar
ivanovic
Lord of Translations
Posts: 1149
Joined: September 28th, 2004, 10:10 pm
Location: Germany

Re: A proposal for replacing the default CJK font

Post by ivanovic »

Uhm, this should not happen unless either the font order is not translated (it is for Chinese), there is a bug in the translation or some codepages which are required are not listed in the font configuration. I don't know how the codepages work exactly so I can't give you details about this part. Just have a look at this file: http://svn.gna.org/viewcvs/*checkout*/w ... /fonts.cfg
CloudiDust
Translator
Posts: 34
Joined: May 1st, 2010, 10:25 am

Re: A proposal for replacing the default CJK font

Post by CloudiDust »

AxalaraFlame wrote:Thank you bro. Does not bother. As you can see in the screenshot, I use english version. I tested chinese version in a whim and stumble upon with this displaying bug. If you can slve it then all is well; if not that is still ok.

Just out of curiosity: why does Japanese fonts have displaying priority over chinese?


BR
Axalara
:)
Try modifying "fonts.cfg" that ivanovic mentioned and revert the order of the Japanese and Chinese fonts. So the Chinese font would be used first even when using non-Chinese locales.

This ordering only matters to Chinese and Japanese players. Due to Han unification and the design of the Droid Sans font family, Droid Sans Japanese contains only the Japanese glyphs that are visually different from their Chinese counterparts. That is to say DSJ must fallback to Droid Sans Fallback in order to properly display Japanese texts. So it is natural for DSJ to come before DSF in the 'default ordering'. Besides, DSF has 'Fallback' in its name anyway. ;)
CloudiDust, the Simplified Chinese translation maintainer.
AI
Developer
Posts: 2396
Joined: January 31st, 2008, 8:38 pm

Re: A proposal for replacing the default CJK font

Post by AI »

You can translate the font order to do that, no need to make changes to your local copy.
User avatar
ivanovic
Lord of Translations
Posts: 1149
Joined: September 28th, 2004, 10:10 pm
Location: Germany

Re: A proposal for replacing the default CJK font

Post by ivanovic »

CloudiDust wrote:
AxalaraFlame wrote:Thank you bro. Does not bother. As you can see in the screenshot, I use english version. I tested chinese version in a whim and stumble upon with this displaying bug. If you can slve it then all is well; if not that is still ok.

Just out of curiosity: why does Japanese fonts have displaying priority over chinese?


BR
Axalara
:)
Try modifying "fonts.cfg" that ivanovic mentioned and revert the order of the Japanese and Chinese fonts. So the Chinese font would be used first even when using non-Chinese locales.
The problem is there should be no need for editing the fonts.cfg file since the translation already comes with the correct string. Meaning: it was translated and *SHOULD* work as expected. If you change the font order in the config file and this makes a difference, then there is obviously a bug in how the font handling works...
CloudiDust
Translator
Posts: 34
Joined: May 1st, 2010, 10:25 am

Re: A proposal for replacing the default CJK font

Post by CloudiDust »

ivanovic wrote: The problem is there should be no need for editing the fonts.cfg file since the translation already comes with the correct string. Meaning: it was translated and *SHOULD* work as expected. If you change the font order in the config file and this makes a difference, then there is obviously a bug in how the font handling works...
The problem is that Axalara wants to display Chinese correctly in the English locale, while the font order is only correct for Chinese in the Chinese locale (because the font order is only correctly 'translated' when using Chinese.)

AFAIK the 'translatable font order' is not exactly designed for this use case.

However, I do think there is a bug in font handling. In the English locale, the Japanese font is used before the Chinese one. In theory, this would result in some Chinese characters being displayed using Japanese glyphs and appear 'weird', with no character being displayed as 'blank', as the Chinese font should always be fallen back on. Instead, blanks are shown.

I still haven't figured out why, but does it have anything to do with GUI 1 vs GUI 2?
CloudiDust, the Simplified Chinese translation maintainer.
User avatar
ivanovic
Lord of Translations
Posts: 1149
Joined: September 28th, 2004, 10:10 pm
Location: Germany

Re: A proposal for replacing the default CJK font

Post by ivanovic »

CloudiDust wrote:
ivanovic wrote: The problem is there should be no need for editing the fonts.cfg file since the translation already comes with the correct string. Meaning: it was translated and *SHOULD* work as expected. If you change the font order in the config file and this makes a difference, then there is obviously a bug in how the font handling works...
The problem is that Axalara wants to display Chinese correctly in the English locale, while the font order is only correct for Chinese in the Chinese locale (because the font order is only correctly 'translated' when using Chinese.)

AFAIK the 'translatable font order' is not exactly designed for this use case.

However, I do think there is a bug in font handling. In the English locale, the Japanese font is used before the Chinese one. In theory, this would result in some Chinese characters being displayed using Japanese glyphs and appear 'weird', with no character being displayed as 'blank', as the Chinese font should always be fallen back on. Instead, blanks are shown.

I still haven't figured out why, but does it have anything to do with GUI 1 vs GUI 2?
But there is only one place where any string using the Chinese font can appear: the language selection. That's it, every other place only appears in Chinese when the Chinese locate is selected!

Or is this exactly where you see a problem in how things are currently handled? Since for anything else it should just not be possible to have Chinese content displayed (unless an addon creator wrote the texts and things not in English and then translated stuff but wrote it in Chinese characters.
AI
Developer
Posts: 2396
Joined: January 31st, 2008, 8:38 pm

Re: A proposal for replacing the default CJK font

Post by AI »

From the screenshot I infer that he played and saved using Chinese (or made a campaign in that language), then switched to English and browsed through the saves. I don't really know what can be done about that.
CloudiDust
Translator
Posts: 34
Joined: May 1st, 2010, 10:25 am

Re: A proposal for replacing the default CJK font

Post by CloudiDust »

ivanovic wrote: But there is only one place where any string using the Chinese font can appear: the language selection. That's it, every other place only appears in Chinese when the Chinese locate is selected!

Or is this exactly where you see a problem in how things are currently handled? Since for anything else it should just not be possible to have Chinese content displayed (unless an addon creator wrote the texts and things not in English and then translated stuff but wrote it in Chinese characters.
Currently wesnoth guarantees correct Chinese display in the Chinese locale, and it does a fine job. To address Axalara's problem, we have to ensure that Chinese is correctly handled in other locales. As AI observed, Chinese characters can appear in savegame names when using other locales. However, I don't know why anyone would want to load a Chinese game then, so this should not be a problem practically.

Still, if the font fallback mechanism is just like how I understand it, Chinese should be displayed (almost) correctly in almost any locale with the current fonts.cfg setup, and no 'blank' should appear. I do think this is a bug, but not one needing immediate fixing. I have no idea whether the game loading dialog is using GUI1 or GUI2, maybe the bug would go away with the old GUI code. ;)
CloudiDust, the Simplified Chinese translation maintainer.
User avatar
AxalaraFlame
Posts: 690
Joined: December 4th, 2011, 1:07 pm
Location: Pasadina, Caltech

Re: A proposal for replacing the default CJK font

Post by AxalaraFlame »

The problem is that Axalara wants to display Chinese correctly in the English locale, while the font order is only correct for Chinese in the Chinese locale (because the font order is only correctly 'translated' when using Chinese.)
Oh, FYI cloudi, I only send that screenshots to you to display the bug. But in actuality, even if you choose the default language as chinese, and display it under chinese locale, this bug still occurs, so I assume it might really mean some technical problems. I have seen that before, and our players in tieba have reported that their message has lossing fonts while playing online as well. The classical chinese fonts has such problems too.
CloudiDust
Translator
Posts: 34
Joined: May 1st, 2010, 10:25 am

Re: A proposal for replacing the default CJK font

Post by CloudiDust »

AxalaraFlame wrote:
The problem is that Axalara wants to display Chinese correctly in the English locale, while the font order is only correct for Chinese in the Chinese locale (because the font order is only correctly 'translated' when using Chinese.)
Oh, FYI cloudi, I only send that screenshots to you to display the bug. But in actuality, even if you choose the default language as chinese, and display it under chinese locale, this bug still occurs, so I assume it might really mean some technical problems. I have seen that before, and our players in tieba have reported that their message has lossing fonts while playing online as well. The classical chinese fonts has such problems too.
After some more testing, it seems that (on my Simplified Chinese Windows 7 machine at least), whether blanks are displayed depends on the locale you launch the game in. If it is launched in the Chinese locale, changing into English would not bring out the blanks. On the other hand, if the game begins in English, the blanks would appear even if Chinese is later selected.

Axalara, is this the same as what you've observed?

And about the 'why', does this have anything to do with font caching? (Does wesnoth cache glyphs?)
CloudiDust, the Simplified Chinese translation maintainer.
Post Reply