Presented at TypeLab 2023.
A much better version is now available at https://gist.github.com/arrowtype/47937ba868b0b2a49e80684319e56037
| ''' | |
| Glyph Proofer | |
| This must be used within the Drawbot extension for RoboFont. | |
| ''' | |
| from datetime import datetime | |
| timestamp = datetime.now().strftime("%Y_%m_%d") |
| """ | |
| A simple way to make some kerning strings, for kerning and/or proofing your kerning. | |
| Change the "side1Names" to glyphs you want on the left side of pairs, and change side2Names to glyphs you want on the right side of pairs. | |
| INSTRUCTIONS: | |
| 1. Copy space-separated list(s) of glyph names from a font editor, then paste into side1Names and side2Names below | |
| - In GlyphsApp, select the glyphs you want, right-click (or control-click) and select Copy Glyph Names > Space Separated | |
| - In RoboFont, select the glyphs you want, then press OPTION + COMMAND + C | |
| 2. Paste those names in the glyphNames variable below, between the quotes |
| """ | |
| DISCLAIMERS: | |
| - WORK IN PROGRESS – works pretty well, but could use a few more improvements | |
| - May or may not work for your particular project | |
| - Always read scripts before you run them, and back up your work before you run scripts | |
| DESCRIPTION: | |
| A script to take the sources of Name Sans and output slanted versions of these, | |
| for the purposes of A) prototyping & B) jumpstarting the italic drawings. |
| """ | |
| A script to set the default instance of a variable font’s wght axis to 400 (Regular). | |
| From https://gist.github.com/arrowtype/9fefe9633cae500bbaf0000230f6a3ed | |
| This can perhaps be more intuitive to designers who expect "Regular" to be the default weight of a variable font, | |
| or for web developers who don’t set a weight range in their @font-face webfont setup. | |
| This could be easily adapted to set defaults along other axes. It simply uses the FontTools Instancer module. |
| """ | |
| Remove instances with a non-default opsz location from a variable font, | |
| in order to avoid Safari v16 bug (https://bugs.webkit.org/show_bug.cgi?id=247987) | |
| NOTE: seems to trigger another Safari issue for wght + opsz fonts, so I’m currently only | |
| using this on an opsz-only font. Do your own testing! | |
| Assumes: | |
| - exactly one font path is being fed in | |
| - it’s a variable font |
| """ | |
| 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 |
| """ | |
| 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 |
| 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 | |
| } |
Presented at TypeLab 2023.
A much better version is now available at https://gist.github.com/arrowtype/47937ba868b0b2a49e80684319e56037
| """ | |
| 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 |