Font doesn't display čšž characters

Started by viktor, Tue 04/02/2014 20:09:41

Previous topic - Next topic

viktor

Hello!

I've recently started developing a new short game that is suppose to be in Slovenian language. So I REALLY need the use of Ã,,Å'Š Ž characters but whenever I type  in the characters it only displays question marks or some other character. I found an old 2008 thread that addressed this issue (surprisingly for the same language :P) but the solution there didn't work for me. I tried using the font provided in that thread but it didn't work. Is there a setting I'm missing?
signature" border="0
<a target='_blank' href='https://imgbb.com/'>resurrection pictures for facebook</a>

monkey0506

I'm not very familiar with foreign characters in AGS, but 1) what are the decimal values of those characters, and 2) are you using a TTF font? Using an WFN font you can only access characters 0-127, a TTF font will let you access characters 0-255. There's currently no support for extended character sets (characters beyond decimal 255).

viktor

It is a TTF font but I don't really know what the decimal values are. How can I check that?
signature" border="0
<a target='_blank' href='https://imgbb.com/'>resurrection pictures for facebook</a>

Crimson Wizard

#3
Monsieur OUXX wrote this wiki page on fonts, perhaps you'll find some useful info there:
http://www.adventuregamestudio.co.uk/wiki/Fonts
specifically this section:
http://www.adventuregamestudio.co.uk/wiki/Fonts#how_to_surf_from_128_to_256_characters.2C_and_back

Quote from: viktor on Tue 04/02/2014 21:45:59
It is a TTF font but I don't really know what the decimal values are. How can I check that?
This really depend on code rules the font follows (font is just a bunch of pictures bound to some numbers, so you can easily create a font that displays weird symbols instead of "normal" letters).
On Windows you may check "Character Map" utility ( Programs » Accessories » System Tools » Character Map in English version; may be called differently on other languages).

viktor

I tried using the default cambria windows font (according to the lucky guy's strategy that should have worked) that I know has the characters. The character code for Š  for instance is U+016 (if that's the right code I'm looking at anyway). It's a .ttf font so I don't know what's up here.

I also tried using this font:
http://www.fontsquirrel.com/fonts/uni-05_53?q[term]=pixel&q[search_check]=Y
signature" border="0
<a target='_blank' href='https://imgbb.com/'>resurrection pictures for facebook</a>

monkey0506

The character code is actually U+0160. The number following the U+ is a hexadecimal value, so that's decimal value 352. AGS only supports characters up to decimal value 255 (or 0xFF). Anything higher than that, even if supported by the font, won't be supported by AGS.

Crimson Wizard

The solution can be to use a font that has Slovenian characters mapped to ids below 256.
Even if there's such font (or you could create one) what is left is to make it possible (and convenient) to type those characters. If there's a 8-bit encoding that supports Slovenian (and you can switch your keyboard mode to that encoding) this could solve the second problem.

For an example, there's a common solution for Russian language that I once used to translate AGS game: it is Cyrillic encoding Windows-1251 supported by russian version of Windows. All I had to do is to get a font that has cyrillic characters on numbers corresponding to that encoding. Then I could just use the "russian" keyboard mode to type a translation file, and that worked (I could type into AGS script too if I wanted).

I am no expert of Slovenian encodings or keyboards, but maybe you could check if similar way exists for you.
Wikipedia mentions ISO_8859 8-bit encoding with Slovenian characters.

viktor

This is starting to get frustrating. I can't find a free TTF font in that format. Slovenian fonts are hard enough to find but I can't even seem to find a czech or similar language font that has the same characters :(. I guess all that's left is to try and remap. I just hope I'm capable enough :P.
signature" border="0
<a target='_blank' href='https://imgbb.com/'>resurrection pictures for facebook</a>

Crimson Wizard

#8
You could make TTF font yourself in some editor by copying letters from existing font according to encoding table:
http://en.wikipedia.org/wiki/ISO/IEC_8859-2#Code_page_layout

Can't tell how quick/easy that would be.

viktor

#9
Well... I managed a workaround. I remapped the characters Ã,,Å'Š Ž to the WXY hexes since Slovenian language doesn't use them. Then I made a new Slovenian keyboard layout and mapped the wxy keys to the Ã,,šž position. The only con to this is that in the source a word like prepriÃ,,an (meaning "to be sure") is spelled like prepriwan. At least it shows right in the game :P.

EDIT: I'll try the font creator later this week too. For now I'll concentrate on the design an layout then worry about the font. At least now I know that it is possible to write the characters. It would be a real drag to design a whole game and not have the language options the game was intended for :P
signature" border="0
<a target='_blank' href='https://imgbb.com/'>resurrection pictures for facebook</a>

Crimson Wizard

#10
I made a quick search and found a cool program called "Font Creator".
http://www.high-logic.com/font-editor/fontcreator.html
It has a trial version for 30 days, and allows to simply copy/paste letters in the table. You can open 2 fonts and copy letters from one to another, to other slots.
Maybe there are other editors out there that can do same.

EDIT: Also there's a free FontForge, I think I used that one few years ago, but I remember it was glitchy. I hope it improved since.

Quote from: viktor on Thu 06/02/2014 11:05:41
Well... I managed a workaround. I remapped the characters Ã,,Å'Š Ž to the WXY hexes since Slovenian language doesn't use them. Then I made a new Slovenian keyboard layout and mapped the wxy keys to the Ã,,šž position. The only con to this is that in the source a word like prepriÃ,,an (meaning "to be sure") is spelled like prepriwan. At least it shows right in the game :P.
Oh, well, that's a solution too. :)

SMF spam blocked by CleanTalk