-
Notifications
You must be signed in to change notification settings - Fork 44
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
Arbitrary number for \gresetinitiallines #1488
Comments
This is something that's been on my ideal list of features for a while now, but I've not had a chance to work on it. Right now the readjustment of the line length that is necessary after the initial is handled within the manual line breaks and so it's necessary for the gabc code to contain multiple There is, however, a work around for now. If
|
See #1491 for my progress on this. |
That would be almost exactly what I was thinking about, I've just never been able to figure out how to get the The thing I'm working on right now is getting the initial positioned correctly vertically (it's baseline should line up with the baseline of the last shortened line. This means calculating/predicting the heights of the lower lines because the initial is typeset at the beginning of the first line (as part of the first syllable). Unfortunately, calculating/predicting line heights of lines which haven't been printed yet is hard, and only possible in our case because of the our second pass adjustment of line heights (which means we record the information needed to make those calculations). |
The
What's the baseline of a line of music? Is it the baseline of the words? |
It's the baseline of the lowest element. That's usually the lyrics, but could be the translation (if present). If there are no lyrics then the baseline is the baseline that the lyrics would have if they were present. |
Since there's some glue between the lines, should the initial remain aligned with the lowest indented line, even if the glue stretches or shrinks? |
That has been our traditional alignment target, but to be honest as I've been working on this over the past few days I'm no longer sure that it's the correct alignment target. In general for drop caps, I think it's more usual for the top of the dropped cap to be aligned with the top of the first line (though perhaps not including extensions above the nominal top line from things like accents). If we consider the initial in a score to be a form of drop cap, should it not have a similar alignment target? Perhaps the top line of the staff? Of course, the complication here are the annotations. These go above the initial and we generally don't want them to protrude too high above the staff. Does this mean that annotations should push down the initial? Do they only do so if the are bigger than a certain size? Does the presence of above lines text, a commentary, or really high notes change this, and if so how? I feel like some effort should be taken to look at old books with various size initials and see if there is any pattern to how things are lined up. Does anyone else have any opinions on this? If we decide to keep the target alignment, #1491 is getting fairly close to getting the alignment right (I'm still missing something in my calculation of a custom line heights when variable line heights matter, look at the 2-line-initials test to see this problem, and have yet to deal with the glue issue that @davidweichiang just mentioned), but I haven't yet tried to incorporate @davidweichiang's solution for automatic adjustment of line width, so I don't know how the two will interact yet. |
Questions about #1491:
(I'm also not seeing why the variable heights computation requires a second pass, but that's a separate issue.) |
Probably. I've never really considered that option. Is it possible? My understanding has always been that our biggest hurdle is the fact that TeX processes stuff in one direction only. Thus when I'm typesetting the initial (the first, or very nearly the first) item in the score, I don't yet know things like how tall the lines will be. What I can do, and incidentally what we do with the line heights, is start with a reasonable guess and then record information about the elements that are either extremely high or extremely low as we encounter them (and figure out what line they are on). Then on a second pass we can use that information to refine our guess and repeat the process. Ideally this process will converge relatively rapidly (perhaps on the second pass) so that our guesses stop changing (and we can say we've arrived at "the solution." That's why I'm looking at our line height information and mostly reproducing the calculations associated with that (though I'm clearly missing something, since I'm not quite getting the same result).
It gets passed back to TeX by setting |
https://github.com/davidweichiang/gregorio/tree/parshape now uses Lua to calculate the vertical shift. But it will be off if the glue stretches or shrinks.
|
Looking at the above image, though, I think I agree with your suggestion that aligning the top of the initial with the top of the first line is better (not to mention easier). |
So, I've finally had a chance to look at your parshape branch and am coming up with several problems:
|
Thanks! I had not even tried running the tests yet. I can open a draft PR to make it easier to review. |
Woud it be possible to have more than 2 lines for the initial ?
I tried a workaround with
wrapfigure
, which sounds promising, but the length of the lines doesn't adjust, so they get out of margin :Perhaps it could be related to #1418
The text was updated successfully, but these errors were encountered: