| value | name |
|---|---|
| 100 | extralight/ultralight |
| 200 | light/thin |
| 300 | book/demi/light |
| 400 | regular/normal |
| 500 | medium |
| 600 | semibold/demibold |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Core Graphics method | |
| CGDataProviderRef provider = CGDataProviderCreateWithURL((__bridge CFURLRef)fontURL); | |
| CGFontRef graphicsFont = CGFontCreateWithDataProvider(provider); | |
| CTFontRef coreTextFont = CTFontCreateWithGraphicsFont(graphicsFont, fontSize, /*matrix*/ NULL, /*attributes*/ NULL); | |
| if (coreTextFont) { | |
| NSFont *font = (__bridge NSFont *)coreTextFont; | |
| [fonts addObject:font]; | |
| CFRelease(coreTextFont); | |
| } | |
| CGFontRelease(graphicsFont); |
NewerOlder