paulrosen / abcjs

javascript for rendering abc music notation
Other
1.9k stars 281 forks source link

Abcjs currently wraps not taking text length into account #509

Open rualark opened 4 years ago

rualark commented 4 years ago

image

%%barnumbers 1
Q:1/4=140
M:4/4
K:C
L:1/16
V: V0 clef=treble name="Sop."
[V: V0]"^!""_VII6""^ok"G8e8-|"^ø""^?""_VI6"e4"^ø"d2"^ø"c2"^!"d4F4|z8"^ok"C4c4|B4e4E4z4|z16|"^ok"E8e8-|e4d2c2d4F4|z8z8|"^ok"E8e8-|e8d8|F8z8|"^ok"E8e8|d8f8|F8z8|"^too far (even with descend)"E4e4d4a4|A4B4G4z4|"^ok"E8e8-|e4d2c2d8|D8E8|z16|"^no (only 2, 3, 5 species)"E16|e16|d16|g16|G16|z16|"^ok"E8e8-|e8d8|f8F8|z16|"^ok"E8e8|c8d8|e8E8|F8z8|"^too far"E8e8-|e8d8|f8e8|E8z8|"^too far"E8e8|d8a8|A8B8|F8z8|z16|

Not sure if this should be fixed. Probably not.

nbruley commented 2 years ago

Is there a workaround for this? e.g. to wrap the text for abcjs-meta-bottom class?

paulrosen commented 2 years ago

Not yet. Are you suggesting to go to two lines in the above case? I was thinking about pushing the string to the left as much as it needs to be, but either way would look better than it currently does but would also have cases where it wouldn't look good.

nbruley commented 2 years ago

Yes, I was thinking to wrap to two lines. My use case is a copyright statement at the bottom of the score since copyright administrators specify to put it at the bottom. Wrapping would enable the text to show in its entirety in abcjs-meta-bottom.

My workaround is to put the statement outside of abcjs, but the problem with that is the other bug causes the notation container to be much longer than the notation itself, so the copyright statement is miles below the score.