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

directories-next: Add system font directory #52

Open
ghost opened this issue Feb 28, 2021 · 1 comment
Open

directories-next: Add system font directory #52

ghost opened this issue Feb 28, 2021 · 1 comment

Comments

@ghost
Copy link

ghost commented Feb 28, 2021

There is currently the user writeable font directory, accessible through UserDirs::font_dir, however, I can't seem to find one in BaseDirs. For reliably getting font file paths on the major platforms to use them for example in SDL, it's needed to get the paths to the system font directories as well.

As I see, the locations for fonts on the major platforms are:

  • Linux: /usr/share/fonts and subdirectories, determined through fc-liston my system (Arch Linux)
  • Mac OS X: /System/Library/Fonts and /Library/Fonts, taken from Wikipedia
  • Windows: C:\Windows\Fonts, found after using find . -type d -iname '*font*' in a clean new Wineprefix

It might be appropiate to return them as a Vec<&Path>, as on Linux and Mac OS X, there are multiple appropiate folders (on Linux the subdirectories of /usr/share/fonts, on Mac OS X /System/Library/Fonts and /Library/Fonts).
Unfortunately I don't have a real system to check if the Mac OS X and Windows paths are right.

@mainrs
Copy link

mainrs commented Mar 22, 2021

I can tackle this one down :) Expect a PR at the end of the week :)

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

1 participant