Author Topic: ENGINE PLUGIN: AGSBMFontRenderer - UTF-8 Text Renderer  (Read 2402 times)

Hi all.

I'm writing utf-8 text renderer for non-ascii users(japanese, chinese, korean, etc).

more info on Github repogitory here => https://github.com/bggd/AGSBMFontRenderer

I'm not sure it works any PC. Feedback is welcome :)

Thanks.

Monsieur OUXX

  • Mittens Vassal
  • Cavefish
  • Mittens Half Initiate
    • I can help with proof reading
    • I can help with translating
    • I can help with voice acting
    • Monsieur OUXX worked on one or more games that won an AGS Award!
    •  
    • Monsieur OUXX worked on one or more games that was nominated for an AGS Award!
Re: ENGINE PLUGIN: AGSBMFontRenderer - UTF-8 Text Renderer
« Reply #1 on: 27 May 2015, 14:57 »
Please keep posting for any updates. I'll add your project to the wiki page
 

Re: ENGINE PLUGIN: AGSBMFontRenderer - UTF-8 Text Renderer
« Reply #2 on: 18 Sep 2015, 15:57 »

Re: ENGINE PLUGIN: AGSBMFontRenderer - UTF-8 Text Renderer
« Reply #3 on: 11 Feb 2020, 10:11 »
Hi guys!

We are working on an adventure game and the investors really want to have a chinese translation. They already started to translate it in a Word document. Is it possible to use this method to create a chinese translation?

Any ideas and advice would be greatly appreciated. Thank you!

Monsieur OUXX

  • Mittens Vassal
  • Cavefish
  • Mittens Half Initiate
    • I can help with proof reading
    • I can help with translating
    • I can help with voice acting
    • Monsieur OUXX worked on one or more games that won an AGS Award!
    •  
    • Monsieur OUXX worked on one or more games that was nominated for an AGS Award!
Re: ENGINE PLUGIN: AGSBMFontRenderer - UTF-8 Text Renderer
« Reply #4 on: 11 Feb 2020, 16:50 »
Hi guys!

We are working on an adventure game and the investors really want to have a chinese translation. They already started to translate it in a Word document. Is it possible to use this method to create a chinese translation?

Any ideas and advice would be greatly appreciated. Thank you!
I'm guessing you'd be the first person ever to translate an AGS game to Chinese. If you succeed, then please post your method. Do you speak Chinese yourself?
Food for thought : https://www.localizedirect.com/posts/chinese-game-localization-factsheet
« Last Edit: 11 Feb 2020, 16:55 by Monsieur OUXX »
 

Gilbert

  • Local Moderator
  • * KILL* * KILL * * KILL *
    • Lifetime Achievement Award Winner
