Reputation: 6612
Normally in a web app i would put a font-family in the CSS something like this
" font-family: "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;"
This way i cover my bases as to whether the target browser can handle the various fonts and will fail gracefully if it is missing some.
However that are only a limited number of fonts on the iphone and presumably if you only specify one, say Helvetica, the iPhone will always have that font and use it. So i don't really need a font-family. Do I?
Upvotes: 0
Views: 12527
Reputation: 19
To retrieve all the fonts presented in your application you may use below code:
NSArray *familyNames = [UIFont familyNames];
for( NSString *familyName in familyNames ){
printf( "Family: %s \n", [familyName UTF8String] );
NSArray *fontNames = [UIFont fontNamesForFamilyName:familyName];
for( NSString *fontName in fontNames ){
printf( "\tFont: %s \n", [fontName UTF8String] );
}
}
Using the above code you may retrieve all the font and font family includes attached externel fonts (custom fonts).
Upvotes: 0
Reputation: 8669
I have always assumed that Apple limited the fonts on the iPhone based on what looked good on the small screen. Below is a list of fonts that are available on the iPhone:
* American Typewriter
* American Typewriter Condensed
* Arial
* Arial Rounded MT Bold
* Courier New
* Georgia
* Helvetica
* Marker Felt
* Times New Roman
* Trebuchet MS
* Verdana
* Zapfino
see What font's are available on the iPhone?
Upvotes: 3
Reputation: 536389
Maybe future iPhone OS releases might have different fonts, or there might be different fonts in different territories.
I'd at least keep the CSS generic font ‘sans-serif’ in.
Upvotes: 2