1

is there any way to change the font of whole swiftUI project from one place. for example in swift we override UIFontDescriptor, CTFontRegularUsage in these similar way, is any possible to override font to whole swiftUI app.

please provide any suggestions regarding this.

Maharajan S
  • 93
  • 10

1 Answers1

-2

Yes, you can, like this example code, once you modify parent the children would use the value, if you do not modify them explicitly!

    @main
struct YourApp: App {
    var body: some Scene {
        WindowGroup {
            ContentView()
                .font(Font.custom("Charter-Black", size: 20)) // <<: Here!
        }
    }
}

struct ContentView: View {
    
    var body: some View {
        
        Text("Hello, World!")

    }
    
}
ios coder
  • 1
  • 4
  • 31
  • 91