emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Ligatures (was: Unify the Platforms: Cairo+FreeType+Harfbuzz Everywh


From: Eli Zaretskii
Subject: Re: Ligatures (was: Unify the Platforms: Cairo+FreeType+Harfbuzz Everywhere (except TTY))
Date: Fri, 22 May 2020 14:23:34 +0300

> From: Pip Cet <address@hidden>
> Date: Fri, 22 May 2020 09:25:31 +0000
> Cc: address@hidden, address@hidden, address@hidden
> 
> > > should work, but it has weird side effects that I'm pretty sure aren't
> > > intended (paren highlighting is broken, for example).
> >
> > This is not the right way.
> 
> What is the right way, then? I want all ligatures my font supports.

You can request all the ligatures that _can_ be supported; those which
aren't available in the font you use will not be ligated (if you use
font-shape-gstring in the composition-function-table slot).

Or you can request only those ligatures that make sense for the
particular use case.  For example, when displaying program source code
you'd probably want the various symbols, like -> etc., to produce
ligatures, but you most probably won't want "ffi" in a variable name
to produce a ligature.

Or you can provide your own function to use in the
composition-function-table, and that function can do more complex
stuff, like refuse to ligate under some complicated conditions.

Therefore, I think letting Lisp programs (and thus users) control what
gets composed into ligatures and what doesn't is an important feature
to have.  We should develop it more, because currently it lacks some
features we'd need for better ligature support (see the TODO item
about that), but I think the basic design is valid.  At least I didn't
yet see any evidence that it isn't valid; perhaps when we develop it
more and/or start using it more, we will find some problems, but I
don't see them yet.

> Also, even if it is the wrong thing to do, why does it break seemingly
> unrelated things?

I don't know.  Can you show how to reproduce that in the current
codebase on master?  Then I'll look into it.

> >   (set-char-table-range
> >    composition-function-table '(?f . ?f)
> >    (list (vector "ffi" 0 'compose-gstring-for-graphic)))
> 
> > This shows how to do this only for the "ffi" ligature, but I think it
> > makes the idea clear.
> 
> I'm afraid it doesn't, to me.

Doesn't make the idea clear or doesn't produce the ligature?  If the
latter, then I'm puzzled, because it did work for me with a font that
has the ffi ligature.  If the former, please ask more questions and I
will try to explain as best I can.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]