Fix #198 — %%stretchlast and %%stretchstaff, as abcm2ps implements them - #211
Merged
Merged
Conversation
The last line of a tune was drawn at natural spacing, which packs eighths almost head to head next to the justified lines above it. abcm2ps 8.14.0 does two things instead, and CeolKit now does both: - %%stretchlast F (0…1, default 0.25): the last system is stretched to the line when its unstretched staff reaches 1 − F of it. The spec's logical form is accepted as 1/0. - A last system that is not stretched is spaced like the line before it, never below natural and never past the line. %%stretchstaff false stretches no system at all; ckprobe --natural now forces it, so it reports natural widths for every system. %%ceolkit:justifylast is deprecated: true/false parse as %%stretchlast 1/0 with a deprecatedDirective warning. CeolKitDirective.justifyLast(Bool) is replaced by .stretchLast(Double) and .stretchStaff(Bool), and SVGRenderConfig.justifyLastSystem by stretchLast/stretchStaff — release notes need an Upgrading entry, since the last line of most tunes changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #198
The last line of a tune was drawn at natural spacing, which packs eighths almost head to head next to the justified lines above it. It now behaves as abcm2ps 8.14.0 does (measured against its output):
%%stretchlast F(0…1, default 0.25): the last system is stretched to the line when its unstretched staff (header + music) reaches1 − Fof it. The spec's logical form is accepted as 1/0; values outside 0…1 are rejected with aninvalidStretchLastwarning, as abcm2ps rejects them.%%stretchstaff falsestretches no system at all.ckprobe --naturalnow forces it, so it reports natural widths for every system (with the rule above,%%stretchlast 0no longer gives a natural last line).API changes (need an
## Upgradingentry)%%ceolkit:justifylast true|falseis deprecated: parsed as%%stretchlast 1|0with adeprecatedDirectivewarning.CeolKitDirective.justifyLast(Bool)→.stretchLast(Double)and.stretchStaff(Bool).SVGRenderConfig.justifyLastSystem→stretchLast(default 0.25) andstretchStaff(default true).Justifier.justify/justifyGroupstakestretchLast:(and optionalstretchStaff:) in place ofjustifyLastSystem:.Tests
stretchStaff: false.%%stretchlastnumbers/logicals/invalid values,%%stretchstaff, deprecated%%ceolkit:justifylast.Docs:
EXTENSIONS.md,README.md,CLAUDE.md.🤖 Generated with Claude Code