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:
The user's home directory library, but this one is tricky.
"/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 the Fonts directory.)
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.