verovio icon indicating copy to clipboard operation
verovio copied to clipboard

adjustPageWidth & different system widths

Open frjurado opened this issue 1 year ago • 4 comments

Describe the problem I don't know if I'm missing something here, but the adjustPageWidth option results in different system widths.

To Reproduce I'm sharing a minimal example, based on the First Steps tutorial:

<html>
  <head>
    <script src="http://www.verovio.org/javascript/latest/verovio-toolkit-wasm.js" defer></script>
    <script>
      document.addEventListener("DOMContentLoaded", (event) => {
          Module.onRuntimeInitialized = async _ => {
            let tk = new verovio.toolkit();
            console.log("Verovio has loaded!");
            tk.setOptions({
              scale: 30,
              adjustPageWidth: true
            });

            fetch("https://www.verovio.org/examples/downloads/Schubert_Lindenbaum.mei")
              .then( (response) => response.text() )
              .then( (meiXML) => {
                let svg = tk.renderData(meiXML, {});
                document.getElementById("notation").innerHTML = svg;
              });
          }
      });
    </script>
  </head>
  <body>
    <h1>Hello Verovio!</h1>
    <div id="notation"></div>
  </body>
</html>

Expected behavior I'm sharing screen captures of both the un-aligned and expected results.

Verovio information

  • Latest version, 3.11.0, JavaScript toolkit

Environment information (as appropriate)

  • Windows 10, Chrome 103

current expected

frjurado avatar Aug 07 '22 21:08 frjurado

By using adjustPageWidth you're saying explicitly "don't justify the system, and cut off whitespace". It should be used for single system layouts only, see the original issue #272.

It's not a bug, it's a feature.

rettinghaus avatar Aug 08 '22 07:08 rettinghaus

Ok then. In that case, shouldn't the docs be more specific? I didn't find that obvious at all...

frjurado avatar Aug 08 '22 08:08 frjurado

Maybe it would be a good idea to throw a warning if you mix incompatible features?

rettinghaus avatar Aug 08 '22 09:08 rettinghaus

That seems appropriate.

frjurado avatar Aug 08 '22 21:08 frjurado

Done here

lpugin avatar Sep 29 '22 12:09 lpugin