-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Search correct paths for fonts on Apple platforms. #71
Search correct paths for fonts on Apple platforms. #71
Conversation
769e81c
to
b1f23b7
Compare
I'm not sure about a couple of things here, like using string concatenation, the use of When I run this locally, I get these search paths:
If @madsmtm has any comments, that in particular would be great. |
Use the Foundation API to get the list of "Library" directories and look in each of them for a "Fonts" directory. This handles the need to search a variety of paths on macOS to find fonts in the various standard locations like "~/Library/Fonts", "/System/Library/Fonts", "/Library/Fonts", "/Network/Library/Fonts", etc. Fixes linebender#50.
b1f23b7
to
98a491f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Memory safety looks fine, and I think using NSSearchPathForDirectoriesInDomains
and appending "Fonts"
is the correct approach. An alternative, as the docs say, would've been -[NSFileManager URLsForDirectory:inDomains:]
.
I'm happy to approve this when mads' comments are addressed (either an answer or a code change). |
Use the Foundation API to get the list of "Library" directories and look in each of them for a "Fonts" directory.
This handles the need to search a variety of paths on macOS to find fonts in the various standard locations like "~/Library/Fonts", "/System/Library/Fonts", "/Library/Fonts", "/Network/Library/Fonts", etc.
Fixes #50.