Presented at TypeLab 2023.
A much better version is now available at https://gist.github.com/arrowtype/47937ba868b0b2a49e80684319e56037
""" | |
MIT License. | |
""" | |
import os | |
import sys | |
import zipfile | |
def zip_directory(dir_to_zip): | |
# Change to the parent directory of the directory to zip |
""" | |
This script requires some edits to be useful. Originally written for proofing Name Sans. | |
Demoed at https://www.youtube.com/watch?v=3a9KIPi_rTU | |
MIT License. Go ahead and use it! | |
Goals: | |
- Test `T` and `T.ultra` against basic lowercase: `TaTbTcT` etc, across full designspace, and especially around where it swaps to `T.ultra` | |
- Test `T` and `T.ultra` against relatively common diacritics |
# menutitle: Remove Overlap in Selected Contours | |
# shortcut: control+command+o | |
g = CurrentGlyph() | |
with g.undo("Remove overlap"): | |
d_glyph = g.asDefcon() | |
sel = d_glyph.selection | |
sel.removeOverlap() |
""" | |
A script to set ufo2ft filters for all fonts in a directory. | |
DIRECTIONS: Set up the dict below with filters you would like to use in your UFO builds. Then, run it in the command | |
line like this, replacing the <content surrounded by angle brackets> with relavent paths: | |
python3 "<path_to_this_script>/add-ufo2ft-filters-to-ufos_in_dir.py" "<path_to_a_folder_containing_UFO_fonts>" | |
See https://github.com/googlefonts/fontmake/blob/a4c83a0693ae7c629db9385a9e68d8641d85718e/USAGE.md#outline-filtering | |
for more information. |
<?xml version='1.0' encoding='UTF-8'?> | |
<designspace format="5.0"> | |
<axes elidedfallbackname="Regular"> | |
<axis tag="opsz" name="Optical Size" minimum="8" maximum="72" default="8"> | |
<labelname xml:lang="en">Optical Size</labelname> | |
<map input="72" output="72"/> | |
<map input="20" output="40"/> | |
<map input="8" output="8" name="Text" elidable="true"/> | |
</axis> | |
<axis tag="wght" name="Weight" minimum="1" maximum="1000" default="700"> |
""" | |
A basic example of how to open a UFO and print out the bezier curve values from a glyph. | |
Example expanded from: | |
https://fonttools.readthedocs.io/en/latest/pens/recordingPen.html | |
Requires FontTools and FontParts. | |
""" | |
from fontParts.fontshell import RFont as Font |
Presented at TypeLab 2023.
A much better version is now available at https://gist.github.com/arrowtype/47937ba868b0b2a49e80684319e56037
function zipit { | |
currentDir=$(pwd) # get current dir so you can return later | |
cd $(dirname $1) # change to target’s dir (works better for zip) | |
target=$(basename $1) # get target’s name | |
zip -r $target.zip $target -x '*/.DS_Store' # make a zip of the target, excluding macOS metadata | |
echo "zip made of " $1 # announce completion | |
cd $currentDir # return to where you were | |
} |
""" | |
A simple Python3 script to take in a project price, and output the fee Stripe will charge on an invoice. | |
See also: | |
https://support.stripe.com/questions/passing-the-stripe-fee-on-to-customers | |
USAGE - Call the script with Python3 and its path, and give your project/goal price as an arg: | |
python3 calculate-stripe-fee.py 95.00 |
""" | |
Simple Python script to count word frequency in a given text document. | |
Started from | |
https://www.geeksforgeeks.org/python-count-occurrences-of-each-word-in-given-text-file/ | |
Usage: Update the file path below, then run in the command line. | |
""" | |
# Relative path to a .txt file |