Game Development Community

Font Characters Extended ASCII Codes

by Markus Schwaerzler · in Torque 2D Beginner · 08/19/2014 (8:16 am) · 4 replies

Is it possible to use the Extended ASCII Codes in the Font's-Asset?

I get only the charactes between 32 and 128.
I need the higer characters for the german language support.

In Germany, Austria we have specials Characters like number 132 ä and so on!

#1
08/19/2014 (11:46 am)
I think this will take a bit of work - internationalization support has fallen behind quite a bit and I if I recall it's pretty broken.
#2
08/19/2014 (12:15 pm)
Torque uses UTF-8 formatting for displaying text. You will need to convert code 132 to the equivalent UTF-8 encoded unicode character in order for it to display correctly.
#3
08/19/2014 (10:39 pm)
ImageFont might be the easiest to "upgrade". I think the text there is simply stored in a string. Anything above 128 simply gets converted into a space at the moment. Here's the section in ImageFont.cc:

// Fetch character.
        U32 character = mText.getChar( characterIndex );

        // Set character to "space" if it's out of bounds.
        if ( character < 32 || character > 128 )
            character = 32;

        // Calculate character frame index.
        const U32 characterFrameIndex = character - 32;

I've got the umlauts on my keyboard, I'll have to try expanding upon this when I find some free time.

There's also nothing stopping you right now with ImageFont from stealing a symbol or other character in the standard ASCII set and swapping that for an umlaut or es-zet.
#4
08/19/2014 (11:20 pm)
Thanks for the reply.
At the moment I will use GUITextCtl to show the text. If I had more time I will look into the imagefont.cc

Thanks