So SwiftUI gives us a nice .font() extension that lets us set the font size, style, weight, etc. of text. This mirrors CSS's font attributes nicely, and even comes with nice shorthands like .font(.title), .font(.body), .font(.caption).
CSS shines when it comes to custom fonts, allowing us to import font faces from one or more files that collectively define several weights and styles within the same family. You can then use that font everywhere automatically by declaring a font family at the top level of the document, and then all font declarations will use that font automatically.
iOS allows us to import custom fonts, but it seems to fall short when it comes to using them. I'm looking for a way for iOS to mirror CSS's behavior.
I have 10 font files for a single font family: 5 different weights (light, regular, semi-bold, bold, and extra-bold) each with a regular and italic style. I am able to instantiate UIFonts for these fonts, but I'm looking for a way to set this font family globally so that I can declare .font(.title, weight: .bold) and have it implicitly use my font family's bold variant with the title size.
I am aware of ways to globally override the font, but I am specifically looking for a way to use multiple fonts from the same family to have automatic bold and italic capabilities. If there is a nice SwiftUI way to do this, that would be preferred, but a UIKit solution is fine as well.
EDIT: Another thing I should have mentioned is that I would like the default font of every View to use my font even with no .font() modifier. So if I have
Text("Hello, world")
it should use my font with the default weight and size (I think this is .body).