CTFontGetBoundingRectsForGlyphs on Lion returns bad left for monospaced fonts
Originator: | caryclark | ||
Number: | rdar://10377021 | Date Originated: | 2011-11-01 |
Status: | Open | Resolved: | |
Product: | Mac OS X | Product Version: | 10.7 |
Classification: | Serious Bug | Reproducible: | Yes |
Call: CTFontGetBoundingRectsForGlyphs(mFont, kCTFontDefaultOrientation, &cgGlyph, &theBounds, 1); where mFont is Courier New and cgGlyph is 11 (the left parenthesis). This computes theBounds.origin.x as 0, instead of > 0 (it's around 11 for at 24 pt). CTFontGetBoundingRectsForGlyphs fails for all glyphs in a font that are greater than the 'hhea' numOfLongHorMetrics entry. For Courier New, this is all glyphs except for the missing glyph at location 0. CGFontGetBBoxes on 10.7 fails the same way. Both calls work correctly on 10.6 with identical font data. One workaround is to read the TrueType tables directly, as shown here: http://code.google.com/p/skia/source/diff?spec=svn2593&old=2528&r=2578&format=unidiff&path=%2Ftrunk%2Fsrc%2Fports%2FSkFontHost_mac_coretext.cpp
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!