Web Font / Text Obj: Multi-Language Support [resolved]

Get help using Construct 2

Post » Sat Feb 13, 2016 3:59 pm

I'm stuck!

Is it possible to change a text object's web font Script during runtime? For example - if I wish to change the language of my game to Russian, how can I change the script from Latin to Cyrillic?

Thanks.
Last edited by Colludium on Sun Feb 14, 2016 12:43 am, edited 1 time in total.
A big fan of JavaScript.
B
74
S
20
G
69
Posts: 2,207
Reputation: 43,836

Post » Sat Feb 13, 2016 5:42 pm

as this is html 5 if you understand coding you could add support for it in the index.html I think I have seen people who have used google translate in their games. But not quite sure how to do it myself.
B
29
S
13
G
10
Posts: 355
Reputation: 8,317

Post » Sat Feb 13, 2016 6:32 pm

I'm not even sure what limitations I'm up against. :/

For example, I've found a font that supports Cyrillic and Latin. However, when I view the ttf, even though I can only see Latin characters in the window, I can set Cyrillic inside c2 directly.

So, my first confusion is that I don't appear to be able to inspect the Cyrillic inside the ttf file.

Then, when I install the same font as a web font in c2, the Cyrillic characters transform to the system default font. I've no idea if this is a limitation, bug, or something that just could be sorted by a css input.

As part of the text object font setting there's a drop down list of supported scripts. I thought that these could be automatically selected according to the Unicode character being input, but this doesn't seem to be the case....
A big fan of JavaScript.
B
74
S
20
G
69
Posts: 2,207
Reputation: 43,836

Post » Sat Feb 13, 2016 7:26 pm

Here are a couple of examples... The font is Stalinist One.

Image

The above shows the font being correctly displayed in the editor


Image

The above shows the font running in chrome - the Russian letters fail to be drawn correctly. This happens if I just run the layout with the font selected in the text object (it's loaded on my system) or if I run the layout and load the text as a web font.

Anyone any ideas? Am I missing something hugely obvious?
A big fan of JavaScript.
B
74
S
20
G
69
Posts: 2,207
Reputation: 43,836

Post » Sat Feb 13, 2016 7:27 pm

Is this a bug?
A big fan of JavaScript.
B
74
S
20
G
69
Posts: 2,207
Reputation: 43,836

Post » Sun Feb 14, 2016 12:45 am

OK, so I checked out a good tutorial here that uses .xml and .json files to load the new font data. I suspect my problem is something to do with the use of .csv somehow because I've tested my 'problem' fonts and they work ok in the tutorial examples.

Edit - in case anyone needs this info. I did a lot of experimenting and found that you have to use the fontsquirrel Basic export option.
A big fan of JavaScript.
B
74
S
20
G
69
Posts: 2,207
Reputation: 43,836


Return to How do I....?

Who is online

Users browsing this forum: evillair, Solomon, vankizzle and 10 guests