Skip to content

directories-next: Add system font directory #52

@ghost

Description

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions