aboutsummaryrefslogtreecommitdiffstats
path: root/equalize_sidebearings.py
blob: 98d209e7371d8f41fdb9a9adee7f5222b7477ae0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from mojo.events import addObserver
from lib.doodleMenus import SpaceCenterMenuForGlyph


class CustomSpaceCenterMenuForGlyph(SpaceCenterMenuForGlyph):

    def __init__(self, glyph):
        self._glyph = glyph
        super(SpaceCenterMenuForGlyph, self).__init__()


class EqualizeSidebearings(object):
    def __init__(self):
        addObserver(self, 'equalize', 'spaceCenterKeyUp')

    def equalize(self, info):
        if info['event'].characters() == 'a':
            space_center_menu = CustomSpaceCenterMenuForGlyph(
                info['glyph'].naked())
            space_center_menu.equalSideBearings_(self)


EqualizeSidebearings()