MCPcopy Index your code
hub / github.com/EzequielRamis/liga

github.com/EzequielRamis/liga @v1.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.0 ↗ · + Follow
40 symbols 96 edges 18 files 2 documented · 5%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Liga

Add ligatures to any programming font!

Ligated fonts showcase

This script copies the ligatures (glyphs and rendering information) from FiraCode into any other TrueType or OpenType font.

This repo contains a Fontforge python script that you can use to add the FiraCode ligatures to any font, as well as submodules for some popular programming fonts and another script for ligating all of them at once.

Pre-ligated versions are available under releases.

Requirements

Using the Fonts: See the FiraCode README for a list of supported editors.

Script: This script requires FontForge python bindings. For Debian/Ubuntu they are available in python-fontforge package. For Arch, OpenSUSE and NixOS, they are included in the fontforge package. For macOS, they are available via brew (brew install fontforge).

It also requires a python library called glyphsLib.

Using the Script

Automatic

Use automatic mode to easily convert a font family.

  1. Generate a script and configuration template with:

$ scripts/generate_build.sh "FONT_FAMILY_NAME"

For example:

$ scripts/generate_build.sh "Space Mono"

  1. Put the family font(s) into input/FONT_FAMILY_NAME
  2. Go to fonts/FONT_FAMILY_NAME
  3. Edit config.py to disable ligatures you don't want, change glyphs scale factor, and/or enable any (non-ligature) characters you want from FiraCode in addition to the ligatures.
  4. Edit build.sh to edit the output family font name, the output directory, the ligatures' weight and many more settings.
  5. Return to the git root directory
  6. Run $ fonts/FONT_FAMILY_NAME/build.sh The ligated fonts will be located in the output directory.

Manual

  1. Move/copy the font you want to ligate into input (or somewhere else convenient).
  2. Edit config_sample.py to disable any ligatures you don't want, etc.
  3. Run the script:

    $ python ligate.py path/to/input/font.ttf --output-dir=path/to/output/dir/ \ --output-name='Name of Ligated Font'

    For exmaple:

    $ python ligate.py input/Hack/Hack-Regular.ttf --output-dir='output/Ligated Hack' \ --output-name='Liga Hack'

    Which will produce output/Ligated Hack/LigaHack-Regular.ttf.

The font weight will be inherited from the original file; the font name will be replaced with whatever you specified in --output-name. You can also use --prefix instead, in which case the original name will be preserved and whatever you put in --prefix will be prepended to it.

ligate.py supports some additional command line options to, for example, change which font ligatures are copied from or enable copying of individual character glyphs; run python ligate.py --help to list them.

Credit

This repo is a redesign of the ToxicFrog/Ligaturizer implementation because, principally, it does not work with the Firacode's ligatures above v3.1, missing incredible features like infinite arrow combinations.

Contributions

Contributions always welcome! Please submit a Pull Request, or create an Issue if you have an idea for a feature/enhancement (or bug).

Core symbols most depended-on inside this repo

replace_sfnt
called by 6
ligate.py
paste_glyphs
called by 2
ligate.py
delete_temp_files
called by 2
ssi-server/ssi_server.py
split_family_style
called by 2
py/fontname.py
get_ligature_source
called by 1
ligate.py
write_fira_feature_file
called by 1
ligate.py
extract_tagged_glyphs
called by 1
ligate.py
rename_tagged_glyphs_from_fea
called by 1
ligate.py

Shape

Function 33
Method 6
Class 1

Languages

Python100%

Modules by API surface

ligate.py11 symbols
py/fontname.py8 symbols
ssi-server/ssi_server.py7 symbols
py/utils.py7 symbols
py/extract_fira_data.py4 symbols
ssi-server/ssi.py2 symbols
ssi-server/ssi_expander.py1 symbols

For agents

$ claude mcp add liga \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page