Unicode support

Started by rbaleksandar, Thu 12/02/2009 20:45:43

Previous topic - Next topic

Monsieur OUXX

#20
Hello .rhavin.

Yes, AGS is a bit limited on the non-Latin front. But there is much more hope than in 2009, when this thread started!

- About UTF-8 : The Editor does support Unicode, because it's coded in .Net. If I'm not mistaken, you should be able to type stuff like String s = "РÃ'Æ'́Ã'Ã'ÐºÐ¸Ð¹"; in the Editor.
- In the engine, it's different : your game does not rely in any way on .Net. It relies on low-level graphical libraries (I can't remember if it's Allegro or SDL or both). They don't support unicode They do support Unicode but sadly AGS didn't take advantage of these features when it got implemented. BUT since the recent versions of AGS, AGS has been supporting 256-characters fonts. That's good news: Some Cyrillic fonts do exist in 256-chars sets (as opposed to the archaic 128-chars basic ascii).

=> Not too much hassle for you. Read this article, and it shouldn't be too hard for you to generate a cyrillic font that will work. Maybe you could start from a TTF font as explained in the article. I found some here.

Why not try that out and be our first 100% successful cyrillic game maker? :D 1. Download the font from here. 2. Use the tool recommended in the Wiki article ("Rulaman Wfn Editor") to turn the TTF font into a .wfn font, 3. Still using Rulaman's editor, fix the few rogue pixels that might have appeared in the process. 4. Success, fame, glory, money, men/women.
 

Crimson Wizard

Quote from: Monsieur OUXX on Fri 19/12/2014 23:55:55
- In the engine, it's different : your game does not rely in any way on .Net. It relies on low-level graphical libraries (I can't remember if it's Allegro or SDL or both). They don't support unicode

Well, this is not correct. Both Allegro and SDL support unicode (AGS uses Allegro), its just that AGS stores all strings as ANSI ones.
Changing that would require rewriting parts of the engine, and also (probably) changing some data formats.

.rhavin

#22
Well, i speak german and english and a bit of español, so the're now way i'll do a cyrillic game.

Yes, i can write something like:

Code: ags
 player.Say("Höchstens 200â,¬!");


but on screen it gets:

H?chstens 200?

and writing "Hoechstens 200 EUR" just looks bad. And SDL seems to support unicode, as does allegro.

Quote from: Crimson Wizard on Sat 20/12/2014 01:51:51
AGS stores all strings as ANSI ones.
Changing that would require rewriting parts of the engine, and also (probably) changing some data formats.


Is the source public? would that be a big issue?

Edit: ok, found it on github. string.ccp seems to be uncaring wheter it processes unicode or not, it just manipulates bytes. so, perhaps it would be enough to just update the functions actually *writing* something on screen? I noticed you write text as bitmaps on screen and use an outline font / plain font combination. well, a bit outdated, dont you think? why not just use the systems ttf dawing routines and write the text in black on screen, then offset by 2px in both directions and write it in the actual color? i do this all the time when i write text in java and it looks pretty well on all backgronds.

Crimson Wizard

#23
Quote from: .rhavin on Sat 20/12/2014 12:37:05
string.ccp seems to be uncaring wheter it processes unicode or not, it just manipulates bytes. so, perhaps it would be enough to just update the functions actually *writing* something on screen?
No. The length of the string is an issue. UTF-8 has its length calculated differently.
Also, its not only string.cpp. The String class is not used everywhere in the engine. I've just started replacing C-strings with String class, but there are tonns of C-string occurances in the program.

Quote from: .rhavin on Sat 20/12/2014 12:37:05
I noticed you write text as bitmaps on screen and use an outline font / plain font combination. well, a bit outdated, dont you think? why not just use the systems ttf dawing routines and write the text in black on screen, then offset by 2px in both directions and write it in the actual color? i do this all the time when i write text in java and it looks pretty well on all backgronds.
AGS supports both TTF and WFN. People use the way they prefer.

Anyways, if you have a particular code change proposal, you can make a pull request, or place an example here.

Monsieur OUXX

#24
@.rhavin  : your latest post doesn't change anything to the problem and how to solve it: it's still as easy.  8-)
- In the article to which I gave you a link, it tells you where to get font that manage accentuated characters (all European accentuated characters you could dream of, including German, Spanish, etc.).
- And since the Editor stores fonts as ANSI, it means they are stored as 256-character tables.

That means you should have no issue in the Editor, and no issue in-game. AGS doesn't support Unicode, but it doesn't need it to manage accentuated fonts that use the standard Western-European latin table, as you plan on doing. It only means that your game cannot be Latin and Cyrillic and Chinese at the same time.  ;-D

If your goal by posting here is to get concrete solutions on how to make a "European" game, then by now you have all the solutions. If your goal is to help enhancing AGS on the long term, then I will stop stepping in and let you guys having clever conversations together ;)



 

SMF spam blocked by CleanTalk