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

GuiFont not a fixed pitch font #1083

Open
sajadspeed opened this issue Sep 21, 2023 · 13 comments
Open

GuiFont not a fixed pitch font #1083

sajadspeed opened this issue Sep 21, 2023 · 13 comments

Comments

@sajadspeed
Copy link

I want Noto Sans Mono font:
:GuiFont Noto Sans Mono

But i got this error:
Noto Sans Mono is not a fixed pitch font


My Fonts:
fc-list | grep NotoSansMono

/usr/share/fonts/truetype/noto/NotoSansMono-Light.ttf: Noto Sans Mono,Noto Sans Mono Light:style=Light,Regular
/usr/share/fonts/truetype/noto/NotoSansMono-Regular.ttf: Noto Sans Mono:style=Regular
/usr/share/fonts/truetype/noto/NotoSansMono-CondensedLight.ttf: Noto Sans Mono,Noto Sans Mono Condensed Light:style=Condensed Light,Regular
/usr/share/fonts/truetype/noto/NotoSansMono-SemiCondensedBlack.ttf: Noto Sans Mono,Noto Sans Mono SemiCondensed Black:style=SemiCondensed Black,Regular
/usr/share/fonts/truetype/noto/NotoSansMono-SemiCondensedLight.ttf: Noto Sans Mono,Noto Sans Mono SemiCondensed Light:style=SemiCondensed Light,Regular
/usr/share/fonts/truetype/noto/NotoSansMono-CondensedExtraBold.ttf: Noto Sans Mono,Noto Sans Mono Condensed ExtraBold:style=Condensed ExtraBold,Regular
/usr/share/fonts/truetype/noto/NotoSansMono-ExtraLight.ttf: Noto Sans Mono,Noto Sans Mono ExtraLight:style=ExtraLight,Regular
/usr/share/fonts/truetype/noto/NotoSansMono-CondensedBold.ttf: Noto Sans Mono,Noto Sans Mono Condensed:style=Condensed Bold,Bold
/usr/share/fonts/truetype/noto/NotoSansMono-CondensedExtraLight.ttf: Noto Sans Mono,Noto Sans Mono Condensed ExtraLight:style=Condensed ExtraLight,Regular
/usr/share/fonts/truetype/noto/NotoSansMono-SemiBold.ttf: Noto Sans Mono,Noto Sans Mono SemiBold:style=SemiBold,Regular
/usr/share/fonts/truetype/noto/NotoSansMono-ExtraCondensedBold.ttf: Noto Sans Mono,Noto Sans Mono ExtraCondensed:style=ExtraCondensed Bold,Bold
/usr/share/fonts/truetype/noto/NotoSansMono-ExtraCondensedThin.ttf: Noto Sans Mono,Noto Sans Mono ExtraCondensed Thin:style=ExtraCondensed Thin,Regular
/usr/share/fonts/truetype/noto/NotoSansMono-CondensedMedium.ttf: Noto Sans Mono,Noto Sans Mono Condensed Medium:style=Condensed Medium,Regular
/usr/share/fonts/truetype/noto/NotoSansMono-ExtraCondensedMedium.ttf: Noto Sans Mono,Noto Sans Mono ExtraCondensed Medium:style=ExtraCondensed Medium,Regular
/usr/share/fonts/truetype/noto/NotoSansMono-SemiCondensedBold.ttf: Noto Sans Mono,Noto Sans Mono SemiCondensed:style=SemiCondensed Bold,Bold
/usr/share/fonts/truetype/noto/NotoSansMono-SemiCondensed.ttf: Noto Sans Mono,Noto Sans Mono SemiCondensed:style=SemiCondensed,Regular
/usr/share/fonts/truetype/noto/NotoSansMono-ExtraCondensedSemiBold.ttf: Noto Sans Mono,Noto Sans Mono ExtraCondensed SemiBold:style=ExtraCondensed SemiBold,Regular
/usr/share/fonts/truetype/noto/NotoSansMono-ExtraCondensedExtraBold.ttf: Noto Sans Mono,Noto Sans Mono ExtraCondensed ExtraBold:style=ExtraCondensed ExtraBold,Regular
/usr/share/fonts/truetype/noto/NotoSansMono-Medium.ttf: Noto Sans Mono,Noto Sans Mono Medium:style=Medium,Regular
/usr/share/fonts/truetype/noto/NotoSansMono-Thin.ttf: Noto Sans Mono,Noto Sans Mono Thin:style=Thin,Regular
/usr/share/fonts/truetype/noto/NotoSansMono-ExtraCondensed.ttf: Noto Sans Mono,Noto Sans Mono ExtraCondensed:style=ExtraCondensed,Regular
/usr/share/fonts/truetype/noto/NotoSansMono-Bold.ttf: Noto Sans Mono:style=Bold
/usr/share/fonts/truetype/noto/NotoSansMono-Condensed.ttf: Noto Sans Mono,Noto Sans Mono Condensed:style=Condensed,Regular
/usr/share/fonts/truetype/noto/NotoSansMono-SemiCondensedSemiBold.ttf: Noto Sans Mono,Noto Sans Mono SemiCondensed SemiBold:style=SemiCondensed SemiBold,Regular
/usr/share/fonts/truetype/noto/NotoSansMono-SemiCondensedExtraLight.ttf: Noto Sans Mono,Noto Sans Mono SemiCondensed ExtraLight:style=SemiCondensed ExtraLight,Regular
/usr/share/fonts/truetype/noto/NotoSansMono-CondensedThin.ttf: Noto Sans Mono,Noto Sans Mono Condensed Thin:style=Condensed Thin,Regular
/usr/share/fonts/truetype/noto/NotoSansMono-CondensedSemiBold.ttf: Noto Sans Mono,Noto Sans Mono Condensed SemiBold:style=Condensed SemiBold,Regular
/usr/share/fonts/truetype/noto/NotoSansMono-SemiCondensedMedium.ttf: Noto Sans Mono,Noto Sans Mono SemiCondensed Medium:style=SemiCondensed Medium,Regular
/usr/share/fonts/truetype/noto/NotoSansMono-ExtraCondensedBlack.ttf: Noto Sans Mono,Noto Sans Mono ExtraCondensed Black:style=ExtraCondensed Black,Regular
/usr/share/fonts/truetype/noto/NotoSansMono-Black.ttf: Noto Sans Mono,Noto Sans Mono Black:style=Black,Regular
/usr/share/fonts/truetype/noto/NotoSansMono-SemiCondensedThin.ttf: Noto Sans Mono,Noto Sans Mono SemiCondensed Thin:style=SemiCondensed Thin,Regular
/usr/share/fonts/truetype/noto/NotoSansMono-ExtraCondensedLight.ttf: Noto Sans Mono,Noto Sans Mono ExtraCondensed Light:style=ExtraCondensed Light,Regular
/usr/share/fonts/truetype/noto/NotoSansMono-ExtraBold.ttf: Noto Sans Mono,Noto Sans Mono ExtraBold:style=ExtraBold,Regular
/usr/share/fonts/truetype/noto/NotoSansMono-CondensedBlack.ttf: Noto Sans Mono,Noto Sans Mono Condensed Black:style=Condensed Black,Regular
/usr/share/fonts/truetype/noto/NotoSansMono-ExtraCondensedExtraLight.ttf: Noto Sans Mono,Noto Sans Mono ExtraCondensed ExtraLight:style=ExtraCondensed ExtraLight,Regular
/usr/share/fonts/truetype/noto/NotoSansMono-SemiCondensedExtraBold.ttf: Noto Sans Mono,Noto Sans Mono SemiCondensed ExtraBold:style=SemiCondensed ExtraBold,Regular
@equalsraf
Copy link
Owner

