Question

How can I store the names of all the fonts available on iOS in an NSMutableArray? This is for later usage and for displaying them on a table view

Was it helpful?

Solution

all font names installed:

id families = [UIFont familyNames];
id fonts = [NSMutableArray array];
for(id fam in families) {
    [fonts addObjectsFromArray:[UIFont fontNamesForFamilyName:fam]]; 
}

OTHER TIPS

[UIFont familyNames] is what you are looking for. If you also want to know what kind of fonts are available in a given family, you can use [UIFont fontNamesForFamilyName].

They both return an inmutable array, if you really need a mutable one (for whatever reason), you can simply make a mutable copy of it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top