You want to use fonts that come preinstalled on an iOS device in order to render some text on the screen.
Fonts are fundamental to displaying text on a graphical user
interface. The UIKit framework provides programmers with high-level APIs
that facilitate the enumerating, loading, and use of fonts. Fonts are
encapsulated in the
UIFont class in
Cocoa Touch. Each iOS device comes with built-in system fonts. Fonts are
organized into families, and each family contains
faces. For instance, Helvetica is a font family,
and Helvetica Bold is one of the faces of the
Helvetica family. To be able to load a font, you must know the font’s
face (that is, its name)—and to know the face, you have to know the
family. So first, let’s enumerate all the font families that are
installed on the device, using the
familyNames class method of the
@"Font Family = %@"
Running this program in iOS Simulator, I get results similar to this:
Font Family = Thonburi Font Family = Academy Engraved LE Font Family = Snell Roundhand Font Family = Avenir Font Family = Marker Felt Font Family = Geeza Pro Font Family = Arial Rounded MT Bo Font Family = Trebuchet MS ...
After getting the font families, we can enumerate the font
names inside each family. We’ll use the
fontNamesForFamilyName: class method of the
UIFont class and get ...