Measure size of each char in an NSString
We 开发者_运维技巧have [NSString sizeWithFont:] which returns the size of the entire string.
What about getting an array of the sizes of each individual character within the string?
How would you do that (besides tokenizing the string and calling sizeWithFont for each)?
Best, Vance
You should be able to get size information about individual glyphs (note though that those don't always map one-to-one with individual characters in a string) by using the Core Graphics function CGFontGetGlyphBBoxes
.
精彩评论