system(size:weight:design:)
Specifies a system font to use, along with the style, weight, and any design parameters you want applied to the text.
Declaration
static func system(size: CGFloat, weight: Font.Weight = .regular, design: Font.Design = .default) -> FontDiscussion
Use this function to create a system font by specifying the size and weight, and a type design together. The following styles the system font as 17 point, semibold text:
Text("Hello").font(.system(size: 17, weight: .semibold))While the following styles the text as 17 point bold, and applies a serif Font.Design to the system font:
Text("Hello").font(.system(size: 17, weight: .bold, design: .serif))If you want to use the default Font.Weight (regular), you don’t need to specify the weight in the method. The following example styles the text as 17 point regular, and uses a Font.Design.rounded system font:
Text("Hello").font(.system(size: 17, design: .rounded))