Disabling ligatures?

697 views
Skip to first unread message

Kaya Bekiroğlu

unread,
Jul 15, 2008, 2:01:45 PM7/15/08
to vim...@googlegroups.com
Lately I've been using Akkurat Mono (a fine, albeit expensive,
monospaced font) in MacVim. I've found that MacVim renders various
character combinations (e.g. 'fi', 'fl') in this font as ligatures, as
depicted in the first line in this screenshot:

http://vps.kaya.name/images/MacVim_fi.png

TextMate and Xcode do not render 'fi' and 'fl' in Akkurat Mono as
ligatures. While I like the concept of ligatures, they're distracting
in a monospaced font. Is there an option to turn them off?

Thanks,

Kaya Bekiroğlu

Jjgod Jiang

unread,
Jul 15, 2008, 9:21:32 PM7/15/08
to vim...@googlegroups.com
Hi Kaya,

On Wed, Jul 16, 2008 at 2:01 AM, Kaya Bekiroğlu <ka...@bekiroglu.com> wrote:
> TextMate and Xcode do not render 'fi' and 'fl' in Akkurat Mono as
> ligatures. While I like the concept of ligatures, they're distracting
> in a monospaced font. Is there an option to turn them off?

Since I don't have that font I wasn't able to reproduce your problem,
however, you may want to turn on the ATSUI renderer to see if that
helps:

defaults write org.vim.MacVim MMAtsuiRenderer 1

AFAIK, that renderer uses a similar (but slightly improved) rendering
method as TextMate.

- Jiang

Kaya Bekiroğlu

unread,
Jul 16, 2008, 2:16:28 AM7/16/08
to vim...@googlegroups.com

On Jul 15, 2008, at 6:21 PM, Jjgod Jiang wrote:
> Since I don't have that font I wasn't able to reproduce your problem,
> however, you may want to turn on the ATSUI renderer to see if that
> helps:
>
> defaults write org.vim.MacVim MMAtsuiRenderer 1

On my machine changing the renderer does not help (though it does
speed up rendering considerably; good work!). I can also reproduce
the ligature using Times and Helvetica. Interestingly, MacVim seems
to misrender other Helvetica character combinations, such as "fa", but
not as ligatures. It seems as though the spacing of the letter "f"
may be screwed up in general, but I'm no font expert.

Cheers,

Kaya Bekiroğlu

björn

unread,
Jul 16, 2008, 3:44:15 AM7/16/08
to vim...@googlegroups.com
2008/7/16 Kaya Bekiroğlu <ka...@bekiroglu.com>:

I vaguely remember seeing a way to disable ligatures in Apple's docs
so I will try to look that up again and see if I can find it. I'm
pretty sure there is a way.

Thanks for reporting the problem.

Björn

Jjgod Jiang

unread,
Jul 16, 2008, 4:03:03 AM7/16/08
to vim...@googlegroups.com
Hi Björn and Kaya,

2008/7/16 björn <bjorn.w...@gmail.com>:

> I vaguely remember seeing a way to disable ligatures in Apple's docs
> so I will try to look that up again and see if I can find it. I'm
> pretty sure there is a way.

Björn, I've sent out a patch to turn off the fi, ffi ligatures and ct,
ss ligatures
for MMAtsuiRenderer. Will you please review it? Do you think it should be
a runtime option?

Kaya, you can try out this patch if you feel convenient to build MacVim
yourself, otherwise you can wait for the next snapshot release, I guess.

- Jiang

Jjgod Jiang

unread,
Jul 16, 2008, 4:29:36 AM7/16/08
to vim...@googlegroups.com
On Wed, Jul 16, 2008 at 4:03 PM, Jjgod Jiang <gzj...@gmail.com> wrote:
> Björn, I've sent out a patch to turn off the fi, ffi ligatures and ct,
> ss ligatures
> for MMAtsuiRenderer. Will you please review it? Do you think it should be
> a runtime option?

OK, I've sent out another patch which should be able to turn off standard
ligatures for both NSTextView renderer and ATSUI renderer.

- Jiang

Kaya Bekiroğlu

unread,
Jul 16, 2008, 2:43:54 PM7/16/08
to vim...@googlegroups.com
On Jul 16, 2008, at 1:29 AM, Jjgod Jiang wrote:
> OK, I've sent out another patch which should be able to turn off
> standard
> ligatures for both NSTextView renderer and ATSUI renderer.


This patch works well for me. Thanks!

If ligatures become a runtime option, then I think it might be
worthwhile to default them off for fixed width fonts but default them
on for variable width fonts. It seems a shame not to enable them when
Vim is used for non-programming-related tasks.

Kaya Bekiroğlu

björn

unread,
Jul 16, 2008, 2:58:52 PM7/16/08
to vim...@googlegroups.com
2008/7/16 Kaya Bekiroğlu <ka...@bekiroglu.com>:

Actually, I don't really see that this makes any difference since Vim
does not really support proportional fonts anyway. As it is, MacVim
renderers proportional fonts as fixed with so even with ligatures
enabled it looks weird.

Björn

Nico Weber

unread,
Jul 16, 2008, 2:59:29 PM7/16/08
to vim...@googlegroups.com
Hi,

> This patch works well for me. Thanks!
>
> If ligatures become a runtime option, then I think it might be
> worthwhile to default them off for fixed width fonts but default them
> on for variable width fonts. It seems a shame not to enable them when
> Vim is used for non-programming-related tasks.

as far as I understand, vim does not support variable-width fonts
(yet?). Using variable-widths fonts renders glyphs with a fixed letter
width anyways, so ligatures will look strange under all circumstances
and need not be a runtime option

Nico.

Reply all
Reply to author
Forward
0 new messages