neovim / neovim

Vim-fork focused on extensibility and usability
https://neovim.io
Other
81.62k stars 5.59k forks source link

non-monospace text rendering #22125

Closed m-faith closed 1 year ago

m-faith commented 1 year ago

Problem

The variety of Nvim GUI applications (neovide, goneovim, neovim-qt, etc) have font rendering that is, in comparison to typically GUI applications, (at best) extremely limited.

Apparently this limitation lies in NeoVim itself, with its "grid" concept/paradigm/thing.

Expected behavior

In terms of UI/UX design of GUI applications, as intended targets for embedding NeoVim inside of, sane font rendering must allow variable-width, non-monospace fonts.

The i's in "About This Config" demonstrate a variable-width font rendering... here in this screenshot...

Screenshot from 2023-02-04 16-09-32

Monospace fonts are seldom considered acceptable in graphic design, let alone appropriate. This applies to the design of interfaces. (Typing into this html <form> on github.com is not being rendered in monospace, nor are these posts outside of <code> elements or any of the rest of this inerface.)

People are raving about Obsidian for diary/documentation/notes/etc, and its UI design is reasonably acceptable. Nvim's lua plugin "ecosystem" can achieve all/or-most of Obsidians functionality (and filling in any gaps would be completely attainable) but Nvim can't render fonts in a sane way and thus can't achieve an acceptable interface design to rival Obsidian.

Emacs GUI's, as demonstrated in the screenshot above, do have font rendering that's acceptable by standard UI design expectations.


PS:

In README.md the first feature listed is: "Modern GUIs". But outside the context of code editing these GUI's are don't look modern...

Looking forward to when this can be prioritized!!! Any chance that could happen for 0.10.0?

clason commented 1 year ago

Any chance that could happen for 0.10.0?

None whatsoever. How strongly somebody feels about a feature has unfortunately no relation to how feasible or reasonable it is to implement.

Check out https://github.com/yatli/fvim in the meantime.

bfredl commented 1 year ago

related: #1767

m-faith commented 1 year ago

Hey thanks for the quick response! And for the tip on fvim I'll look into that.

I assumed "none whatsoever" would be the response for 0.9.0 given https://neovim.io/roadmap/ but I guess it's reasonable to think the trajectory toward 0.10.0 would be still quite defined already even though it's not published.

Considering that a major topic/theme driving the work is "Embed Neovim everywhere", and this pertains to that... is it possibly this might be something that could be given attention in the foreseeable future?

I have no idea what efforts are underway pertaining to embedding everywhere, and given that, it's easy to imagine that this issue appears completely frivolous to those who are working on whatever those efforts are.

But if it's possible to say... I'd love to know how this ranks among other priorities in that area...?

m-faith commented 1 year ago

no relation to how feasible or reasonable it is to implement.

That sounds like this would not be very easy to do then...?

clason commented 1 year ago

Apparently this limitation lies in NeoVim itself, with its "grid" concept/paradigm/thing.

You have been misinformed. (Don't believe everything a random Redditor tells you.)

Every text editor works with a grid concept (rows and columns), and it's perfectly possible for Neovim GUIs -- who handle rendering of that grid completely on their own -- to use grids with variable-width (even height) cells; they just ("just") have to take care of the coordinate transform that is now piecewise affine rather than fully affine.

That's not saying that it's easy, by any means; you'll probably have the best luck with GUIs that rely on a massive toolkit like QT or are platform-specific.

I'm going to close this issue therefore; but concrete and actionable requests for Neovim APIs or features that would make this easier for GUI devs would be welcome.

m-faith commented 1 year ago

Thanks for the explanation!

m-faith commented 1 year ago

You have been misinformed. (Don't believe everything a random Redditor tells you.)

Not just random redditors, but GUI maintainers too https://github.com/neovide/neovide/issues/1757.

shaunsingh commented 1 year ago

Sorry for the delay and apologies for the earlier, misinformed statement (both on reddit and the neovide repo), thank you for the clarification! We'll certainly look into it then

tricktux commented 1 year ago

@clason I would like to develop a neovim GUI from scratch. Do you know of any good learning resources for font rendering that would help in this process?

silicakes commented 1 year ago

I would love to have code-folding looking like that:

image

Where you still have the folded contents in a smaller font which sort of retain your spatial awareness around the file.

I would really love to hear about the steps one can take in order to move towards such possibility