On 28/09/21, Bram Moolenaar wrote:
> If you now also use the special handling for some ASCII characters,
> perhaps the special casing can just be skipped?
Current state of affairs in gvim:
- glyphs are prerendered at ascii_glyph_table_init
- non-bold non-italic ascii < 128 is rendered with glyphs
- bold, italic, string with single >128 char, all falls down to Pango
- big string ready to use glyphs but having single complex utf-8 char
will fall trough to be rendered with Pango.
Pango is not optimal:
- Not measured but very visible: In my c++ projects at work color scheme
renders renders function names in bold, which fall down to Pango. When
I quickly scroll trough region with 'more' bold content, scroll
becomes erratic, with more normal text it becomes smoother.
Current patch I am working on
(
https://github.com/dusanx/vim/commit/a00791cd3c0df7d921bb4188df1c165de04961d3)
additionally splits strings into clear ascii/everything else parts,
which then go trough glyphs or Pango. Result is rendering with Pango
only what we can't avoid and using glyphs for everything else. Almost a
side effect is proper ligatures support.
When that is done, in next PR, I intend to introduce cache for bold and
italic glyphs, same as we do for normal text. There is no need to treat
bold differently and use Pango for that.
In short using Pango as little as possible should be valid gvim
optimization. Using Pango for everything because of few ligatures and
emojis should be avoided because of the visible speed penalty. However
if you see some obstacle for this plan please let me know.