iOS 6:动态下载字体

iOS 6:字体列表

了解 iOS 6 中所使用的字体。

iOS 6 随附安装了下列字体:

  • Academy Engraved LET Plain:1.0

  • American Typewriter

  • American Typewriter Bold

  • American Typewriter Condensed

  • American Typewriter Condensed Bold

  • American Typewriter Condensed Light

  • American Typewriter Light

  • Apple Color Emoji

  • Apple SD Gothic Neo Bold

  • Apple SD Gothic Neo Medium

  • AppleGothic Regular

  • Arial

  • Arial Bold

  • Arial Bold Italic

  • Arial Hebrew

  • Arial Hebrew Bold

  • Arial Italic

  • Arial Rounded MT Bold

  • Avenir Black

  • Avenir Black Oblique

  • Avenir Book

  • Avenir Book Oblique

  • Avenir Heavy

  • Avenir Heavy Oblique

  • Avenir Light

  • Avenir Light Oblique

  • Avenir Medium

  • Avenir Medium Oblique

  • Avenir Next Bold

  • Avenir Next Bold Italic

  • Avenir Next Condensed Bold

  • Avenir Next Condensed Bold Italic

  • Avenir Next Condensed Demi Bold

  • Avenir Next Condensed Demi Bold Italic

  • Avenir Next Condensed Heavy

  • Avenir Next Condensed Heavy Italic

  • Avenir Next Condensed Italic

  • Avenir Next Condensed Medium

  • Avenir Next Condensed Medium Italic

  • Avenir Next Condensed Regular

  • Avenir Next Condensed Ultra Light

  • Avenir Next Condensed Ultra Light Italic

  • Avenir Next Demi Bold

  • Avenir Next Demi Bold Italic

  • Avenir Next Heavy

  • Avenir Next Heavy Italic

  • Avenir Next Italic

  • Avenir Next Medium

  • Avenir Next Medium Italic

  • Avenir Next Regular

  • Avenir Next Ultra Light

  • Avenir Next Ultra Light Italic

  • Avenir Oblique

  • Avenir Roman

  • Bangla Sangam MN

  • Bangla Sangam MN Bold

  • Baskerville

  • Baskerville Bold

  • Baskerville Bold Italic

  • Baskerville Italic

  • Baskerville SemiBold

  • Baskerville SemiBold Italic

  • Bodoni 72 Bold

  • Bodoni 72 Book

  • Bodoni 72 Book Italic

  • Bodoni 72 Oldstyle Bold

  • Bodoni 72 Oldstyle Book

  • Bodoni 72 Oldstyle Book Italic

  • Bodoni 72 Smallcaps Book

  • Bodoni Ornaments

  • Bradley Hand Bold

  • Chalkboard SE Bold

  • Chalkboard SE Light

  • Chalkboard SE Regular

  • Chalkduster

  • Cochin

  • Cochin Bold

  • Cochin Bold Italic

  • Cochin Italic

  • Copperplate

  • Copperplate Bold

  • Copperplate Light

  • Courier

  • Courier Bold

  • Courier Bold Oblique

  • Courier New

  • Courier New Bold

  • Courier New Bold Italic

  • Courier New Italic

  • Courier Oblique

  • Devanagari Sangam MN

  • Devanagari Sangam MN Bold

  • Didot

  • Didot Bold

  • Didot Italic

  • Euphemia UCAS

  • Euphemia UCAS Bold

  • Euphemia UCAS Italic

  • Futura Condensed ExtraBold

  • Futura Condensed Medium

  • Futura Medium

  • Futura Medium Italic

  • Geeza Pro

  • Geeza Pro Bold

  • Georgia

  • Georgia Bold

  • Georgia Bold Italic

  • Georgia Italic

  • Gill Sans

  • Gill Sans Bold

  • Gill Sans Bold Italic

  • Gill Sans Italic

  • Gill Sans Light

  • Gill Sans Light Italic

  • Gujarati Sangam MN

  • Gujarati Sangam MN Bold

  • Gurmukhi MN

  • Gurmukhi MN Bold

  • Heiti SC Light

  • Heiti SC Medium

  • Heiti TC Light

  • Heiti TC Medium

  • Helvetica

  • Helvetica Bold

  • Helvetica Bold Oblique

  • Helvetica Light

  • Helvetica Light Oblique

  • Helvetica Neue

  • Helvetica Neue Bold

  • Helvetica Neue Bold Italic

  • Helvetica Neue Condensed Black

  • Helvetica Neue Condensed Bold

  • Helvetica Neue Italic

  • Helvetica Neue Light

  • Helvetica Neue Light Italic

  • Helvetica Neue Medium

  • Helvetica Neue UltraLight

  • Helvetica Neue UltraLight Italic

  • Helvetica Oblique

  • Hiragino Kaku Gothic ProN W3

  • Hiragino Kaku Gothic ProN W6

  • Hiragino Mincho ProN W3

  • Hiragino Mincho ProN W6

  • Hoefler Text

  • Hoefler Text Black

  • Hoefler Text Black Italic

  • Hoefler Text Italic

  • Kailasa Bold

  • Kailasa Regular

  • Kannada Sangam MN

  • Kannada Sangam MN Bold

  • Malayalam Sangam MN

  • Malayalam Sangam MN Bold

  • Marion Bold

  • Marion Italic

  • Marion Regular

  • Marker Felt Thin

  • Marker Felt Wide

  • Noteworthy Bold

  • Noteworthy Light

  • Optima Bold

  • Optima Bold Italic

  • Optima ExtraBlack

  • Optima Italic

  • Optima Regular

  • Oriya Sangam MN

  • Oriya Sangam MN Bold

  • Palatino

  • Palatino Bold

  • Palatino Bold Italic

  • Palatino Italic

  • Papyrus

  • Papyrus Condensed

  • Party LET Plain

  • Sinhala Sangam MN

  • Sinhala Sangam MN Bold

  • Snell Roundhand

  • Snell Roundhand Black

  • Snell Roundhand Bold

  • Symbol

  • Tamil Sangam MN

  • Tamil Sangam MN Bold

  • Telugu Sangam MN

  • Telugu Sangam MN Bold

  • Thonburi

  • Thonburi Bold

  • Times New Roman

  • Times New Roman Bold

  • Times New Roman Bold Italic

  • Times New Roman Italic

  • Trebuchet MS

  • Trebuchet MS Bold

  • Trebuchet MS Bold Italic

  • Trebuchet MS Italic

  • Verdana

  • Verdana Bold

  • Verdana Bold Italic

  • Verdana Italic

  • Zapf Dingbats

  • Zapfino

