Execution order of DOCUMENTEXPORTED callbacks

Is there any way to control in which order the callbacks for DOCUMENTEXPORTED are executed?

I have a plugin that build a MATH table and a plugin that saves the exported fonts as ttx dumps. Both do their work via DOCUMENTEXPORTED. Now apparently the ttx dump runs before the MATH table building, and so the MATH table is missing from the ttx file even though it is present in the exported fonts.

I think the best approach would be for these subsystem to coordinate with each other. So, the math plugin would signal that it is done and the ttx plugin listens for that event instead of the document export.

Otherwise, I don’t think that reordering the callbacks would help since that only changes the start of the work in the subsystems. You cannot know whether the work of another subsystem is already done by callback order alone.

I wonder if the order of registering of those notification plays a roll?

I tried naming the plugin aliases in the Plugins folder so that the MATH plugin comes first, but maybe they are not loaded alphabetically, at least not reliably.

Thanks, Florian. Good points about the duration of each plugin’s processing.

I’m trying to add a disable option to the MATH plugin, so that I can call the MATH table builder from my other plugin. It seems to work so far.

1 Like