Skip to content

Instantly share code, notes, and snippets.

View schriftgestalt's full-sized avatar

Georg Seifert schriftgestalt

View GitHub Profile
Font = Glyphs.font
Glyphs.clearLog()
currentGraphicView = Font.currentTab.graphicView()
#thisActivePosition = currentGraphicView.activePosition() # This could be used to just the visibleRect
thisVisibleRect = currentGraphicView.visibleRect()
thisScale = currentGraphicView.scale()
for eachTab in Font.tabs:
@schriftgestalt
schriftgestalt / Clipboard.py
Created January 26, 2016 10:36
Access the Glyphs clipboard
#MenuTitle: Clipboard
# -*- coding: utf-8 -*-
from Foundation import *
pasteboard = NSPasteboard.generalPasteboard()
typeName = pasteboard.availableTypeFromArray_(["Glyphs elements pasteboard type"])
if typeName == "Glyphs elements pasteboard type":
Layer = Glyphs.font.selectedLayers[0]
if Layer:
#MenuTitle: Set Transform Origin to Centre of Selection
# -*- coding: utf-8 -*-
__doc__="""
Sets origin point for Rotate tool to the centre of the selection.
"""
import GlyphsApp
Font = Glyphs.font
selectedLayer = Font.selectedLayers[0]
#MenuTitle: Show Glyphs with this Anchor
# -*- coding: utf-8 -*-
__doc__="""
New Tab with all Glyphs that have the selected anchor.
"""
thisFont = Glyphs.font # frontmost font
selectedLayer = thisFont.selectedLayers[0]
selection = selectedLayer.selection
@schriftgestalt
schriftgestalt / uppercase.py
Created October 13, 2014 09:27
Covert text to Uppercase for Glyphs App
#MenuTitle: Uppercase
# -*- coding: utf-8 -*-
"""Converts the selected text to upppercase."""
Doc = Glyphs.currentDocument
Font = Glyphs.font
Doc = Glyphs.currentDocument
TextStoreage = Doc.windowController().activeEditViewController().graphicView().textStorage()
String = TextStoreage.text().string()
Range = TextStoreage.selectedRange()