Re: ENGINE PLUGIN: AGSBMFontRenderer - UTF-8 Text Renderer
« Reply #5 on: 12 Feb 2020, 05:27 »
I never knew about this plug-in, and by how inactive this thread was it seems few (if any) people actually tried it, which is a pity as it seems to work well according to the test video clip. (Though I won't use it as I am against plug-ins myself.)

Supporting UTF-8 text is a much needed feature of AGS, it'd be great if the functionality of this plug-in can be incorporated into the engine itself.

Monsieur OUXX

  • Mittens Vassal
  • Cavefish
  • Mittens Half Initiate
    • I can help with proof reading
    • I can help with translating
    • I can help with voice acting
    • Monsieur OUXX worked on one or more games that won an AGS Award!
    •  
    • Monsieur OUXX worked on one or more games that was nominated for an AGS Award!
Re: ENGINE PLUGIN: AGSBMFontRenderer - UTF-8 Text Renderer
« Reply #6 on: 12 Feb 2020, 08:44 »
I mentionned the plugin on the Fonts wiki page but only now am I realizing how powerful it could be for pushing AGS' limits, especially in regards to translations.
 

Re: ENGINE PLUGIN: AGSBMFontRenderer - UTF-8 Text Renderer
« Reply #7 on: 12 Feb 2020, 10:44 »
Supporting UTF-8 text is a much needed feature of AGS, it'd be great if the functionality of this plug-in can be incorporated into the engine itself.

Speaking of which, the Editor should accept and write source code in UTF-8, and the compiler should process such source code.
  • The definition of identifiers could remain the same (1st char a-z, A-Z, _; 2nd and following char a-z, A-Z, _, 0-9)
  • single-quoted  characters, e.g., 'ä', would be converted to integers in the range 0 … 65536
  • single-quoted characters could contain \x and \u sequences with high numbers, those would be converted into the corresponding integers
  • char would continue to be 0 … 255, and strings would continue to be char sequences, but could now contain UTF-8 sequences
  • double-quoted strings "…" could contain Unicode, which would be coded as UTF-8 sequences in the source file, e.g., "Frühstück"
  • double-quoted strings could contain \x and \u sequences with high numbers, those would expand into UTF-8 encoded Unicode

The nice thing about UTF-8 sequences is that they are guaranteed not to contain zeroes, so these changes would be sufficient as far as the compiler is concerned.

However, if an Engine function is passed a string that contains UTF-8 and if that Engine function isn't Unicode aware (yet) then it might garble the string or produce illegal UTF-8.

Pre-existing AGS bytecode that is only given strict ASCII as input will continue to work and ASCII source code can be directly "interpreted as" UTF-8, so those changes would be completely backward compatible.

The String class should probably need helper functions so that it is possible to iterate through its characters  even if some of those are UTF-8 sequences and need to be processed as one. For each String function we'd probably also need an additional function that works like the original but treats whole UTF-8 sequences as 1 character. This doesn't concern the compiler.
« Last Edit: 12 Feb 2020, 11:48 by fernewelten »

Re: ENGINE PLUGIN: AGSBMFontRenderer - UTF-8 Text Renderer
« Reply #8 on: 12 Feb 2020, 11:54 »
I am not sure this thread is the adequate place to discuss engine/editor limits. This is an already open issue in the AGS repository: https://github.com/adventuregamestudio/ags/issues/711

Note: the issue above isn't exactly this, but a reduced scope functionality that would work for translations (not original AGS Script code as far as I can tell). For a general utf-8 support, it's useful to open a new issue.

Alternatively, opening a new thread for the editor on Editor Development Board.

Anyway, I quickly built this plug-in: AGSBMFontRenderer.dll

I recommend reading the README since one needs to generate the font before using this.
« Last Edit: 12 Feb 2020, 12:34 by eri0o »

Re: ENGINE PLUGIN: AGSBMFontRenderer - UTF-8 Text Renderer
« Reply #9 on: 12 Feb 2020, 12:50 »
I am not sure this thread is the adequate place to discuss engine/editor limits.

It definitely isn't.

I am not sure this thread is the adequate place to discuss engine/editor limits. This is an already open issue in the AGS repository: https://github.com/adventuregamestudio/ags/issues/711

This is a wrong ticket also, it was open merely for reference on one hacky solution, and not meant to discuss full transition to UTF-8. There was also a series of utf-related comments made in another ticket recently (https://github.com/adventuregamestudio/ags/issues/990) but it was also a non-convenient place to do so.
I don't think we have a proper "main ticket" for discussing Unicode problem yet.
« Last Edit: 12 Feb 2020, 13:00 by Crimson Wizard »

Re: ENGINE PLUGIN: AGSBMFontRenderer - UTF-8 Text Renderer
« Reply #10 on: 23 Feb 2020, 00:39 »
Hi! Thank you for all the answers.
Unfortunately I don't speak chinese at all but we have a person for this job  :smiley: I didn't have time to try this plugin but I definitely will, and then I'll tell you my experiences.

Re: ENGINE PLUGIN: AGSBMFontRenderer - UTF-8 Text Renderer
« Reply #11 on: Yesterday at 22:13 »
I tried everything I can but it's not working :( I have no idea what I'm doing wrong. I copied the DLL into the AGS folder, then I made a bitmap font from the UTF-8 text file. When I try to import this font I get an error message:
"Unable to import the font. Not a valid SCI font file"
Maybe I don't need to import it, because the script does it when I run the game, but when I run the game I get another error message:
"Error: Unable to load font 8, no renderer could load a matching file."

I tried to use the font from the Demo, the same happened. Did I miss something? I read the readme file many times, and I can't figure out what I'm doing wrong :confused:
Should I do something with these files maybe? -> src folder, thirdparty folder, appveyor.yml

Edit: I tried to remake the font in AGS and now I got this message:


"Illegal exception
An exception 0xC0000005 occurred in ACWIN.EXE at EIP = 0x578B2AF7; program pointer is +6, ACI version 3.5.0.22, gtags (7,1)
AGS cannot continue, this exception was fatal. Please note down the numbers above, remember what you were doing at the time and post the details on the AGS Technical Forum.

in "room2.asc", line 18"
« Last Edit: Yesterday at 22:23 by daneeca »