Using strange characters in my font...

Started by Technocrat, Wed 02/05/2012 00:17:16

Previous topic - Next topic

Technocrat

I've created a custom font, and I plan to see that the game is translated into French. Since french involves characters not present in English (acute accents, etc), I've decided to make use of thepeculiar set of symbols in the top cluster of this font, since they'd otherwise never be used in this game.



Problem is, I have no idea how these things would be entered into the text in AGS. My character map doesn't have "smiley face" or "double exclamation mark".

Could anyone explain to me how these strange letters could be placed into a character's speech? Merci!

Khris

Try this:
Code: ags
  Display("Character test: %c", 25);

That might produce the arrow pointing down.

However, the first 32 characters are reserved and non-printable afaik, at least in ASCII-Code.
For instance, 10 and 13 are the line feed and carriage return codes, and 27 is the Escape key.

What I did when I wanted to add a â,,¢ to my game was use a ttf font and add it using a ttf editor.

Deu2000

#2
If you are going to translate your game into a language that has accents, try to erase the accents. I do that when i'm translating my games into spanish. Adios!



Technocrat

Quote from: Deu2000 on Wed 02/05/2012 07:58:48
If you are going to translate your game into a language that has accents, try to erase the accents. I do that when i'm translating my games into spanish. Adios!

Is that a reasonable thing to do? Most of my experience of languages with accents comes from school, where they'd have you executed if you missed them out, and insist that nobody could possibly understand what you mean without them. Granted, I'm sure that was hyperbole on their part, but (for example, in Spanish) is it still acceptable do leave the accents out?

Deu2000

In spanish a word can have several meanings depending on accents, and i think in french too (example: bajo (under) bajó (he went down)). But our case is that we can deduct the meaning, given the complete sentence.



cat

Aren't there also other different letters in French? I think there is some kind of c with an s attached to the bottom. If you intend to do a German translation as well for example, you will have to use umlauts anyway. Maybe it's better to use TTF from the start.

Alan v.Drake

Either use a TTF font or beg Radiant to release a new FontEdit that supports 256 characters font which you can use with AGS draconian.

The hard way is making two fonts and then merging them together.
Each standard wfn fonts is composed like this:

Header: 15 bytes
Address to character table: 2 bytes
Fonts data: ----
Character table: the last 256 bytes (128 entries of 2 bytes: adressess)

You'll need an hexadecimal editor like WinHEX and do this:
1. take the font data from the second  font and append it at the end of the font data of the first (prior to the character table)
2. do the same to the character table
3. update the Address to character table to point to the new position (the character table has been pushed down)
4. alter the address values of the second part of the character table so they point to the correct places, you'll have to do some math and use the "Modify data..." (16bit unsigned) feature
5. pray it works

Or you could write an application that does that.

Have fun.

- Alan


Snarky

That's good info, Alan. Do you have more details on how the actual font data is stored? I'm assuming it's literally a sequence of bitmaps, but how are the dimensions indicated, for example?

Alan v.Drake

Quote from: Snarky on Wed 02/05/2012 21:20:53
That's good info, Alan. Do you have more details on how the actual font data is stored? I'm assuming it's literally a sequence of bitmaps, but how are the dimensions indicated, for example?

There was a thread anout it on the forums if I recal correctly, I didn't get into understanding the inner workings of how it's stored because I realized I didn't need to for what I was doing.
A glance at the code might sate your enquiries -> acfonts.cpp

- Alan

SMF spam blocked by CleanTalk