Font Currying style of construct attributed string and font Sep 15, 2019 1 min read SCTypeKit SCTypeKit is help us to easy that, currying style of construct attributedString and UIFont. ? Overview 1. FontBuilder let container = UIView(frame: CGRect(x: 0, y: 0, width: 500, height: 200)) let view = UILabel(frame: container.frame) view.numberOfLines = 1 view.text = "I watched the storm, so beautiful yet terrific." view.textAlignment = .center view.font = FontBuilder() .fontName("KannadaSangamMN") .fontSize(20) .build() Swift 2. AttributedStringBuilder let builder = AttributedStringBuilder() let shadow = NSShadow() shadow.shadowColor = UIColor.black shadow.shadowBlurRadius = 1.2 shadow.shadowOffset = .init(width: 1, height: 1) view.numberOfLines = 0 view.textAlignment = .center view.attributedText = builder .text("It", attributes: [ .font(UIFont.systemFont(ofSize: 50, weight: .semibold)), .textColor(.darkGray), .alignment(.center), .kerning(5) ]) .space() .text("was going", attributes: [ .font(UIFont.systemFont(ofSize: 70, weight: .medium)), .textColor(.gray), ]) .spaces(5) .text("to", attributes: [ .font(UIFont.systemFont(ofSize: 90, weight: .semibold)), .textColor(.lightGray) ]) .spaces(5) .text("be", attributes: [ .font(UIFont(name: "AvenirNext-Bold", size: 70)!), .textColor(UIColor.yellow), .kerning(5), .shadow(shadow), .skew(0.3), .underline(true) ]) .spaces(15) .text("a lonely", attributes: [ .font(UIFont(name: "SnellRoundhand", size: 60)!), .textColor(.purple), .kerning(5) ]) .spaces(20) .text("Back", attributes: [ .font(UIFont(name: "Marker Felt", size: 50)!), .textColor(.white), .strokeColor(.red), .strokeWidth(2) ]) .build() Swift Installation Using Cocoapods: pod 'SCTypeKit' Ruby Using Carthage: github 'interactord/SCTypeKit' Ruby GitHub interactord/SCTypeKit52Currying style of construct attributed string and font — Read MoreLatest commit to the master branch on 9-14-2019Download as zip Font
Font A versatile Swift library designed to seamlessly integrate custom fonts into iOS Dynamic Type A versatile Swift library designed to seamlessly integrate custom fonts into iOS Dynamic Type 09 December 2023
Font A simple control to select a font on macOS A simple control to select a font on macOS 09 June 2023
Font A Swift package for easily loading and using custom fonts in SwiftUI applications A Swift package for easily loading and using custom fonts in SwiftUI applications. 01 May 2023