Skip to content

Commit

Permalink
Remove output-fonts in favour of releases
Browse files Browse the repository at this point in the history
Ligaturized fonts are no longer checked in; instead they're zipped and
put under releases.
  • Loading branch information
ToxicFrog committed Sep 1, 2018
1 parent 9810633 commit 5389c7c
Show file tree
Hide file tree
Showing 76 changed files with 12 additions and 28 deletions.
32 changes: 8 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,9 @@

This script copies the ligatures (glyphs and rendering information) from [Fira Code](https://github.com/tonsky/FiraCode) into any other TrueType or OpenType font. (Note that the ligatures are scale-corrected, but otherwise copied as is from Fira Code; it doesn't create new ligature graphics based on the font you're modifying.)

**This repo contains 2 things:**
1. Programming fonts with ligatures added (in `output-fonts/`), including:
* [Anonymous Pro](output-fonts/LigaAnonymous_Pro.ttf)
* [CamingoCode](output-fonts/LigaCamingoCode-Regular.ttf)
* Cousine: [Regular](output-fonts/LigaCousine-Regular.ttf), [Bold](output-fonts/LigaCousine-Bold.ttf)
* [DejaVu Sans Mono](output-fonts/LigaDejaVuSansMono.ttf)
* [Droid Sans Mono](output-fonts/LigaDroidSansMono.ttf)
* [edlo](output-fonts/Ligaedlo.ttf)
* Fantasque Sans Mono: [Normal](output-fonts/FantasqueSansMono-Normal), [NoLoopK variant](output-fonts/FantasqueSansMono-NoLoopK)
* [Hack](output-fonts/LigaHack-Regular.ttf)
* [Inconsolata](output-fonts/LigaInconsolata-Regular.ttf) & [Inconsolata-g](output-fonts/LigaInconsolata-g.ttf)
* IBM Plex Mono: [Regular](output-fonts/LigaIBMPlexMono-Regular.ttf), [Semibold](output-fonts/LigaIBMPlexMono-SemiBold.ttf)
* Meslo ([LGL](output-fonts/LigaMesloLGL-Regular.ttf), [LGLDZ](output-fonts/LigaMesloLGLDZ-Regular.ttf), [LGM](output-fonts/LigaMesloLGM-Regular.ttf), [LGMDZ](output-fonts/LigaMesloLGMDZ-Regular.ttf), [LGS](output-fonts/LigaMesloLGS-Regular.ttf), [LGSDZ](output-fonts/LigaMesloLGSDZ-Regular.ttf))
* [Oxygen Mono](output-fonts/LigaOxygenMono-Regular.ttf)
* [Roboto Mono](output-fonts/LigaRobotoMono-Regular.ttf)
* SF Mono: [Regular](output-fonts/LigaSFMono-Regular.ttf), [Semibold](output-fonts/LigaSFMono-Semibold.ttf)
* [Ubuntu Mono](output-fonts/LigaUbuntuMono-Regular.ttf)

2. A fontforge python script ([ligaturize.py](ligaturize.py)) that you can use to add the Fira Code ligatures to any other font you like.
This repo contains a [Fontforge python script](ligaturize.py) that you can use to add the Fira Code ligatures to any font, as well as submodules for some popular coding fonts and [another script](build.py) for ligaturizing all of them at once.

Pre-ligaturized versions are available under [releases](https://github.com/ToxicFrog/Ligaturizer/releases).

Here's a couple examples of the fonts generated: SF Mono & Menlo with ligatures (note the `!=` and `->`):
![](images/sf-mono.png)
Expand All @@ -44,14 +28,14 @@ Use automatic mode to easily convert 1 or more font(s).
1. Edit `ligatures.py` to disable any ligatures you don't want, and/or enable any (non-ligature) characters you want from Fira Code in addition to the ligatures.
1. Edit `build.py` to add your new font(s) to the `prefixed_fonts` list. It supports globbing, so if (e.g.) you want to ligaturize all the different weights of FooFont you can add `'FooFont*'` to the list.
1. Run `make`.
1. Retrieve the ligaturized fonts from `output-fonts/`.
1. Retrieve the ligaturized fonts from `fonts/output/`.
1. The output fonts will be renamed with the prefix "Liga".

### Manual ###

1. Move/copy the font you want to ligaturize into `fonts/` (or somewhere else convenient).
2. Edit `ligatures.py` to disable any ligatures you don't want.
3. Run the script:
1. Edit `ligatures.py` to disable any ligatures you don't want.
1. Run the script:

```
$ fontforge -lang py -script ligaturize.py path/to/input/font.ttf
Expand All @@ -62,11 +46,11 @@ Use automatic mode to easily convert 1 or more font(s).

```
$ fontforge -lang py -script ligaturize.py fonts/Cousine-Regular.ttf
--output-dir='fonts/' \
--output-dir='fonts/output/' \
--output-name='Ligaturized Cousine'
```

Which will produce `fonts/LigaturizedCousine-Regular.ttf`.
Which will produce `fonts/output/LigaturizedCousine-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.

Expand Down
4 changes: 2 additions & 2 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
sys.exit(1)
for input_file in files:
ligaturize_font(
input_file, ligature_font_file=None, output_dir='output-fonts/',
input_file, ligature_font_file=None, output_dir='fonts/output/',
prefix=LIGATURIZED_FONT_NAME_PREFIX, output_name=None,
copy_character_glyphs=COPY_CHARACTER_GLYPHS,
scale_character_glyphs_threshold=SCALE_CHARACTER_GLYPHS_THRESHOLD)
Expand All @@ -97,7 +97,7 @@
sys.exit(1)
for input_file in files:
ligaturize_font(
input_file, ligature_font_file=None, output_dir='output-fonts/',
input_file, ligature_font_file=None, output_dir='fonts/output/',
prefix=None, output_name=name,
copy_character_glyphs=COPY_CHARACTER_GLYPHS,
scale_character_glyphs_threshold=SCALE_CHARACTER_GLYPHS_THRESHOLD)
1 change: 1 addition & 0 deletions fonts/output/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*
3 changes: 1 addition & 2 deletions ligaturize.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,7 @@ def copy_character_glyphs(self, chars):
"""Copy individual (non-ligature) characters from the ligature font."""
if not self.should_copy_character_glyphs:
return
print("Copying %d character glyphs from %s..." % (
len(chars), self.firacode.fullname))
print(" ...copying %d character glyphs..." % (len(chars)))

for char in chars:
self.firacode.selection.none()
Expand Down
Binary file removed output-fonts/LigaCousine-Bold.ttf
Binary file not shown.
Binary file removed output-fonts/LigaCousine-BoldItalic.ttf
Binary file not shown.
Binary file removed output-fonts/LigaCousine-Italic.ttf
Binary file not shown.
Binary file removed output-fonts/LigaCousine.ttf
Binary file not shown.
Binary file removed output-fonts/LigaDejaVuSansMono-Bold.ttf
Binary file not shown.
Binary file removed output-fonts/LigaDejaVuSansMono-BoldOblique.ttf
Binary file not shown.
Binary file removed output-fonts/LigaDejaVuSansMono-Oblique.ttf
Binary file not shown.
Binary file removed output-fonts/LigaDejaVuSansMono.ttf
Binary file not shown.
Binary file removed output-fonts/LigaDroidSansMono.ttf
Binary file not shown.
Binary file removed output-fonts/LigaEdlo.ttf
Binary file not shown.
Binary file removed output-fonts/LigaFantasqueSansMono-Bold.ttf
Binary file not shown.
Binary file removed output-fonts/LigaFantasqueSansMono-BoldItalic.ttf
Binary file not shown.
Binary file removed output-fonts/LigaFantasqueSansMono-RegItalic.ttf
Binary file not shown.
Binary file removed output-fonts/LigaFantasqueSansMono-Regular.ttf
Binary file not shown.
Binary file removed output-fonts/LigaFantasqueSansMonoNoLoopK-Bold.ttf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed output-fonts/LigaHack-Bold.ttf
Binary file not shown.
Binary file removed output-fonts/LigaHack-BoldItalic.ttf
Binary file not shown.
Binary file removed output-fonts/LigaHack-Italic.ttf
Binary file not shown.
Binary file removed output-fonts/LigaHack-Regular.ttf
Binary file not shown.
Binary file removed output-fonts/LigaInconsolata-Bold.ttf
Binary file not shown.
Binary file removed output-fonts/LigaInconsolata-Regular.ttf
Binary file not shown.
Binary file removed output-fonts/LigaMesloLGMDZ-Bold.ttf
Binary file not shown.
Binary file removed output-fonts/LigaMesloLGMDZ-BoldItalic.ttf
Binary file not shown.
Binary file removed output-fonts/LigaMesloLGMDZ-Italic.ttf
Binary file not shown.
Binary file removed output-fonts/LigaMesloLGMDZ-Regular.ttf
Binary file not shown.
Binary file removed output-fonts/LigaO2Mono-Regular.ttf
Binary file not shown.
Binary file removed output-fonts/LigaRobotoMono-Bold.ttf
Binary file not shown.
Binary file removed output-fonts/LigaRobotoMono-BoldItalic.ttf
Binary file not shown.
Binary file removed output-fonts/LigaRobotoMono-Italic.ttf
Binary file not shown.
Binary file removed output-fonts/LigaRobotoMono-Regular.ttf
Binary file not shown.
Binary file removed output-fonts/LigaSrcPro-Black.ttf
Binary file not shown.
Binary file removed output-fonts/LigaSrcPro-BlackIt.ttf
Binary file not shown.
Binary file removed output-fonts/LigaSrcPro-Bold.ttf
Binary file not shown.
Binary file removed output-fonts/LigaSrcPro-BoldIt.ttf
Binary file not shown.
Binary file removed output-fonts/LigaSrcPro-ExtraLight.ttf
Binary file not shown.
Binary file removed output-fonts/LigaSrcPro-ExtraLightIt.ttf
Binary file not shown.
Binary file removed output-fonts/LigaSrcPro-It.ttf
Binary file not shown.
Binary file removed output-fonts/LigaSrcPro-Light.ttf
Binary file not shown.
Binary file removed output-fonts/LigaSrcPro-LightIt.ttf
Binary file not shown.
Binary file removed output-fonts/LigaSrcPro-Medium.ttf
Binary file not shown.
Binary file removed output-fonts/LigaSrcPro-MediumIt.ttf
Binary file not shown.
Binary file removed output-fonts/LigaSrcPro-Regular.ttf
Binary file not shown.
Binary file removed output-fonts/LigaSrcPro-Semibold.ttf
Binary file not shown.
Binary file removed output-fonts/LigaSrcPro-SemiboldIt.ttf
Binary file not shown.
Binary file removed output-fonts/LigaSrcVariable-Roman.ttf
Binary file not shown.
Binary file removed output-fonts/LigalexMono-Bold.ttf
Binary file not shown.
Binary file removed output-fonts/LigalexMono-BoldItalic.ttf
Binary file not shown.
Binary file removed output-fonts/LigalexMono-ExtraLight.ttf
Binary file not shown.
Binary file removed output-fonts/LigalexMono-ExtraLightItalic.ttf
Binary file not shown.
Binary file removed output-fonts/LigalexMono-Italic.ttf
Binary file not shown.
Binary file removed output-fonts/LigalexMono-Light.ttf
Binary file not shown.
Binary file removed output-fonts/LigalexMono-LightItalic.ttf
Binary file not shown.
Binary file removed output-fonts/LigalexMono-Medium.ttf
Binary file not shown.
Binary file removed output-fonts/LigalexMono-MediumItalic.ttf
Binary file not shown.
Binary file removed output-fonts/LigalexMono-SemiBold.ttf
Binary file not shown.
Binary file removed output-fonts/LigalexMono-SemiBoldItalic.ttf
Binary file not shown.
Binary file removed output-fonts/LigalexMono-Text.ttf
Binary file not shown.
Binary file removed output-fonts/LigalexMono-TextItalic.ttf
Binary file not shown.
Binary file removed output-fonts/LigalexMono-Thin.ttf
Binary file not shown.
Binary file removed output-fonts/LigalexMono-ThinItalic.ttf
Binary file not shown.
Binary file removed output-fonts/LigalexMono.ttf
Binary file not shown.
Binary file removed output-fonts/Liganymous-Bold.ttf
Binary file not shown.
Binary file removed output-fonts/Liganymous-BoldItalic.ttf
Binary file not shown.
Binary file removed output-fonts/Liganymous-Italic.ttf
Binary file not shown.
Binary file removed output-fonts/Liganymous.ttf
Binary file not shown.
Binary file removed output-fonts/UbuntuMonoLigaturized-Bold.ttf
Binary file not shown.
Binary file removed output-fonts/UbuntuMonoLigaturized-BoldItalic.ttf
Binary file not shown.
Binary file removed output-fonts/UbuntuMonoLigaturized-Italic.ttf
Binary file not shown.
Binary file removed output-fonts/UbuntuMonoLigaturized-Regular.ttf
Binary file not shown.

0 comments on commit 5389c7c

Please sign in to comment.