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 Find Ligature Names #112

Open
stevemolitor opened this issue Apr 29, 2024 · 1 comment
Open

How to Find Ligature Names #112

stevemolitor opened this issue Apr 29, 2024 · 1 comment

Comments

@stevemolitor
Copy link

This is more of a question than an issue, although maybe the answer could be added to the docs in case others find it useful:

How do I find the name of the ligatures in fonts besides Fira Code, so that I can customize a font with their ligatures using Ligaturizer? Specifically, I want to use the ligatures in Iosevka with the M+ Code font.

I tried just editing ligaturizer.py to use Iosevka source fonts instead of Fira. It found the fonts but no ligatures showed up in the output font.

I did the same thing using JetBrains Mono as the source of ligatures, and it worked - I got JetBrains ligatures in M+ Code. But it didn't work with Iosevak as the ligature source. I did build Iosevka with ligatures, and I can see them when I use Iosevka directly in my editor.

My guess is that since Jet Brains sort of inherited from Fira, it uses the same ligature names so everything still works. But with Iosevka the ligature names are different maybe? Or something?

I tried opening up Iosevka in FontForge but I wasn't sure how to find the ligatures (it's a huge font).

Maybe the ligature names are not the problem, maybe it's something else. So more generally, how do I use Iosevaka as the ligatures donar?

Also see #22.

@stevemolitor stevemolitor changed the title How to Find Li How to Find Ligature Names Apr 29, 2024
@ToxicFrog
Copy link
Owner

The problem is indeed the ligature names; font designers are free to use any names for their ligatures they want, and while it's common to include "lig" or "liga" in the name somewhere, it's not required.

Actual ligature information is stored in the GSUB (glyph substitution) and CALT (contextual alternates) tables in the font. Making sense of these is not straightforward; there are many layers of indirection.

Historically, I've had decent results by studying the source code for the font to figure out the naming convention for its ligatures, then using strings to dump a list of ligatures from the font file itself. I realize this is not a very satisfying answer.

A better approach probably involves using fontforge and a script that processes the GSUB/CALT tables, but I don't have one lying around.

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

2 participants