Use fonts in SwiftUI

Hello there!
Does anyone know how to apply Apple's default fonts to text in SwiftUI?

Answered by SpiderKenny in 710982022

Sure! So do soemthing like this:

Text("Hello World!").font(.custom("Copperplate", size: 33))

You don't give us much to go on! What have you tried so far?

Basically you just need to add the .font() modifier to any Text object. Like this:

Text("Hello, world")
				.font(.headline)

@SpiderKenny actually I want to change the style of the text.

.font(.system(size: 20))

will select the system font in size 20.

Is it what you are looking for ?

Sorry, I didn't express myself well... I need to change the text style and apply a font on it (like: Palatino, Gill Sans, Futura, SF Pro etc...).
Is it possible?

Accepted Answer

Sure! So do soemthing like this:

Text("Hello World!").font(.custom("Copperplate", size: 33))
Use fonts in SwiftUI
 
 
Q