Last active
October 11, 2015 23:58
-
-
Save zsiegel/3939839 to your computer and use it in GitHub Desktop.
Core Text - Line height property inspection
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
/* Setup our fonts - One system font from Apple and a custom font */ | |
CTFontRef bodyCopyFont = CTFontCreateWithName((__bridge CFStringRef) [Theme fontForBodyOfSize:11].fontName, [Theme fontForBodyOfSize:11].lineHeight, NULL); | |
CTFontRef systemFont = CTFontCreateWithName((__bridge CFStringRef) [UIFont systemFontOfSize:11].fontName, [UIFont systemFontOfSize:11].lineHeight, NULL); | |
/* Lets inspect the properties */ | |
NSLog(@"*****************************************************************"); | |
NSLog(@"SYSTEM-FONT LINE HEIGHT PROPERTY %f", [UIFont systemFontOfSize:11].lineHeight); | |
NSLog(@"SYSTEM-FONT CALCULATED LINE HEIGHT %f", [self getLineHeightForFont:systemFont]); //Custom function | |
NSLog(@"*****************************************************************"); | |
NSLog(@"CUSTOM-FONT LINE HEIGHT PROPERTY %f", [Theme fontForBodyOfSize:11].lineHeight); | |
NSLog(@"CUSTOM-FONT CALCULATED LINE HEIGHT %f", [self getLineHeightForFont:bodyCopyFont]); //Custom function | |
NSLog(@"*****************************************************************"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment