Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

i.yalovecky

macrumors member
Original poster
Feb 24, 2010
67
0
How i can do it? User can change Fontsize and font family in NSTextField, and i need to get width for specified symbol. Thanks.
 
Probably something like

bool CGFontGetGlyphBBoxes (
CGFontRef font,
const CGGlyph glyphs[],
size_t count,
CGRect bboxes[]
);

Pass it your font, your symbol (glyph), 1, and a CGRect and if the function returns true then CGRect.width should contain the appropriate width you are looking for.
 
Probably something like
Pass it your font, your symbol (glyph), 1, and a CGRect and if the function returns true then CGRect.width should contain the appropriate width you are looking for.
How i can convert unichar or NSString* to glyphs?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.