11

I have an issue with stroke color on iOS 14.

let attributes: [NSAttributedString.Key: Any] = [
    .foregroundColor: UIColor.white,
    .strokeColor: UIColor.black,
    .font: UIFont.systemFont(ofSize: 65, weight: .black),
    .strokeWidth: -1 
]
lableNumber.attributedText =  NSAttributedString(string: "2", attributes: attributes)

iOS 13

enter image description here

iOS 14

example

It is working on iOS 13 but not working in iOS 14. Can anyone help me to resolve this issue?

koen
  • 5,383
  • 7
  • 50
  • 89
vikas prajapati
  • 1,868
  • 2
  • 18
  • 26

1 Answers1

4

Looks like Apple has changed the font outlines in iOS 14, the glyphs for 6 and 9 exhibit similar artifacts. I would file a bug with Apple.

Depending on your requirements, using UIFont.monospacedSystemFont(...) could work, those glyphs still look OK to me. (Edit: "1" has artifacts in the monospaced version as well. Maybe use UIFont(name: "HelveticaNeue-Bold", size: 65) instead?)

Gereon
  • 17,258
  • 4
  • 42
  • 73