Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion GlyphConstruction.roboFontExt/info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<key>requiresVersionMinor</key>
<string>5</string>
<key>timeStamp</key>
<real>1679000061.4736819</real>
<real>1680895559.418968</real>
<key>version</key>
<string>0.13</string>
</dict>
Expand Down
21 changes: 17 additions & 4 deletions GlyphConstruction.roboFontExt/lib/glyphConstructionController.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,6 @@ def __init__(self, constructions, font, parentWindow, shouldOverWrite=None, shou
self.constructions = constructions

self.w = Sheet((300, 170), parentWindow=parentWindow)
getExtensionDefault, setExtensionDefault, getExtensionDefaultColor, setExtensionDefaultColor
y = 15
if shouldOverWrite is None:
shouldOverWrite = getExtensionDefault(self.overWriteKey, True)
Expand Down Expand Up @@ -494,11 +493,15 @@ class GlyphBuilderController(BaseWindowController):
fileNameKey = "%s.lastSavedFileName" % defaultKey
glyphLibConstructionKey = "%s.construction" % defaultKey

isLiveUpdatingKey = "%s.liveUpdating" % defaultKey

def __init__(self, font):
self.font = None
self._glyphs = []
self._filePath = None

self.isLiveUpdating = getExtensionDefault(self.isLiveUpdatingKey, True)

statusBarHeight = 20

self.w = GlyphConstructionWindow((900, 700), "Glyph Builder", minSize=(400, 400))
Expand Down Expand Up @@ -586,18 +589,20 @@ def __init__(self, font):
# self.w.split.showPane("analyser", True)

self.w.statusBar = StatusBar((0, -statusBarHeight, -0, statusBarHeight))
self.w.statusBar.hiddenReload = Button((0, 0, -0, -0), "Reload", self.reload)
self.w.statusBar.hiddenReload = Button((0, 0, 1, 1), "Reload", self.reload)
button = self.w.statusBar.hiddenReload.getNSButton()
button.setBezelStyle_(AppKit.NSRoundRectBezelStyle)
button.setAlphaValue_(0)
self.w.statusBar.hiddenReload.bind("\r", ["command"])

self.w.statusBar.hiddenSave = Button((0, 0, -0, -0), "Reload", self.saveFile)
self.w.statusBar.hiddenSave = Button((0, 0, 1, 1), "Reload", self.saveFile)
button = self.w.statusBar.hiddenSave.getNSButton()
button.setBezelStyle_(AppKit.NSRoundRectBezelStyle)
button.setAlphaValue_(0)
self.w.statusBar.hiddenSave.bind("s", ["command"])

self.w.statusBar.liveUpdating = CheckBox((10, 0, 100, 18), "Live Updates", value=self.isLiveUpdating, sizeStyle="mini", callback=self.liveUpdatingCallback)

self.subscribeFont(font)
self.setUpBaseWindowBehavior()

Expand All @@ -620,6 +625,9 @@ def unsubscribeFont(self):
self.font.removeObserver(self, notification="Font.Changed")
self.font = None

def liveUpdatingCallback(self, sender):
self.isLiveUpdating = sender.get()

def constructionsCallback(self, sender, update=True):
if self.font is None:
return
Expand Down Expand Up @@ -860,7 +868,8 @@ def analyse(self, sender=None):
# notifications

def fontChanged(self, notification):
self.reload()
if self.isLiveUpdating:
self.reload()

def fontBecameCurrent(self, notification):
font = notification["font"]
Expand All @@ -869,10 +878,14 @@ def fontBecameCurrent(self, notification):
def fontResignCurrent(self, notification):
self.unsubscribeFont()

def windowSelectCallback(self, sender):
self.reload()

def windowCloseCallback(self, sender):
self.unsubscribeFont()
removeObserver(self, "fontBecameCurrent")
removeObserver(self, "fontResignCurrent")
setExtensionDefault(self.isLiveUpdatingKey, self.w.statusBar.liveUpdating.get())
super(GlyphBuilderController, self).windowCloseCallback(sender)


Expand Down
22 changes: 18 additions & 4 deletions LibExtension/glyphConstructionController.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,6 @@ def __init__(self, constructions, font, parentWindow, shouldOverWrite=None, shou
self.constructions = constructions

self.w = Sheet((300, 170), parentWindow=parentWindow)
getExtensionDefault, setExtensionDefault, getExtensionDefaultColor, setExtensionDefaultColor
y = 15
if shouldOverWrite is None:
shouldOverWrite = getExtensionDefault(self.overWriteKey, True)
Expand Down Expand Up @@ -494,11 +493,15 @@ class GlyphBuilderController(BaseWindowController):
fileNameKey = "%s.lastSavedFileName" % defaultKey
glyphLibConstructionKey = "%s.construction" % defaultKey

isLiveUpdatingKey = "%s.liveUpdating" % defaultKey

def __init__(self, font):
self.font = None
self._glyphs = []
self._filePath = None

self.isLiveUpdating = getExtensionDefault(self.isLiveUpdatingKey, True)

statusBarHeight = 20

self.w = GlyphConstructionWindow((900, 700), "Glyph Builder", minSize=(400, 400))
Expand Down Expand Up @@ -586,18 +589,20 @@ def __init__(self, font):
# self.w.split.showPane("analyser", True)

self.w.statusBar = StatusBar((0, -statusBarHeight, -0, statusBarHeight))
self.w.statusBar.hiddenReload = Button((0, 0, -0, -0), "Reload", self.reload)
self.w.statusBar.hiddenReload = Button((0, 0, 1, 1), "Reload", self.reload)
button = self.w.statusBar.hiddenReload.getNSButton()
button.setBezelStyle_(AppKit.NSRoundRectBezelStyle)
button.setAlphaValue_(0)
self.w.statusBar.hiddenReload.bind("\r", ["command"])

self.w.statusBar.hiddenSave = Button((0, 0, -0, -0), "Reload", self.saveFile)
self.w.statusBar.hiddenSave = Button((0, 0, 1, 1), "Reload", self.saveFile)
button = self.w.statusBar.hiddenSave.getNSButton()
button.setBezelStyle_(AppKit.NSRoundRectBezelStyle)
button.setAlphaValue_(0)
self.w.statusBar.hiddenSave.bind("s", ["command"])

self.w.statusBar.liveUpdating = CheckBox((10, 0, 100, 18), "Live Updates", value=self.isLiveUpdating, sizeStyle="mini", callback=self.liveUpdatingCallback)

self.subscribeFont(font)
self.setUpBaseWindowBehavior()

Expand All @@ -620,6 +625,9 @@ def unsubscribeFont(self):
self.font.removeObserver(self, notification="Font.Changed")
self.font = None

def liveUpdatingCallback(self, sender):
self.isLiveUpdating = sender.get()

def constructionsCallback(self, sender, update=True):
if self.font is None:
return
Expand Down Expand Up @@ -860,7 +868,8 @@ def analyse(self, sender=None):
# notifications

def fontChanged(self, notification):
self.reload()
if self.isLiveUpdating:
self.reload()

def fontBecameCurrent(self, notification):
font = notification["font"]
Expand All @@ -869,10 +878,15 @@ def fontBecameCurrent(self, notification):
def fontResignCurrent(self, notification):
self.unsubscribeFont()

def windowSelectCallback(self, sender):
if not self.isLiveUpdating:
self.reload()

def windowCloseCallback(self, sender):
self.unsubscribeFont()
removeObserver(self, "fontBecameCurrent")
removeObserver(self, "fontResignCurrent")
setExtensionDefault(self.isLiveUpdatingKey, self.w.statusBar.liveUpdating.get())
super(GlyphBuilderController, self).windowCloseCallback(sender)


Expand Down