Steam Steam Leaderboard with non-roman names

J

JapanGamer29

Guest
My game on Steam, Shisensho Solitaire, has a built-in Leaderboard that pulls data from Steam Leaderboards.

My problem is that players with names in Japanese or Chinese don't show up on my leaderboard, presumably because I don't have the fonts for them. I'm currently using a Verdana font.

Not knowing what language a random user name is written in, is there anyway around this problem? Thanks.
 

2Dcube

Member
Nice looking game!

Old arcade games often only allowed 3 alphabet letters. You could simply only allow roman letters, but non Westerners might find it inconvenient.

You could detect the user's system language and send it together with their name + score, and then pick the font based on that.
However there are a lot of languages, and something like Chinese has a lot of characters which would mean giant font textures...
If you don't need the leaderboard inside the game you could direct players to an online website that displays it.
 

FrostyCat

Redemption Seeker
Verdana doesn't come with CJK glyphs. If you want to display them, you should use a font that has CJK glyphs (e.g. Arial Unicode), include its TTF file and use font_add() to set up the font. For your reference, this is what the setup should look like. In actual practice, you want that font_add() line somewhere that will execute once and only once, before any potential CJK text is drawn.

CTL is another can of worms that GML still hasn't sorted out yet (though in a limited capacity with Arabic and Hebrew), but CJK appears to be fine for now.
 

NightFrost

Member
One way to sidestep the issue is to not let players write their names but do what's done since arcade cabinets: display a bunch of letters (ie, A-Z) and have player pick from those. That of course wouldn't sit too well if a game were supposed to be multi-lingual. (I use this method in projects that have player name entries and use bitmap fonts I've drawn, so that I only need to draw a-z,A-Z,0-9 and some punctuation.)
 
J

JapanGamer29

Guest
Yeah, but since I've integrated the game with Steam, I really want to use the players' Steam usernames. And I've accomplished that now with FrostyCat's CJK glyphs tip. :)
 

FoxyOfJungle

Kazan Games
Verdana doesn't come with CJK glyphs. If you want to display them, you should use a font that has CJK glyphs (e.g. Arial Unicode), include its TTF file and use font_add() to set up the font. For your reference, this is what the setup should look like. In actual practice, you want that font_add() line somewhere that will execute once and only once, before any potential CJK text is drawn.

CTL is another can of worms that GML still hasn't sorted out yet (though in a limited capacity with Arabic and Hebrew), but CJK appears to be fine for now.
Hi @FrostyCat , I downloaded your language demonstration project, I realized that it is support for Korean, Japanese and Chinese languages. However, I realized that the ARIALUNI.ttf font supports Russian characters (Is this font the same as Arial Unicode MS?), how would I go about adding their range using the same "scheme"? Is it already set up? Should I just add the text? 🤔


What I have:

GML:
font = font_add(working_directory + "ARIALUNI.TTF", 16, false, false, 32, 127);
text = "人人生而自由,在尊严和权利上一律平等。他们赋有理性和良心,并应以兄弟关系的精神相对待。\n\n" +
    "人人生而自由,在尊嚴和權利上一律平等。他们賦有理性和良心,並應以兄弟關係的精神相對待。\n\n" +
    "すべての人間は、生まれながらにして自由であり、かつ、尊厳と権利とについて平等である。\n人間は、理性と良心とを授けられており、互いに同胞の精神をもって行動しなければならない。\n\n" +
    "모든인간은태어날때부터자유로우며그존엄과권리에있어동등하다. 인간은천부적으로이성과양\n심을부여받았으며서로형제애의정신으로행동하여야한다. ";
GML:
draw_set_font(font);
draw_set_colour(c_white);
draw_text(x, y, text);
And one more thing, is it possible to redistribute this font as part of the compiled project (in the included files folder)? Should I include a license for it?

Thank you!
 
Last edited:

FrostyCat

Redemption Seeker
Hi @FrostyCat , I downloaded your language demonstration project, I realized that it is support for Korean, Japanese and Chinese languages. However, I realized that the ARIALUNI.ttf font supports Russian characters (Is this font the same as Arial Unicode MS?), how would I go about adding their range using the same "scheme"? Is it already set up? Should I just add the text?
You just add the Russian text and leave it at that, the Cyrillic glyphs will be pulled at runtime the same way the CJK glyphs are.
And one more thing, is it possible to redistribute this font as part of the compiled project (in the included files folder)? Should I include a license for it?
That depends on the way your project is licensed. Arial Unicode needs licensing for commercial use, I'm only using it here as a technical demo.

See: Open-source Unicode typefaces
 

FoxyOfJungle

Kazan Games
You just add the Russian text and leave it at that, the Cyrillic glyphs will be pulled at runtime the same way the CJK glyphs are.

That depends on the way your project is licensed. Arial Unicode needs licensing for commercial use, I'm only using it here as a technical demo.

See: Open-source Unicode typefaces
Hi @FrostyCat Thanks for the links.
But, I spent a lot of time looking for a suitable font, one I found was "BabelStoneHan", however, it can't draw Korean or Russian characters...
I also found "GNU Unifont", It works with all characters I want, but it is very weird...
I looked at that fonts from Adobe and Google (Source Han Sans / Noto Sans CJK), but apparently they are separated into different files...



Using "BabelStoneHan": Chinese1 > Chinese2 > Japanese > Korean > Russian


From what I saw in the manual, the font_add() function doesn't need a range, so it's probably the font itself...

Do you have any alternative fonts that are free for commercial use? And that contains the languages in a single font (.ttf), just like Arial Unicode MS?
Thank you!


EDIT:

I found a perfect font! It's free and OFL: NanumGothic.
I discovered this font when I entered the Game Maker Studio 2 folder to see what fonts it used, I did it because I realized that in Code Editor I can write in CJK languages, so I tested the font and saw that the license is free and I will use it.




I also included the licenses:




Thank you so much!
 
Last edited:
Top