Set up TTF or OTF format font file that you want to import your App.
drag the font files to your Xcode Project that you want to import your custom font.
check Copy items if needed & Add to targets.
Project Target -> Project Properties -> Build Phases -> Copy Bundle Resources
and click + to import your custom font in your Xcode Projcet
Info.plist > Information Property List (Dictionary)
import Item and set the value by font file name
⚠️ You must be include file extension name
Text("Hello, Wolrd!")
.font(.custom("filename: String", fontsize: CGFloat))
like this,
Text("Hello, Wolrd!")
.font(.custom("Pretendard-Bold", size: 16))
if custom font are still not available ,
You need to check the defined font name by belowing code...
init(){
for family in UIFont.familyNames {
print(family)
for names in UIFont.fontNames(forFamilyName: family){
print("== \(names)")
}
}
}
Execute the corresponding iteration statement to use the defined font name output.