commit | 8e30188777b016182658fbaa0a4a020a48183224 | [log] [tgz] |
---|---|---|
author | Will Larche <willlarche@users.noreply.github.com> | Fri Feb 17 20:32:11 2017 |
committer | Randall Li <randall.li@gmail.com> | Fri Feb 17 20:32:11 2017 |
tree | 80b6a8a0df7a845265741a1ce947b36a707865fb | |
parent | 93acc021e3034898716028822cb802a3a816be7e [diff] |
[Docs] Clarity in README (#1)
#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)!;