Skip to content

fix: find in current directory first#35

Open
viktornv wants to merge 1 commit intoAraq:masterfrom
viktornv:local-fonts-priority
Open

fix: find in current directory first#35
viktornv wants to merge 1 commit intoAraq:masterfrom
viktornv:local-fonts-priority

Conversation

@viktornv
Copy link
Copy Markdown

@viktornv viktornv commented Apr 7, 2026

Even if the DejaVuSansMono.ttf font is installed on Windows, it is sometimes not found by name in the system folder. I have implemented a more portable approach: the application now looks for fonts in the executable's directory before falling back to the default system logic. This ensures the app works correctly even if system font detection fails.

@Araq
Copy link
Copy Markdown
Owner

Araq commented Apr 7, 2026

Well but we don't ship any fonts.

@ZoomRmc
Copy link
Copy Markdown

ZoomRmc commented Apr 7, 2026

Be aware that there's no reliable way to getAppDir/getAppFilename on Windows with pure stdlib, as there's no way to resolve symlinks yet and the docs lie by omission.

ref: nim-lang/Nim#25701

Using appDir is very convenient but is generally discouraged as it usually implies getting elevated permissions. It's ok as a fallback, but you always better start with envs: APPDATA/LOCALAPPDATA (which is idiomatic but difficult to appreciate), then PROGRAMDATA (from Vista), then/or something like USERPROFILE/.config which is wrong but has a nice property of mirroring XDG.

@Araq
Copy link
Copy Markdown
Owner

Araq commented Apr 7, 2026

I use getAppDir successfully for about 15 years and symlinks are largely unused on Windows...

@ZoomRmc
Copy link
Copy Markdown

ZoomRmc commented Apr 7, 2026

What can I say, you miss a lot.

Also, it's better not conflate personal experience with statistical significance. Even if it was insignificant, shouldn't we strive to be correct?

@Araq
Copy link
Copy Markdown
Owner

Araq commented Apr 9, 2026

No, we should strive to make OSes simpler by removing anti-features from them. And we do that in a first step by pretending the anti-features don't exist. The alternative is that every API documents its signal-safety behavior and apparently the whole world decided, rightly so, that that would be stupid.

@ZoomRmc
Copy link
Copy Markdown

ZoomRmc commented Apr 9, 2026

You should set up a twitter account, you'll have a blast with the hot takes.

"anti-features" = "features I don't need", cool.

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

Successfully merging this pull request may close these issues.

3 participants