在iOS 14中获取strokeWidth NSAttributedString的问题
我在iOS 14上的笔触颜色有问题.
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
iOS 14
它可以在iOS 13上运行,但不能在iOS 14上运行.有人可以帮助我解决此问题吗?
It is working on iOS 13 but not working in iOS 14. Can anyone help me to resolve this issue?
Apple似乎已更改了iOS 14中的字体轮廓,其中6和9的字形显示了相似的伪像.我会向Apple提交错误.
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.
根据您的要求,使用 UIFont.monospacedSystemFont(...)
可能有效,这些字形在我看来仍然可以.("1"在等距版本中也有伪像.也许使用 UIFont(名称:"HelveticaNeue-Bold",大小:65)
?)
Depending on your requirements, using UIFont.monospacedSystemFont(...)
could work, those glyphs still look OK to me. ( "1" has artifacts in the monospaced version as well. Maybe use UIFont(name: "HelveticaNeue-Bold", size: 65)
instead?)