UITextView Ignores Font Kerning

Originator:oliver.drobnik
Number:rdar://12889869 Date Originated:Dec 16th, 2012
Status:Open Resolved:
Product:iPhone SDK Product Version:6.0
Classification:Serious Bug Reproducible:Always
 
Summary:

When setting an attributedText on a UITextView the text is rendered with Kerning disabled.


Steps to Reproduce:

Create a simple attributed string, e.g. "AV" in Times New Roman with 50 px font size

Expected Results:

When setting this attributed string on a UITextView it should display the text with Kerning, as is the default when rendering this text via CoreText. For the example "AV" the right bottom of the A is overlapping the left top of the V.

Actual Results:

Letters do not overlap making the text harder to read. Especially if using UITextView to display a longer text for reading it is bad to have Kerning disabled.

Regression:

Support for NSAttributedText is new as of iOS 6.

Notes:

Internally UITextView converts the attributed string to HTML via NSHTMLWriter and then displays it in a UIWebDocumentView. The default mode for this is to have Kerning disabled.

It can be enabled by the CSS style, which is mentioned at http://en.wikipedia.org/wiki/Kerning

text-rendering: optimizeLegibility;


Having this not be the default also confuses developer, as you can see on this question on stack overflow: http://stackoverflow.com/questions/13239267/kerning-in-ios-uitextview


I propose that when text is set via setAttributedText on UITextView to make this setting the default since as a developer we would expect the output to match CoreText as closely as possible.

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!