Closed rettinghaus closed 3 years ago
@rettinghaus is this issue different than #1708 ? Please elaborate a bit if so. Otherwise can close it.
Yes, it is different. Passing engravingDefaults: "non-existent-file"
does not throw an error. Even if you pass a correct file, the function Options::Sync
isn't called.
And wouldn't it make sense for the toolkit to pass complete engravingDefaults JSON within the JSON object containing the options?
How are you passing the file? My understanding is that, as it stands, it cannot work.
The way I think you can make it work would be to:
OptionJson::SetValue
taking a JSON string as parameter and not a filename, andmain.cpp
to have it reading the file and passing its content instead of passing the filename - with a check on the option type similar to https://github.com/rism-ch/verovio/blob/375ee1e6a6e8765cf22467316a50741197259db9/tools/main.cpp#L280-L283.
For the JS toolkit, I think then JSON within JSON would work.The problem I can see with this is that it would then not work with a file with other bindings (e.g., the Python one). So other people will complain, and I agree it would be confusing. So to make it clear, we could have a --engraving-defaults-file but only for the C++ toolkit, which would work as described above, and then have --engraving-defaults only supporting JSON with JSON for other bindings. (It should actually also work for the C++ toolkit)
This is also now implemented properly.
The newly added support for
engravingDefaults
is not working in the toolkit. I don't know how to fix this, and the toolkit documentation is still under development.