This PR makes the various asyncLoad implementations (node, esm, and system) operate more consistently, and updates their tests. In particular, relative file names are resolved using the root directory, while other names are used as is. That allows using package names like mathjax-full, for example (at least in the implementation where that is possible).
In addition, there is a new flag that indicates whether the asyncLoad command is synchronous, use by the font's dynamic file loading command loadDynamicFilesSync() to determine if it can work or not.
There is also a fix to FontData.js that resolves a problem with having removed the .js from file names, which are needed by asyncLoad().
The asyncLoad/node.js implementation is modified to be able to be used by both ESM and CJS modules (by calling on the #source/srouce.js file to obtain the __dirname value used to construct the root).
Finally, all the tests are updated to include tests for non-relative file names, and for the synchronous flag.
This PR makes the various
asyncLoad
implementations (node
,esm
, andsystem
) operate more consistently, and updates their tests. In particular, relative file names are resolved using theroot
directory, while other names are used as is. That allows using package names likemathjax-full
, for example (at least in the implementation where that is possible).In addition, there is a new flag that indicates whether the asyncLoad command is synchronous, use by the font's dynamic file loading command
loadDynamicFilesSync()
to determine if it can work or not.There is also a fix to
FontData.js
that resolves a problem with having removed the.js
from file names, which are needed byasyncLoad()
.The
asyncLoad/node.js
implementation is modified to be able to be used by both ESM and CJS modules (by calling on the#source/srouce.js
file to obtain the__dirname
value used to construct theroot
).Finally, all the tests are updated to include tests for non-relative file names, and for the synchronous flag.