Core Text: kCTParagraphStyleSpecifierDefaultTabInterval does not work correctly with certain fonts and font sizes
| Originator: | lextar | ||
| Number: | rdar://25216315 | Date Originated: | 17-Mar-2016 03:08 PM |
| Status: | Open | Resolved: | |
| Product: | OS X | Product Version: | Mac OS X 10.11.3 (15D21) |
| Classification: | Other Bug | Reproducible: | Always |
Summary: I’m using Core Text to draw text that contains tab characters. The code creates a CTParagraphStyle and sets the kCTParagraphStyleSpecifierDefaultTabInterval setting. The kCTParagraphStyleSpecifierTabStops settings is set to nil. For most font and font size combinations this works as expected, but for some combinations the tab indentation breaks. I could reproduce the issue in a small Swift playground example that I have attached to the bug report. Steps to Reproduce: - Run the attached Swift Playground. Have a look at the NSView quick look previews at the bottom of the file. Expected Results: - Line 5 and 6 of the string should be properly indented and respect the tab characters in the string for all font and font size combinations Actual Results: - Instead, when using the font „PT Mono“ and font size 11.0, line 5 and 6 have the same indentation as line 4. Regression: - This also happens with fonts such as „Source Code Pro“, „Letter Gothic Std“ or „Prestige Elite Std“. I actually discovered this problem with the font „Source Code Pro“, but the playground uses „PT Mono“, since this should be preinstalled on all systems. It happens when using the following font sizes: 11.0, 22.0, 39.0, 44.0, 73.0 and so on… Even when changing the font size slightly from 11.0 to 11.01 it works as expected. The same issues also happens on iOS.
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!