Skip to content

Commit 2b76ac3

Browse files
committed
Add open ufos button
fixing #73
1 parent b687dbf commit 2b76ac3

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

Batch.roboFontExt/lib/batch.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import ezui
1919
import defcon
2020

21-
from mojo.roboFont import OpenFont
21+
from mojo.roboFont import OpenFont, AllFonts
2222
from mojo.extensions import getExtensionDefault, setExtensionDefault, ExtensionBundle
2323
from lib.tools.misc import walkDirectoryForFile
2424

@@ -85,7 +85,8 @@ def build(self, sources=[]):
8585
8686
#= ScrollingVerticalStack
8787
|---| @sources
88-
(+-) @sourcesAddRemoveButton
88+
> (+-) @sourcesAddRemoveButton
89+
> ( Add Open UFO's ) @sourcesAddOpenUFOsButton
8990
9091
* HorizontalStack
9192
> * Box @desktopFontsBox
@@ -119,9 +120,7 @@ def build(self, sources=[]):
119120
performDropCallback=self.sourcesPerformDropCallback
120121
)
121122
),
122-
sourcesAddOpenUFO=dict(
123-
width="fill",
124-
alignment="left",
123+
sourcesAddOpenUFOsButton=dict(
125124
gravity="leading",
126125
),
127126
help=dict(
@@ -176,6 +175,11 @@ def sourcesAddRemoveButtonRemoveCallback(self, sender):
176175
table = self.w.getItem("sources")
177176
table.removeSelectedItems()
178177

178+
def sourcesAddOpenUFOsButtonCallback(self, sender):
179+
# add open ufo's only when they are saved on disk
180+
paths = [font.path for font in AllFonts() if font.path is not None]
181+
tableAddPathItems(self.w.getItem("sources"), paths)
182+
179183
def sourcesDropCandidateCallback(self, info):
180184
table = self.w.getItem("sources")
181185
sender = info["sender"]

0 commit comments

Comments
 (0)