yatli / fvim

Cross platform Neovim front-end UI, built with F# + Avalonia
MIT License
1.32k stars 28 forks source link

Missing Unicode symbols (maybe Powerline symbols issue?) #103

Open wbthomason opened 4 years ago

wbthomason commented 4 years ago

This might be related to #8, but, as the below screenshots show, I'm seeing an odd subset of symbols missing in FVim vs. terminal Neovim.

Here's FVIM: fvim

And here's terminal Neovim (in Kitty): correct

You'll notice that the symbols for ALE on the sign bar aren't rendered correctly, nor are some of the statusline symbols, nor the symbols for coc.nvim.

The relevant part of my ginit.vim is

  set guifont=Fira\ Code\ Retina:h11
  FVimFontAntialias v:true
  FVimFontAutohint v:true
  FVimFontSubpixel v:true
  FVimFontLcdRender v:true
  FVimFontHintLevel 'full'
  FVimFontAutoSnap v:true
  nnoremap <silent> <C-ScrollWheelUp> :set guifont=+<CR>
  nnoremap <silent> <C-ScrollWheelDown> :set guifont=-<CR>

my Kitty config uses the following fonts

font_family      FiraCode-Retina
bold_font        Fira Code Bold
italic_font      Roboto Mono Italic Nerd Font Complete Mono
bold_italic_font Roboto Mono Bold Italic Nerd Font Complete Mono
font_size 10.0

and I'm on Arch Linux with the latest AUR FVim and Neovim built from master 12/12/2019.

The additional difference in the FVim screenshot - the coc.nvim documentation floating window showing vs. in terminal Neovim - seems to be due to some weird interaction with FVim and coc.nvim. I sometimes see the first item selected and confirmed instantly for me in FVim whereas it is not in Neovim. This seems like a separate issue, though.

The specific symbols not rendering are:

I'm happy to perform more debugging/supply more information to help, but I'm not quite sure what to check next. Please let me know how I can help with this issue! Thanks!

wbthomason commented 4 years ago

Hmm. The ● symbol now isn't showing up, after I rebuilt FVim from the AUR...

yatli commented 4 years ago

Here are the symbol codepoint ranges:

https://github.com/yatli/fvim/blob/83a779851ada77ea2857895a02843735793858c4/wcwidth.fs#L491-L521

Could you please check if the symbols can be displayed when you insert the missing range? Also, are these codepoints documented somewhere? Looks like some kind of extension that I was not aware of.

yatli commented 4 years ago

Also fyi, to leverage the popup symbols:

if exists("g:fvim_loaded")
    call coc#config('suggest.completionItemKindLabels', {
                \ "text": "t",
                \ "method": ":",
                \ "function": "f",
                \ "constructor": "c",
                \ "field": ".",
                \ "variable": "v",
                \ "class": "C",
                \ "interface": "I",
                \ "module": "M",
                \ "property": "p",
                \ "unit": "U",
                \ "value": "l",
                \ "enum": "E",
                \ "keyword": "k",
                \ "snippet": "s",
                \ "color": "K",
                \ "file": "F",
                \ "reference": "r",
                \ "folder": "d",
                \ "enumMember": "m",
                \ "constant": "0",
                \ "struct": "S",
                \ "event": "e",
                \ "operator": "o",
                \ "typeParameter": "T"
                \ })
endif

(mainly suggest.completionItemKindLabels)

wbthomason commented 4 years ago

Thanks for the tip about coc.nvim; I was already setting suggest.completionItemKindLabels, but did not know that I couldn't set it to custom symbols or that setting the values you suggest would cause FVim to render fancier symbols than the basic characters. Perhaps this could be added to the README or wiki?

I inserted the following line

(0x23fa, 0x1f5d9)

(which, according to http://unicode.scarfboy.com/?s=%F0%9F%97%99%E2%9E%A4%E2%97%8F%E2%8F%BA, encompasses the range for the characters I mentioned in the statusline and sign column)

in the NerdFont array and recompiled (from the release commit used by the AUR FVim). I did not observe any difference in character rendering; the same characters rendered incorrectly. I tried building from master but haven't been able to get it to compile on my machine (I get an error about not being able to target .NET Core 3.0).

If that's not what you meant by inserting the missing range, please let me know and I can try again.

I unfortunately don't know of anywhere that documents those codepoints; as far as I was aware, they were ordinary Unicode symbols. I found them in a variety of docs and vim configs over a while; I'm afraid I don't know specifically where each came from originally.

wbthomason commented 4 years ago

Ah, I figured out that the Arch dotnet-sdk package is woefully out of date and installed .NET Core 3.1. That let me build from master. Sadly, this did not fix anything; I still observe the original rendering problems.

yatli commented 4 years ago

Let's use this thread as the primary progress tracker for unicode fallback calculation.

wbthomason commented 4 years ago

@yatli There's been some relevant discussion to my original question here over at https://github.com/Kethku/neovide/issues/75.

Specifically:

yatli commented 4 years ago

Thanks for the info!

yatli commented 4 years ago

Okay regular revisit on this issue:

🗙  1F5D9  missing in both FVim calculation and NerdFont
➤  27A4  missing in both FVim calculation and NerdFont
⏺ 23FA  works, but too wide (can't fix this one at the moment..)
jdhao commented 3 years ago

More airline characters that can not be shown by fvim (nvim-qt shows them correctly using the same Hack font)

☰ (U+2630)
Ꞩ (U+A7A8)
Ɇ (U+0246)
⎇ (U+2387)
☲ (U+2632)
yatli commented 3 years ago

@jdhao @wbthomason and also @Kethku, you may be interested in this: https://github.com/yatli/fvim/blob/master/wcwidth.fsx

motorto commented 2 years ago

Adding to this making sure that the problem is not my config:

As you can see from the pictures the unicode for endLine is not working properly.

vim.opt.listchars="tab:» ,eol:↲,nbsp:␣,precedes:<,extends:>,trail:·,conceal:┊"
if exists('g:fvim_loaded')
    " good old 'set guifont' compatibility with HiDPI hints...
    if g:fvim_os == 'windows' || g:fvim_render_scale > 1.0
        set guifont=FantasqueSansMono\ Nerd\ Font\ Mono:h14
    else
        set guifont=FantasqueSansMono\ Nerd\ Font\ Mono:h28
    endif
endif

image

acomagu commented 2 years ago

Hi, I'm encountering similar issue. FVim can't render .

image

Similar to #8 situation, neovim-qt can render the character correctly with same guifont setting.

My guifont: set guifont=Source\ Code\ Pro

--wsl option enabled.

Changing FVimNoBuiltinSymbols didn't help.

Thank you for your effort!