Fix #203 — %%scale and %%pagescale, as abcm2ps implements them - #210
Merged
Merged
Conversation
%%scale S and %%pagescale F (= %%scale 0.75 × F) are parsed in the file header, tune header and tune body, with abcm2ps's generation scope: a file value governs the tunes after it, a tune's own governs that tune, and the last one written wins. A body directive scales the whole tune and says so with a scaleAppliesToWholeTune note. With no directive a document renders at abcm2ps's default %%scale 0.75 (4.5 pt staff space). The scale applies to the music and to every piece of text the tune sets — title block and W: words included — but not to the page, its margins or the footer. Default font sizes are now abcm2ps's, in its nominal units, scaled with everything else. SVGRenderConfig.scale is the host default (abcm2ps's -s); scaledStaffSize is the drawn staff space. %%ceolkit:scale F now means %%pagescale F and emits a deprecatedDirective warning. ckprobe --scale/--sweep set %%scale. Canzonetta (§14.4, %%scale 0.7) now prints on one page with a 22.4 pt title, as abcm2ps does; the tunebook fixture paginates to 15 pages, the same as abcm2ps 8.14. Snapshots re-recorded after a visual comparison. 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 #203
Summary
%%scale Sand%%pagescale F(≡%%scale 0.75 × F) are implemented with abcm2ps's behaviour and generation scope: file → following tunes, tune → that tune, last value wins. A body directive scales the whole tune and gets aninfonote (scaleAppliesToWholeTune).%%scale 0.75(staff space 4.5 pt instead of 6).W:words. The page, margins and%%footerdo not.SVGRenderConfig.scale(default 0.75) is the host default, like abcm2ps's-s;scaledStaffSizeis the staff space as drawn.%%ceolkit:scale F≡%%pagescale F, with adeprecatedDirectivewarning (decision B).ckprobe --scale/--sweepset%%scale.EXTENSIONS.md,CONFORMANCE.md(§11.4.3, font table),README.md,CLAUDE.md.Checked against abcm2ps 8.14
%%scale 0.7now prints on one page with a 22.4 pt title, as abcm2ps does (new tests).tunebook.abcpaginates to 15 pages, the same count as abcm2ps (was 16). The Parting Glass now fits under The Radar Racketeer on page 3; abcm2ps starts it on page 4.Test changes
Geometry tests that used
SVGRenderConfig().staffSizeas the drawn staff space now usescaledStaffSize; a few tolerances moved from 1e-6/1e-9 to 1e-3 for rounded SVG coordinates; three tests got more music so they still overflow a line or page. Tests that used%%ceolkit:scaleas a tool now use%%pagescale.Upgrading
%%scale 0.75. More fits on a line and a page, so line and page breaks move. For the old size, add%%scale 1(≡%%pagescale 1.333) or setSVGRenderConfig.scale = 1.%%ceolkit:scale Fis deprecated and now means%%pagescale F: it scales the title block and words too, and the same value prints at 75% of its former size.Test plan
swift buildswift test— all suites pass🤖 Generated with Claude Code