gonzalezreal / swift-markdown-ui

Display and customize Markdown text in SwiftUI
MIT License
2.53k stars 318 forks source link

Font+FontProperties: Avoid losing explicit precision #202

Closed b8591340 closed 1 year ago

b8591340 commented 1 year ago

Explicit fractional point sizes were being silently rounded. I assume it could have been desired behavior, only it's not expected nor communicated, and we cannot opt-out otherwise.

gonzalezreal commented 1 year ago

Yes, the idea is to have integral font sizes. Can you elaborate on the reasons for having fractional font sizes? By the way, this change will break the snapshot tests and the FontProperties tests.

b8591340 commented 1 year ago

I see! I only noticed when I was trying to replicate a pixel size from the web. We can close this if you’d rather keep integral sizes. It could be documented, but other than that it’s not that important to me—especially if it’s being relied upon by other users.

Thanks for the library by the way!

gonzalezreal commented 1 year ago

The decision on rounding font sizes is based on the belief that it will produce crispier text. If I'm proven wrong, I'll be happy to reconsider.

Thanks for the feedback! I will add this to the documentation.