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
import random | |
import string | |
import uharfbuzz as hb | |
import sys | |
from fontTools.ttLib import TTFont | |
def generate_random_string(fp): | |
f = TTFont(fp) | |
cmap = f.getBestCmap() | |
length = random.randint(3, 100) |
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
@condition | |
... | |
def gf_family(ttFont): | |
from gfcore.font import family_name | |
from gfcore.site import download_family, family_exists | |
name = family_name(ttFont) | |
if family_exists(name): | |
return download_family(name) | |
return None |
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
# Lookup type 1: Single Adjustment Positioning | |
# format 1: Single Positioning Value & format 2: Array of Positioning Values | |
{ | |
'format': int, | |
'valueRecord': [ | |
{"a": {"XPlacement": 0, "XAdvance": 10, "YPlacement": 0, "YAdvance": 0}, | |
... | |
} |
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
set -e | |
# Install homebrew | |
if ! [ -x "$(command -v brew)" ]; then | |
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
else | |
echo "Homebrew already installed! skipping." | |
fi | |
# Install python3 |
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
"""Compare Comfortaa production against Comfortaa VF in sandbox""" | |
from diffbrowsers.screenshot import ScreenShot | |
from diffbrowsers.utils import gen_diff_gif, load_browserstack_credentials | |
from glob import glob | |
import os | |
OFFICIAL_FONTS = 'https://output.jsbin.com/moranexova' | |
SANDBOX_VF_FONT = 'https://output.jsbin.com/xawawuluvo' | |
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
""" | |
Add an avar table to a VF font. This is often needed for VF fonts generated with glyphsapp | |
Please note: this script requires the same dependencies as fontmake, https://github.com/googlei18n/fontmake | |
For testing avar table see script, https://github.com/googlefonts/gftools/blob/master/bin/gftools-check-vf-avar.py | |
TODO (GF team) File issue on Glyphsapp if glyphsapp does not generate avar table by default. | |
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
# -*- 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'])) |
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
ﻻﴅ ﻻﺻﺊ ﻻﴆ ﻻﺻ ﻻصي ﻻبي ﻻﺑﺊ ﻻﰊ ﻻﰉ ﻻﺑ ﻻﻇﻲ ﻻغي ﻻﳷ ﻻﳶ ﻻﳵ ﻻﴇ ﻻﻃ ﻻطي ﻻظي ﻻﻇﺊ ﻻﻏﺊ ﻻﻋﺊ ﻻﴈ ﻻﻇﻰ ﻻضي ﻻﺿﺊ ﻻﳺ ﻻﳹ ﻻﺿ ﻻﻇ ﻻعي ﻻﻃﺊ ﻻﳸ ’ ” 7 ﻻﱓ ﻻﱔ ﻻﳽ ﻻﺷ ʻ ﻻﺳﺊ ﻻﺷﺊ ‘ ﻻﳻ ﻻﳾ ﻻﳼ ﻻﺳ ﻻﻫ ﻻشي “ ﻻهي ﻻسي ﻻﻫﺊ |
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
""" | |
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 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() |
NewerOlder