RMichelsen / Nvy

Nvy - A Neovim client in C++

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Feature Request] Support specifying fallback fonts

statiolake opened this issue · comments

The issue #29 is closed but it would be great to have font fallbacking. I'm Japanese and we're using CJK characters in addition to ASCII characters, so I need to set ASCII coding fonts (like Consolas) and fallbacking CJK fonts (like Meiryo). Though current version does fallback to the system default font, I want to specify the font by myself.

If you are interested, you can look at an experimental implementation in my fork: statiolake@123002b. I tried to implement basic font fallbacking similar to Nvui. It basically works for me, but a there's also a problem: you can now decide which font to fall back to, but instead, it won't fall back unless you set it to do so. Default fallback no longer occurs.

See equalsraf/neovim-qt#614. The implementation might get complicated to avoid slowing down the startup (one of the USP of nvy).

In my understanding, equalsraf/neovim-qt#614 is the slowdown caused by Qt framework, not by Windows or DirectWrite itself. Moreover, font fallbacking is already supported in Nvy, just specifying fallback fonts is not supported.

I agree that having the option to specify the fallback font instead of it defaulting to Consolas would be good, we just need to modify the "parser" (https://github.com/RMichelsen/Nvy/blob/master/src/nvim/nvim.cpp#L163) and decide on how it should be specified in the init.vim. It's not a huge task I'll see if I can find some time to do this soon, if not feel free to open a PR.