I followed a bunch of tutorials but it doesn’t work: I simply want to add a custom font to a macOS app.
What I tried essentially:
- Added the
.ttf
font-files to my project: Target Membership is set and I also made sure that the files are copied usingCopy Files
withinBundle Phases
. After compiling I can see that all files are within the Bundle. So that seems to work perfectly fine.
Info.plist
: I addedFonts provided by application
and created an item for every font-file I want to add (values likemyFont.tff
).I made sure that I use the correct font name. I installed the fonts on my system and configured a Label with Interface Builder so that it uses the desired font. I printed it’s value
print(myLabel.font.fontName)
.Confusing: If the exactly same font-file I want to add to the app is installed in the systems Fontbook and activated, everything works well. When I deactivate it, it doesn’t work. For me that indicates that I am using the correct font name.
I found
ATSApplicationFontsPath
and tried to add it to theInfo.plist
, but neither using a path (recommended by the docs) or values like.
(which seemed to work for some people out there) worked out.
Appreciate any help!