了解详情

App 也可以根据需要安装下列字体:

  • Apple SD Gothic Neo Heavy

  • Apple SD Gothic Neo Light

  • Apple SD Gothic Neo Regular

  • Apple SD Gothic Neo SemiBold

  • Apple SD Gothic Neo Thin

  • Apple SD Gothic Neo UltraLight

  • Apple SD GothicNeo ExtraBold

  • AppleGothic Regular

  • AppleMyungjo Regular

  • Baoli SC Regular

  • BiauKai

  • HeadLineA Regular

  • Hiragino Kaku Gothic StdN W8

  • Hiragino Maru Gothic ProN W4

  • Hiragino Sans GB W3

  • Hiragino Sans GB W6

  • Kaiti SC Black

  • Kaiti SC Bold

  • Kaiti SC Regular

  • Lantinghei SC Demibold

  • Lantinghei SC Extralight

  • Lantinghei SC Heavy

  • Lantinghei TC Demibold

  • Lantinghei TC Extralight

  • Lantinghei TC Heavy

  • LiHei Pro

  • LiSong Pro

  • Libian SC Regular

  • Nanum Brush Script

  • Nanum Pen Script

  • NanumGothic

  • NanumGothic Bold

  • NanumGothic ExtraBold

  • NanumMyeongjo

  • NanumMyeongjo Bold

  • NanumMyeongjo ExtraBold

  • PCMyungjo Regular

  • PilGi Regular

  • STFangsong

  • Songti SC Black

  • Songti SC Bold

  • Songti SC Light

  • Songti SC Regular

  • Wawati SC Regular

  • Wawati TC Regular

  • Weibei SC Bold

  • Weibei TC Bold

  • Xingkai SC Bold

  • Xingkai SC Light

  • YuGothic Bold

  • YuGothic Medium

  • YuMincho Demibold

  • YuMincho Medium

  • Yuanti SC Bold

  • Yuanti SC Light

  • Yuanti SC Regular

  • Yuppy SC Regular

  • Yuppy TC Regular

上次修改时间: 2015-2-21


简体中文对应的PostScript名称(下载时使用的名称)

    报隶-简   STBaoli-SC-Regular

    冬青黑体简体中文    HiraginoSansGB-W3     HiraginoSansGB-W6    

    黑体-简   STHeitiSC-Light   STHeitiSC-Medium

    华文仿宋    STFangsong

    华文黑体   STXihei     STHeiti

    华文楷体   STKaiti

    华文宋体   STSong

    楷体-简   STKaiti-SC-Regular    STKaiti-SC-Bold    STKaiti-SC-Black

    兰亭黑-简   FZLTXHK--GBK1-0    FZLTTHK--GBK1-0   FZLTZHK--GBK1-0

    隶变-简    STLibian-SC-Regular

    翩翩体-简   HanziPenSC-W3    HanziPenSC-W5

    手札体-简   HannotateSC-W5     HannotateSC-W7

    宋体-简    STSongti-SC-Regular    STSongti-SC-Light    STSongti-SC-Bold    STSongti-SC-Black

    娃娃体-简    DFWaWaSC-W5

    魏碑-简   Weibei-SC-Bold

    行楷-简    STXingkai-SC-Light    STXingkai-SC-Bold

    雅痞-简    YuppySC-Regular

    圆体-简    STYuanti-SC-Regular    STYuanti-SC-Light    STYuanti-SC-Bold


