My font... it's acting weird.

Started by DBoyWheeler, Wed 18/07/2018 13:42:20

Previous topic - Next topic

DBoyWheeler

(I'm sure this is an advanced issue, but I won't object if this needs to be moved to "Beginner" stuff.)

Okay, I've been making up a custom font for a game project, as some of the characters have Norwegian names, and thus needing special characters.

So, I went to Calligraphr to make up special fonts.  I'd add them here if there were an option to.

But, instead of showing the special characters, like that ae diphthong, it just shows a box.

How do I get AGS to recognize special characters in a font?

Crimson Wizard

#1
AGS is strictly ANSI program, which means that you can only use slots 0-255 in font. All other letters will be ignored.

If your game is primarily not in Norwegian language, but you simply want to use special letters in limited case, then the best solution IMHO is to choose some slots that are not used in your main font and put these letters there. Of course you will have to type these letters using original letters in your script.

If typing by hand is difficult (e.g. you position the letter in slot 255 and do not know what letter in your system locale's corresponds to it), you may try setting these letters programmatically using String.ReplaceCharAt(index, number_of_slot), or String.Format("Regular text and then special letter: %c", number_of_slot);

Snarky

The Norwegian letters are included in the most common ANSI codepages (which means: they're among the 256 characters that can be used in old-school strings). For example, in Windows-1252, you have:

Æ=198, æ=230, Ø=216, ø=248, Š=197, å=229

I would recommend starting with a TTF font that has the characters, testing that that works in AGS, and using the same slots for the characters in your own font. That way it should just work, I think.

Cassiebsg

Also, at least in Danish, you can replace the special letters with normal letters.
As in Æ = AE, Ø = OE and Š = AA ... But not sure Norwegian uses these exact matches... you might want to investigate that if you wish to save your self some trouble with special characters. The special characters are actually "new/modern" letters.
There are those who believe that life here began out there...

DBoyWheeler

Right.  I guess I'll have to see what substitutions I can make.  Thanks.

Monsieur OUXX

Reposting this : http://www.adventuregamestudio.co.uk/wiki/Fonts
The advice provided in previous posts is the right advice :
1) find a font (potentially TTF) that has all the characters (you can filter fonts on that criteria on free fonts sites).
2) convert it to bitmap, using any of the tools in the article. Keep only the relevant 256 characters and put them in the right slots, matching Windows-1252.
3) Import it into AGS, still using any of the methods from the article.
 

SMF spam blocked by CleanTalk