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
""" | |
Removes currently selected glyphs from current font. | |
Also removes these glyphs from groups, kerning, and components. | |
Includes template glyphs in selection and removal. | |
""" | |
f = CurrentFont() |
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
""" | |
Here’s a snippet to determine how much horizontal shift a point should get in an italic glyph. | |
In practical terms, I have just used this to shift anchors in a UFO font source, in order to prepare an oblique font. | |
Basically, how can we determine "x" below, given a height ("y") and an angle (italicAngle)? | |
x | |
• - - • | |
| / |
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
""" | |
⚠️⚠️⚠️ | |
OOPS. Don’t use this. FontParts already has BaseGlyph.correctDirection() | |
⚠️⚠️⚠️ | |
Go through UFOs in directory and orient contour paths in a counter-clockwise direction, | |
as they should be for cubic/postscript/CFF/"OTF" curves. | |
DEPENDENCIES: |
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
""" | |
Split glyphs from a given kerning group, but keep kerning | |
so you don’t lose a bunch of almost-correct kerns. | |
(Slightly | |
E.g. If you need to split "e" glyphs out of the "o" group. | |
USAGE: | |
- set originalGroupName (group to split from) |
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
""" | |
A script to make all glyphs in a TTF blank, while leaving metrics, features, etc in place. | |
""" | |
from fontTools import ttLib | |
from fontTools.ttLib.tables._g_l_y_f import Glyph | |
from argparse import ArgumentParser | |
def eraseGlyphs(fontPath, inplace=False): |
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
""" | |
A script to run on UFO files from a command line. Go through a pair list and | |
copy kerns from one UFO to one other UFO, if those kern pairs are in the pair list. | |
What happens: | |
- copy groups from ufoToCopyFrom to ufoToCopyTo | |
- for each pair in the pair list, copy kern from ufoToCopyFrom to ufoToCopyTo | |
Usage: |
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
import board | |
from adafruit_hid.keyboard import Keyboard | |
from adafruit_hid.keycode import Keycode | |
from adafruit_hid.consumer_control import ConsumerControl | |
from adafruit_hid.consumer_control_code import ConsumerControlCode | |
import adafruit_dotstar as dotstar | |
from digitalio import DigitalInOut, Direction, Pull | |
from analogio import AnalogIn | |
from encoder import Encoder | |
import time |
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
""" | |
Book page cheat sheet! | |
Alternate left/right alongside number for a given page count. | |
Example: | |
1 Right | |
2 Left | |
3 Right |
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
""" | |
Perhaps useful for kerning secondary sources once primary sources are kerned. | |
E.g. kern numerals to caps in your Regular, then run this, then kern the new list in your Bold. | |
Or maybe useful for a second pass at kerning, if you only want to view items which have already been kerned. | |
Basic approach: | |
- Take in UFO(s), | |
- Take in existing MetricsMachine kerning pair list, | |
- Go through kern pair list and check which pairs are kerned in the font, |
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
""" | |
Script to create an image of a glyph in the current layer. | |
Instructions: | |
- Use within the Drawbot plugin of GlyphsApp. | |
- Get this plugin via Window > Plugin Manager, then search for "Drawbot" and install it. | |
- Then, go to File > New Drawbot, and paste in this code and run it. | |
- You may need to restart glyphs for the Plugin to work. | |