-
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
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. |
Running the tests is SOP for me. I find if I go to long without running my changes through the tests I end up breaking something accidentally that takes me forever to find. |
I think the above issues are fixed. 1-2 are easy. 3 is fixed in Lua (add the depth of the descender to the depth of the k-th line), and 5 is also fixed in Lua and I hope it's not too ugly. I can't reproduce 4. |
I believe the tests that are now failing are all because the placement of the initial is not the same as before for 2-line initials. What would you think about adding a
And The reason for the odd choice of |
I confirm the fixes to 1 & 2. 4 is no longer appearing for me, so that may have been caused by one of the others. 5 appears to be fixed as the tests with commentary no longer fail. I am, however, getting some strange extra spacing above scores with multi-line initials: That's the illumination test, but I see the same in some other tests. The blue is the new result, the red the expectation. You can see the whole score has been pushed down a fair bit. The second score is even worse since it's being pushed down twice. Of the various tests where I'm seeing the issue, none have commentary and the worst are the ones with annotations, but I'm not seeing it on all tests with annotations, just all tests with 2-line initials:
I've been running against develop branch in the test repository for the moment, so I don't have tests with more than 2-line initials. The output reminds me of the stray |
Thanks -- previously I thought the discrepancy was small, but that's huge. |
I've now added a gregorio-project/gregorio-test#358 to look specifically at this version of multi-line initials. The modified version of the multi-line initial test really shows the excess space. Said space, however, is increasing with the size of the initial, so I don't think it's a matter of stray uncommented lines. I would expect uncommented lines to introduce the same amount of extra space in each case. As for your diff file, your blue background is the problem. The diff colors are blue and red, blue for new result, red for expectation (gray is used for pixels which are the same). To view the image diffs correctly you need to have the paper rendered in white (or at least some color other than blue, red, and gray). |
The problem was that (after removing a |
An alternative to my suggestion above: add options
and for completeness
|
I am late to the party (and understand that time is of the essence if you are aiming to include this in TeXLive 2025; I have been particularly hoping that some of the already-merged changes get released so I don't want to delay this) Fr Samuel may remember my related issue mentioned on the mailing list that the current drop cap pushes too far down if it's a letter J (so all of the Jesu examples…). And as someone who makes use of the greannotation feature, I would strongly suggest looking in particular at the 1949 Liber antiohonarius and the 1908 gradual (both versions) and the Solesmes 1961 version. I don't plan on using a multiline initial but I'm happy if that can be done. There are some elegant examples in the 1949 LA. |
I like the term "anchor" for this and think we might adopt that over on the annotation side, but I'd make that a different PR. What are the desirable anchors for the initials? For the Finally, mindful of the timeframe, which of these can we implement quickly and which are doable but will take time we don't really have right now. The TL pretest begins Saturday. Any feature we can't close out by the end of the week should be postponed to the next release. |
After looking at the results of #1608, I came to think that the only reasonable options were:
Both can of course be adjusted using When a 2-line initial's baseline is aligned to the lower baseline, it creates to me an optical illusion that the initial should be read with the second line. Also, computing the lowering distance takes a lot of code. I'd be happy deleting that code. |
Those are, to me, the most logical ones and I’d be happy with just having them at this point. If some of the other options are requested after people start using the new feature, we can look at adding them as an enhancement. It’s not like we’re going to lose the progress we’ve made towards the ones we’ve been working on. It will always be there in the commit history if we need to resurrect it. Sent with GitHawk |
If the default \greinitialraise is 0, then I imagine it will collide with the annotation. And it doesn't seem right for there to be a different default depending on \gresetinitiallines, does it? |
I think it'll only collide if the annotation is multi-line or has a significant descender. I'm looking through the tests and noticing that the vertical distance collapse that get's rid of the extra space above the initial is also collapsing distances that are intentional. Look at tex-output/per-line-multi. That test deliberately introduces lots of extra space on some of the lines. All that extra space is removed now. |
I'll take a good look at that test. However, I've noticed that that test sometimes fails, and when I re-run it, it passes. (I can't remember which PR I've noticed this for.) Is that the case for you? |
I don't think I've noticed that with this particular test, but I have noticed that phenomena with other tests. I thought it was just because I was doing to many things at once and had accidentally changed my gregoriotex installation in the middle of the test suite, but if you're seeing it too, then it's probably a real issue. Maybe something wrong with how the correct number of LuaLaTeX passes is detected? The intermittent nature of the failure is what I don't get at the moment. |
I have a guess but haven’t looked into it: the Lua code triggers a rerun if
the keys of the line_heights table changes, but doesn’t check if the values
changed.
…On Wed, Feb 5, 2025 at 09:28 Br. Samuel Springuel ***@***.***> wrote:
I don't think I've noticed that with this particular test, but I have
noticed that phenomena with other tests. I thought it was just because I
was doing to many things at once and had accidentally changed my
gregoriotex installation in the middle of the test suite, but if you're
seeing it too, then it's probably a real issue. Maybe something wrong with
how the correct number of LuaLaTeX passes is detected? The intermittent
nature of the failure is what I don't get at the moment.
—
Reply to this email directly, view it on GitHub
<#1488 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKVY2LBHP3YVWSDROIPCLT2OINY3AVCNFSM6AAAAABV7NQKFOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMZXGAYDIMBQGE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Either I'm not seeing the problem on my end, or the latest commit fixed it. These are the tests that are failing for me:
The high-bars ones are very slight differences that don't appear to have anything to do with initials; the others are all because the placement of 2-line initials changed. |
Very open to better ideas for the options, since I don't know much about what is needed. A simpler setup could be a single command |
I think the way you've set up the options is a good way of handling it. Fundamentally we have to pick the location on two different objects (the initial and the score) which are going to be the alignment base point, so it makes perfect sense to me that there be two settings, one for each object. That's how we do it for the annotations, though I much prefer the word For the other, Can you push those option changes so that I can look at how the tests are affected? |
Yes, they're pushed. The reason that some more tests fails is probably boring but I can offer my guess if you want. Summary of options:
Does it bother you that In any case, note that |
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: