Loading…
Loading…
Rule
Gradus GE-146 · cite this code — it is permanent. Rule id spacing-accidental-width-unmodeled
An accidental sits to the left of its notehead and needs its own reserved horizontal room — Gould and Ross both treat accidental clearance as a first-class width contributor, not an afterthought absorbed into general note spacing; SMuFL glyph-advance metadata gives each accidental its own width the layout engine must add.
`fixedExtras = FIXED_EXTRAS_BASE + keySigExtra + barlineCount * 12` (line 797) reserves width for the KEY SIGNATURE's accidentals but nothing for accidentals attached to individual notes via `Accidental` modifiers (lines 1009-1011, `sn.addModifier(new Accidental(vk.acc), idx)`). `formatW = maxBeats * beatW + maxNoteCount * NOTE_PAD` (line 829) has no accidental term at all. A passage in C major with heavy chromatic alteration (secondary dominants, a raised leading tone in every bar) gets zero extra width reserved for any of those accidentals in the pre-render estimate, even though VexFlow's real Formatter WILL widen for them at draw time — the pre-render `staveW` can be too narrow for what the Formatter then has to fit into it.
Gould, Behind Bars, accidentals chapter (placement and clearance); Ross, The Art of Music Engraving (accidental spacing tables — an accidental 'borrows' width from the space before its note); SMuFL/Bravura glyph metadata, measured directly from Gradus's own bundled font (`node_modules/vexflow/src/fonts/bravura_glyphs.ts`).
This rule needs the notated content and the rendered result together — the score says what should happen, the page says whether it did.
Gradus GE-146 — Accidentals must add horizontal width to their note's column, and the pre-render estimate must account for it. Gradus Engraving Rulebook v1.0. https://gradusmusic.com/engraving/rule/spacing-accidental-width-unmodeled
Rulebook v1.0 · text licensed CC-BY-4.0 · machine-readable at /api/v1/engraving/rules/spacing-accidental-width-unmodeled