iphone开发之获取系统字体

代码:

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.

    NSLog(@"--系统的所有字体--%@",[self getAllSystemFonts]);
    NSLog(@"--系统当前字体--%@",[self getCurrentFont]);

}
//获得系统的所有字体
- (NSArray*)getAllSystemFonts;
{
    NSMutableArray *array = [[NSMutableArray alloc] init] ;
    NSArray* familys = [UIFont familyNames];

    for (id obj in familys) {
        NSArray* fonts = [UIFont fontNamesForFamilyName:obj];
        for (id font in fonts)
        {
            [array addObject:font];
        }
    }
    return array;
}
//获得系统的当前字体
- (UIFont*)getCurrentFont
{
    //判断系统字体的size,返回使用的字体。
    UIFont *font = [UIFont systemFontOfSize:[UIFont systemFontSize]];
    return font;
}

输出:

2014-12-02 13:31:15.594 iphone开发之获取系统字体[11349:60b] --系统的所有字体--(

    "Thonburi-Bold",

    Thonburi,

    "Thonburi-Light",

    "SnellRoundhand-Black",

    "SnellRoundhand-Bold",

    SnellRoundhand,

    AcademyEngravedLetPlain,

    "MarkerFelt-Thin",

    "MarkerFelt-Wide",

    "Avenir-Heavy",

    "Avenir-Oblique",

    "Avenir-Black",

    "Avenir-Book",

    "Avenir-BlackOblique",

    "Avenir-HeavyOblique",

    "Avenir-Light",

    "Avenir-MediumOblique",

    "Avenir-Medium",

    "Avenir-LightOblique",

    "Avenir-Roman",

    "Avenir-BookOblique",

    "GeezaPro-Bold",

    GeezaPro,

    "GeezaPro-Light",

    ArialRoundedMTBold,

    "Trebuchet-BoldItalic",

    TrebuchetMS,

    "TrebuchetMS-Bold",

    "TrebuchetMS-Italic",

    ArialMT,

    "Arial-BoldItalicMT",

    "Arial-ItalicMT",

    "Arial-BoldMT",

    "Marion-Regular",

    "Marion-Italic",

    "Marion-Bold",

    "Menlo-BoldItalic",

    "Menlo-Regular",

    "Menlo-Bold",

    "Menlo-Italic",

    MalayalamSangamMN,

    "MalayalamSangamMN-Bold",

    KannadaSangamMN,

    "KannadaSangamMN-Bold",

    "GurmukhiMN-Bold",

    GurmukhiMN,

    "BodoniSvtyTwoOSITCTT-BookIt",

    "BodoniSvtyTwoOSITCTT-Bold",

    "BodoniSvtyTwoOSITCTT-Book",

    "BradleyHandITCTT-Bold",

    "Cochin-Bold",

    "Cochin-BoldItalic",

    "Cochin-Italic",

    Cochin,

    SinhalaSangamMN,

    "SinhalaSangamMN-Bold",

    "HiraKakuProN-W6",

    "HiraKakuProN-W3",

    "IowanOldStyle-Bold",

    "IowanOldStyle-BoldItalic",

    "IowanOldStyle-Italic",

    "IowanOldStyle-Roman",

    DamascusBold,

    Damascus,

    DamascusMedium,

    DamascusSemiBold,

    "AlNile-Bold",

    AlNile,

    Farah,

    "Papyrus-Condensed",

    Papyrus,

    "Verdana-BoldItalic",

    "Verdana-Italic",

    Verdana,

    "Verdana-Bold",

    ZapfDingbatsITC,

    "DINCondensed-Bold",

    "AvenirNextCondensed-Regular",

    "AvenirNextCondensed-MediumItalic",

    "AvenirNextCondensed-UltraLightItalic",

    "AvenirNextCondensed-UltraLight",

    "AvenirNextCondensed-BoldItalic",

    "AvenirNextCondensed-Italic",

    "AvenirNextCondensed-Medium",

    "AvenirNextCondensed-HeavyItalic",

    "AvenirNextCondensed-Heavy",

    "AvenirNextCondensed-DemiBoldItalic",

    "AvenirNextCondensed-DemiBold",

    "AvenirNextCondensed-Bold",

    Courier,

    "Courier-Oblique",

    "Courier-BoldOblique",

    "Courier-Bold",

    "HoeflerText-Regular",

    "HoeflerText-BlackItalic",

    "HoeflerText-Italic",

    "HoeflerText-Black",

    EuphemiaUCAS,

    "EuphemiaUCAS-Bold",

    "EuphemiaUCAS-Italic",

    "Helvetica-Oblique",

    "Helvetica-Light",

    "Helvetica-Bold",

    Helvetica,

    "Helvetica-BoldOblique",

    "Helvetica-LightOblique",

    "HiraMinProN-W6",

    "HiraMinProN-W3",

    BodoniOrnamentsITCTT,

    "Superclarendon-Regular",

    "Superclarendon-BoldItalic",

    "Superclarendon-Light",

    "Superclarendon-BlackItalic",

    "Superclarendon-Italic",

    "Superclarendon-LightItalic",

    "Superclarendon-Bold",

    "Superclarendon-Black",

    DiwanMishafi,

    "Optima-Regular",

    "Optima-Italic",

    "Optima-Bold",

    "Optima-BoldItalic",

    "Optima-ExtraBlack",

    "GujaratiSangamMN-Bold",

    GujaratiSangamMN,

    DevanagariSangamMN,

    "DevanagariSangamMN-Bold",

    AppleColorEmoji,

    SavoyeLetPlain,

    Kailasa,

    "Kailasa-Bold",

    "TimesNewRomanPS-BoldItalicMT",

    TimesNewRomanPSMT,

    "TimesNewRomanPS-BoldMT",

    "TimesNewRomanPS-ItalicMT",

    TeluguSangamMN,

    "TeluguSangamMN-Bold",

    "STHeitiSC-Medium",

    "STHeitiSC-Light",

    "AppleSDGothicNeo-Thin",

    "AppleSDGothicNeo-SemiBold",

    "AppleSDGothicNeo-Medium",

    "AppleSDGothicNeo-Regular",

    "AppleSDGothicNeo-Bold",

    "AppleSDGothicNeo-Light",

    "Futura-Medium",

    "Futura-CondensedMedium",

    "Futura-MediumItalic",

    "Futura-CondensedExtraBold",

    "BodoniSvtyTwoITCTT-Book",

    "BodoniSvtyTwoITCTT-Bold",

    "BodoniSvtyTwoITCTT-BookIta",

    "Baskerville-Bold",

    "Baskerville-SemiBoldItalic",

    "Baskerville-BoldItalic",

    Baskerville,

    "Baskerville-SemiBold",

    "Baskerville-Italic",

    Symbol,

    "STHeitiTC-Medium",

    "STHeitiTC-Light",

    Copperplate,

    "Copperplate-Light",

    "Copperplate-Bold",

    PartyLetPlain,

    "AmericanTypewriter-Light",

    "AmericanTypewriter-CondensedLight",

    "AmericanTypewriter-CondensedBold",

    AmericanTypewriter,

    "AmericanTypewriter-Condensed",

    "AmericanTypewriter-Bold",

    "ChalkboardSE-Light",

    "ChalkboardSE-Regular",

    "ChalkboardSE-Bold",

    "AvenirNext-MediumItalic",

    "AvenirNext-Bold",

    "AvenirNext-UltraLight",

    "AvenirNext-DemiBold",

    "AvenirNext-HeavyItalic",

    "AvenirNext-Heavy",

    "AvenirNext-Medium",

    "AvenirNext-Italic",

    "AvenirNext-UltraLightItalic",

    "AvenirNext-BoldItalic",

    "AvenirNext-Regular",

    "AvenirNext-DemiBoldItalic",

    BanglaSangamMN,

    "BanglaSangamMN-Bold",

    "Noteworthy-Bold",

    "Noteworthy-Light",

    Zapfino,

    TamilSangamMN,

    "TamilSangamMN-Bold",

    Chalkduster,

    "ArialHebrew-Bold",

    "ArialHebrew-Light",

    ArialHebrew,

    "Georgia-BoldItalic",

    "Georgia-Bold",

    "Georgia-Italic",

    Georgia,

    "HelveticaNeue-BoldItalic",

    "HelveticaNeue-Light",

    "HelveticaNeue-Italic",

    "HelveticaNeue-UltraLightItalic",

    "HelveticaNeue-CondensedBold",

    "HelveticaNeue-MediumItalic",

    "HelveticaNeue-Thin",

    "HelveticaNeue-Medium",

    "HelveticaNeue-ThinItalic",

    "HelveticaNeue-LightItalic",

    "HelveticaNeue-UltraLight",

    "HelveticaNeue-Bold",

    HelveticaNeue,

    "HelveticaNeue-CondensedBlack",

    GillSans,

    "GillSans-Italic",

    "GillSans-BoldItalic",

    "GillSans-Light",

    "GillSans-LightItalic",

    "GillSans-Bold",

    "Palatino-Roman",

    "Palatino-Italic",

    "Palatino-Bold",

    "Palatino-BoldItalic",

    CourierNewPSMT,

    "CourierNewPS-BoldMT",

    "CourierNewPS-ItalicMT",

    "CourierNewPS-BoldItalicMT",

    OriyaSangamMN,

    "OriyaSangamMN-Bold",

    "Didot-Bold",

    "Didot-Italic",

    Didot,

    "DINAlternate-Bold",

    "BodoniSvtyTwoSCITCTT-Book"

)

