Skip to content

Instantly share code, notes, and snippets.

View mekkablue's full-sized avatar

Rainer Erich Scheichelbauer mekkablue

View GitHub Profile
@mekkablue
mekkablue / Bump down.py
Created July 27, 2019 16:59
Align to Metrics scripts
#MenuTitle: Bump down
# -*- coding: utf-8 -*-
__doc__="""
Align selected components, paths (and parts of paths) to the next metric line or guideline below.
"""
Font = Glyphs.font
Doc = Glyphs.currentDocument
#MenuTitle: Move glyph down 1 unit
# -*- coding: utf-8 -*-
__doc__="""
Moves the current glyph(s) down by 1 unit.
Similar to ctrl-cmd-left/right.
Suggested shortcut: ctrl-cmd-downarrow.
"""
yDiff = -1
@mekkablue
mekkablue / Open closed paths.py
Created July 27, 2019 16:54
Open closed paths
#MenuTitle: Open closed paths
# -*- coding: utf-8 -*-
__doc__="""
Opens all paths in the visible layers of selected glyphs.
"""
Font = Glyphs.font
selectedLayers = Font.selectedLayers
def process( thisLayer ):
@mekkablue
mekkablue / Insert BCPs into straight segments.py
Created July 27, 2019 16:52
Insert BCPs into straight segments
#MenuTitle: Insert BCPs into straight segments
# -*- coding: utf-8 -*-
__doc__="""
Inserts BCPs into straight segments of selected glyphs. The opposite of what the Tidy Up Paths command does. Useful if you want to bend the shape later.
"""
Font = Glyphs.font
FontMaster = Font.selectedFontMaster
selectedLayers = Font.selectedLayers
selectedLayer = selectedLayers[0]
@mekkablue
mekkablue / Close open paths.py
Created July 27, 2019 16:50
Close open paths
#MenuTitle: Close open paths
# -*- coding: utf-8 -*-
__doc__="""
Close all paths in visible layers of selected glyphs.
"""
Font = Glyphs.font
selectedLayers = Font.selectedLayers
def process( thisLayer ):
@mekkablue
mekkablue / Preflight Font.py
Created July 27, 2019 16:28
Preflight Font
#MenuTitle: Preflight Font
# -*- coding: utf-8 -*-
__doc__="""
Checks if everything is alright in the font.
"""
Doc = Glyphs.currentDocument
Font = Glyphs.font
Glyphs.clearLog()
Glyphs.showMacroWindow()
@mekkablue
mekkablue / Compare Font Info for Open Fonts.py
Created July 27, 2019 16:27
Compare Font Info for Open Fonts
#MenuTitle: Compare Font Info for Open Fonts
# -*- coding: utf-8 -*-
__doc__="""
Analyzes font info entries in all open fonts and outputs differences.
"""
Glyphs.clearLog()
Glyphs.showMacroWindow()
@mekkablue
mekkablue / Reset Compound Metrics to First Component.py
Created July 27, 2019 16:24
Reset Compound Metrics to First Component
#MenuTitle: Reset Compound Metrics to First Component
# -*- coding: utf-8 -*-
__doc__="""
Looks for the first component in a compound glyph and sets it back to x=0 and inherits its width. Useful for syncing numerators and denominators.
"""
Font = Glyphs.font
FontMasterID = Font.selectedFontMaster.id
selectedLayers = Font.selectedLayers
@mekkablue
mekkablue / Delete All Vertical Hints in Selected Glyphs.py
Created July 27, 2019 16:13
Delete All Vertical Hints in Selected Glyphs
#MenuTitle: Delete All Vertical Hints in Selected Glyphs
# -*- coding: utf-8 -*-
__doc__="""
Removes all vertical hints in the selected layers.
"""
thisFont = Glyphs.font # frontmost font
thisFontMaster = thisFont.selectedFontMaster # active master
listOfSelectedLayers = thisFont.selectedLayers # active layers of selected glyphs
@mekkablue
mekkablue / Delete All Vertical Hints in Font.py
Created July 27, 2019 16:12
Delete All Vertical Hints in Font
#MenuTitle: Delete All Vertical Hints in Font
# -*- coding: utf-8 -*-
__doc__="""
Removes all vertical hints in the font.
"""
thisFont = Glyphs.font # frontmost font
thisFontMaster = thisFont.selectedFontMaster # active master
def process( thisLayer ):