ios - SenticoSansDT - 中型和薄型不在 xcode 中加载

标签 ios xcode uifont

我尝试加载以下字体

SenticoSansDT - Light
SenticoSansDT - Regular
SenticoSansDT - Thin
SenticoSansDT - Medium

都是后缀为.ttf的字体文件

我添加到 Xcode 并检查目标。在构建阶段添加字体以及 info.plist。但我只看到要启用的 Regular 和 Light 字体。字体簿和 Storyboard 中均未显示 Medium

最佳答案

在 mac 上安装 .ttf 文件并使用下面的代码找到字体的确切名称。

NSArray *familyNames = [[NSArray alloc] initWithArray:[UIFont familyNames]];
NSArray *fontNames;
NSInteger indFamily, indFont;
NSInteger fontsCount = [familyNames count];

for (indFamily = 0; indFamily < fontsCount; ++indFamily) {
    NSLog (@"Family name: %@", [familyNames objectAtIndex:indFamily]);
    fontNames = [[NSArray alloc] initWithArray:[UIFont fontNamesForFamilyName:[familyNames objectAtIndex:indFamily]]];
    for (indFont = 0; indFont < [fontNames count]; ++indFont) {
        NSLog (@"Font name: %@", [fontNames objectAtIndex:indFont]);
    }

}

使用日志上打印的“SenticoSansDT Medium and Thin”字体名称。

关于ios - SenticoSansDT - 中型和薄型不在 xcode 中加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36130065/

相关文章:

ios - 我如何应用 CICrystallize 过滤器 iOS 7?

ios - Xcode 在您的钥匙串(keychain)错误中找不到此配置文件的有效私钥/证书对

ios - 将 while 循环添加到 didMoveToView

iOS:根据 UILabel 的大小找到正确的字体大小以适合其大小

ios - 自定义字体在 swift 3 中变为 nil 值

android - 相当于 Xcode 中的 android 的 styles.xml

ios - 将一个 NSMutableArray 拆分为两个,以便我可以在 UITableView 的每个部分中设置每个

iphone - 在 iPhone 中缓存来自远程服务器的图像

xcode - 从 Settings.bundle plist 文件注册默认设置?

ios - 无法同时满足 View Controller 的约束