Sign in to follow this  
TrickTrackMicky

Font Kerning Libs?

Recommended Posts

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.

Share this post


Link to post
Share on other sites
SiCrane    11839
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Hodgman    51234
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.

Share this post


Link to post
Share on other sites
nox_pp    499
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this