CTFramesetterSuggestFrameSizeWithConstraints returns a size smaller than needed to render the text

Originator:powerchart.touch
Number:rdar://11896495 Date Originated:7/17/2012
Status:Open Resolved:
Product:iPad SDK Product Version:5.1
Classification:Serious Bug Reproducible:Always
 
Summary: CTFramesetterSuggestFrameSizeWithConstraints returns a size smaller than what's needed to render the text

Steps to Reproduce:

1. Have some text with sad face character (\u263A).
2. Have a size you want to fit to the text.
3. Call CTFramesetterSuggestFrameSizeWithConstraints.

Expected Results:
You get a size that completely fits the text as tightly as possible.

Actual Results:
CTFramesetterSuggestFrameSizeWithConstraints returns a size that does not actually fit the entire input text (despite the constraint size being more than big enough to fit it).

Regression:
Unknown.

Notes:

Running XCode Version 4.3.2 (4E2002) with iOS SDK 5.1 on MacBook Pro with Mac OS X Version 10.7.4

Comments

Issue closed

Engineering has determined that this issue behaves as intended based on the following information:

The label frame is only 21 points high but the attributed string requires 26 points, hence CTFramesetterSuggestFrameSizeWithConstraints is returning (0, 0). Generally this function is used with only one dimension being constrained in order to determine what the other one should be. Additionally, there is no guarantee of metrics compatibility between CoreText and UILabel.

By powerchart.touch at Oct. 1, 2012, 6:19 p.m. (reply...)

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!