-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Completely rework build process, and rename files for license compliance
This addresses #25 and (partially) #42; fonts that we can't make derivative works of are no longer checked in, and fonts that need to be renamed for license compliance have been. The build process is also now a bit more robust.
- Loading branch information
Showing
63 changed files
with
205 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,7 @@ | ||
# Alternate options for ligaturize.py. | ||
# Run `fontforge -lang=py ligaturize.py --help` for details. | ||
LIGATURIZE_OPTS=--prefix=Liga | ||
# LIGATURIZE_OPTS+=--copy-character-glyphs | ||
# LIGATURIZE_OPTS+=--scale-character-glyphs-threshold=0.0 | ||
# LIGATURIZE_OPTS+=--scale-character-glyphs-threshold=2.0 | ||
# To build with different settings (e.g. turn on character glyph copying), | ||
# edit build.py and then "make". | ||
|
||
TTF_SRCS=$(wildcard input-fonts/*.ttf) | ||
OTF_SRCS=$(wildcard input-fonts/*.otf) | ||
|
||
TTF_OUTS=$(patsubst input-fonts/%,output-fonts/Liga%,${TTF_SRCS}) | ||
OTF_OUTS=$(patsubst input-fonts/%.otf,output-fonts/Liga%.ttf,${OTF_SRCS}) | ||
|
||
all: ${TTF_OUTS} ${OTF_OUTS} | ||
|
||
output-fonts/Liga%.ttf: input-fonts/%.* ligatures.py ligaturize.py | ||
fontforge -lang=py -script ligaturize.py $(LIGATURIZE_OPTS) "$<" "$@" 2>&1 \ | ||
| fgrep -v 'This contextual rule applies no lookups.' | ||
all: | ||
fontforge -lang=py -script build.py 2>&1 \ | ||
| fgrep -v 'This contextual rule applies no lookups.' \ | ||
| fgrep -v 'Bad device table' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
#!/usr/bin/env python | ||
# | ||
# Rebuild script for ligaturized fonts. | ||
# Uses ligaturize.py to do the heavy lifting; this file basically just contains | ||
# the mapping from input font paths to output fonts. | ||
|
||
#### User configurable settings #### | ||
|
||
# For the prefixed_fonts below, what word do we stick in front of the font name? | ||
LIGATURIZED_FONT_NAME_PREFIX = "Liga" | ||
|
||
# Should we copy some individual punctuations characters like &, ~, and <>, | ||
# as well as ligatures? The full list is in ligatures.py. | ||
COPY_CHARACTER_GLYPHS = False | ||
|
||
# If copying individual characters, how different in width (relative to the font | ||
# we're ligaturizing) should they be before we attempt to width-correct them? | ||
# The default (0.1) means to width-correct if they're +/- 10%. Values >1.0 | ||
# effectively disable this feature. | ||
SCALE_CHARACTER_GLYPHS_THRESHOLD = 0.1 | ||
|
||
#### Fonts that should be prefixed with "Liga" when ligaturized. #### | ||
# Don't put fonts licensed under UFL here, and don't put fonts licensed under | ||
# SIL OFL here either unless they haven't specified a Reserved Font Name. | ||
|
||
prefixed_fonts = [ | ||
# Apache 2.0 license | ||
'Cousine*', | ||
'Droid*', | ||
'Meslo*', | ||
'Roboto*', | ||
|
||
# MIT license | ||
'DejaVu*', | ||
'Hack*', | ||
|
||
# SIL OFL with no Reserved Font Name | ||
'Edlo*', | ||
'FantasqueSansMono-Normal/*', | ||
'Inconsolata*', | ||
] | ||
|
||
#### Fonts that need to be renamed. #### | ||
# These are fonts that either have name collisions with the prefixed_fonts | ||
# above, or are released under licenses that permit modification only if we | ||
# change the name of the modified fonts. | ||
|
||
renamed_fonts = { | ||
# This doesn't have a reserved name, but if we don't rename it it'll collide | ||
# with its sibling Fantasque Sans Mono Normal, listed above. | ||
'FantasqueSansMono-NoLoopK/*': 'Liga Fantasque Sans Mono NoLoopK', | ||
|
||
# SIL OFL with reserved name | ||
'Anonymous*': 'Liganymous', | ||
'IBMPlexMono*': 'Ligalex Mono', | ||
'OxygenMono*': 'Liga O2 Mono', | ||
'SourceCodePro*': 'LigaSrc Pro', | ||
'SourceCodeVariable*': 'LigaSrc Variable', | ||
|
||
# UFL | ||
'UbuntuMono*': 'Ubuntu Mono Ligaturized', | ||
} | ||
|
||
#### Fonts we can't ligaturize. #### | ||
# Fonts that we can't ligaturize because their licences do not permit derivative | ||
# works of any kind. | ||
# Individual users may still be able to make ligaturized versions for personal | ||
# use, but we can't check them into the repo or include them in releases. | ||
|
||
# prefixed_fonts += [ | ||
# 'CamingoCode*', | ||
# 'SFMono*', | ||
# ] | ||
|
||
#### No user serviceable parts below this line. #### | ||
|
||
from glob import glob | ||
from os import path | ||
from ligaturize import ligaturize_font | ||
|
||
for pattern in prefixed_fonts: | ||
for input_file in glob(path.join('input-fonts', pattern)): | ||
ligaturize_font( | ||
input_file, ligature_font_file=None, output_dir='output-fonts/', | ||
prefix=LIGATURIZED_FONT_NAME_PREFIX, output_name=None, | ||
copy_character_glyphs=COPY_CHARACTER_GLYPHS, | ||
scale_character_glyphs_threshold=SCALE_CHARACTER_GLYPHS_THRESHOLD) | ||
|
||
for pattern,name in renamed_fonts.iteritems(): | ||
for input_file in glob(path.join('input-fonts', pattern)): | ||
ligaturize_font( | ||
input_file, ligature_font_file=None, output_dir='output-fonts/', | ||
prefix=None, output_name=name, | ||
copy_character_glyphs=COPY_CHARACTER_GLYPHS, | ||
scale_character_glyphs_threshold=SCALE_CHARACTER_GLYPHS_THRESHOLD) |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file removed
BIN
-164 KB
output-fonts/FantasqueSansMono-NoLoopK/LigaFantasqueSansMono-Bold.otf
Binary file not shown.
Binary file removed
BIN
-173 KB
output-fonts/FantasqueSansMono-NoLoopK/LigaFantasqueSansMono-BoldItalic.otf
Binary file not shown.
Binary file removed
BIN
-172 KB
output-fonts/FantasqueSansMono-NoLoopK/LigaFantasqueSansMono-Italic.otf
Binary file not shown.
Binary file removed
BIN
-166 KB
output-fonts/FantasqueSansMono-NoLoopK/LigaFantasqueSansMono-Regular.otf
Binary file not shown.
Binary file removed
BIN
-164 KB
output-fonts/FantasqueSansMono-Normal/LigaFantasqueSansMono-Bold.otf
Binary file not shown.
Binary file removed
BIN
-173 KB
output-fonts/FantasqueSansMono-Normal/LigaFantasqueSansMono-BoldItalic.otf
Binary file not shown.
Binary file removed
BIN
-172 KB
output-fonts/FantasqueSansMono-Normal/LigaFantasqueSansMono-Italic.otf
Binary file not shown.
Binary file removed
BIN
-166 KB
output-fonts/FantasqueSansMono-Normal/LigaFantasqueSansMono-Regular.otf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file renamed
BIN
+78 KB
output-fonts/LigaInconsolata-g.ttf → output-fonts/LigaInconsolata-g-g.ttf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file renamed
BIN
+113 KB
output-fonts/LigaOxygenMono-Regular.ttf → output-fonts/LigaO2Mono-Regular.ttf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file renamed
BIN
+152 KB
output-fonts/LigaSourceCodePro-Bold.ttf → output-fonts/LigaSrcPro-Bold.ttf
Binary file not shown.
Binary file renamed
BIN
+152 KB
output-fonts/LigaSourceCodePro-Regular.ttf → output-fonts/LigaSrcPro-Regular.ttf
Binary file not shown.
Binary file renamed
BIN
+179 KB
...ut-fonts/LigaSourceCodeVariable-Roman.ttf → output-fonts/LigaSrcVariable-Roman.ttf
Binary file not shown.
Binary file renamed
BIN
+136 KB
output-fonts/LigaIBMPlexMono-Bold.ttf → output-fonts/LigalexMono-Bold.ttf
Binary file not shown.
Binary file renamed
BIN
+150 KB
output-fonts/LigaIBMPlexMono-BoldItalic.ttf → output-fonts/LigalexMono-BoldItalic.ttf
Binary file not shown.
Binary file renamed
BIN
+137 KB
output-fonts/LigaIBMPlexMono-ExtraLight.ttf → output-fonts/LigalexMono-ExtraLight.ttf
Binary file not shown.
Binary file renamed
BIN
+151 KB
...onts/LigaIBMPlexMono-ExtraLightItalic.ttf → ...ut-fonts/LigalexMono-ExtraLightItalic.ttf
Binary file not shown.
Binary file renamed
BIN
+151 KB
output-fonts/LigaIBMPlexMono-Italic.ttf → output-fonts/LigalexMono-Italic.ttf
Binary file not shown.
Binary file renamed
BIN
+136 KB
output-fonts/LigaIBMPlexMono-Light.ttf → output-fonts/LigalexMono-Light.ttf
Binary file not shown.
Binary file renamed
BIN
+151 KB
output-fonts/LigaIBMPlexMono-LightItalic.ttf → output-fonts/LigalexMono-LightItalic.ttf
Binary file not shown.
Binary file renamed
BIN
+136 KB
output-fonts/LigaIBMPlexMono-Medium.ttf → output-fonts/LigalexMono-Medium.ttf
Binary file not shown.
Binary file renamed
BIN
+150 KB
...ut-fonts/LigaIBMPlexMono-MediumItalic.ttf → output-fonts/LigalexMono-MediumItalic.ttf
Binary file not shown.
Binary file renamed
BIN
+136 KB
output-fonts/LigaIBMPlexMono-SemiBold.ttf → output-fonts/LigalexMono-SemiBold.ttf
Binary file not shown.
Binary file renamed
BIN
+150 KB
...-fonts/LigaIBMPlexMono-SemiBoldItalic.ttf → output-fonts/LigalexMono-SemiBoldItalic.ttf
Binary file not shown.
Binary file renamed
BIN
+137 KB
output-fonts/LigaIBMPlexMono-Text.ttf → output-fonts/LigalexMono-Text.ttf
Binary file not shown.
Binary file renamed
BIN
+151 KB
output-fonts/LigaIBMPlexMono-TextItalic.ttf → output-fonts/LigalexMono-TextItalic.ttf
Binary file not shown.
Binary file renamed
BIN
+137 KB
output-fonts/LigaIBMPlexMono-Thin.ttf → output-fonts/LigalexMono-Thin.ttf
Binary file not shown.
Binary file renamed
BIN
+151 KB
output-fonts/LigaIBMPlexMono-ThinItalic.ttf → output-fonts/LigalexMono-ThinItalic.ttf
Binary file not shown.
Binary file renamed
BIN
+137 KB
output-fonts/LigaIBMPlexMono-Regular.ttf → output-fonts/LigalexMono.ttf
Binary file not shown.
Binary file not shown.
Binary file renamed
BIN
+236 KB
output-fonts/LigaUbuntuMono-Regular.ttf → ...t-fonts/UbuntuMonoLigaturized-Regular.ttf
Binary file not shown.