Hello,
Sorry if this is the wrong place as this is my first post.
I need help with some understanding with kerning font values. I completely understand how font kerning works but I'm used to importing kerning values for a specific font through a file. Now what I plan on doing is writing a bitmap font creator ( I know they exist, it's just a side project). I'm planning on having similar functionality to what angel code does if anyone is familiar with that. What I'm thinking is there has to be some sort of lib. out there that contains kerning values for standard fonts and all their sizes. I refuse to believe that people just hard code these values into some ridiculously long file or multiple files.
If that isn't the cases then how to programs such as... well any program that you can type in handle the kerning of multiple fonts and their sizes? Do they really just have multiple files for each specific case and load them in once the specific is set?
Any enlightenment to this would be greatly appreciated.
4 replies to this topic
Sponsor:
#2 Moderators - Reputation: 6786
Posted 17 October 2012 - 03:20 PM
Kerning information is generally embedded in the font itself. The TrueType font format has an optional kerning table as part of the spec for pairs of glyphs and OpenType has a more complicated, but more robust, kerning information table.
#3 Members - Reputation: 108
Posted 17 October 2012 - 08:10 PM
Interesting, I was unaware that the values were directly embedded into the font itself. Kind of silly to think otherwise. I imagine it's just as easy as reading in the specific tables of the font itself. OTF as you said is more complicated so that would obviously be handled slightly differently.
Thanks for the assistance SiCrane, I have a clear understanding of how I need to go about it.
Thanks for the assistance SiCrane, I have a clear understanding of how I need to go about it.
#4 Moderators - Reputation: 14301
Posted 17 October 2012 - 08:34 PM
If for some reason you can't use the original values -- e.g. if your bitmap glyphs have been modified form the original TTF data, such as adding outlines, etc -- you can brute-force discover them by placing each possible pair of glyphs side by side, and then iteratively moving them 1 pixel closer together until a non-transparent pixel overlaps.
#5 Members - Reputation: 429
Posted 20 October 2012 - 03:49 PM
Do you know about FreeType?
http://freetype.sourceforge.net/index2.html
It can make your job much easier.
Alternatively, stb_truetype, http://mollyrocket.com/forums/viewtopic.php?t=736
http://freetype.sourceforge.net/index2.html
It can make your job much easier.
Alternatively, stb_truetype, http://mollyrocket.com/forums/viewtopic.php?t=736