例:下载并使用行楷-简(STXingkai-SC-Bold)(粗体)

#import <CoreText/CoreText.h>


    textView = [[UITextView alloc] initWithFrame:CGRectMake(0, 0,WIDTH , HEIGHT - 64)];
    textView.contentSize = CGSizeMake(WIDTH, 1500);
    NSString *text = localizedStrng(@"FAQ_content");
    textView.editable = NO;
    
    [self.view addSubview:textView];
    
 
    //fontName要用对应的PostScript名称,否则,无法下载,行楷-简对应的PostScript名称有两个:STXingkai-SC-Light(细体)  和  STXingkai-SC-Bold(粗体),下面用的是粗体。
    NSString *fontName = @"STXingkai-SC-Bold";
    
    // Create a dictionary with the font's PostScript name.
    NSMutableDictionary *attrs = [NSMutableDictionary dictionaryWithObjectsAndKeys:fontName, kCTFontNameAttribute, nil];
    
    // Create a new font descriptor reference from the attributes dictionary.
    CTFontDescriptorRef desc = CTFontDescriptorCreateWithAttributes((__bridge CFDictionaryRef)attrs);
    
    NSMutableArray *descs = [NSMutableArray arrayWithCapacity:0];
    [descs addObject:(__bridge id)desc];
    CFRelease(desc);
    
    __block BOOL errorDuringDownload = NO;
    
    // Start processing the font descriptor..
    // This function returns immediately, but can potentially take long time to process.
    // The progress is notified via the callback block of CTFontDescriptorProgressHandler type.
    // See CTFontDescriptor.h for the list of progress states and keys for progressParameter dictionary.
    CTFontDescriptorMatchFontDescriptorsWithProgressHandler( (__bridge CFArrayRef)descs, NULL,  ^(CTFontDescriptorMatchingState state, CFDictionaryRef progressParameter) {
        
//        NSLog( @"state %d - %@", state, progressParameter);
        
        double progressValue = [[(__bridge NSDictionary *)progressParameter objectForKey:(id)kCTFontDescriptorMatchingPercentage] doubleValue];
        
        if (state == kCTFontDescriptorMatchingDidBegin) {
            dispatch_async( dispatch_get_main_queue(), ^ {
                
                // Show something in the text view to indicate that we are downloading
                textView.text= [NSString stringWithFormat:@"Downloading %@", fontName];
                textView.font = [UIFont systemFontOfSize:16.];
                
                NSLog(@"Begin Matching");
            });
        } else if (state == kCTFontDescriptorMatchingDidFinish) {
            dispatch_async( dispatch_get_main_queue(), ^ {
                
                // Display the sample text for the newly downloaded font
                textView.text = text;
                textView.font = [UIFont fontWithName:fontName size:16.];
                
                // Log the font URL in the console
                CTFontRef fontRef = CTFontCreateWithName((__bridge CFStringRef)fontName, 0., NULL);
                CFStringRef fontURL = CTFontCopyAttribute(fontRef, kCTFontURLAttribute);
                NSLog(@"%@", (__bridge NSURL*)(fontURL));
                CFRelease(fontURL);
                CFRelease(fontRef);
                
                if (!errorDuringDownload) {
                    NSLog(@"%@ downloaded", fontName);
                }
            });
        } else if (state == kCTFontDescriptorMatchingWillBeginDownloading) {
            dispatch_async( dispatch_get_main_queue(), ^ {

                NSLog(@"Begin Downloading");
            });
        } else if (state == kCTFontDescriptorMatchingDidFinishDownloading) {
            dispatch_async( dispatch_get_main_queue(), ^ {

                NSLog(@"Finish downloading");
            });
        } else if (state == kCTFontDescriptorMatchingDownloading) {
            dispatch_async( dispatch_get_main_queue(), ^ {

                textView.text= [NSString stringWithFormat:@"Downloading %@  %.0f%%", fontName,progressValue];
                NSLog(@"Downloading %.0f%% complete", progressValue);
            });
        } else if (state == kCTFontDescriptorMatchingDidFailWithError) {
            // An error has occurred.
            // Get the error message
            NSError *error = [(__bridge NSDictionary *)progressParameter objectForKey:(id)kCTFontDescriptorMatchingError];
            if (error != nil) {
                NSLog(@"Download error: %@", [error description]);
                
            } else {
                
                NSLog(@"ERROR MESSAGE IS NOT AVAILABLE!");
            }
          
        }
        
        return (bool)YES;
    });

效果如下:

110134_tJvT_2344008.png




转载于:https://my.oschina.net/u/2344008/blog/485626

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值