Tremulous Forum

Mods => Mod Releases => Non-Gameplay Changing => Topic started by: bob0 on November 29, 2010, 10:38:29 pm

Title: i18n + unicode
Post by: bob0 on November 29, 2010, 10:38:29 pm
The patch (http://lojban.org/~krabbykrap/patches/tremulous/i18n) includes Lakitu7-freetype+consolecustomize.patch, which implements freetype support for ASCII (non-unicode) characters.  The code can also be found in the "i18n" branch of git://git.mercenariesguild.net/obstacle.git

The renderer has been updated to support rendering UTF-8 encoded unicode characters.  Other truetype fonts can be used, and by default ttf/DejaVuSans-Bold.ttf (which needs to be downloaded in addition to the patch) is used.  The console font can be changed by setting "cl_consoleDynFont".  For the UI, next to "font", "smallFont" and "bigFont" in an assetGlobalDef block, the fields "dynFont", "smallDynFont", and "bigDynFont", all of which the patch sets to ttf/DejaVuSans-Bold.ttf, have been added.  There is a cache with a fixed size of MAX_FACE_GLYPHS (384 for now) glyphs.  When a new glyph is rendered, an image and a shader is created for it at runtime, and it is added to the cache.  The cache has a fixed size, so eventually old glyphs will be replaced by new glyphs, and when they are, the image is freed and a new one is created, and the mutable shader is overwritten for the new glyph.  Currently, there is a problem when more than MAX_FACE_GLYPHS glyphs are rendered simultaneously, as new glyphs will continuously be generated, significantly reducing the frame rate.

Gettext is used for translation.  The path containing all the translated messages determined by concatenating the cvar "localepath", or "fs_homepath" if "localepath" is empty, with the cvar "locale". By default, "localepath" is empty and "locale" is "/locale".  Normally the environment variable LANG can be set.  Unfortunately, gettext expects this directory to really be a directory, so it can't exist in a zip package.

This patch requires both the client and the VMs to be patched.  Patched VMs are backwards-compatible with unpatched clients, so a server that includes this patch in their VMs will enable patched clients to use unicode, and unpatched clients will be unchanged.  A patched client is able to load unpatched VMs.

The Domination server (running on lojban.org) includes this patch, in addition to domination itself, in its dowloadable package, as well as ttf/DejaVuSans-Bold.ttf.  As far as I'm aware, it's the only server with vms that support unicode.

This has not been tested extensively.

Screenshots:
(http://lojban.org/~krabbykrap/images/tremulous/i18n.png)

(http://lojban.org/~krabbykrap/images/tremulous/shot-i18n-chat.jpg)

(http://lojban.org/~krabbykrap/images/tremulous/shot-i18n-console.jpg)

(http://lojban.org/~krabbykrap/images/tremulous/i18n-shot-chatfield.jpg)

(http://lojban.org/~krabbykrap/images/tremulous/i18n-shot-chatfeed.jpg)
Title: Re: i18n + unicode
Post by: CreatureofHell on November 29, 2010, 10:43:00 pm
This has not been tested extensively.

Nice line.

The patch looks quite interesting.
Title: Re: i18n + unicode
Post by: khalsa on November 29, 2010, 11:03:09 pm
Sweet, Can't wait to see the way this goes! I'll have to install trem to check it out! Good work man!
Title: Re: i18n + unicode
Post by: SlackerLinux on November 29, 2010, 11:27:53 pm
wow just wow a dev hasnt even got trem installed

havent looked at the patch yet but the screenies look good
Title: Re: i18n + unicode
Post by: CATAHA on November 29, 2010, 11:41:37 pm
Good work! That one of things 1.2 definitely should have!
Title: Re: i18n + unicode
Post by: F50 on November 30, 2010, 02:16:47 am
Welcome to a whole new level of pain in trying to find which unpronounceable slurpee of characters belongs to the greifer, and which to the poor innocent noob you just banned.

This could be very good for those of us who don't want to have to type in English but...sorry in advance.
Title: Re: i18n + unicode
Post by: KillerWhale on November 30, 2010, 02:21:17 am
Holy shit Unicode fuck yes.

@F50: Slot numbers.
Title: Re: i18n + unicode
Post by: Undeference on November 30, 2010, 04:51:12 am
A few things on first glance
Title: Re: i18n + unicode
Post by: Aelita on November 30, 2010, 10:45:42 am
Quote from: khalsa
I'll have to install trem to check it out!
Title: Re: i18n + unicode
Post by: DevilishFreak on December 02, 2010, 02:55:18 pm
This is very nice! Good work!
Finally we can speak spanish in trem with good spelling  ;D

Edit: the patch doesn't work with svn 2065 :/
Title: Re: i18n + unicode
Post by: Haraldx on December 15, 2010, 04:13:21 pm
lol, "I don't speak Russian" wrote in pure Russian.  :laugh:
Title: Re: i18n + unicode
Post by: prent on December 24, 2010, 10:17:42 am
no you shouldn't do it that way...
Title: Re: i18n + unicode
Post by: SamOz on January 23, 2011, 08:02:23 pm
Can this also allow Japanese, Chinese, and Korean writing?
Title: Re: i18n + unicode
Post by: CATAHA on January 23, 2011, 09:59:15 pm
Its Unicode (http://en.wikipedia.org/wiki/Unicode), lol. =)
Title: Re: i18n + unicode
Post by: SamOz on January 27, 2011, 09:33:41 am
Its Unicode (http://en.wikipedia.org/wiki/Unicode), lol. =)

It's a patch, not a magic wand. Sometimes these ideas and patches don't work out. I still worry what the patch will do to the server otherwise.

I noticed the line "This has not been tested extensively"

See my point here?


.
Title: Re: i18n + unicode
Post by: Tremulant on January 27, 2011, 05:03:31 pm
See my point here?
It's unicode (http://en.wikipedia.org/wiki/Unicode), of course it can potentially allow any of those, see the point there?

You never asked about anything else, what kind of thing do you expect it to "do to the server otherwise"?
Title: Re: i18n + unicode
Post by: SamOz on January 27, 2011, 07:01:02 pm
See my point here?
It's unicode (http://en.wikipedia.org/wiki/Unicode), of course it can potentially allow any of those, see the point there?

You never asked about anything else, what kind of thing do you expect it to "do to the server otherwise"?

Screw-up the server, perhaps?

"potentially" is a very vague thing, btw. Clarity is an excellent method to take in communication. Politicians and salesmans love to handwave problems away by never clearly answering questions too. Do I have to add anything else besides the patch, or will the patch alone provide the fonts for those Asian languages? Is the patch going to interfere with anything else? Blithe answers don't really answer.

I notice there's also no clear instructions on how the patch is installed, or applied.
Title: Re: i18n + unicode
Post by: Tremulant on January 27, 2011, 09:01:25 pm
Well no, were you expecting to be able to use the patch as-is, does it look particularly finished? it looks like a very rough around the edges proof of concept to me, did you assume otherwise?

So, where were we? oh yeah, it's unicode, it is designed to allow one to use any number of different character sets, how well this individual patch does so is something you'll have to either check for yourself or wait for the author to respond about.
Title: Re: i18n + unicode
Post by: SamOz on January 28, 2011, 01:09:45 am
Well no, were you expecting to be able to use the patch as-is, does it look particularly finished? it looks like a very rough around the edges proof of concept to me, did you assume otherwise?

So, where were we? oh yeah, it's unicode, it is designed to allow one to use any number of different character sets, how well this individual patch does so is something you'll have to either check for yourself or wait for the author to respond about.

So, being flippant replaces clear answers for you. Thanks. I expected that. Sorry, no, I have no idea what the patch really looks like - rough, polished, wierd, strange - since I have no patches to compare it against - should I get some and stare at them too for some mysterious meaning?

Thank you for being so obfuscating.

Title: Re: i18n + unicode
Post by: Tremulant on January 28, 2011, 03:53:12 am
Sorry, no, I have no idea what the patch really looks like - rough, polished, wierd, strange - since I have no patches to compare it against - should I get some and stare at them too for some mysterious meaning?
I'd only looked at the screenshots myself, it doesn't look like a polished product from those alone, undeference has commented on the state of the code but that means nothing to me. Sure, go ahead and stare at some patches, if you feel that it'll prove enjoyable.
Thank you for being so obfuscating.
No problem, I shall continue in my endeavour to cause you inexplicable confusion and bewilderment at every turn.