Add Google Fonts submodule for those fonts present in it

The following fonts are now loaded from the submodule rather than checked in:
- Cousine
- Roboto Mono
- Inconsolata
- Anonymous Pro
- IBM Plex Mono
- Oxygen Mono
- Source Code Pro
- Ubuntu Mono

This also means a bunch of new output fonts have been added for variants not
present in the original input-fonts.
This commit is contained in:
Ben Kelly 2018-08-31 15:18:25 -04:00 committed by Ben Kelly
parent 01b7c2bb01
commit d5db9c0f5a
80 changed files with 25 additions and 11 deletions

4
.gitmodules vendored
View File

@ -1,3 +1,7 @@
[submodule "fira"]
path = fira
url = https://github.com/tonsky/FiraCode
[submodule "google-fonts"]
path = input-fonts/google
url = https://github.com/google/fonts.git
shallow = true

View File

@ -25,10 +25,10 @@ SCALE_CHARACTER_GLYPHS_THRESHOLD = 0.1
prefixed_fonts = [
# Apache 2.0 license
'Cousine*',
'google/apache/cousine/*.ttf',
'Droid*',
'Meslo*',
'Roboto*',
'google/apache/robotomono/*.ttf',
# MIT license
'DejaVu*',
@ -37,7 +37,7 @@ prefixed_fonts = [
# SIL OFL with no Reserved Font Name
'Edlo*',
'FantasqueSansMono-Normal/*',
'Inconsolata*',
'google/ofl/inconsolata/*.ttf',
]
#### Fonts that need to be renamed. ####
@ -51,14 +51,14 @@ renamed_fonts = {
'FantasqueSansMono-NoLoopK/*': 'Liga Fantasque Sans Mono NoLoopK',
# SIL OFL with reserved name
'Anonymous*': 'Liganymous',
'IBMPlexMono*': 'Ligalex Mono',
'OxygenMono*': 'Liga O2 Mono',
'SourceCodePro*': 'LigaSrc Pro',
'google/ofl/anonymouspro/*.ttf': 'Liganymous',
'google/ofl/ibmplexmono/*.ttf': 'Ligalex Mono',
'google/ofl/oxygenmono/*.ttf': 'Liga O2 Mono',
'google/ofl/sourcecodepro/*.ttf': 'LigaSrc Pro',
'SourceCodeVariable*': 'LigaSrc Variable',
# UFL
'UbuntuMono*': 'Ubuntu Mono Ligaturized',
'google/ufl/ubuntumono/*.ttf': 'Ubuntu Mono Ligaturized',
}
#### Fonts we can't ligaturize. ####
@ -74,12 +74,17 @@ renamed_fonts = {
#### No user serviceable parts below this line. ####
import sys
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)):
files = glob(path.join('input-fonts', pattern))
if not files:
print("Error: pattern 'input-fonts/%s' didn't match any files." % pattern)
sys.exit(1)
for input_file in files:
ligaturize_font(
input_file, ligature_font_file=None, output_dir='output-fonts/',
prefix=LIGATURIZED_FONT_NAME_PREFIX, output_name=None,
@ -87,7 +92,11 @@ for pattern in prefixed_fonts:
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)):
files = glob(path.join('input-fonts', pattern))
if not files:
print("Error: pattern 'input-fonts/%s' didn't match any files." % pattern)
sys.exit(1)
for input_file in files:
ligaturize_font(
input_file, ligature_font_file=None, output_dir='output-fonts/',
prefix=None, output_name=name,

2
fira

@ -1 +1 @@
Subproject commit 30862e05b00f41c9179a9424e382755a5ef954f0
Subproject commit ade27f514af43920eb4c40d354c8e0a36e9ebb12

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.

1
input-fonts/google Submodule

@ -0,0 +1 @@
Subproject commit 08b5f47811dfdea8be45ca44836c4229fc306953

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 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.