Skip to content

Instantly share code, notes, and snippets.

This file has been truncated, but you can view the full file.
<?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"/>
@m4rc1e
m4rc1e / github_reporter.py
Created June 28, 2017 16:39
Report how many issues/prs were opened and closed for a specific Github repository between two dates.
#!/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
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)
@m4rc1e
m4rc1e / ofl_check.py
Created June 6, 2017 14:23
Check the OFL.txt files in the gf repo are good
"""
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)
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')
"""
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
import glyphsLib
import os
parent_dir = '/Users/marc/Documents/googlefonts/manual_font_cleaning/'
possible_var_fonts = []
almost_possible_var_fonts = []
for root, dirs, files in os.walk(parent_dir, topdown=False):
for f in files:
@m4rc1e
m4rc1e / gfonts_collection_bad_fstype_macstyle.py
Created February 7, 2017 17:01
fonts/google: Search for incorrect macStyle and fsType font calues
"""
Recrusively traverse a collection of fonts and find incorrect fsType and
macStyle values
fsType should always be 0x000
macStyle values should map to the MACSTYLE constant
"""
import sys
@m4rc1e
m4rc1e / ymin_ymax.py
Last active November 18, 2016 12:16
In Glyphsapp, find the ymin and ymax in all layers
#MenuTitle: Find Family ymin and ymax
def shortest_tallest_glyphs(font, *args):
'''find the tallest and shortest glyphs in all masters from a list.
If no list is given, search all glyphs.'''
lowest = 0.0
highest = 0.0
highest_name = ''
lowest_name = ''
masters_count = len(font.masters)
@m4rc1e
m4rc1e / change_font_name.py
Last active November 15, 2016 18:42
Append '_new' to font names
import os
import sys
from glob import glob
from fontTools.ttLib import TTFont
import re
NAME_SUFFIX = '_new'
NAME_ENTRIES = [
(1, 0, 0), # Mac
(3, 1, 1033)