Feature suggestion: preprocessing and postprocessing scripts
I ❤ Batch and I wouldn't want to use anything else. However there are a few things that I like to do that are specific to my workflow, such as dealing with double encodings that the FDK strips from the UFO, etc. Right now I have to run them as a separate step, but would love to incorporate it into my generating process.
Would you consider allowing users to add an optional preprocessing and postprocessing script to Batch? I think it would be as easy as letting the user select these scripts in the UI, and then providing a way for the scripts to access the source UFO and the generated font (and the designspace, if applicable).
(I considered making my own version of Batch, but then I have to keep it up to date and distribute it to anyone else generating my fonts. Adding a custom preprocessing/postprocessing preferences seems like a cleaner solution.)
Feel free to close this issue if you’re not interested, and thanks for hearing me out!
this would be indeed a welcome addition :)
I would rather propose to either use the already embedded RoboFont notifications: fontWillGenerate and fontDidGenerate
If this is not sufficient Batch could add his own notifications before and after generating binaries.
Thank you for reminding me about these notifications! I will give it a go, and submit a pull request if I come up with something respectable. ;-)
Looking forward, would be cool for these notifications to also contain a designspace attribute if one is being used in the generation process.
would be cool for these notifications to also contain a designspace attribute if one is being used in the generation process.
maybe Batch should add his own notifications and send the additional data like design space docs objects.
I just made a first attempt a postprocessor, and it works when I use RoboFont’s File > Generate. But is it just me or is Batch not providing a fontDidGenerate notification?
from mojo.events import addObserver
class Postprocessor:
def __init__(self):
addObserver(self, "didGenerateObserver", "fontDidGenerate")
def didGenerateObserver(self, info):
print 'POSTPROCESS!!!!!!!'
Postprocessor()
Hope I am not being a bother, just following up on the status of the fontDidGenerate notification,which at the moment still doesn't appear to fire when I generate a font with Batch (but fires as expected when I use File > Generate). Thanks for whatever advice you're able to give!
Batch 2.0 is almost there
is there still a need to post notifications and maybe subscriber notifications specific from Batch?
something like batchDidGenerateFont(ufo/ufoOperator, binaryPath)