GameEngine2D

Reply
Accepted Solution

Font doesn't support foreign characters.

So I've just been adding localisation to our game, and it appears that Game Engine FontMap doesn't support non-ASCII characters (e.g. characters with accents, japanese characters, etc.). Am I missing something obvious, or is this in fact the case?

 

It all works fine with UIFont, so I'm now planning to move all of my in-game text out into a UI Screen.

 

Are other people finding this to be an issue? If so, I'll create a suggestion for it.

 

Please use plain text.

Re: Font doesn't support foreign characters.

Hi:

 

I have some questions and answers for that:

 

Did you have the correct fonts on your system? may be the uifont can recognice the font you want to use, another thing it's better to check the source code of font creation(I see that somewhere) because cretes a texture from the char code, probalby there it's the place to fix this problem. Did you think in create your own font map? Many members are japanese so I don't think they report an issue wiht japanese fonts...

 

cheers,

Please use plain text.
PSM Dev Team
mshkla04
Posts: 736
Registered: ‎28-05-2012
Message 3 of 7 (256 Views)

Re: Font doesn't support foreign characters.

Hi Sophie,

 

We  will look into this and get back to you.

PlayStation®Mobile Dev Team
I am like you, I have no name.
Please use plain text.

Re: Font doesn't support foreign characters.

Thanks everyone.

I actually found a way around this - not sure if it's how you're supposed to do it, but when constructing the font map, you can manually set the character set

 

charset = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÀÁÂÃÄÅÈÉÊËÌÍÎÏÑÒÓÔÕÖÙÚÛÜÝàáâãäéèêëìíîïòóôõöùúûü";
myfontMap = new FontMap(
new Font("/Path/to/font.ttf", 12, fontStyle.Regular), charset);

 

Please use plain text.

Re: Font doesn't support foreign characters.

By default, the FontMap class uses an ASCII character set. As sophie_89_2 has pointed out, it is possible to load in the character set that you wish to use if using non ASCII characters.

For other users who may also have problems displaying non ASCII character sets, you should also ensure that your font set actually supports these characters too.
PlayStation®Mobile Dev Team
Please use plain text.

Re: Font doesn't support foreign characters.

[ Edited ]

Do you have any information on the character set string that we'd need to pass through to FontMap to support the Japanese Language?  My game is localised for EFIGS + Japanese and while the frontend menus use UIFont and all work fine, the In Game font uses FontMap and I haven't managed to get Japanese Characters to display at all.  I'm using the System Font at present for Japanese as I know it supports Japanese Characters, I just am not sure what to pass to FontMap in order to make use of them.

 

Thanks

 

Claire

Please use plain text.

Re: Font doesn't support foreign characters.

Ah, I figured out an easy way to do it.  I don't have very much In game text and almost all of it uses unique characters, so I just used the strings I am actually using.

Please use plain text.
Announcements

Welcome to the PlayStation Mobile Developer Forums


This is a community for the discussion of technical topics with other developers and SCE engineers. Posting ideas/requests are also appreciated. Join the discussion!

PlayStation®Mobile開発者フォーラムでは世界中の開発者の皆様と一緒に、議論や情報交換が可能です。SCEも議論に参加し、皆様の開発をサポートします。アイデアやリクエストも大歓迎です。ぜひご参加ください。

PSM Developer Registration (for free) on PSM DevPortal is required to post on the forum.
Please sign out then sign in again to the forum and PSM DevPortal after you have completed the registration.

フォーラムへ投稿をするにはPSM DevPortalへの登録(無料)が必要です。
登録後はフォーラムと PSM DevPortalを一度ログアウトし、再度ログインしてください。