简体   繁体   English

无法将自定义字体添加到Xcode

[英]Can't add custom font to Xcode

I'm trying to add a downloaded font to Xcode and I've folowed every single step based on this link: http://codewithchris.com/common-mistakes-with-adding-custom-fonts-to-your-ios-app/ 我正在尝试将下载的字体添加到Xcode,并根据此链接遵循了每个步骤: http : //codewithchris.com/common-mistakes-with-adding-custom-fonts-to-your-ios-应用程序/

在此处输入图片说明

I added the font to my Xcode Project, 我将字体添加到了Xcode项目中, 在此处输入图片说明

included it in Copy Bundle Resources (Build Phases), 将其包含在副本捆绑资源中(构建阶段),

在此处输入图片说明

and typed it in Fonts Provided by Application (in Info.plist). 并在“应用程序提供的字体”中键入它(在Info.plist中)。

在此处输入图片说明

Then I typed this in GameScene.swift inside didMoveToView 然后我在didMoveToView的GameScene.swift中键入了

It has worked with other fonts but not with this one. 它可以与其他字体一起使用,但不能与该字体一起使用。 This is really frustrating me and I've got no idea what the problem is, thanks. 这真的让我感到沮丧,我也不知道问题是什么,谢谢。

The name of the font is not always the name of the file. 字体的名称并不总是文件的名称。 Try looking for the file and then opening in. It should automatically pull it up in font book, and the name of the font is located on the top bar. 尝试查找文件,然后打开。它会自动将其拉到字体书中,并且字体名称位于顶部栏上。 Simply enter that instead of the file name and it should work. 只需输入该名称而不是文件名即可。

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

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