diff options
author | Rasmus Andersson <rasmus@notion.se> | 2018-11-26 19:57:13 +0300 |
---|---|---|
committer | Rasmus Andersson <rasmus@notion.se> | 2018-11-26 19:57:13 +0300 |
commit | 0eb9bd892f4d65bd470fed7e9d84eef2844f9362 (patch) | |
tree | 6a5607df0cc89f9351211770b340698514dabd0b /misc/rf-scripts | |
parent | 30c17551659d0b852fd8c4d028136e64caa2a4c3 (diff) | |
download | inter-0eb9bd892f4d65bd470fed7e9d84eef2844f9362.tar.xz |
scripts
Diffstat (limited to 'misc/rf-scripts')
-rw-r--r-- | misc/rf-scripts/fixup-variant.py | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/misc/rf-scripts/fixup-variant.py b/misc/rf-scripts/fixup-variant.py deleted file mode 100644 index c2ac0f652..000000000 --- a/misc/rf-scripts/fixup-variant.py +++ /dev/null @@ -1,55 +0,0 @@ -# Helper for making variants of a glyph. -# -# e.g. we have 10 glyphs based on "I" and we now want to -# create an alternate "I" called "I.1". -# -# 1. We first make our I.1 manually -# 2. Next we generate all other glyphs: -# Idieresisacute=Idieresisacute.1 -# Istroke=Istroke.1 -# Itildebelow=Itildebelow.1 -# Igrave=Igrave.1 -# Iacute=Iacute.1 -# Icircumflex=Icircumflex.1 -# Itilde=Itilde.1 -# Imacron=Imacron.1 -# Ibreve=Ibreve.1 -# Iogonek=Iogonek.1 -# Which we paset into the "create glyphs" window -# 3. We now have 10 new glyphs. -# 4. Select all those new glyphs -# 5. Open the macro window -# 6. Paste this script and modify `prevcn` and `newcn` -# 7. Run it -# -prevcn = "I" # component to find and replace -newcn = "I.1" # replacement component - -font = Glyphs.font -font.disableUpdateInterface() -try: - for layer in font.selectedLayers: - g = None - if isinstance(layer, GSGlyph): - g = layer - else: - g = layer.parent - print(g) - g.beginUndo() - try: - for master in font.masters: - layer = g.layers[master.id] - print(layer) - if len(layer.components) != 1: - print("not a single component %s" % layer) - continue - layer.components[0].decompose() - for c in layer.components: - if c.name == prevcn: - print("replace %s with %s" % (prevcn, newcn)) - c.name = newcn - finally: - g.endUndo() -finally: - font.enableUpdateInterface() - |