gpt4 book ai didi

objective-c - Cocoa 应用程序中的自定义字体

转载 作者:太空狗 更新时间:2023-10-30 03:10:26 27 4
gpt4 key购买 nike

我知道您可以使用 Interface Builder 并选择一种字体来自定义字体。但是,我很好奇我是否可以使用系统默认不包含的自定义字体。有没有办法在我的应用程序中包含自定义字体?

最佳答案

虽然手动字体激活过程是一种选择,但您也可以考虑 ATSApplicationFontsPath Info.plist 键:

Information Property List Key Reference :

"ATSApplicationFontsPath (String - Mac OS X) identifies the location of a font file or directory of fonts in the bundle’s Resources directory. If present, Mac OS X activates the fonts at the specified path for use by the bundled application. The fonts are activated only for the bundled application and not for the system as a whole. The path itself should be specified as a relative directory of the bundle’s Resources directory. For example, if a directory of fonts was at the path /Applications/MyApp.app/Contents/Resources/Stuff/MyFonts/, you should specify the string Stuff/MyFonts/ for the value of this key."

我一定会仔细检查,但我相信这个功能是在 OS X 10.5.x 中添加的(Jinhyung Park 发布的代码针对的)。

关于objective-c - Cocoa 应用程序中的自定义字体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5283572/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com