iOS 6:動態下載字體

iOS 6:字體列表

瞭解 iOS 6 中所使用的字體。async

iOS 6 隨附安裝了下列字體:ide

  • Academy Engraved LET Plain:1.0字體

  • American Typewriterspa

  • American Typewriter Boldcode

  • American Typewriter Condensedorm

  • American Typewriter Condensed Boldip

  • American Typewriter Condensed Lightci

  • American Typewriter Lightget

  • Apple Color Emojistring

  • 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;
    });

效果以下:

相關文章
相關標籤/搜索