Open Phytolizer opened 4 years ago
Hi @onContentStop, thanks for submitting this issue.
The “includeFontFamilies” config setting was designed mostly for programming fonts developers purchase.
As far as I know, I don’t have access to look at what system monospaced fonts are installed. I could dig into this a bit more to see if anything has changed since the last time I checked. Otherwise, if you have any ideas about how this could be accomplished, please feel free to open a PR.
There is another way to accomplish this without looking at the file system for installed monospace fonts. What fonts are missing and what platform are you using (mac, windows, linux)?
It's not necessarily that a specific font is missing, but more that it would be a generic solution.
On Linux, you can get this information by running in a shell fc-list :mono family | sed 's/\\-/-/g'
.
On Windows it is more complicated, involving reading the registry and getting font metrics with .NET. I don't have an elegant solution for that.
Thanks for the suggestion @onContentStop.
I would certainly like to have a more generic solution since it would remove another one of my config settings (ignoreCodefaceFontFamilies) as well. When I have time I will do more research on how this could work across different platforms. The command you mentioned above doesn't work on macOS either.
As I mentioned before, PRs are welcome if you are also interested in digging into this.
Sure, I'll get to work figuring out how to integrate into your code, then make a Linux implementation at the very least. Unfortunately that nice one-liner I wrote relies on you having fontconfig installed (on Mac, through Homebrew), so it won't work for most OSX machines unless they install that. I can work on a generic Objective-C solution for that though. As for Windows, I still don't know :(
This might result in slower startup time, but I would like the option to shift between all installed monospace fonts instead of having to enumerate them manually in the "includeFontFamilies" config option.