Specific fonts won't work with Angelfont?

Monkey Forums/Monkey Programming/Specific fonts won't work with Angelfont?

Lillpeter(Posted 2016) [#1]
Hi guys. I'm just totally lost on something. I'm trying to create a font for my game using Angelfont. I export the font using the Bitmap font generator commonly used with Angelfont. When loading the .fnt file using LoadFontXml i get a crash in list.monkey (More specifically at: _curr=list._head._succ).

Class Enumerator<T>

Method New( list:List<T> )
_list=list
_curr=list._head._succ
End Method

I've been pulling my hair (literally) for a while now and have found out that the crash depends on the specific font I use when exporting from the font generator (I assume the .fnt file end up with sketchy data then). When using most of my installed fonts everything works fine, but apparently not when using the .ttf font I downloaded from Goggle Fonts yesterday. So the problem has to with with something tied to my installed font, but I have no idea of what that could be? The image file being exported from the font generator looks fine!

Any ideas?


Gerry Quinn(Posted 2016) [#2]
Just guessing, but I'd look at the font generator output first. Or else try to narrow things down by poking about in the Angelfont code, which is not that complex, to find out just what it is kicking on. Angelfont should be pretty blind to the font itself, if the image is right, Do other fonts the same size work?

Idea: maybe there is one really wacky symbol somewhere that may be semi-invisible. You could try making an image file restricted to the characters you need, e.g. Latin characters and common symbols.


Lillpeter(Posted 2016) [#3]
Aahh! When comparing the working vs the faulty .fnt files the broken one was missing a set of kerning definitions, adding this tag made it work. It also seems like AngelFont assume there is always at least one entry within these tags as I still get a crash if there are none at all!

<kernings count="164">
<kerning first="39" second="65" amount="-1" />
...
</kernings>

Thanks for the tip Gerry Quinn! I realized the output .fnt files are the same as .xml so that was an easy matter to look into first. Don't know if I need to modify any code as I will only use basic characters in a few places in my game. Perhaps the font I'm using does not need any kerning at all and that's why that data is missing, but if neccessary I guess I could add kerning between some characters manually if I need to.