commit | d1843d565452172ecfb3432ebd4c0ceba2ce0353 | [log] [tgz] |
---|---|---|
author | Will Larche <willlarche@users.noreply.github.com> | Sun Feb 12 16:13:00 2017 |
committer | GitHub <noreply@github.com> | Sun Feb 12 16:13:00 2017 |
tree | 80b6a8a0df7a845265741a1ce947b36a707865fb | |
parent | 93acc021e3034898716028822cb802a3a816be7e [diff] |
[Docs] Clarity in README
#FontDiskLoader
Registers a single custom font asset from disk
Font Disk Loader lazily registers custom fonts and caches them even if they are not included in the app's info.plist.
To add this component to your Xcode project using CocoaPods, add the following to your Podfile
:
pod 'MDFFontDiskLoader'
Then, run the following command:
pod install
Before using Font Disk Loader, you'll need to import it:
#import "MaterialFontDiskLoader.h"
import MDFFontDiskLoader
Make sure to add your font (or the bundle it is in) to your app target. The FontDiskLoader will lazy register the font using a CoreText API so adding the font to your info.plist
is not necessary. All you need to do is initialize the loader with the font name and url of the file and ask for the font.
MDFFontDiskLoader *fontDiskLoader = [[MDFFontDiskLoader alloc] initWithFontName:nameOfFontInFile fontURL:fontURLOnDisk]; UIFont *font = [fontDiskLoader fontOfSize:16];
let fontLoader = MDFFontDiskLoader.init(fontName: nameOfFontInFile, fontURL: fontURLOnDisk); let myFont:UIFont = fontLoader.fontOfSize(16)!;