2014-12-02 13:31:15.606 iphone开发之获取系统字体[11349:60b] --系统当前字体--<UICTFont: 0x8c98000> font-family: ".HelveticaNeueInterface-Regular"; font-weight: normal; font-style: normal; font-size: 14.00pt

 

时间: 2024-10-12 07:54:52

iphone开发之获取系统字体的相关文章

【代码笔记】iOS-iphone开发之获取系统字体

代码: - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. NSLog(@"--系统的所有字体--%@",[self getAllSystemFonts]); NSLog(@"--系统当前字体--%@",[self getCurrentFont]); } //获得系统的所有字体 - (NSArray*)getAllSystemFon

js 获取系统字体

参考自网上,非原创. 1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 5 </head> 6 <body> 7 <div style="left: 0px; positon: absolute; top: 0px;

iphone开发之获取网卡的MAC地址和IP地址

本文转载至 http://blog.csdn.net/arthurchenjs/article/details/6358489 这是获取网卡的硬件地址的代码,如果无法编译通过,记得把下面的这几个头文件加上把. #include <sys/socket.h> // Per msqr#include <sys/sysctl.h>#include <net/if.h>#include <net/if_dl.h> #pragma mark MAC addy// Re

Android开发之获取系统12/24小时制的时间

//通过DateFormat获取系统的时间 String currentTime=DateFormat.format("yyyy-MM-dd hh-mm-ss", new Date()).toString(); currentTime="通过DateFormat获取的时间:\n"+currentTime; //通过SimpleDateFormat获取24小时制时间 SimpleDateFormat sdf=new SimpleDateFormat("yyy

