• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Legacy GM Using Japanese characters in Game Maker

theg721

Member
Hi all,

I'm trying to implement some localisation in my game, starting with translating it into Japanese, and found that trying to use draw_text with Japanese text (either kana or kanji) wouldn't work; nothing is drawn. After consulting the IRC channel, I found that Game Maker's font system only supports the first 255 Unicode characters, and hence there's no immediately obvious way to make use of characters not within that range when using this font system.

Whilst I suppose I could just open up Photoshop and make sprites out of every phrase I want to use, this isn't a perfect solution due to images being static, since I need to be able to accept user input and (later) draw it, wrap text and/or use a smaller font depending upon resolution, etc. Additionally, I would imagine that this would increase my memory and/or storage footprint, which isn't desirable on mobile. Thus I was wondering if there was some other way of getting this to work? How did those of you who have already localised games into languages such as Japanese, Chinese, Korean, Russian, etc. which use characters not within the 255 supported by Game Maker go about dealing with this?

Thanks.
 

Yal

šŸ§ *penguin noises*
GMC Elder
I'm pretty sure you can add arbitrary (unicode) ranges to a font using the plus and minus buttons; as long as the font itself has those characters it should be possible to draw stuff with them normally. @FrostyCat is the authority on CJK text here, though, and the leading force in the petition to get proper support for it.
 

GMWolf

aka fel666
I would also recomend you write you localized text in a lang file in the included files. (but im guessing thats quite obvious).

this reminds me of when i had to hand in my project after having changed my local lang, and all my special charcters got messed up. code still worked, but output formatting was... interesting.
 

theg721

Member
You should include a TTF font in the game itself, then do an font_add() at runtime. This sets up a dynamic font that will generate glyph's on request. You then draw UTF-8 text and this will render any glyph as required. Be aware, that to include a TTF font in the game, you need to have purchased the rights to do so.
This worked, thank you ^.^
 

Tirous

Member
i managed to add in hiragana and katakana to my games main font, it uses the default font rather then the one im using tho, as the glyths arent included in by pixelated font, so ya.

currently i dont need katakana and thus its been left out, however hiragana i managed to find around 12353 - 12438 in unicode, with katakana being stored after that.

edit: as for kanji, they prove to be case-by-case in nature, picking and choosing the ones needed as to avoid miles of unneeded glyphs filling up the texture page.
 
D

Dejima

Guest
You should include a TTF font in the game itself, then do an font_add() at runtime. This sets up a dynamic font that will generate glyph's on request. You then draw UTF-8 text and this will render any glyph as required. Be aware, that to include a TTF font in the game, you need to have purchased the rights to do so.

https://docs.yoyogames.com/index.html?page=source/dadiospice/002_reference/game assets/fonts/font_add.html
Hi!

I am in the exact same situation as the original poster.

However I am not sure I understand how I can include A TTF font in the game.

It means adding a .ttf file in the "included files" right?
And then actually adding it with something like "JapanFont = font_add( working_directory + "JP.tff",24,false,false,32,128)" ?

Thanks.
 
Top