I have the following code for that creates multiple fonts.
UIFont* systemFont1 = [UIFont systemFontOfSize:12.0];
UIFont* systemFont2 = [UIFont boldSystemFontOfSize:12.0];
UIFont* systemFont3 = [UIFont italicSystemFontOfSize:12.0];
UIFont* customFont1 = [UIFont fontWithName:@"HelveticaNeue-Light" size:12.0];
UIFont* customFont2 = [UIFont fontWithName:@"HelveticaNeue-Regular" size:12.0];
UIFont* customFont3 = [UIFont fontWithName:@"HelveticaNeue-Thin" size:12.0];
UIFont* customFont4 = [UIFont fontWithName:@"MyriadPro" size:12.0];
UIFont* customFont5 = [UIFont fontWithName:@"MyriadPro-Italic" size:12.0];
UIFont* customFont6 = [UIFont fontWithName:@"MyriadPro-Condensed" size:12.0];
I would like to know which UIFont
's are system. I practically need a method that would return a BOOL
YES
for variables: systemFont1, systemFont2, systemFont3 and NO
for customFont4
, customFont5
, customFont6
.
Since Helvetica Neue is system font on iOS7, this is subject of a debate, whether it should return NO
or YES
in these cases, but for my issue, it would be fine either way.
So my question is:
How to verify if UIFont instance was created by either of system font methods?
Thank you for your help!