This file contains hidden or 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
# MM2SpaceCenter by CJ Dunn, 2019, and licensed under the MIT license. Thanks to Tal Leming, Andy Clymer, David Jonathan Ross, Jackson Cavanaugh, Nina Stössinger for help and inspiration with this script | |
# #when pair changes: get pair and set to space center | |
#you must have a UFO open and have MetricsMachine open | |
import sys, os | |
import random | |
from mojo.UI import CurrentSpaceCenter, OpenSpaceCenter |
This file contains hidden or 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
# it’s easy to access a letter’s contours through a BezierPath object: | |
bp = BezierPath() | |
bp.text( | |
's', | |
font='.SFNSDisplayCondensed-Black', | |
fontSize=1200) | |
# Fill the letter, and offset the whole canvas so it sits in the middle. | |
fill(1, 1, 0) | |
letter_width = bp.bounds()[-2] - bp.bounds()[0] |