-
Notifications
You must be signed in to change notification settings - Fork 43
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
Multiline initial #1491
base: ctan
Are you sure you want to change the base?
Multiline initial #1491
Conversation
This appears to fix gregorio-project#1458. Please test on other systems.
There was a whole bunch of repeated code on both branches of several if statements. I've pulled that code out to reduce the if branches down to the absolute minimum.
The gre@biginitial flag is redundant. The same information can be found out by checking the value of gre@count@initiallines.
I don't know what circumstances led to this backup being put into place, but I the whole test suite passes without it, so I don't think it's necessary anymore.
We want to identify gre@knownline as a count Also adding in debug messages associated with knownline to help with the identification of when lines are processed (eventually so we can adjust the staff lines at the right places).
initialraise is already accounted for when \gre@dimen@temp@five is first established (line 402). It doesn't need to be double counted for the large initial.
This makes the height placement of the initial a function of the number of lines which wrap it rather than a fixed amount. It doesn't change anything for the 1 or 2 line initials, just makes it so that when 3 (or more) line initials are implemented, this calculation will be ready for them.
As staff lines with fewer or more than 4 lines have different heights so the position of the initial needs to be adapted as appropriate. This change fixes the new tests introduced in gregorio-project/gregorio-test@8713c85 (and amended in gregorio-project/gregorio-test@d8829fc).
We already calculate the staffheight and don't need to calculate it again here. Note: making this change reveals an off-by-one error in the manual calculation: there was an extra interstafflinespace. The number of spaces between the lines is one less than the number of lines: line-space-line
In line with 8106316 these are calculations which should have been using staffheight but weren't. Also found another off-by-one error in the placement of the above lines text. This was hidden by the fact that the size of the lyrics wasn't being taken into account. The change in gregoriotex-signs.tex did not have an off-by-one error because we're drawing the ledger line exactly one interstafflinespace above the staff. Hence, when we change to using staffheight, we still need one more factor of interstafflinespace
In semi-manual mode, only the last line of the lines wrapping the initial needs to be indicated manually (as opposed to the manual mode, where each line must be indicated).
Hmm... Another thing I noticed that still needs fixing: Right now the placement of the initial is based purely on the height of the first line (multiplied by the appropriate number of lines to lower the initial when the initial is wrapped by more than one line). Since the subsequent lines could be slightly taller or shorter, this means that 2 or more line initials may be slightly higher or lower than they ought to be (in the test case, they're all higher). Ideally I should access the actual heights of the second (and later) lines when they wrap the initial. |
I've done some more research on this and am rapidly coming to the conclusion that implementing the fully automatic multi-line initial may require changing how the lines are drawn: going from using |
Accidentally removed this when merging other branches in.
Since there are only two possible states, the code can be simplified if this flag is a boolean.
Full automation is going to require a full rewrite of how line drawing is handled, so I'm going to separate out that feature for now. @henryso what's the easiest way to access the total height of a specific line of a score (as determined on the previous run)? |
I'm working on accounting for actual line heights and came across a "magic number" in the Based on how it's being used, it appears to be like it's supposed to be the amount of additional space to add for excessively high/low elements. Does any one know why this calculation isn't using |
After some painstaking traces through the git history concerning this magic number and |
Getting the line height adjustments for variable line heights right is proving much harder than expected. @henryso, can you look at the code in my most recent commit (39d9496) and see if I'm doing anything blatantly wrong. Things aren't lining up as I would expect them to and I'm trying to figure out if that's do to my not understanding the way the line height information is stored and used, or if it's because there's something more subtle in the way the spacing around lines works. |
@rpspringuel I realize this is way late. I've been off the scene for a while due to family issues. I looked at your commit, and I can't tell why it's not working. Maybe it's some collapsed measurement in TeX, but I don't think I understand TeX at that level to give a good answer. |
With some significant refactoring and bug-fixing along the way, this PR is about supporting initials of an arbitrary number of lines explicitly.
Right now I've got two "modes" for doing so:
z
orZ
). This is the way 2-line initials are currently supported and so is set as the default.I'd like to make something which is fully automatic, but have yet to come up with a good way of tracking the automatic line endings. I've identified a point in the
post_linebreak
function where the line numbers are increasing as expected, but I'm not sure how, or even if, I can resize the lines on the lua side. Hence, I'm posting this here for some feedback.Note: This still needs some documentation work and so is not ready for merge.