ToxicFrog / Ligaturizer

Programming Fonts with Ligatures added (& a script to add them to other fonts)
GNU General Public License v3.0
2.19k stars 112 forks source link

Other Ligatures #76

Closed sirgru closed 4 years ago

sirgru commented 4 years ago

I would like to import ligatures from another font, different from Fira Code. Concretely, I would like to import ligatures from https://github.com/i-tu/Hasklig .

For example, they have

    lookup hyphen_greater_greater {
    ignore sub hyphen hyphen' greater greater;
    ignore sub hyphen' greater greater greater;
    sub LIG LIG greater' by hyphen_greater_greater;
    sub LIG  greater' greater  by LIG;
    sub hyphen'   greater  greater  by LIG;
  } hyphen_greater_greater;

Putting this in ligatures.py doesn't do anything.

{   # ->>
        'chars': ['hyphen', 'greater', 'greater'],
        'firacode_ligature_name': 'hyphen_greater_greater',
},

How to find the ligatures in that font, and how to make sure ligature rules are correct?

ToxicFrog commented 4 years ago

Just putting them in ligatures.py won't do anything unless you also modify ligaturize.py to read from Hasklig. Getting it to read ligatures from both Fira Code and Hasklig is a bigger project, that will probably involve extending ligatures.py to note which font each ligature comes from.

For a quick and dirty hack you might try replacing the Fira Code files with renamed Hasklig files and updating ligatures.py to contain only the Hasklig ligatures, but then you'll lose the Fira Code ones.

ToxicFrog commented 4 years ago

Duplicate of #22