lionheart / openradar-mirror

A mirror of radars pulled from http://openradar.me/.
245 stars 17 forks source link

29758498: NSTextField with tabs in text displays incorrectly in 10.12.2 #16580

Open openradar-mirror opened 7 years ago

openradar-mirror commented 7 years ago

Description

Summary: An NSTextField contains text with tabs in order to display a data table. The text has an NSParagraphStyle with its tabStops property set to an array containing a number of right-aligned NSTextTabs. The text field was drawn as intended (with the text aligned to the tab stops) before upgrading to 10.12.2. After upgraded, the text was no longer aligned to the tab stops, and when using monospacedDigitsSystemFont there were cosmetic glitches displayed as well. See the attached screen shots.

Steps to Reproduce: Build and run the attached test project with Xcode 8 (any version) under macOS 10.12.2. Use the popup button to select the font for the text field (system font; system font with monospaced digits; and user font).

Expected Results: The window should display a data table with the numbers in right-aligned columns, no matter which font is selected.

Actual Results: With the system font selected, the text in the table appears as though the tabs were spaces, without any alignment. If the font is changed to the monospaced digits variation, cosmetic graphic glitches appear where the tab characters are located (see the attached screenshots). Neither of these are desirable.

[Switching to the user font displays the text in aligned columns as intended.]

Version: macOS 10.12.2 (16C67)

Notes: This problem did not exist before 10.12.2 (including earlier OS releases; I tested back as far as 10.9.5).

Workarounds (see the attached "Additional Notes" file for more discussion): 1) Don't use the system font (use the user font instead, e.g.) 2) Use an NSTextView instead of an NSTextField 3) Ensure that wantsLayer is set on the window's content view

Configuration: MacBookPro11,5 16 GB RAM 512 GB SSD macOS 10.12.2 (16C67)


Additional note: When running the application in Xcode, at the point at which the erroneous text field display occurs, the system displays repeated copies of the following message in the console: CoreText: *** Unmapped "\t" ".SFNSText 11.00 pt. P [] (0x10486a490) fobj=0x10486a490, spc=3.17" The hexadecimal number (address?) can vary. Typically there are ten copies of this message, with the address staying the same for four messages, then changing for the next four, etc. (I have no insight as to why ten messages appear.)

- Product Version: 10.12.2 Created: 2016-12-20T20:42:16.828060 Originated: 2016-12-20T00:00:00 Open Radar Link: http://www.openradar.me/29758498

openradar-mirror commented 7 years ago

Modified: 2017-01-05T16:19:18.545930

openradar-mirror commented 7 years ago

Modified: 2017-01-05T16:19:18.545930