Skip to content
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

OS X: Cannot read fonts in ~/Library/Fonts #7

Open
deepakjois opened this issue May 25, 2017 · 6 comments
Open

OS X: Cannot read fonts in ~/Library/Fonts #7

deepakjois opened this issue May 25, 2017 · 6 comments

Comments

@deepakjois
Copy link
Member

Cannot read the fonts in the user’s home directory.

Need to check this for Linux as well, if applicable.

@deepakjois
Copy link
Member Author

deepakjois commented May 25, 2017

Not sure if CTFontCollectionCreateFromAvailableFonts will get us what we need.

@deepakjois
Copy link
Member Author

deepakjois commented Jun 20, 2017

It does not look like CTFontCollectionCreateFromAvailableFonts will get us what we need. Filed foliojs/font-manager#19 to find out more about whether there is an API that can read fonts from the user’s home directory.

@michal-h21
Copy link

I dont know if the following idea is really usefull, but it seems that fc-list utility which comes with TeX Live (I dont know about Miktex, but I quess it should be similar) can list all fonts installed both in system and in TeX tree. It can also be used to get family name, style and other information about particular font files.

It works at least on Linux and Windows, I cannot test it on OS X. Maybe it could be possible to use it as a library even without TeX distribution?

@deepakjois
Copy link
Member Author

deepakjois commented Jun 20, 2017

Yes, that is an option. fc-list is actually part of fontconfig.

Instead of depending on a commandline tool like fc-list it might be better to just use the fontconfig API. In fact, on Linux, we use fontconfig to get this information already because fontconfig is pretty much guaranteed to be pre-installed on any decent Linux desktop.

fontconfig can be used as a library on OS X as well, just like Harfbuzz. I was just a bit reluctant to add an additional dependency on OS X for fontconfig. It will mean that before installing this package from LuaRocks, the user will need to have fontconfig headers and library installed in the right place.

I am not sure about Windows yet. So maybe there, as a fallback, we can use tools like fc-list or the native Windows directwrite backend to retrieve fonts.

@deepakjois
Copy link
Member Author

Pushed a change on another branch, which makes OS X use fontconfig as well. It works well and detects all the fonts, even the ones in the home folder.

@michal-h21
Copy link

fontmanager could then return some additional field, if fontconfig could be used on all platforms. I can think at least of family, style and fontformat. It would then enable to select font family and then use particular font files for standard TeX style and shape commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants