François Gannaz wrote:

> In a few words, here is a patch that makes gvim work better with ligatures
> in fonts, which can be useful even for programmers. Details follow.
> 
> I tried to use a Hasklig[^1], a font with ligatures intended for the
> Haskell language. It serves the same objective as the Haskell Conceal
> script[^2], but with the added benefit that even a mouse copy-paste works
> as intended.
> [^1]: https://github.com/i-tu/hasklig
> [^2]: http://www.vim.org/scripts/script.php?script_id=3200
> 
> Unfortunately, gvim doesn't support ligatures on ASCII characters. The
> following assertion fails at run-time:
> 
>     ascii_glyph_table_init: assertion 'gui.ascii_glyphs->num_glyphs ==
>     sizeof(ascii_chars)' failed
> 
> and many characters are displayed with the wrong glyphs.
> The attached patch limits the function ascii_glyph_table_init() to
> spaces and alphanumeric chars. It solves the problem here.
> 
> Yet I wonder if the current hack with ASCII characters is really useful.
> Is there any performance test to check if a simpler behaviour wouldn't be
> suitable, at least for modern desktop installations?
> As the code comment mentions spaces, maybe it should be restricted to
> blank lines?

This stuff is too complicated to guess what works best.
Any changes need to be tested with various GTK versions and with
different display drivers to check the speed.  Even modern desktops
sometimes have slow graphics (using generic drivers instead of
proprietary ones).

Note the remark about drawing the cursor, check that the test doesn't
change when moving the cursor over it.

Perhaps we should add an option to disable the optimization?


-- 
hundred-and-one symptoms of being an internet addict:
80. At parties, you introduce your spouse as your "service provider."

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui