[Top][All Lists]

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

Re: Emacs 28: Specific TTF font gets loaded with font-backend x instead

From: Tassilo Horn
Subject: Re: Emacs 28: Specific TTF font gets loaded with font-backend x instead of ftcrhb
Date: Fri, 07 Feb 2020 11:41:57 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Eli Zaretskii <> writes:

>> I'm pretty sure I had built with HarfBuzz but tried again anyway.
>> This time it worked just fine.  I'll attach a screenshot showing two
>> emacs frames with ligatures in action.  The left one is with the
>> JetBrains Mono font, the right one is with the PragmataPro Liga font.
> So the conclusion is that this works with both fonts?  (I cannot be
> sure because the two displays look somewhat differently).

I'd say, yes.  There are some slight differences in which ligatures
those two fonts support, of course.

>> > Not exactly.  In Emacs built with HarfBuzz, you will see the
>> > original ASCII characters displayed, but handled as a single
>> > grapheme cluster, i.e. the cursor will be "widened" to include all
>> > of them, and a single C-f will move across all of them.
>> That doesn't seem to happen.  forward-char moves inside ligature
>> sequences no matter if the font has a ligature or not.  I.e., even
>> with a ligature ~= which gets composed to an equal sign with curvy
>> upper line point move half-by-half.
> I think that's because you use font-shape-gstring directly.  You
> should use compose-gstring-for-graphic instead.

Ah, then it works as you've described.  I actually like this behavior.

>> > Burt if you only care about ligatures in programming languages, the
>> > job becomes much simpler, I think.  Although I'd still expect the
>> > ligatures in effect to depend on the programming language of the
>> > current buffer.
>> Right now I've just enabled anything.
> Not really everything, IMO, as there are also ligatures relevant only
> to human-readable text.  For example, see this URL:

Yes, right.  I meant "all that I've listed" which are just those I could
copy & paste from the JetBrains Mono homepage and those are basically
just the typical programming ligatures.

>> But one thing which comes to mind is that one might want to suppress
>> ligature composition inside strings...
> Which probably means we'd need some text property to disable
> composition there.

Yes, something like that.

>> > Which means composition-function-table needs to be buffer-local,
>> > and we should make sure making it buffer-local does TRT.
>> This doesn't seem to work right now.  See the FIXME at the bottom of
>> below code.
> We need to fix that.  We do have buffer-local char-tables, for example
> buffer-display-table.  We should probably define a buffer-local
> composition-function-table in the same way, and have a global table as
> its parent or something (for language-specific compositions, like
> those for accented letters).

Sounds about right.

By the way, if I enable ligatures, I get reproducible infloops or
something alike.  The visual bell starts ringing/blinking, C-g won't
help, and even with debug-on-{error,quit} I'm unable to get into the
debugger.  I can reproduce that simply by starting Gnus and trying to
enter a group but I got that also once with pushing my commits in Magit
and sometimes when quitting emacs with C-x C-c.

Attached is a GDB backtrace.

Attachment: gdb.log.gz
Description: application/gzip


reply via email to

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