This file contains hidden or 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
""" | |
Generate variable fonts with fontmake from .glyphs sources. | |
Script traverses a directory tree and will generate var fonts if it | |
encounters a .glyphs file with at least 2 masters and more than 3 | |
instances, if directory matches the repository GF-Checklist spec: | |
https://github.com/googlefonts/gf-docs/blob/master/ProjectChecklist.md | |
""" | |
import glyphsLib |
This file contains hidden or 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
from fontTools.ttLib import TTFont | |
import csv | |
import os | |
import re | |
from ntpath import basename | |
gf_dir = '/Users/marc/Documents/googlefonts/fonts' | |
gf_repo_file = open('/Users/marc/Documents/googlefonts/gf_doc_patches/GF_Upstream_Repos - Sheet1-4.csv') |
This file contains hidden or 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
""" | |
For each OFL.txt file, if there is not a double linebreak after the firt | |
line, add it. | |
e.g: | |
Before: | |
Copyright 2017 The Manuala Project Authors (http:www.gitrepo.com) |
This file contains hidden or 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
import csv | |
import json | |
from fontTools.ttLib import TTFont | |
class SetEncoder(json.JSONEncoder): | |
def default(self, obj): | |
if isinstance(obj, set): | |
return list(obj) | |
return json.JSONEncoder.default(self, obj) |
This file contains hidden or 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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
""" | |
Report how many issues/prs were opened and closed for a specific | |
Github repository between two dates. | |
Examples: | |
Issues between 2017-01-01 to 2017-06-01: | |
python github_reporter.py <user> <pass> pallets/flask 2017-01-01 2017-06-01 |
This file has been truncated, but you can view the full file.
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<ttFont sfntVersion="\x00\x01\x00\x00" ttLibVersion="3.13"> | |
<GDEF> | |
<Version value="0x00010000"/> | |
<GlyphClassDef Format="0"> | |
<ClassDef glyph="A" class="1"/> | |
<ClassDef glyph="A.ss01" class="1"/> | |
<ClassDef glyph="AE" class="1"/> | |
<ClassDef glyph="AEacute" class="1"/> |
This file contains hidden or 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
import requests | |
import json | |
img_path = 'foo/img_path.jpg' | |
r = requests.post('https://api.imgur.com/3/image', | |
data={'image': open(img_path, 'rb').read(), 'type': 'file' }, | |
headers = {'Authorization': 'Client-ID {{Your-CLIENT-ID}}'} | |
) | |
print r.json() |
This file contains hidden or 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
""" | |
Flatten a font's GPOS kerning. | |
""" | |
from fontTools.ttLib import TTFont | |
def _kerning_lookup_indexes(ttfont): | |
"""Return the lookup ids for the kern feature""" | |
for feat in ttfont['GPOS'].table.FeatureList.FeatureRecord: | |
if feat.FeatureTag == 'kern': |
This file contains hidden or 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
ﻻﴅ ﻻﺻﺊ ﻻﴆ ﻻﺻ ﻻصي ﻻبي ﻻﺑﺊ ﻻﰊ ﻻﰉ ﻻﺑ ﻻﻇﻲ ﻻغي ﻻﳷ ﻻﳶ ﻻﳵ ﻻﴇ ﻻﻃ ﻻطي ﻻظي ﻻﻇﺊ ﻻﻏﺊ ﻻﻋﺊ ﻻﴈ ﻻﻇﻰ ﻻضي ﻻﺿﺊ ﻻﳺ ﻻﳹ ﻻﺿ ﻻﻇ ﻻعي ﻻﻃﺊ ﻻﳸ ’ ” 7 ﻻﱓ ﻻﱔ ﻻﳽ ﻻﺷ ʻ ﻻﺳﺊ ﻻﺷﺊ ‘ ﻻﳻ ﻻﳾ ﻻﳼ ﻻﺳ ﻻﻫ ﻻشي “ ﻻهي ﻻسي ﻻﻫﺊ |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
import requests | |
r = requests.get('https://api.github.com/repos/google/fonts/issues?milestone=2&per_page=100') | |
print('Title,Url,Date') | |
for issue in r.json(): | |
if not issue['closed_at']: | |
print('{},{},{}'.format(issue['title'], issue['html_url'], issue['created_at'])) |