Manu Schiller wrote:

> On Monday, 19 October 2015 08:41:36 UTC+2, Hörmetjan Yiltiz  wrote:
> > On Sunday, 20 April 2014 11:55:22 UTC-4, François Gannaz  wrote:
> > > Hello
> > > 
> > > 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?
> > > 
> > > Regards
> > > --
> > > François
> > 
> > This would be so great to see implemented.
> 
> It certainly would (and apologies for reopening such an old discussion).
> 
> On my system, the patch François sent doesn't work for the ligatures
> in PragmataPro (but flawlessly for other fonts like Hasklig),
> apparently because the ASCII-to-glyph mapping won't quite work - I
> suspect that's due to PragmataPro having ligatures in that range, too.
> I solved this by inserting a space between characters that we hand to
> pango for shaping. Sane fonts will not have ligatures between a space
> and a printable character, this way we still get one glyph per ASCII
> character. I've attached the modified patch. This will work with
> normal fonts and ones with programming ligatures like Hasklig and
> PragmataPro; I've tested it with the gtk2 and gtk3 front ends.
> 
> Please let me know if it would be possible to include this, and if
> not, at least the patch is public now where people can find it if they
> want it.

Let's hear from a few people whether this works in various contexts.

-- 
Are leaders born or made?  And if they're made, can we return them under
warranty?
                                (Scott Adams - The Dilbert principle)

 /// Bram Moolenaar -- [email protected] -- 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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui