Custom Font Add In Swift

[Solved] Custom Font Add In Swift | Vb - Code Explorer | yomemimo.com
Question : custom font programmatically in swift

Answered by : md-murad-hossain

import UIKit
import Foundation
extension UIFont{ public enum SFProDisplayType: String { case regular = "Regular" case semiBold = "Semibold" case medium = "Medium" case bold = "Bold" case heavy = "Heavy" case light = "Light" case black = "Black" } static func SFProDisplay(_ type: SFProDisplayType = .regular, size: CGFloat = UIFont.systemFontSize) -> UIFont { return UIFont(name: "SFProDisplay-\(type.rawValue)", size: size)! } var isBold: Bool { return fontDescriptor.symbolicTraits.contains(.traitBold) } var isItalic: Bool { return fontDescriptor.symbolicTraits.contains(.traitItalic) }
}

Source : | Last Update : Tue, 24 Oct 23

Question : how to set the font of text in swiftui

Answered by : blueeyed-booby-yb48kgqo8fq2

Text("Simple Swift Guide").font(.system(size: 45, weight: .bold, design: .default))

Source : https://www.simpleswiftguide.com/swiftui-font-tutorial/ | Last Update : Wed, 16 Dec 20

Question : swift programmatically set font

Answered by : kristopher-wrobel

label.font = UIFont.systemFont(ofSize: 14, weight: .light)

Source : https://stackoverflow.com/questions/33999976/how-to-set-text-font-as-system-thin-in-swift | Last Update : Sun, 04 Jul 21

Question : swiftui font add

Answered by : alice-roncella

// Create a new Folder(group) "Fonts"
// Drag your fonts files in it with Create Groups and your prj as Ref
// Add property “Fonts provided by application.” into Info.plist
// Copy and paste the names of the fonts with extension
// Now use them
.font(.custom("Your-Font-Name.noExtension", size: 42))

Source : | Last Update : Tue, 11 May 21

Answers related to custom font add in swift

Code Explorer Popular Question For Vb