Jump to content
  • Advertisement
Cursive

How to ensure Facebook user names font characters exist (chinese, latin, russian,..)

This topic is 383 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, our game will have Facebook integration and we have the issue of how to make sure that each user name character actually exists.

For example, a Chinese person could have a Russian letter as a part of his name, but if our ttf files are split into a separate Russian and Chinese files, we can't do this well.

How do games handle these cases? Is there like a "master" ttf file which contains the most common letters of large alphabets (eg all latin + cirilic + most common chinese + arabic... )?

Share this post


Link to post
Share on other sites
Advertisement
19 minutes ago, Cursive said:

We're using cocos2d-x.

Then there is a very high chance that it's your font. Many custom fonts have only the letters for the default alphabet. As making the letters for every letter of all languages often isn't worth the time.

 

To test if this is the problem use your OS(Windows or what ever) font like Ariel and set the font to the right Unicode and check to see what happens. With your OS font you should get the right letters.

If that works then you can just use a fallback font when a letter isn't fount in the custom font. Or you could hire a font artist, graphics designers also do this.

For the Japanese unicode numbers you can just check one of the thousands of online references.

Share this post


Link to post
Share on other sites

Hey Scouting Ninja, there was a bit of a misunderstanding, partially because I didn't write enough about what we're doing :)

We are making a mobile game (android, ios) which has Facebook login, so size of the ttf files is an issue, some were 120mb which contain "all" common letters of most used alphabets.

So my use case is more mobile-specific than desktop.

Share this post


Link to post
Share on other sites
4 hours ago, Cursive said:

We are making a mobile game (android, ios) which has Facebook login, so size of the ttf files is an issue, some were 120mb which contain "all" common letters of most used alphabets.

So you are manually cutting the fonts and packing only the needed ones.

In this case there is no real problem except what the user sees. The engine still knows what letter it is even if it can't find the font for it.

So check if the Unicode is in range of the font the user has and if it isn't display a null character. You should have seen this with mobiles before they create a box when they can't display that letter.

 

Share this post


Link to post
Share on other sites

I haven't worked enough with cocos2d-x, but I expect that there's no "master" font unless you explicitly tell it to do something like that. This is easy enough to test though, so you'd probably get your answers quicker by testing than waiting for replies here; see what happens when you load two fonts in different order and see which one takes precedence for printing both shared and unshared characters. 

 

You might also be able to leverage native fonts on the machine instead of importing your own, especially for the limited case of the facebook login screen.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!