'SwiftUI custom font meta data requirements for "native" `.bold()` modifier
From https://blog.eidinger.info/what-can-go-wrong-when-using-custom-fonts-in-swiftui I recently learned, that if we have a font-regular and font-bold SwiftUI can infer the bold font when we use the .bold() modifier, which is awesome. (If we registre them).
Now I have two licensed fonts, one where it works and one where it doesn't, and I wonder what in the meta-data of the fonts could break this behaviour?
I have the two fonts: SharpSans and SharpGrotesk, both in a medium and a bold format. For the SharpSans it all just works. It uses the medium as regular, and responds to .bold(), .fontWeight() and even SwiftUI.Text markdown boldness. However, for SharpGrotesk it only works by using .fontWeight() but I would very much like it to support both .bold() and SwiftUI.Text markdown formatting.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
