Skip to content
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

Font with fallback shows error when one font isn't found #2533

Closed
yourboirusty opened this issue May 10, 2024 · 5 comments
Closed

Font with fallback shows error when one font isn't found #2533

yourboirusty opened this issue May 10, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@yourboirusty
Copy link

yourboirusty commented May 10, 2024

Describe the bug
When Neovide doesn't find one of the fonts in vim.opt.guifont it will still print out an error on startup.

To Reproduce
Steps to reproduce the behavior:

  1. Set vim.opt.guifont to two fonts, one non existent, eg. "FiraCode Nerd Font Mono,FiraCode NFM:h12"
  2. Open neovide
  3. See error
  4. Skip error, notice that at least font size is changing

Expected behavior
Neovide silently falls back to another font, without throwing an error.

Screenshots
obraz

Desktop (please complete the following information):

  • OS: Ubuntu 22.04.4 LTS in WSL over Windows 11 Pro Version 10.0.22000 Build 22000
  • Neovide Version 0.12.2
  • Neovim Version 0.9.5

Neovide log output

@yourboirusty yourboirusty added the bug Something isn't working label May 10, 2024
@fredizzimo
Copy link
Member

I don't think so, in the past we have got way too many issues where people have made typos in their font names and those are completely pointless, since the users could have figured it out themselves.

Additionally, I can't think of a single valid reason why you have configured a fallback font, and don't want to use it. For machine specific configuration, the config file is the preferred way.

@yourboirusty
Copy link
Author

Noted, I'll switch to using the config file or work around it in Lua.

@yourboirusty yourboirusty closed this as not planned Won't fix, can't repro, duplicate, stale May 13, 2024
@BatmanAoD
Copy link

@fredizzimo I added a comment here to this effect, but I do actually rely on silent fallback, and it seems like there's no way to get my preferred behavior without a more complex configuration. Would you consider a config option to let users opt-in to the silent-fallback behavior? This would make it easy to debug font selection by opting back out, but also enable the old behavior for people who use it.

@fredizzimo
Copy link
Member

Your use case is one of the reasons why added the font settings to the confg.toml file. https://neovide.dev/config-file.html#runtime-settings

That file is machine specific, so you can have different fonts and font sizes on all your client machines, while using the same main neovim configuration. It's also always loaded from the same host as Neovide, so it's unaffected by any remote settings when you connect to remote Neovim instances.

@BatmanAoD
Copy link

@fredizzimo I'm not sure how that addresses my use case? What I want is to be able to download my config onto any machine, any OS, and have a reasonable choice of fonts auto-selected, without a warning message about invalid fonts, and without needing to manually tweak the downloaded files. Then, when I do get around to installing my preferred font, I'll automatically get that font instead of the fallback, again without modifying a config file. This is the behavior of gvim and of all neovide versions before 0.12.

I appreciate the concept of local files for machine-specific config, but that's essentially the opposite of what I want for this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants