dirs icon indicating copy to clipboard operation
dirs copied to clipboard

directories-next: Add system font directory

Open ghost opened this issue 4 years ago • 1 comments

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.

ghost avatar Feb 28 '21 13:02 ghost

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

mainrs avatar Mar 22 '21 14:03 mainrs