-
Notifications
You must be signed in to change notification settings - Fork 46
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
Windows font_dir #37
Comments
Hey Gustavo, thanks for your contribution! If Windows made these improvements this would be really great news – I'll try to read through things and try to gain a better understanding. My first instinct would be to check whether there is a appropriate Win32 API call for it – the general approach of the library is to avoid hitting the file system for various reasons (see second point in https://github.com/dirs-dev/dirs-rs#design-goals). So I wouldn't try to use the presence or absence of this directory as an indication for anything; I'd probably have a look at whatever the Win32 API does and think whether this is appropriate for this library. Do you have an idea whether the Cheers, Simon |
Ah interesting! I didn't expect that the registry key was the "intended" way to use the folder (in general I have the impression that they want to avoid introducing public-facing registry things as much as possible) – that's why I assumed there was a Win32 API available. I'm really curious why the known folder API wasn't updated. :-/ |
If I had to guess the API hasn't been update to maintain backwards compatibility... |
Based on https://stackoverflow.com/questions/70526705/why-was-the-user-font-directory-not-added-to-the-knownfolder-api I'll (sadly) close this. It appears that this directory is neither required nor sufficient to do anything userfont-wise. Feel free to reopen if you have more ideas how to tackle this. |
Thanks for looking into it |
Currently
dirs-rs
returns always None for a font directory in Windows:However, according to this , ever since Windows 1809, there has been support for a user font directory.
I have written a fork of dirs-sys-rs with support for the folder , basically it tries to find the directory
%userprofile%\AppData\Local\Microsoft\Windows\Fonts
, if it doesn't exist, the function returns None. Is this a good approach for a merge request?The text was updated successfully, but these errors were encountered: