Measure the size of each char in an NSString

We have [NSString sizeWithFont:], which returns the size of the entire row.

How to get an array of sizes of each individual character in a string?

How would you do this (besides string tokenization and calling sizeWithFont for each)?

Best, Vance

+1
source share
1 answer

You should be able to get information about the sizes of individual glyphs (note that they are not always compared with each other with individual characters in a string) using the Core Graphics function CGFontGetGlyphBBoxes.

0
source