Exemplo n.º 1
0
 def restoreGlyphViewItems(self):
     pref_as_is = getDefault('glyphZoomViewShowItems')
     pref_new = dict()
     for i in pref_as_is:
         if i in turnOffItems:
             # global gridWasOn
             # gridWasOn = pref_as_is[i]
             pref_new[i] = 1
         else:
             pref_new[i] = pref_as_is[i]
     setDefault('glyphZoomViewShowItems', pref_new)
     PostNotification("doodle.preferencesChanged")
Exemplo n.º 2
0
    def calculateBoundingBox(self, sender=None):
        xmin = [9999, ""]
        ymin = [9999, ""]
        xmax = [-9999, ""]
        ymax = [-9999, ""]

        for g in CurrentFont():
            if g.bounds:
                if xmin[0] > g.bounds[0]:
                    xmin[0] = g.bounds[0]
                    xmin[1] = g.name
                if ymin[0] > g.bounds[1]:
                    ymin[0] = g.bounds[1]
                    ymin[1] = g.name
                if xmax[0] < g.bounds[2]:
                    xmax[0] = g.bounds[2]
                    xmax[1] = g.name
                if ymax[0] < g.bounds[3]:
                    ymax[0] = g.bounds[3]
                    ymax[1] = g.name
        self.xmin = xmin
        self.ymin = ymin
        self.xmax = xmax
        self.ymax = ymax
        PostNotification('doodle.updateGlyphView')
        if hasattr(self, 'w'):
            l = []
            # if hasattr(self, 'w'):
            l.append(dict(B='←', glyphname=xmin[1], value=xmin[0]))
            l.append(dict(B='↓', glyphname=ymin[1], value=ymin[0]))
            l.append(dict(B='→', glyphname=xmax[1], value=xmax[0]))
            l.append(dict(B='↑', glyphname=ymax[1], value=ymax[0]))
            l.append(
                dict(B='↔︎',
                     glyphname="full width",
                     value=self.xmax[0] - self.xmin[0]))
            l.append(
                dict(B='↕︎',
                     glyphname="full height",
                     value=self.ymax[0] - self.ymin[0]))
            # {"B": 'a', "glyphname": self.xmin[1], "value": str(
            #     self.xmin[0])}

            self.w.results.set(l)
Exemplo n.º 3
0
 def updateView(self, sender):
     PostNotification('doodle.updateGlyphView')
Exemplo n.º 4
0
 def _close(self, sender):
     self.w.hide()
     removeObserver(self, event)
     removeObserver(self, "currentGlyphChanged")
     PostNotification('doodle.updateGlyphView')
Exemplo n.º 5
0
 def changes(self, sender):
     PostNotification('doodle.updateGlyphView')
Exemplo n.º 6
0
 def getUfo(self, sinder):
     ufoPath = getFile()[0]
     self.ufo = OpenFont(ufoPath, showUI=False)
     PostNotification('doodle.updateGlyphView')
Exemplo n.º 7
0
 def _applyTheme(self, theme):
     # Do the actual applying of the theme
     for key, val in theme.items():
         setDefault(key, val)
     PostNotification("doodle.preferencesChanged")
Exemplo n.º 8
0
 def _set_size(self, value):
     self._size = value
     setDefault("glyphViewGridx", value)
     setDefault("glyphViewGridy", value)
     PostNotification("doodle.preferencesChanged")