I have been using bitmap fonts with OpenGL. Its a basic scheme that uses kerning information and does para layout. I would like to know if I can get kerning information of fonts through CoreText, so that I can continue using OpenGL for my text rendering. It appears that in CoreText you can specify a string, gets its glyphs and the advances for the glyphs. Then I imagine one can back calculate the glyphs for specific kernings. But what I would like is all the kerning pairs.
The brute force would be to create a (really long) string of all possible character pairs, which would be more than a mile long, and then have the advances from CoreText and back calculate the kerning information. But if there were a direct way to get kerning that would less messy, I would like that. I know on Windows you can do this, but I was hoping something similar were available in CoreText or Quartz.
Asked
Active
Viewed 352 times
0
-
if you use core text it will handle spacing between letters/words and wrap. I did a console with core text http://stackoverflow.com/questions/14921476/core-text-view-memory-leak it prints a line at a time out and i had to handle spacing between lines and came up with some jury rigged formula base on font height to prevent crashes. this isn't an exact answer(that's why this is just a comment) but i hadn't seen you get any responses. – LanternMike May 30 '13 at 22:30
-
Thanks the code is useful for reference. But I would like to keep control on doing the layout myself as I have my own fonts too. And CoreText layout won't port. So I need to know everything that CoreText knows that allows it to do the layout on words and lines. So mostly what I need is char widths and kerning. The font height I have already as you did too. I am experimenting and if I find a brute force to do this I will publish it. – nishant Jun 01 '13 at 08:13