Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to enable Ligatures in Emacs 28? #58

Open
precompute opened this issue Aug 20, 2020 · 1 comment
Open

How to enable Ligatures in Emacs 28? #58

precompute opened this issue Aug 20, 2020 · 1 comment

Comments

@precompute
Copy link

Emacs 28 built with HARFBUZZ supports ligatures via composite ((featurep 'composite) to check)

Using DOOM Emacs , ligatures do not work with Inconsolata (and Ligconsolata) while they work for other fonts (without their specific config flags).

https://github.com/hlissner/doom-emacs/blob/f6f90c9791fa4a5e433bc42af52823bccfe1a362/modules/ui/ligatures/config.el#L174

Since the ligatures are exposed differently, I tried this, but to no avail:

(font-spec :family "Ligconsolata" :size 17 :otf '(latn nil nil (liga)))
(font-spec :family "Inconsolata" :size 17 :otf '(latn nil nil (dlig)))

:otf

VALUE must be a list (SCRIPT-TAG LANGSYS-TAG GSUB [ GPOS ]) to specify
required OpenType features.

  SCRIPT-TAG: OpenType script tag symbol (e.g. deva).
  LANGSYS-TAG: OpenType language system tag symbol,
     or nil for the default language system.
  GSUB: List of OpenType GSUB feature tag symbols, or nil if none required.
  GPOS: List of OpenType GPOS feature tag symbols, or nil if none required.

GSUB and GPOS may contain nil elements.  In such a case, the font
must not have any of the remaining elements.

For instance, if the VALUE is (thai nil nil (mark)), the font must
be an OpenType font whose GPOS table of thai script's default
language system must contain mark feature.

Modifying a Customize entry:

(custom-set-faces
 '(default ((t (:family "Inconsolata"
                :otf '(latn nil nil (dlig))
                )))))

Does not work either.

I'd preferably sort this out in vanilla Emacs first, but I've had no luck there either.

Any help is appreciated!

@precompute
Copy link
Author

I've managed to sidestep the problem using
https://github.com/ToxicFrog/Ligaturizer

It inserts ligatures from Fira Code into the target font. Fira Code's ligatures work without any extra configuration, and the same inserted into Inconsolata also work well. It does looks jarring, but I have turned off most 2/3 repeating character ligatures. I had to turn off the -- ligature because it interfered with dired. The remaining arrows and gt / lt signs look fairly okay.

@precompute precompute reopened this Sep 22, 2020
as-cii added a commit to zed-industries/zed that referenced this issue Sep 4, 2021
There's a newer version of the font available but ligatures seem
broken googlefonts/Inconsolata#58 and googlefonts/Inconsolata#52.

As part of this commit I also upgraded rust-embed to use the new
exclusion feature, which allows us to skip embedding OS files like
`.DS_Store`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant