xcode 如何使用 Interface Builder 为 UITextView 选择 San Francisco 字体?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/32751806/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 07:55:36  来源:igfitidea点击:

How to select San Francisco font using Interface Builder for attributed UITextView?

iosxcodeios9

提问by Meriw

I have an UITextViewwith attributed textin which I want to select the new 'San Francisco' font for certain parts of the text. However, I can't find the font from Xcode's font picker.

我有一个带有属性文本UITextView,我想在其中为文本的某些部分选择新的“旧金山”字体。但是,我无法从 Xcode 的字体选择器中找到该字体。

Is there a way to select San Francisco or select the system's default font (as as I normally would if using plain text) using attributed text in Interface Builder?

有没有办法使用Interface Builder 中的属性文本来选择 San Francisco 或选择系统的默认字体(就像我通常使用纯文本时那样)?

采纳答案by l'L'l

You need to download the font, then install/use it according to the guidelines:

您需要下载字体,然后根据指南安装/使用它:

https://developer.apple.com/fonts/

https://developer.apple.com/fonts/

WWDC video on the subject:

关于这个主题的 WWDC 视频:

https://developer.apple.com/videos/wwdc/2015/?id=804

https://developer.apple.com/videos/wwdc/2015/?id=804

There's also a github repo that contains the fonts and alternative instructions (in case you don't happen to have your Apple developer account handy):

还有一个包含字体和替代说明的 github 存储库(以防您碰巧没有 Apple 开发者帐户):

https://github.com/supermarin/YosemiteSanFranciscoFont

https://github.com/supermarin/YosemiteSanFranciscoFont

*The font is still in a beta stage it looks like; use in production code at your own risk.

*字体看起来仍处于测试阶段;在生产代码中使用,风险自负。