Objective-C (iOS): フォント一覧

iOS で使用可能なフォント名一覧を出力します。
[UIFont fontWithName:@”フォント名” size:12.0f]; などに使用できます。

例は iOS6.1 時点のものになります。

Objective-C: FontViewController.h

#import <UIKit/UIKit.h>

@interface FontViewController : UIViewController

@end

Objective-C: FontViewController.m

#import "FontViewController.h"

@interface FontViewController ()

@end

@implementation FontViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view.
    
    NSEnumerator *enu = [[UIFont familyNames] objectEnumerator];
    NSString *fontName;
    NSMutableArray *fontNames = [NSMutableArray array];
    while(fontName = [enu nextObject]) {
        [fontNames addObject:[UIFont fontNamesForFamilyName:fontName]];
    }
    NSLog(@"%@", fontNames);

}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end

出力

2013-05-05 21:13:37.929 Snippets[8423:c07] (
        (
        "Thonburi-Bold",
        Thonburi
    ),
        (
        "SnellRoundhand-Bold",
        "SnellRoundhand-Black",
        SnellRoundhand
    ),
        (
        AcademyEngravedLetPlain
    ),
        (
        "Avenir-LightOblique",
        "Avenir-MediumOblique",
        "Avenir-Medium",
        "Avenir-HeavyOblique",
        "Avenir-BlackOblique",
        "Avenir-Oblique",
        "Avenir-Book",
        "Avenir-Roman",
        "Avenir-BookOblique",
        "Avenir-Light",
        "Avenir-Heavy",
        "Avenir-Black"
    ),
        (
        "MarkerFelt-Wide",
        "MarkerFelt-Thin"
    ),
        (
        "GeezaPro-Bold",
        GeezaPro
    ),
        (
        ArialRoundedMTBold
    ),
        (
        TrebuchetMS,
        "TrebuchetMS-Bold",
        "TrebuchetMS-Italic",
        "Trebuchet-BoldItalic"
    ),
        (
        "Arial-BoldMT",
        ArialMT,
        "Arial-ItalicMT",
        "Arial-BoldItalicMT"
    ),
        (
        "Marion-Regular",
        "Marion-Bold",
        "Marion-Italic"
    ),
        (
        GurmukhiMN,
        "GurmukhiMN-Bold"
    ),
        (
        "MalayalamSangamMN-Bold",
        MalayalamSangamMN
    ),
        (
        "BradleyHandITCTT-Bold"
    ),
        (
        KannadaSangamMN,
        "KannadaSangamMN-Bold"
    ),
        (
        "BodoniSvtyTwoOSITCTT-Book",
        "BodoniSvtyTwoOSITCTT-Bold",
        "BodoniSvtyTwoOSITCTT-BookIt"
    ),
        (
        Cochin,
        "Cochin-BoldItalic",
        "Cochin-Italic",
        "Cochin-Bold"
    ),
        (
        SinhalaSangamMN,
        "SinhalaSangamMN-Bold"
    ),
        (
        "HiraKakuProN-W6",
        "HiraKakuProN-W3"
    ),
        (
        "Papyrus-Condensed",
        Papyrus
    ),
        (
        Verdana,
        "Verdana-Bold",
        "Verdana-BoldItalic",
        "Verdana-Italic"
    ),
        (
        ZapfDingbatsITC
    ),
        (
        "AvenirNextCondensed-HeavyItalic",
        "AvenirNextCondensed-DemiBold",
        "AvenirNextCondensed-Italic",
        "AvenirNextCondensed-Heavy",
        "AvenirNextCondensed-DemiBoldItalic",
        "AvenirNextCondensed-Medium",
        "AvenirNextCondensed-BoldItalic",
        "AvenirNextCondensed-Bold",
        "AvenirNextCondensed-UltraLightItalic",
        "AvenirNextCondensed-UltraLight",
        "AvenirNextCondensed-MediumItalic",
        "AvenirNextCondensed-Regular"
    ),
        (
        "Courier-Bold",
        Courier,
        "Courier-BoldOblique",
        "Courier-Oblique"
    ),
        (
        "HoeflerText-Black",
        "HoeflerText-Italic",
        "HoeflerText-Regular",
        "HoeflerText-BlackItalic"
    ),
        (
        "Helvetica-LightOblique",
        Helvetica,
        "Helvetica-Oblique",
        "Helvetica-BoldOblique",
        "Helvetica-Bold",
        "Helvetica-Light"
    ),
        (
        "EuphemiaUCAS-Bold",
        EuphemiaUCAS,
        "EuphemiaUCAS-Italic"
    ),
        (
        "HiraMinProN-W3",
        "HiraMinProN-W6"
    ),
        (
        BodoniOrnamentsITCTT
    ),
        (
        AppleColorEmoji
    ),
        (
        "Optima-ExtraBlack",
        "Optima-Italic",
        "Optima-Regular",
        "Optima-BoldItalic",
        "Optima-Bold"
    ),
        (
        GujaratiSangamMN,
        "GujaratiSangamMN-Bold"
    ),
        (
        DevanagariSangamMN,
        "DevanagariSangamMN-Bold"
    ),
        (
        "TimesNewRomanPS-ItalicMT",
        "TimesNewRomanPS-BoldMT",
        TimesNewRomanPSMT,
        "TimesNewRomanPS-BoldItalicMT"
    ),
        (
        Kailasa,
        "Kailasa-Bold"
    ),
        (
        "TeluguSangamMN-Bold",
        TeluguSangamMN
    ),
        (
        "STHeitiSC-Medium",
        "STHeitiSC-Light"
    ),
        (
        "AppleSDGothicNeo-Bold",
        "AppleSDGothicNeo-Medium"
    ),
        (
        "Futura-Medium",
        "Futura-CondensedExtraBold",
        "Futura-CondensedMedium",
        "Futura-MediumItalic"
    ),
        (
        "BodoniSvtyTwoITCTT-BookIta",
        "BodoniSvtyTwoITCTT-Book",
        "BodoniSvtyTwoITCTT-Bold"
    ),
        (
        "Baskerville-SemiBoldItalic",
        "Baskerville-Bold",
        "Baskerville-Italic",
        "Baskerville-BoldItalic",
        "Baskerville-SemiBold",
        Baskerville
    ),
        (
        "ChalkboardSE-Regular",
        "ChalkboardSE-Bold",
        "ChalkboardSE-Light"
    ),
        (
        "STHeitiTC-Medium",
        "STHeitiTC-Light"
    ),
        (
        Copperplate,
        "Copperplate-Light",
        "Copperplate-Bold"
    ),
        (
        PartyLetPlain
    ),
        (
        "AmericanTypewriter-CondensedLight",
        "AmericanTypewriter-Light",
        "AmericanTypewriter-Bold",
        AmericanTypewriter,
        "AmericanTypewriter-CondensedBold",
        "AmericanTypewriter-Condensed"
    ),
        (
        Symbol
    ),
        (
        "AvenirNext-Heavy",
        "AvenirNext-DemiBoldItalic",
        "AvenirNext-UltraLightItalic",
        "AvenirNext-HeavyItalic",
        "AvenirNext-MediumItalic",
        "AvenirNext-UltraLight",
        "AvenirNext-BoldItalic",
        "AvenirNext-DemiBold",
        "AvenirNext-Bold",
        "AvenirNext-Regular",
        "AvenirNext-Medium",
        "AvenirNext-Italic"
    ),
        (
        "Noteworthy-Light",
        "Noteworthy-Bold"
    ),
        (
        "BanglaSangamMN-Bold",
        BanglaSangamMN
    ),
        (
        Zapfino
    ),
        (
        TamilSangamMN,
        "TamilSangamMN-Bold"
    ),
        (
        Chalkduster
    ),
        (
        ArialHebrew,
        "ArialHebrew-Bold"
    ),
        (
        "Georgia-Italic",
        "Georgia-BoldItalic",
        "Georgia-Bold",
        Georgia
    ),
        (
        "HelveticaNeue-Bold",
        "HelveticaNeue-CondensedBlack",
        "HelveticaNeue-Medium",
        HelveticaNeue,
        "HelveticaNeue-Light",
        "HelveticaNeue-CondensedBold",
        "HelveticaNeue-LightItalic",
        "HelveticaNeue-UltraLightItalic",
        "HelveticaNeue-UltraLight",
        "HelveticaNeue-BoldItalic",
        "HelveticaNeue-Italic"
    ),
        (
        "GillSans-LightItalic",
        "GillSans-BoldItalic",
        "GillSans-Italic",
        GillSans,
        "GillSans-Bold",
        "GillSans-Light"
    ),
        (
        "Palatino-Roman",
        "Palatino-Bold",
        "Palatino-BoldItalic",
        "Palatino-Italic"
    ),
        (
        "CourierNewPS-BoldMT",
        CourierNewPSMT,
        "CourierNewPS-BoldItalicMT",
        "CourierNewPS-ItalicMT"
    ),
        (
        "OriyaSangamMN-Bold",
        OriyaSangamMN
    ),
        (
        "Didot-Italic",
        Didot,
        "Didot-Bold"
    ),
        (
        "BodoniSvtyTwoSCITCTT-Book"
    )
)