moinejf/abc2svg

%%linewarn 0 does not filter "line too much shrunk"

Closed this issue · 10 comments

bwl21 commented

I do not manage to suppress "line too much shrunk" by %%linewarn 0

I think in music.js line 4323 it should be

if (cfmt.linewarn) {
	error(0, s, "Line too much shrunk $1 $2 $3",
		xmin.toFixed(2),
		x.toFixed(2),
		width.toFixed(2))
}

This message should not be a warning.
Normally, abc2svg tries to cut the music into lines so that there should be room enough for the selected symbols in each music line.
But this job is done before a detailed computation, so, it may occur that there are too many symbols in a music line. In this case, this message indicates that there are glyph clashes in the rendering and that some manual adjustment has to be done.
It won't be honest to remove it!

bwl21 commented

I Just thought because http://moinejf.free.fr/abcm2ps-doc/linewarn.xhtml says:

When set, raise a warning when there are too few or too many elements in a music line.

And linewarn allows the user to suppress it. If he turns it off, It would be honest to suppress the message.

Normally, the message "Line too much shrunk" should never appear. If it does, this means that there is a problem in the music line computation. Have you such examples? (BTW, I will change the documentation)

bwl21 commented

I have sent the example on PM.

To be honest, i would prefer that linewarn suppresses both, overfull and underful messages. As the focus in Zupfnoter is on the music model rather than on the generated notes, such messages might be annoying for my users.

Thanks for the example. Fixed by commit 3ef1f49.

bwl21 commented

Thanks for the fix. The error is gone.

Of course it is your decision to flag overfull lines as error. Does it mean that incase of overfull lines, the notes overlap each other?

I tried to produce this situation, but was not successful since abc2svd adds linebreaks, even if I have I:linebreak $. Is this intended?

It appears to me that '$' always marks a line break regardless of the linebreak header.

X:1
I:linebreak *
K:C
V:1
CCCC| CCCC | CCCC |CCCC| CCCC |*  dddd | $ cccc | eeee | CCCC |* CCCC |CCCC| CCCC | CCCC |

yields

screenshot_1034

About line overflow, as you saw, the symbols are closer than normal, but, as there are some free pixels between them, there may be no clash.

abcm2ps and abc2svg have been designed so that people don't have to worry about line breaks. These ones are inserted when needed to avoid symbol clashes.

Otherwise, the line break table was not fully reset when setting new line breaks. This bug is fixed. Thanks.

bwl21 commented

I tried with v1.15.0-30-g114068d

X:1
T:handling linebreaks in abc2svg
F:3050_handling-linebreaks-in-abc2-svg
I:linebreak *
I:measurenb 1
I:linewarn 0
K:C
V:1
CCCC| CCCC | CCCC |CCCC| CCCC |*  dddd | $ "^no line break here" cccc | eeee | CCCC |* CCCC |CCCC| CCCC | CCCC |
%
W:Expected result:
W:.
W:Linebreak shoud not appear in measure 7

it still yields a line brea in measure 7

screenshot_1036

p.S. I am currently working on a test suite. It did not detect a difference in the generated html but detected other changes I have done in the testfiles.

I have not this behaviour.
May you look (printErr / debug) in the function set_linebreak():

  • at the end of the first loop, there should be pointers to 'nil' in char_tb[0x0a] and char_tb[0x24],
  • and same at the end of the function. Only char_tb[0x2a] should point to "\n".
bwl21 commented

shame on me .. after running ninja, I don't have this behaviour either.

I am working on a regression test suite - which now performs ninja as well :-) It also exposed that abc2svg now throws a message "Error: Bad character '$'" which is obviously expected.

I close this.