Model cuts as polylines, not horizontal lines

Page 1 of Engel (Bosse/Partitura) has a boxed VERSE 1 label in the left
margin at the same rows as the preceding system's bass lyric line — ink
on both sides of the page throughout the band, so no horizontal line
separates them. The label belongs to system 2, the lyrics to system 1.

A cut is therefore a polyline spanning the page, two points being the
ordinary straight case. A slice bounded by a non-straight cut is not
rectangular: its image is the region's bounding box with everything
outside made transparent, which composites invisibly on the viewer's
sheet. Masking paints transparency, never white.
This commit is contained in:
Esa Kataja
2026-07-28 22:22:03 +03:00
parent 46ae7e813a
commit 01227b3382
2 changed files with 31 additions and 9 deletions
+15 -8
View File
@@ -20,9 +20,11 @@ _Avoid_: mode, format
**Slice**: **Slice**:
The atomic visual unit of a song — one *system*, one full line of music across The atomic visual unit of a song — one *system*, one full line of music across
all voices, typically 412 bars with lyrics intact. Same definition as noteman's. all voices, typically 412 bars with lyrics intact. Same definition as noteman's.
Structurally, a horizontal region of a page: a page begins as a single slice and Structurally, a region of a page bounded above and below by cuts: a page begins
each cut splits one slice into two, so slices always tile the page with no gaps as a single slice and each cut splits one slice into two, so slices always tile
and no overlap. the page with no gaps and no overlap. Rectangular when its cuts are straight,
and stepped when they are not — the slice image is then its bounding box with
everything outside the region transparent.
_Avoid_: segment, strip, row, band _Avoid_: segment, strip, row, band
**Discard**: **Discard**:
@@ -76,11 +78,16 @@ living unenforced in two repos, and a score with two codas simply works.
_Avoid_: link, reference, pointer _Avoid_: link, reference, pointer
**Cut**: **Cut**:
A horizontal line placed on a page that splits one slice into two. Straight at A boundary placed on a page that splits one slice into two. Modelled as a
first; a later polyline form handles pages where systems slant or interleave. **polyline** spanning the page from left edge to right edge, with two points —
Placement is forgiving — anywhere inside the whitespace gap yields the same a straight horizontal line — as the ordinary case. Extra vertices handle the
output, because trim crops to ink afterwards. common publisher habit of printing a section label (`VERSE 1`, `INTRO`) in the
_Avoid_: split, divider, break left margin at the same height as the previous system's lyrics: the cut steps
above the label on the left and below the lyrics on the right.
Placement along the boundary is forgiving — anywhere inside the whitespace yields
the same output, because trim crops to ink afterwards.
_Avoid_: split, divider, break, cut line
**Content rectangle**: **Content rectangle**:
The region of a page that holds music. Set per PDF, adjustable per page, applied The region of a page that holds music. Set per PDF, adjustable per page, applied
+16 -1
View File
@@ -89,9 +89,24 @@ cuts at the page edges. Modelling a slice as "the region between two cuts" leaks
page 2 has no header, so it would need an invented top cut whose position depends page 2 has no header, so it would need an invented top cut whose position depends
on whether that page happens to have one. on whether that page happens to have one.
Cut placement is forgiving — anywhere inside the whitespace gap yields the same Cut placement is forgiving — anywhere inside the whitespace yields the same
output, because trim crops to ink afterwards. output, because trim crops to ink afterwards.
**A cut is a polyline, not a line.** Two points — a straight horizontal
boundary — is the ordinary case and what detection proposes. Extra vertices exist
because publishers routinely print a section label in the left margin at the same
height as the *previous* system's lyrics. On page 1 of *Engel* (Bosse/Partitura
edition), the boxed `VERSE 1` label and the preceding system's bass lyric line
occupy the same rows: ink is present on both sides of the page throughout that
band, so no horizontal line separates them. `VERSE 1` belongs to system 2, the
lyrics to system 1. The cut has to step — above the label on the left, below the
lyrics on the right.
A slice bounded by a non-straight cut is **not rectangular**. Its image is the
bounding box of the region, with everything outside the region made transparent.
That composites invisibly on the viewer's sheet, so nothing downstream needs to
know. This is also why masking must paint transparency rather than white.
### Content rectangle ### Content rectangle
The region of a page that holds music, set per PDF and adjustable per page, The region of a page that holds music, set per PDF and adjustable per page,