UIFont.withSize(_:) does not work on UIFont.monospacedDigitSystemFont

Originator:ian.terrell
Number:rdar://28965717 Date Originated:10/28/2016
Status:Open Resolved:
Product:iOS Product Version:
Classification: Reproducible:
 
Area:
UIKit

Summary:
When I copy a monospacedDigitSystemFont using withSize, it does not keep the monospaced digits.

Steps to Reproduce:
Create a font via UIFont.monospacedDigitSystemFont(ofSize:weight:).
Create a copy by calling .withSize(_:) on it, with any size.

Observe that the new font does not use monospaced digits.

Expected Results:
New font uses monospaced digits, as the documentation on UIFont.withSize(_:) states that:

Returns a font object that is the same as the receiver but which has the specified size instead.

Actual Results:
New font does not have monospaced digits.

Version:
iOS 10.1

Notes:


Configuration:
Simulator, iPhone 7 plus

Attachments:
'MonospaceDigitFontWithSize.zip' was successfully uploaded.

Comments

Duplicate of 25596276

By ian.terrell at Oct. 30, 2016, 6:50 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!