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
library(readr) | |
library(dplyr) | |
library(ggplot2) | |
library(tidyr) | |
logTicks <- function(n = 5, base = 10){ | |
# Divisors of the logarithm base. E.g. for base 10: 1, 2, 5, 10. | |
divisors <- which((base / seq_len(base)) %% 1 == 0) | |
mkTcks <- function(min, max, base, divisor){ | |
f <- seq(divisor, base, by = divisor) |
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
#!env python3 | |
import sys | |
from fontTools.ttLib import TTFont | |
from argparse import ArgumentParser | |
import itertools | |
parser = ArgumentParser() | |
parser.add_argument("input", | |
help="font file to process", metavar="FILE") | |
parser.add_argument('-n', "--name", action='store_true', |
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
from tensorfont.dataset import prepare_training_data | |
from tensorfont.generators import RandomPair | |
prepare_training_data() | |
def kern_generator(): | |
rpg = RandomPair(196, 196, 76, "training") | |
gen = rpg.generator() | |
while True: | |
font, left, right = next(gen) | |
img1, perturbation = rpg.get_image(font, left, right, perturbation_range= [-100,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
from fontTools.ttLib import TTFont | |
import glob | |
from tabulate import tabulate | |
import os | |
import random | |
paths = [ | |
os.path.expanduser("~/Library/Fonts"), | |
"/Library/Fonts", |
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
#!/usr/bin/env python | |
# Builds a JSTF table from specially named features | |
# To use: | |
# First, set up the features in your font. | |
# You may add as many or as few features as you like, but they must conform | |
# to the following naming convention: | |
# exs1: First priority extension substitution. | |
# i.e. the first rules we try to substitute glyphs to make the line longer | |
# exp1: First priority extension positioning. | |
# i.e. the first rules we try to reposition glyphs to make the line longer |
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
# Dot a Glyph | |
from fontTools.ttLib import TTFont | |
from beziers.path import BezierPath | |
from beziers.path.representations.fontparts import FontParts | |
from fontParts.world import * | |
from beziers.point import Point | |
from beziers.path.geometricshapes import Circle | |
import sys |
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
# Dot a Glyph | |
# Copyright 2019 Simon Cozens | |
# Redistribution and use in source and binary forms, with or without | |
# modification, are permitted provided that the following conditions are met: | |
# 1. Redistributions of source code must retain the above copyright notice, | |
# this list of conditions and the following disclaimer. | |
# 2. Redistributions in binary form must reproduce the above copyright notice, |
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 | |
from urllib.parse import urlencode | |
languages = ["en"] | |
doneglyphs = " ABCDEFGHIJKLMNOPRQSTUVXYZabcdefghijklmnopqrstuvwxyz0123456789.,-" | |
API_TOKEN = "Use your own, not mine." | |
def get_a_page_of_headlines(page): | |
params = urlencode( | |
{"api_token": API_TOKEN, "languages": ",".join(languages), "page": page} |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
#MenuTitle: HT LetterKerner | |
# Put this in your HTLetterSpacer script directory so it can find | |
# the library. | |
# Todo: | |
# Does not handle whole-font yet. | |
# Does not know or care about kerning groups. | |
# The reference glyph should be adjusted based on the letter pair | |
# - "n" works well for lowercase-lowercase |