Export Callback

It would be nice to have access to the corresponding GSInstance in the export callback function, not only the path of the exported font file. For example, if I want to read my own custom parameter from the instance or GSFont and apply some changes based on that to the exported font.

I also noticed that the export callback is apparently not triggered when exporting variable fonts!?

The current callback happens when everything is done. Is that the right time for you? I can add the instance to the callback.

Yes, that’s fine. I was thinking of postprocessing the exported font file, like copying it to a folder and adding a ttx dump, committing to a versioning system etc. For most of this you don’t need access to the GSInstance, but it can be useful for some things.

I change this, so the scripts need adjusting. you get a dict with “fontFilePath” and “instance” as keys.

1 Like

It seems the fontFilePath is missing the font file name now. Is there another way to get the file name in the callback?

NSConcreteNotification 0x600002044fe0 {name = GSDocumentWasExportedNotification; object = {
    fontFilePath = "/Users/jk/Documents/Schriften/MyFont/fonts/ttf";
    instance = "GSInstance <0x608000309120>: Book (90, 100, 0)";

Fixed it.

Is it already fixed in build 1153? It looks like it is still missing there.

Will be in the next update.