Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vertical spacing with line breaks and above-line text #533

Closed
rarty opened this issue Jul 1, 2015 · 6 comments
Closed

Vertical spacing with line breaks and above-line text #533

rarty opened this issue Jul 1, 2015 · 6 comments
Assignees
Milestone

Comments

@rarty
Copy link

rarty commented Jul 1, 2015

In a score with manual line breaks and above-line text, the vertical spacing between the bottom of the 'lyric' line and the top of the above-line text of the next line can be inconsistent. It seems that in this case, the distance abovelinestextheight is added to all the lines with above-line text, except for the first line past the manual line break.

(Here abovelinestextheight is set to 1 cm to emphasize the difference)

(c4)Ma(f)gní(gh)fi(h)cat(h.) (::Z)
Ma(f)gní(gh)fi(h)cat([alt:Above-line text]h.) (::Z)
Ma(f)gní(gh)fi(h)cat([alt:Above-line text]h.) (::)

screen shot 2015-06-30 at 9 27 13 pm

In the case of a score with no manual line breaks, it seems abovelinestextheight is not added at all.

(c4)Ma(f)gní(gh)fi(h)cat(h.) (::)
Ma(f)gní(gh)fi(h)cat(h.) (::)
Ma(f)gní(gh)fi(h)cat(h.) (::)
Ma(f)gní(gh)fi(h)cat(h.) (::)
Ma(f)gní(gh)fi(h)cat(h.) (::)
Ma([alt:Above-line text]f)gní(gh)fi(h)cat(h.) (::)
Ma(f)gní(gh)fi(h)cat(h.) (::)
Ma(f)gní(gh)fi(h)cat(h.) (::)
Ma(f)gní(gh)fi(h)cat(h.) (::)
Ma(f)gní(gh)fi(h)cat(h.) (::)
Ma([alt:Above-line text]f)gní(gh)fi(h)cat(h.) (::)
Ma(f)gní(gh)fi(h)cat(h.) (::)
Ma(f)gní(gh)fi(h)cat(h.) (::)
Ma(f)gní(gh)fi(h)cat(h.) (::)
Ma(f)gní(gh)fi(h)cat(h.) (::)
Ma(f)gní(gh)fi(h)cat(h.) (::)
Ma([alt:Above-line text]f)gní(gh)fi(h)cat(h.) (::)

screen shot 2015-06-30 at 9 39 39 pm

I'm not sure what the correct behavior should be (with or without the added space).

I have noticed this for some time, so I don't think it is a behavior introduced recently, but the testing I did just now was using build 54a3036 from the develop branch.

@henryso
Copy link
Contributor

henryso commented Jul 1, 2015

I noticed, while I was adding the variable line height implementation, that gregorio was only setting spaces below the line at the start of a score. Though this didn't seem congruent with manual line breaks, not knowing any better, I just assumed that was the correct behavior. What you see appears to be consistent with what I saw (though, in my case, it wasn't with the above line text height). As for me, I would think that the space should be added regardless of whether there is a manual line break, but I don't know if this was done intentionally for some reason or is just an oversight.

As @rpspringuel is intimately familiar with the spacing code, he might be the best person to answer the question of intention.

@henryso
Copy link
Contributor

henryso commented Jul 1, 2015

Thinking about this more, I'm beginning to feel that:

  1. When GregorioTeX is in uniform line height expansion mode, the above lines text space and the space for anything else above and below the line should be added uniformly. This means that the values computed by gregorio (the executable) for top/bottom height as well as for translation space and above lines text space should all be added to all lines so that the lines are uniform.
  2. When GregorioTeX is in variable line height expansion mode, the Lua algorithm needs to determine whether there is above lines text or translation space for the given line and add the spaces as necessary, per line.

What does everyone think? Does this sound correct? Or should above lines text and translation text be considered "outside" the staff and be allocated space uniformly, regardless of expansion mode? Or is there a better way?

@eroux
Copy link
Contributor

eroux commented Jul 1, 2015

Agreed!

@eschwab
Copy link
Contributor

eschwab commented Jul 1, 2015

I most certainly agree. Since most of the hard work was done for #59 it makes sense to have all the lines taken into account in variable mode.

@rpspringuel
Copy link
Contributor

I agree as well. Frankly, I never realized this was a problem because my work on the spacing code had more to do with how spaces were stored and used rather than in when they were calculated and/or used.

@henryso henryso added this to the 4.0 milestone Jul 1, 2015
@henryso henryso self-assigned this Jul 1, 2015
henryso added a commit to henryso/gregorio that referenced this issue Jul 2, 2015
Variable line height algorithm now includes translation and above lines text
spaces in the computation.  Uniform line height algorithm now adds translation
and above lines text spaces to all lines uniformly.

Fixes gregorio-project#533.
@henryso
Copy link
Contributor

henryso commented Jul 2, 2015

The fix in #534 is ready for review.

@henryso henryso closed this as completed Jul 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants