help-gnu-emacs
[Top][All Lists]
Advanced

[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: Thu, 06 Feb 2020 08:12:06 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Eli Zaretskii <address@hidden> writes:

Hi Eli,

>> > That probably means PragmataPro doesn't support ligatures, at least
>> > not the one for ->.
>> 
>> It does, at least I get an -> arrow glyph in gedit.
>
> Can you show the code you tried to use, and also tell in which version
> of Emacs did you try that?

I've tried it at home maybe two weeks ago with the current master at
that time.  I've just tried anew at work with today's master and the
JetBrains Mono font, and now it works just fine:

--8<---------------cut here---------------start------------->8---
(let ((alist '((33 . ".\\(?:\\(?:==\\|!!\\)\\|[!=]\\)")
               (35 . ".\\(?:###\\|##\\|_(\\|[#(?[_{]\\)")
               (36 . ".\\(?:>\\)")
               (37 . ".\\(?:\\(?:%%\\)\\|%\\)")
               (38 . ".\\(?:\\(?:&&\\)\\|&\\)")
               (42 . ".\\(?:\\(?:\\*\\*/\\)\\|\\(?:\\*[*/]\\)\\|[*/>]\\)")
               (43 . ".\\(?:\\(?:\\+\\+\\)\\|[+>]\\)")
               (45 . ".\\(?:\\(?:-[>-]\\|<<\\|>>\\)\\|[<>}~-]\\)")
               (46 . ".\\(?:\\(?:\\.[.<]\\)\\|[.=-]\\)")
               (47 . ".\\(?:\\(?:\\*\\*\\|//\\|==\\)\\|[*/=>]\\)")
               (48 . ".\\(?:x[a-zA-Z]\\)")
               (58 . ".\\(?:::\\|[:=]\\)")
               (59 . ".\\(?:;;\\|;\\)")
               (60 . 
".\\(?:\\(?:!--\\)\\|\\(?:~~\\|->\\|\\$>\\|\\*>\\|\\+>\\|--\\|<[<=-]\\|=[<=>]\\||>\\)\\|[*$+~/<=>|-]\\)")
               (61 . ".\\(?:\\(?:/=\\|:=\\|<<\\|=[=>]\\|>>\\)\\|[<=>~]\\)")
               (62 . ".\\(?:\\(?:=>\\|>[=>-]\\)\\|[=>-]\\)")
               (63 . ".\\(?:\\(\\?\\?\\)\\|[:=?]\\)")
               (91 . ".\\(?:]\\)")
               (92 . ".\\(?:\\(?:\\\\\\\\\\)\\|\\\\\\)")
               (94 . ".\\(?:=\\)")
               (119 . ".\\(?:ww\\)")
               (123 . ".\\(?:-\\)")
               (124 . ".\\(?:\\(?:|[=|]\\)\\|[=>|]\\)")
               (126 . ".\\(?:~>\\|~~\\|[>=@~-]\\)"))))
  (dolist (char-regexp alist)
    (set-char-table-range composition-function-table (car char-regexp)
                          `([,(cdr char-regexp) 0 font-shape-gstring]))))
--8<---------------cut here---------------end--------------->8---

After evaling that, -> becomes an arrow and ~> becomes an arrow with
curvy stroke.  So either there's some issue with PragmataPro or my
computer at home.

>> Ok, I'll tinker with it when I find some spare time.
>
> Feel free to ask any questions or point out unclear areas, we should
> at least make the effort of clarifying the existing docs to the extent
> that we are able.

Do I understand it correctly that "overshooting" with the above rules
has no bad effect, i.e., if there is a composition rule for -> but the
font has no ligature glyph for that, then it just stays the way it is?
So there could be some ligature-minor-mode which just adds all possible
composition rules?  (Just speaking naively, I guess there are several
distinct categories of ligatures which you would want to enable/disable
on a per-mode basis.)

Bye,
Tassilo



reply via email to

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