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
  • 4,902
  • 6
  • 42
  • 80
vikas prajapati
  • 1,794
  • 1
  • 16
  • 24

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
  • 16,040
  • 4
  • 38
  • 69