Jump to content

  • Log In with Google      Sign In   
  • Create Account


Font Kerning Libs?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 TrickTrackMicky   Members   -  Reputation: 108

Like
0Likes
Like

Posted 17 October 2012 - 02:45 PM

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.

Sponsor:

#2 SiCrane   Moderators   -  Reputation: 9541

Like
1Likes
Like

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 TrickTrackMicky   Members   -  Reputation: 108

Like
0Likes
Like

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.

#4 Hodgman   Moderators   -  Reputation: 29395

Like
1Likes
Like

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 nox_pp   Members   -  Reputation: 490

Like
0Likes
Like

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

Between Scylla and Charybdis: First Look <-- The game I'm working on

 

Object-Oriented Programming Sucks <-- The kind of thing I say





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS