简体   繁体   English

Xcode自定义字体不模拟

[英]Xcode Custom Fonts Not Simulating

I've seen that this question has already been asked but none of the previous answers have solved my problem. 我已经看到这个问题已被提出,但以前的答案都没有解决我的问题。 I have carefully followed multiple tutorials to adding custom fonts to an xcode project so I am sure that I have set it all up right. 我已经仔细地遵循了多个教程来为xcode项目添加自定义字体,所以我确信我已经将它设置正确。

The problem is that in the main.storyboard, the 'name' label shows the custom font but when I run the simulator the font doesn't show. 问题是在main.storyboard中,'name'标签显示自定义字体,但是当我运行模拟器时,字体不显示。 The problem can be summed up in this screen shot showing both the storyboard and the simulator (the name label.text is "Luna"). 问题可以在这个屏幕截图中总结出来,同时显示故事板和模拟器(名称label.text是“Luna”)。 Is this a problem with the simulator? 这是模拟器的问题吗?

I followed this tutorial http://codewithchris.com/common-mistakes-with-adding-custom-fonts-to-your-ios-app/ when I added the font. 当我添加字体时,我按照本教程http://codewithchris.com/common-mistakes-with-adding-custom-fonts-to-your-ios-app/ I downloaded the custom font then installed in from 'FontBook', after that I added the font.TTF into the supporting files folder in my Xcode project and made sure to add the target membership to my app. 我从'FontBook'下载了自定义字体,之后我将font.TTF添加到我的Xcode项目的支持文件文件夹中,并确保将目标成员资格添加到我的应用程序中。 I included my iOS custom fonts in my application plist. 我在我的应用程序plist中包含了我的iOS自定义字体。 To set the font to the label all I did was set it in the labels attribute inspector. 要将字体设置为标签,我所做的就是在标签属性检查器中设置它。

The language of the project is swift. 该项目的语言很快。 字形

自定义字体

Add your fonts to your bundle resources aswell as the project files 将字体添加到捆绑包资源以及项目文件中

According to your screen shoot the font of the label is System 32.0 . 根据您的屏幕截图,标签的字体是System 32.0 Set your font into font field in interface builder or through code. 在界面构建器中或通过代码将字体设置为字体字段。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM