From b8529ddb96e1af4d510be9e5e6a540755987815f Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Wed, 23 Dec 2015 15:03:19 -0800 Subject: equalize_sidebearings.py: Get rid of proprietary code Remove RoboFont's proprietary `getDefault` and `equalSideBearings_` code since the extension now works without them and we shouldn't be using this code in an extension that we plan to open source. Sorry for even including this in the repo! It did end up being useful for testing, just to see that it was possible. --- equalize_sidebearings.py | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/equalize_sidebearings.py b/equalize_sidebearings.py index 28ee956..8e640b3 100644 --- a/equalize_sidebearings.py +++ b/equalize_sidebearings.py @@ -2,14 +2,6 @@ from AppKit import NSUserDefaults from mojo.events import addObserver from lib.doodleMenus import SpaceCenterMenuForGlyph -# from tools.defaults import getDefault - -def getDefault(key, defaultValue = None, defaultClass = None): - defaultsFromFile = NSUserDefaults.standardUserDefaults() - value = defaultsFromFile.get(key, defaultValue) - if defaultClass is not None: - return defaultClass(value) - return value class CustomSpaceCenterMenuForGlyph(SpaceCenterMenuForGlyph): @@ -44,20 +36,5 @@ class EqualizeSidebearings(object): # # g.performUndo() - # def equalize_sidebearings(self, glyph): - # useItalicAngleForDisplay = getDefault('glyphViewShouldUseItalicAngleForDisplay') - # leftMarginAttribute = 'leftMargin' - # rightMarginAttribute = 'rightMargin' - # if useItalicAngleForDisplay: - # leftMarginAttribute = 'angledLeftMargin' - # rightMarginAttribute = 'angledRightMargin' - # left = getattr(glyph, leftMarginAttribute) - # right = getattr(glyph, rightMarginAttribute) - # margin = int(round((left + right) / 2.0)) - # glyph.prepareUndo('Equalize sidebearings') - # setattr(glyph, leftMarginAttribute, margin) - # setattr(glyph, rightMarginAttribute, margin) - # glyph.selection.resetSelectionPath() - # glyph.performUndo() EqualizeSidebearings() \ No newline at end of file -- cgit v1.2.3