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
# [email protected] | |
# April 2024 | |
# version 1 | |
# For robofont | |
# Dedicated to my github sponsors who encourate explorations like this. | |
# this can find the t for horizontals in a cubic bezier segment. |
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
# coding: utf-8 | |
# menuTitle : Sort Space Center | |
import ezui | |
from random import shuffle | |
from glyphNameFormatter.reader import u2c | |
from mojo.UI import CurrentSpaceCenter, splitText, OpenSpaceCenter | |
""" | |
Take the glyphs from the current spacecenter |
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 fontTools.designspaceLib import InstanceDescriptor | |
from mojo.UI import CurrentSpaceCenter | |
# Scripting with live designspaces | |
# demo [email protected] 8.12.2023 | |
# have a desigspace open in DSE2 | |
d = CurrentDesignspace() | |
# have a spacecenter open |
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
# | |
# script for drawbot extension in robofont | |
# draws a fitted / interpolating image from a responsive lettering ufo | |
# [email protected] / 20231204 | |
def ip(a, b, f): | |
return a + f * (b-a) | |
page = (659, 500) # image size | |
margin = 59 # nice to have a margin |
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
# another animation generator | |
# for NCND fun only | |
# 2023 letterror.com | |
# the number of frames for this animation | |
frames = 25 | |
# margin, in pixels |
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 cosineSimilarity | |
from cosineSimilarity import cosineSimilarity, SimilarGlyphsKey | |
print('SimilarGlyphsKey', SimilarGlyphsKey) | |
g = CurrentGlyph() | |
font = CurrentFont() |
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 io | |
from fontParts.fontshell import RGlyph as partsGlyph | |
from shutil import copyfile | |
""" | |
This will cross reference the image files in <ufoname>/images | |
with the actual files referenced in the .glif. | |
Images that are not used will be copied to a new folder <ufoname>_rescued_images |
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 ufoProcessor | |
from mojo.UI import PutFile, GetFile | |
import os | |
""" | |
Open a .sp3 or .designspace document and generate the instances. | |
No reporting, no editing, no debugging. | |
""" | |
def convertSuperpolatorToDesignSpace(path): |
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 fontTools.pens.transformPen import TransformPen | |
from fontTools.pens.pointPen import AbstractPointPen | |
from fontTools.misc.transform import Transform | |
import math | |
from defcon.objects.glyph import Glyph | |
class TransformPen2(TransformPen): | |
# because we don't want to change the transform matrix of the actual components | |
def addComponent(self, glyphName, transformation): |
NewerOlder