-
Notifications
You must be signed in to change notification settings - Fork 15
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 paths for fonts on Apple platforms #50
Comments
Ends up: |
waywardmonkeys
added a commit
to waywardmonkeys/parley
that referenced
this issue
Jun 2, 2024
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.
waywardmonkeys
added a commit
to waywardmonkeys/parley
that referenced
this issue
Jun 2, 2024
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.
waywardmonkeys
added a commit
to waywardmonkeys/parley
that referenced
this issue
Jun 2, 2024
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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently, the CoreText source is searching in
"/System/Library/Fonts/"
for fonts, but it should probably be searching in more than that.Fonts can be found in:
"/Library/Fonts"
"/System/Library/Fonts"
"/Network/Library/Fonts"
The user's home directory might be tricky due to sandboxing and so we shouldn't just put together the paths ourselves, but use the system APIs for this instead. (In sandboxed applications, one doesn't have direct access to
~/Library/
but has access to something in~/Library/Containers/<application id>/data/Library
which contains a symlink to theFonts
directory.)I think the right thing to do would be to use
NSSearchPathForDirectoriesInDomains
(https://developer.apple.com/documentation/foundation/1414224-nssearchpathfordirectoriesindoma?language=objc) withNSLibraryDirectory
or (NSAllLibrariesDirectory
, I don't know which) and a mask ofNSAllDomainsMask
. We should be able to get this fromobjc2_foundation
(https://docs.rs/objc2-foundation/latest/objc2_foundation/fn.NSSearchPathForDirectoriesInDomains.html)And finally ... there are ALSO fonts in
/System/Library/Fonts/Supplemental
which should be scanned.The text was updated successfully, but these errors were encountered: