Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature suggestion: preprocessing and postprocessing scripts #23

Open
djrrb opened this issue Apr 25, 2017 · 6 comments
Open

Feature suggestion: preprocessing and postprocessing scripts #23

djrrb opened this issue Apr 25, 2017 · 6 comments

Comments

@djrrb
Copy link
Sponsor

djrrb commented Apr 25, 2017

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!

@typemytype
Copy link
Owner

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.

@djrrb
Copy link
Sponsor Author

djrrb commented Apr 25, 2017

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.

@typemytype
Copy link
Owner

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.

@djrrb
Copy link
Sponsor Author

djrrb commented Apr 27, 2017

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()

@djrrb
Copy link
Sponsor Author

djrrb commented May 16, 2017

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!

@typemytype
Copy link
Owner

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants