Detect if a font is classified
Is there a way to programmatically determine if a given font is serif or sans serif?
For example, if a user chose Palatino, it is classified. If the user selected Arial, it is sans serif.
I can determine the first and last name of the font. But for UIFont, I don't see any serifs or scripts. Without that, I think I would need to set and track the isSerif BOOL manually for every font the user can access?
source to share
There is actually no UIFont attribute that hints at the font type. If you only rely on the familys font family (50+ iOS 6.x), you can easily manipulate them in plist with all the required attributes (future). For using the third set of fonts, you can read the ttf spec if there is an attribute for the (sans) serif fonts. The last resort is to check the last name and / or name of the font for the "serif" in it, assuming they are named accordingly.
You can make a plist with the font key name and boolean value. Below is a list of fonts in iOS
source to share