Syllable spacing in Lua#1720
Syllable spacing in Lua#1720davidweichiang wants to merge 6 commits intogregorio-project:developfrom
Conversation
…erently from the old one, in the following ways: + The old algorithm worked by moving the last part of a syllable to the first part of the next syllable. It could therefore break ligatures between the middle and last part of a syllable. The new algorithm works by joining the text boxes together; it does not break ligatures. + If maximumspacewithoutdash > 0, the old algorithm could make the last part of a syllable "jump" across the space between syllables; the new one only rewrites syllables if they are actually touching. - The old algorithm computed syllable spacing after rewriting; the new algorithm computes them in the opposite order. This means that some syllable spacing will be slightly too big or small. This will be fixable when syllable spacing is also moved to Lua.
…calculated in TeX for now, because it's needed in a couple of places, but \GreSyllable only generates a zero-width \hskip, and the Lua code recalculates it and resizes the \hskip accordingly. The Lua syllablefinalskip calculation uses the actual begindifference of the next syllable, not the predicted one (nextbegindifference). In the old code, sometimes this prediction was wrong (gregorio-project#1723). Therefore this commit breaks several tests, but I believe they are all actually bug fixes.
|
Commit 4fa508d starts to move the calculation of Because it uses the actual Because of #1723: Because of #1724: Only miniscule changes: |
- Move syllable clearing for \GreSyllables into Lua, which works by directly measuring the distances between syllables. This fixes issue gregorio-project#1725 but also breaks tests/gabc-output/glyphs/clear.gabc because it now inserts no extra space (and never removes space). - Simplify syllable spacing by directly measuring distances between syllables, similarly to above.
|
Commit ec4e22c moves syllable clearing into Lua. The amount to shift a syllable in order to clear it is now measured exactly, whereas previously it depended on predicting the begindifference of the next syllable, as well as issue #1725. So cleared syllables are tighter than before. Breaks two new tests: |
…en a syllable and the next, a hyphen is inserted. This used to be done in \GreSyllable, but now is done in the Lua pre_linebreak filter. - Added some missing cases to \gre@calculate@eolshift - Remove TeX code computing syllablefinalskip and code that depends on it * It is still used inside the new bar spacing algorithm, but for a different purpose * There is still a macro \gre@calculate@syllablefinalskip, but it actually computes minNotesDistance and minTextDistance - Intra-line and end-of-line hyphens are now generated by the same code * One very minor side effect is that end-of-line hyphens should now be correctly kerned.
|
Commit a48c861 moves hyphenation into Lua. This was the last thing that depended on syllablefinalskip, so syllablefinalskip can be deleted from the TeX code, and perhaps it would make sense to merge (so that @lbssousa can work on #1715), after 6.2.0 of course. Some very minor benefits:
Several more tests are broken. If a hyphenated word comes before a bar, the space between them is now incorrect until bar spacing is moved into Lua. This happens in the following tests:
Miniscule differences:
More than miniscule but not worrisome in my opinion:
|
This isn't ready for merging yet, but is just here for comments.
This is aiming towards #1673, but pursuing a different strategy than what was proposed there.
The first commit (02ec952) moves syllable rewriting into Lua, which has the following benefits:
And there are still the following problems:
The first problem can be seen in the test
tex-output/syllable-rewriting/syllable-rewriting.tex
Further tests that have miniscule differences:
gabc-output/glyphs/torculus_resupinus_quilisma.gabc
gabc-output/glyphs/torculus_resupinus.gabc
gabc-output/slurs.gabc
gabc-output/FactusEst.gabc
tex-output/dominican-flats/dominican-flats.tex
tex-output/SalveReginaOP/SalveReginaOP.tex
tex-output/bugs/fix-595/fix-595.tex
tex-output/bugs/fix-1110/fix-1110.tex
tex-output/lyric-centering/lyric-centering.tex
Tests that have big changes:
Closes #1719.