Skip to content
This repository has been archived by the owner on Oct 17, 2021. It is now read-only.
/ UIFontSerialization Public archive

Encode and decode between UIFont and Postscript font data

License

Notifications You must be signed in to change notification settings

mattt/UIFontSerialization

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

UIFontSerialization

UIFontSerialization encodes and decodes between UIFont and Postscript font data, following the API conventions of Foundation's NSJSONSerialization class.

Usage

Decoding

NSURL *fontFileURL = [[NSBundle mainBundle] URLForResource:@"font" withExtension:@"tty"];
NSData *data = [NSData dataWithContentsOfURL:fontFileURL];
UIFont *font = [UIFontSerialization fontWithData:data error:nil];

Encoding

UIFont *font = [UIFont systemFontOfSize:24]
NSData *data = [UIFontSerialization dataWithFont:font error:nil];

Contact

Mattt Thompson

License

UIFontSerialization is available under the MIT license. See the LICENSE file for more info.

About

Encode and decode between UIFont and Postscript font data

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published