aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2015-12-23 15:03:19 -0800
committerTeddy Wing2015-12-23 15:03:19 -0800
commitb8529ddb96e1af4d510be9e5e6a540755987815f (patch)
tree43132fb37512ab41fb356cc74de3e48785c2eb62
parenta942a2e5e8cc69432f4956f6556686d46a49769b (diff)
downloadRoboFont-Equalize-Sidebearings-Key-b8529ddb96e1af4d510be9e5e6a540755987815f.tar.bz2
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.
-rw-r--r--equalize_sidebearings.py23
1 files changed, 0 insertions, 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