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
""" | |
This is some very old code that implemented a doctest-like | |
format for .fea files. It was useful, but I seemed to be | |
the only person using it so it fell off my radar. I still | |
think this, or something like it would be extremely useful | |
in the font development workflow. | |
The syntax is defined below. This implementation uses a | |
test file that is separate from the .fea file. It shouldn't | |
be too hard to make it work with tests that are embedded |
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
""" | |
This compares the speed of experimental changes in ufoLib | |
with the experimental ufoLib in fontTools. This requires the | |
"Roboto-Regular.ufo" font to be located next to this script. | |
""" | |
import os | |
import shutil | |
import timeit | |
import cProfile |
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 sys | |
sys.path.insert(0, '/Users/frederik/Downloads/fonttools-ufoLib/Lib') | |
import os | |
import shutil | |
import ufoLib | |
from fontTools.pens.basePen import NullPen | |
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 sys | |
sys.path.insert(0, '/Users/frederik/Downloads/fonttools-ufoLib/Lib') | |
import os | |
import shutil | |
import ufoLib | |
from fontTools.pens.basePen import NullPen | |
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 time | |
from random import shuffle | |
# ---------- | |
# The Inputs | |
# ---------- | |
pageSize = 500 | |
maximumFrameCalculationDuration = 0.1 | |
minimumPixelSize = 5 |
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 objc import python_method | |
from AppKit import * | |
import Quartz | |
import vanilla | |
class LayerTestView(vanilla.Group): | |
def __init__(self, posSize): | |
super(LayerTestView, self).__init__(posSize) |
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 os | |
import shutil | |
from mojo.events import addObserver | |
""" | |
Goal: Create a UFOZ automatically when a UFO is saved. | |
Off the top of my head, I can think of a few ways to do this: | |
1. Make a copy of the font object, save as UFOZ, discard the |
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
# This is a comment, which shouldn't be visible! | |
# This is a script declaration: | |
^ latn | |
# This is a language declaration: | |
@ None | |
# This is a writing direction start point declaration: | |
* left | |
# the options are "left" for left to right | |
# and "right" for right to left. |
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 mojo import events | |
import metricsMachine | |
class MMCurrentPairObserver(object): | |
def __init__(self): | |
self.previousPair = None | |
events.addObserver( | |
self, | |
"currentPairChangedCallback", |
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 urllib.request import build_opener | |
import bs4 | |
from nltk.tokenize import PunktSentenceTokenizer | |
# Pull some text from a Wikipedia entry. | |
# The text could also come from a string, file or whatever. | |
url = "https://en.wikipedia.org/wiki/Font,_Switzerland" | |
opener = build_opener() |
OlderNewer