Why is the .medium system font not showing for .title style in SwiftUI?
I have also tried explicitly setting the font with Font.custom...
Text("Text").font(Font.title.weight(.light))
Text("Text").font(Font.title.weight(.regular))
Text("Text").font(Font.title.weight(.medium))
Text("Text").font(Font.title.weight(.semibold))
Text("Text").font(Font.title.weight(.bold))
Here is my output:
I am expecting .medium to be heavier than .regular.
Hold the command key and click the text to bring up a pop-over menu. Choose Show SwiftUI Inspector and then you can edit the text/font properties.
System Fontsystem(size:weight:design:) method. This method lets us specify a fixed font size that we want. Here is an example where we set the font for the second text to a fixed size of 36 points.
The best way to achieve this is by splitting up the font type and the font weight into two separate parts.
Text("Text")
.font(.title)
.fontWeight(.medium)
I hope this helps.
Text("Home")
.font(.system(size: 20, weight: .bold, design: .default))
Use like this
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With