equalsraf / neovim-qt

Neovim client library and GUI, in Qt5.
https://github.com/equalsraf/neovim-qt/wiki
ISC License
1.85k stars 171 forks source link

Unicode combining characters not displayed #1070

Open silmeth opened 1 year ago

silmeth commented 1 year ago

When using combining characters in a buffer, only the base character is displayed and the combining diacritic isn’t. This doesn’t depend on the font used.

Here is a sample text I tested it on:

/kũːl´/ an Ᵹ̇aoiꝺ̇ealᵹ

This is how nvim-qt displays it: obraz and here the same text displayed in Kate: obraz

both using Noto Mono font, size 12pt (:GuiFont Noto Mono:h12 in nvim).

As you can see, Kate displays the combining tilde over u, and the dots over insular g characters.

If the dedicated codepoint for a letter with diacritic (ũ) is used, then nvim-qt correctly displays the diacritic: kũːl´ and I’d expect the ⟨u⟩ + ⟨◌̃⟩ sequence to be displayed the same way (and other combinations that don’t have a dedicated codepoint, but might have glyphs in the font, to also be handled somehow and not just lose the combining character).

Neovim-qt version:

NVIM-QT v0.2.16.0
Build type: Release
Compilation:-g -O2 -fdebug-prefix-map=/build/neovim-qt-16pch9/neovim-qt-0.2.16=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -Wextra -Wno-unused-parameter -std=c++11 -Wfatal-errors
Qt Version: 5.14.2
silmeth commented 1 year ago

Also a comparison between nvim-qt and Kate with a non-monospaced font that has dedicated glyphs for the insular g/d + dot combinations, Junicode Two Beta (the spacing is bad, but it also shows that the combining character doesn’t get displayed even if the font has a dedicated glyph for the combination; I don’t think I have a mono font with those glyphs):

nvim-qt: obraz

Kate: obraz

And a font without dedicated glyph or positioning info, but which handles the dot better than Noto Mono – GNU Unifont: nvim-qt: obraz Kate: obraz

silmeth commented 1 year ago

Tested with a fresh build of master too, same results.

NVIM-QT v0.2.18.9999
Build type: 
Compilation: -Wall -Wextra -Wno-unused-parameter -Wunused-variable
Qt Version: 5.15.8
Environment: 
  nvim: nvim
  args: --cmd let &rtp.=',/home/silmeth/nvim-qt-new/runtime' --cmd set termguicolors
  runtime: /home/silmeth/nvim-qt-new/runtime

Moreover, in this version I get weird results with the Noto Mono font with :GuiRenderLigatures 1 (doesn’t affect other fonts though):