uwp 获取系统字体库

原文:uwp 获取系统字体库 效果图: 要获取到字体库首先要在 NuGet 添加 SharpDx.Direct2D1  api: /// <summary> /// 获取系统字体库列表 /// </summary> public void GetFontLibrary() { SharpDX.DirectWrite.Factory factory = new SharpDX.DirectWrite.Factory(); var fontCollection = factory.Ge

获取系统字体方法

//需要引用命名空间 using System.Drawing; using System.Drawing.Text; //获取系统字体方法 public dynamic GetFontNames() { FontFamily[] fontFamilies; InstalledFontCollection installedFontCollection = new InstalledFontCollection(); fontFamilies = installedFontCollection.

C#获取系统字体

C#获取系统字体使用的方法: InstalledFontCollection MyFont = new InstalledFontCollection(); 但是当上面的命令出错的时候,可以试试下面这种: System.Drawing.Text.InstalledFontCollection MyFont = new System.Drawing.Text.InstalledFontCollection(); 原文地址:https://www.cnblogs.com/kuangzhenxia-4

Android开发之获取系统所有进程信息。

最近在做一个app,有一个进程管理模块用于管理系统中正在运行的进程,并且可以关闭进程进行加速手机的功能,基本把它实现了出来.界面的效果都是自己写的,虽然有BUG,但是基本上能满足需求,后期我会改进BUG.好了,来看看效果: 1.获取系统的可用内存和总内存. 获取系统内存中应用的信息,需要用到ActivityManager这个类,然而当你用这个类拿数据的时候你会发现,拿到的数据不正确.用这个类的API获取系统的总内存和可用内存会出现数据不正确的情况.除了这个类,Android手机中有文件描述了这些

获取系统字体

//如何获得系统字体列表 System.Drawing.Text.InstalledFontCollection fonts=new System.Drawing.Text.InstalledFontCollection(); foreach(System.Drawing.FontFamily ff in fonts.Families) {    this.comboBox1.Items.Add(ff.Name); }