fc-list does list the fonts, but if GuiFont is failing either there is a problem with the font itself (usually different size for different variants), or some issue with the Qt font metrics code.

We keep a little binary in src/gui/shellwidget/fontinfo.cpp that prints out the font metrics reported by Qt.

As workaround you can also force the font using GuiFont! fontname.

@hoofcushion
Copy link

How to force the font by using lua?
I use lua vim.opt.guifont="<font-name>" but I got an error like this:
image

@equalsraf
Copy link
Owner

The lua code would be

vim.cmd('GuiFont ...')

If you are running this from init.lua instead of ginit.vim, then you will need something like an autocommand for UIEnter.

@hoofcushion
Copy link

It seems there is no command called GuiFont

Both :lua vim.cmd('GuiFont') and :GuiFont doesn't work
image
image

Am I doing anything wrong?

@hoofcushion
Copy link

I got it, nvim_gui_shim.vim is required. and somehow I haven't got one.

@equalsraf
Copy link
Owner

I got it, nvim_gui_shim.vim is required. and somehow I haven't got one.

Usually you don't need to set it up manually, check its path in https://github.com/equalsraf/neovim-qt#why-are-the-gui-commands-missing

@hoofcushion
Copy link

To force the font by using lua, use this lua vim.rpcnotify(0, 'Gui', 'Font', <font-name>, "!").

@hoofcushion
Copy link

Usually you don't need to set it up manually, check its path in https://github.com/equalsraf/neovim-qt#why-are-the-gui-commands-missing

I checked, and it just wasn't there, I download one from the repo, and everything is fine now, thanks.

@equalsraf
Copy link
Owner

That sounds like it is looking for it in the wrong place. If you are building from source it would be in src/gui/runtime. If you installed from some package, it sounds broken, where did you install from?

@hoofcushion
Copy link

I think it's from the official website of Neovim

  1. Install Now
    image
  2. Redirect to Github Wiki
  3. Install from download
  4. Latest stable release
  5. Windows
    image

@sajadspeed
Copy link
Author

I use NotoSansM Nerd Font Mono and is ok. thank you all for your answeres.

@equalsraf
Copy link
Owner

I assume it is this font https://github.com/ryanoasis/nerd-fonts/tree/master/patched-fonts/Noto/Sans-Mono is that correct?

@sajadspeed
Copy link
Author

I assume it is this font https://github.com/ryanoasis/nerd-fonts/tree/master/patched-fonts/Noto/Sans-Mono is that correct?

Yes, I also use this font.

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

No branches or pull requests

3 participants