UITextView font bug

Originator:an00na
Number:rdar://18454837 Date Originated:25-Sep-2014 10:34 AM
Status:Open Resolved:
Product:iOS SDK Product Version:iOS 10 beta 1
Classification:UI/Usability Reproducible:Always
 
Summary:
With FontDescriptorCascadeList being [A, B], after encountering one character that is not supported by font A but supported by font B, UITextView incorrectly continues using font B after that character even if the following characters are perfectly supported by font A and A is before B in FontDescriptorCascadeList.

Notice: the text and fonts are all Chinese, so you'd better have a Chinese engineer to help. The zip file is large because I have to pack in the Chinese font.

In the sample app, font A is "STKaiti-SC-Regular", font B is "STHeitiSC-Light", the character that is supported by B but not A is "⋯", the character that is supported by both A and B is "字".

If rendered correctly, "字" should be the same before and after "⋯".

The 1st line is correctly rendered using Core Text.
The 2nd line is correctly rendered by UILabel.
The 3rd line is incorrectly rendered by UITextView. Notice "字" after "⋯" is not the same as the one before "⋯" because it is incorrectly using font "STHeitiSC-Light" instead of "STKaiti-SC-Regular".

Steps to Reproduce:
1. Launch sample app.
2. Compare the three lines of text.
3. Read the console log to see the incorrect attributed string of UITextView.

Expected Results:
 "字" should be rendered exactly the same before and after "⋯".

Actual Results:
"字" after "⋯" is not rendered the same as the one before "⋯".

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!