OpenSansSwift alternatives and similar libraries
Based on the "Fonts" category.
Alternatively, view OpenSansSwift alternatives based on common mentions on social networks and blogs.
-
SwiftIconFont
Icons fonts for iOS (Font Awesome 5, Iconic, Ionicon, Octicon, Themify, MapIcon, MaterialIcon, Foundation 3, Elegant Icon, Captain Icon) -
Swicon
Use 1600+ icons (and more!) from FontAwesome and Google Material Icons in your swift/iOS project in an easy and space-efficient way!
CodeRabbit: AI Code Reviews for Developers

* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of OpenSansSwift or a related project?
README
OpenSansSwift
Easily use the OpenSans font in Swift.
[Screenshot](OpenSans-SS.png)
Why use OpenSansSwift frameworks ?
The usual process of embedding any custom fonts in your IOS applications has a few steps:
- Copy all your font resources to your project
- Make sure they're copied to the bundle
- Add UIAppFonts key to info.plist.
- Painstakingly add all the font names with the right extension
- Find out the font family and font names programatically
- Use the fonts
For the OpenSans font, this framework does all that for you. All you have to do is link the compiled framework.
How to Install - Carthage
If you dont' already have Carthage, Install it with:
$ brew update
$ brew install carthage
Add github "hemantasapkota/OpenSansSwift"
to your Cartfile.
Execute carthage install
Swift 3
Add github "hemantasapkota/OpenSansSwift" "swift3"
to your Cartfile.
Execute carthage install
How to Install - Manual
Clone the repo and add OpenSansSwift.xcodeproj
to you project. Link OpenSansSwift.framework
to your project.
OpenSans Font Methods
Based on OpenSans v2.0, OpenSansSwift registers the following methods:
openSansFontOfSize(size: Float) -> UIFont!
openSansBoldFontOfSize(size: Float) -> UIFont!
openSansBoldItalicFontOfSize(size: Float) -> UIFont!
openSansExtraBoldFontOfSize(size: Float) -> UIFont!
openSansExtraBoldItalicFontOfSize(size: Float) -> UIFont!
openSansItalicFontOfSize(size: Float) -> UIFont!
openSansLightFontOfSize(size: Float) -> UIFont!
openSansLightItalicFontOfSize(size: Float) -> UIFont!
openSansSemiboldFontOfSize(size: Float) -> UIFont!
openSansSemiboldItalicFontOfSize(size: Float) -> UIFont!
Retina Scale Factor
Set OpenSans.retinaScaleFactor
to scale out font sizes for the iPad. Default is 2.
Usage - Programmatically
See Example for more details.
import UIKit
import OpenSansSwift
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
//Register Open Sans fonts. Register only once.
OpenSans.registerFonts()
// Set the scale for iPad. Default is 2.
OpenSans.retinaScaleFactor = 1.5
// Create a label
let lbl1 = UILabel(frame: CGRectMake(x, y, size.width, size.height))
lbl1.font = UIFont.openSansFontOfSize(30)
lbl1.text = "This is OpenSans-Regular"
self.view.addSubView(lbl1)
}
}
Usage - Storyboard
XCode automatically detects the fonts present in the bundle, so you don't have to perform any registration for use in Storyboards.
[Screenshot](OpenSans-StoryBoard.png)
Usage - With NSAttributedString
For use with NSAttributedString, Use the following strings: OpenSans, OpenSans-Bold, OpenSans-Italic
let regularAttribute = [NSFontAttributeName: UIFont(name: "OpenSans", size: 12)!]
let boldAttribute = [NSFontAttributeName: UIFont(name: "OpenSans-Bold", size: 12)!]
let italicAttribute = [NSFontAttributeName: UIFont(name: "OpenSans-Italic", size: 12)!]
Licence
MIT for OpenSansSwift framework.
Apache for OpenSans v2.0 fonts. See http://www.apache.org/licenses/
*Note that all licence references and agreements mentioned in the OpenSansSwift README section above
are relevant to that project's source code only.