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 cosineSimilarity | |
from cosineSimilarity import cosineSimilarity, SimilarGlyphsKey | |
print('SimilarGlyphsKey', SimilarGlyphsKey) | |
g = CurrentGlyph() | |
font = 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
from mojo.UI import * | |
""" | |
RoboFont Script | |
- Type: Composites | |
- Purpose: To create RoboFont glyph construction syntax out of the exisiting | |
composites inside a font using the anchor names. | |
- Specifications: | |
- Determines the base letter and marks according to anchor names. | |
- Reconstruct the glyphConstruction syntax from the anchor names. | |
- Publish Date: 7 Dec 2020 |
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
from mojo.roboFont import RGlyph | |
from mojo.UI import getDefault, setDefault, inDarkMode | |
from lib.tools.notifications import PostNotification | |
from fontTools.pens.basePen import BasePen | |
from mojo.subscriber import Subscriber, registerGlyphEditorSubscriber, unregisterGlyphEditorSubscriber, listRegisteredSubscribers | |
class MyCopyDecomposingPen(BasePen): | |
def __init__(self, glyphSet, outPen): | |
super(MyCopyDecomposingPen, self).__init__(glyphSet) |
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
from fontParts.base.errors import FontPartsError | |
from fontPens.digestPointPen import DigestPointStructurePen | |
def isStrictCompatible(path1,path2): | |
# check interpolation compatibility | |
if type(path1).__name__.split(".")[-1] == "RSegment": | |
if path1.type == path2.type: |
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
from mojo.subscriber import Subscriber, registerGlyphEditorSubscriber, disableSubscriberEvents | |
''' | |
A startup script to help keep anchors in-sync across glyphs | |
The script will not append anchors, only move existing anchors | |
To set a linked glyph, add 'LinkedGlyphs:' in your main glyph's .note | |
On that same line add a comma separated list of glyph names (no spaces) | |
Adding a ! after a glyph name with a semicolon separated list will add | |
an exception and only those anchors will be moved | |
e.g. |
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 metricsMachine | |
from mm4.mmScripting import MetricsMachineScriptingError | |
from vanilla import FloatingWindow, List, CheckBox, PopUpButton | |
from mojo.events import addObserver, removeObserver | |
from AppKit import * | |
from mojo.UI import Message | |
class SyncMM: | |
def __init__(self): |
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
''' | |
Toggle the pair list of an open MetricsMachine (extension) window | |
from all kerning pairs (sorted by glyph order) to exceptions and back. | |
''' | |
import metricsMachine | |
import mm4 | |
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
''' | |
table-flip any phrase you like! | |
If the expression contains spaces, please use quotes. | |
python flip_phrase.py fontlab | |
>>> (╯°□°)╯︵ qɐlʇuoɟ | |
''' | |
import sys | |
import unicodedata |
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
# Copyright 2020 Khaled Hosny | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: | |
# | |
# The above copyright notice and this permission notice shall be included in |
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
""" | |
Toggle a dark mode in RoboFont. | |
For a dark mode in the Glyph Edit view, install Theme Editor: | |
https://github.com/connordavenport/Theme-Manager | |
...and import the "Dark Connor" theme from this Gist | |
(https://gist.github.com/arrowtype/ce0cee426f47c2fe7e82aa07d1e0a450). | |
Also offers to edit the markColor of glyphs with a high opacity in their markColor, | |
which will disrupt the visual effect of a dark mode on the Font View. However, |