vexflow 5.3.0 → 5.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/README.md +2 -0
  2. package/build/cjs/vexflow-bravura.js +2 -2
  3. package/build/cjs/vexflow-bravura.js.map +1 -1
  4. package/build/cjs/vexflow-core.js +2 -2
  5. package/build/cjs/vexflow-core.js.map +1 -1
  6. package/build/cjs/vexflow-debug-with-tests.js +4189 -772
  7. package/build/cjs/vexflow-debug-with-tests.js.map +1 -1
  8. package/build/cjs/vexflow-debug.js +4323 -906
  9. package/build/cjs/vexflow-debug.js.map +1 -1
  10. package/build/cjs/vexflow.js +2 -2
  11. package/build/cjs/vexflow.js.map +1 -1
  12. package/build/esm/src/alternatingtremolo.js +68 -0
  13. package/build/esm/src/annotation.js +19 -3
  14. package/build/esm/src/articulation.js +5 -1
  15. package/build/esm/src/beam.js +13 -0
  16. package/build/esm/src/bend.js +57 -6
  17. package/build/esm/src/clef.js +3 -0
  18. package/build/esm/src/continuouslayout.js +681 -0
  19. package/build/esm/src/continuousspan.js +159 -0
  20. package/build/esm/src/curve.js +21 -2
  21. package/build/esm/src/easyscore/composition.js +13 -2
  22. package/build/esm/src/easyscore/policies.js +6 -3
  23. package/build/esm/src/engravinggeometry.js +8 -1
  24. package/build/esm/src/factory.js +16 -4
  25. package/build/esm/src/font.js +9 -1
  26. package/build/esm/src/fretdiagram.js +77 -0
  27. package/build/esm/src/guitargesture.js +33 -0
  28. package/build/esm/src/guitarmodifiers.js +26 -0
  29. package/build/esm/src/index.js +8 -0
  30. package/build/esm/src/instrumentprofile.js +123 -0
  31. package/build/esm/src/keysignature.js +23 -1
  32. package/build/esm/src/notationspelling.js +73 -0
  33. package/build/esm/src/note.js +3 -0
  34. package/build/esm/src/ornament.js +5 -0
  35. package/build/esm/src/pagebreaks.js +58 -0
  36. package/build/esm/src/pedalmarking.js +39 -17
  37. package/build/esm/src/phraselayout.js +503 -0
  38. package/build/esm/src/phraseribbon.js +28 -0
  39. package/build/esm/src/publication.js +402 -0
  40. package/build/esm/src/publicationview.js +114 -0
  41. package/build/esm/src/scorenavigation.js +172 -0
  42. package/build/esm/src/sheet.js +14 -2
  43. package/build/esm/src/stave.js +33 -16
  44. package/build/esm/src/stavebarline.js +5 -7
  45. package/build/esm/src/staveconnector.js +1 -0
  46. package/build/esm/src/stavehairpin.js +53 -27
  47. package/build/esm/src/stavenote.js +6 -1
  48. package/build/esm/src/stavetie.js +27 -2
  49. package/build/esm/src/strokes.js +4 -0
  50. package/build/esm/src/system.js +19 -4
  51. package/build/esm/src/systembreaks.js +42 -0
  52. package/build/esm/src/tabnote.js +6 -1
  53. package/build/esm/src/textbracket.js +24 -5
  54. package/build/esm/src/timesignature.js +15 -6
  55. package/build/esm/src/tuplet.js +1 -0
  56. package/build/esm/src/version.js +3 -3
  57. package/build/esm/src/vexflow.js +16 -0
  58. package/build/esm/src/voice.js +7 -3
  59. package/build/esm/tests/engraving/continuous-studies.mjs +140 -0
  60. package/build/esm/tests/engraving/instrument-studies.mjs +273 -0
  61. package/build/esm/tests/engraving/phrase-studies.mjs +63 -0
  62. package/build/esm/tests/engraving/publication-studies.mjs +87 -0
  63. package/build/esm/tests/engraving/specialist-studies.mjs +347 -0
  64. package/build/esm/tests/engraving/studies.mjs +88 -0
  65. package/build/esm/tests/node/continuous-score-tests.mjs +282 -0
  66. package/build/esm/tests/node/instrument-profile-tests.mjs +224 -0
  67. package/build/esm/tests/node/phrase-layout-tests.mjs +281 -0
  68. package/build/esm/tests/node/publication-tests.mjs +219 -0
  69. package/build/esm/tools/easyscore-structure.mjs +1 -1
  70. package/build/esm/tools/explorer/catalog/entries.mjs +2 -1
  71. package/build/esm/tools/explorer/catalog/expression.mjs +14 -9
  72. package/build/esm/tools/explorer/catalog/guitar.mjs +238 -0
  73. package/build/esm/tools/explorer/catalog/layout.mjs +8 -6
  74. package/build/esm/tools/explorer/catalog/notes.mjs +16 -14
  75. package/build/esm/tools/explorer/catalog/staves.mjs +12 -6
  76. package/build/esm/tools/explorer/catalog/strings.mjs +10 -7
  77. package/build/types/src/alternatingtremolo.d.ts +13 -0
  78. package/build/types/src/annotation.d.ts +9 -0
  79. package/build/types/src/articulation.d.ts +3 -0
  80. package/build/types/src/beam.d.ts +2 -0
  81. package/build/types/src/bend.d.ts +8 -0
  82. package/build/types/src/clef.d.ts +3 -0
  83. package/build/types/src/continuouslayout.d.ts +103 -0
  84. package/build/types/src/continuousspan.d.ts +60 -0
  85. package/build/types/src/curve.d.ts +11 -0
  86. package/build/types/src/easyscore/composition.d.ts +8 -0
  87. package/build/types/src/easyscore/policies.d.ts +1 -1
  88. package/build/types/src/fretdiagram.d.ts +23 -0
  89. package/build/types/src/guitargesture.d.ts +26 -0
  90. package/build/types/src/guitarmodifiers.d.ts +3 -0
  91. package/build/types/src/index.d.ts +10 -0
  92. package/build/types/src/instrumentprofile.d.ts +124 -0
  93. package/build/types/src/keysignature.d.ts +9 -0
  94. package/build/types/src/notationspelling.d.ts +25 -0
  95. package/build/types/src/note.d.ts +15 -0
  96. package/build/types/src/ornament.d.ts +3 -1
  97. package/build/types/src/pagebreaks.d.ts +26 -0
  98. package/build/types/src/pedalmarking.d.ts +9 -0
  99. package/build/types/src/phraselayout.d.ts +87 -0
  100. package/build/types/src/phraseribbon.d.ts +7 -0
  101. package/build/types/src/publication.d.ts +61 -0
  102. package/build/types/src/publicationview.d.ts +27 -0
  103. package/build/types/src/scorenavigation.d.ts +33 -0
  104. package/build/types/src/sheet.d.ts +5 -0
  105. package/build/types/src/stave.d.ts +13 -0
  106. package/build/types/src/stavehairpin.d.ts +18 -0
  107. package/build/types/src/stavetie.d.ts +5 -0
  108. package/build/types/src/system.d.ts +8 -1
  109. package/build/types/src/systembreaks.d.ts +9 -0
  110. package/build/types/src/textbracket.d.ts +7 -0
  111. package/build/types/src/timesignature.d.ts +4 -0
  112. package/build/types/src/vexflow.d.ts +16 -0
  113. package/build/types/src/voice.d.ts +2 -0
  114. package/changelog/CHANGELOG.md +8 -0
  115. package/package.json +9 -2
@@ -0,0 +1,87 @@
1
+ import { Annotation } from './annotation';
2
+ import { Articulation } from './articulation';
3
+ import { BoundingBox } from './boundingbox';
4
+ import { Curve } from './curve';
5
+ import { Element } from './element';
6
+ import { Ornament } from './ornament';
7
+ import { PedalMarking } from './pedalmarking';
8
+ import { RenderContext } from './rendercontext';
9
+ import { Stave } from './stave';
10
+ import { StaveHairpin } from './stavehairpin';
11
+ import { StaveNote } from './stavenote';
12
+ import { StaveTie } from './stavetie';
13
+ import { TextBracket } from './textbracket';
14
+ import { Voice } from './voice';
15
+ /** A syllable owns one event. Hyphens lead to the next syllable; extenders end on a named event. */
16
+ export interface PhraseSyllable {
17
+ note: StaveNote;
18
+ text: string;
19
+ hyphenAfter?: boolean;
20
+ extendTo?: StaveNote;
21
+ }
22
+ export type PhraseMark = Annotation | StaveHairpin | PedalMarking | TextBracket;
23
+ export interface PhraseLaneOptions {
24
+ side?: 'above' | 'below';
25
+ /** Pin the common baseline in staff spaces from the top line, positive downward. */
26
+ baselineSpaces?: number;
27
+ }
28
+ export interface PhraseDiagnostic {
29
+ code: 'PinnedCollision' | 'UnresolvedCollision' | 'CrossingSpans' | 'UnsupportedGeometry' | 'UnsupportedScript' | 'InvalidAnchor' | 'IterationLimit' | 'InsufficientLyricSpace';
30
+ sources: string[];
31
+ }
32
+ type Route = Curve | StaveTie;
33
+ type LocalMark = Articulation | Ornament;
34
+ /** Opt-in system-local layout. Register native spans and outside marks before formatting. */
35
+ export declare class PhraseLayout {
36
+ readonly diagnostics: PhraseDiagnostic[];
37
+ private lanes;
38
+ private routes;
39
+ private fixed;
40
+ private pins;
41
+ private managed;
42
+ private restLines;
43
+ private obstacles;
44
+ private connectors;
45
+ private messages;
46
+ private iterationLimit;
47
+ private lockedStaves;
48
+ bounds?: BoundingBox;
49
+ passes: number;
50
+ /** Include a native span or additional positioned obstacle, e.g. a tuplet on a second voice. */
51
+ addObstacle(stave: Stave, owner: Element): this;
52
+ /** Keep authored rest lines, mark placement or curve controls. Report any unresolved collision. */
53
+ pin(owner: LocalMark | StaveNote | Route): this;
54
+ /** Preserve the configured distance above this stave. */
55
+ lockStaffGap(stave: Stave): this;
56
+ /** Bound the number of staff-spacing and cross-staff beam refits. */
57
+ setPassLimit(limit: number): this;
58
+ /** Fit ties before slurs. Explicit control points remain authoritative. */
59
+ route(span: Route): this;
60
+ /** One lane aligns dynamics with wedges, or places a pedal or ottava outside earlier lanes. */
61
+ addLane(stave: Stave, marks: PhraseMark[], options?: PhraseLaneOptions): this;
62
+ /** Each whole syllable uses native text shaping and participates in ModifierContext horizontal spacing. */
63
+ addVerse(stave: Stave, syllables: PhraseSyllable[], options?: PhraseLaneOptions): Annotation[];
64
+ /** Restore derived rest positions before native formatting; preserve subsequent authored edits. */
65
+ resetPlacement(): void;
66
+ private report;
67
+ private addParts;
68
+ private measure;
69
+ /** Collect native ink once per owner. Bare staff lines constrain outside lanes but permit notes and curves. */
70
+ private collect;
71
+ private hits;
72
+ private placeRest;
73
+ private placeAttachment;
74
+ /** Inner spans reserve their ribbons first. Ties use modest quadratic lifts, slurs a wider cubic search. */
75
+ private placeRoutes;
76
+ /** Reject detached, reversed and foreign anchors before asking a mark for drawing coordinates. */
77
+ private validLane;
78
+ private lyricLines;
79
+ private placeLane;
80
+ /** Refit from the native staff positions on every format, never from the previous solution. */
81
+ format(staves: Stave[], voices: Voice[]): void;
82
+ /** Staff-space placement in renderer coordinates. The result is a snapshot after format. */
83
+ getLyricConnectors(): BoundingBox[];
84
+ /** Draw only lyric connectors; notes and registered marks retain their native rendering ownership. */
85
+ draw(context: RenderContext): void;
86
+ }
87
+ export {};
@@ -0,0 +1,7 @@
1
+ import { BoundingBox } from './boundingbox';
2
+ export interface RibbonPoint {
3
+ x: number;
4
+ y: number;
5
+ }
6
+ /** Both boundaries run from the first attachment to the last. Never sample past a thin obstacle. */
7
+ export declare function ribbonParts(upper: RibbonPoint[], lower: RibbonPoint[], padding?: number): BoundingBox[];
@@ -0,0 +1,61 @@
1
+ import type { EasyScoreCompositionSpec } from './easyscore';
2
+ import { PublicationView } from './publicationview';
3
+ import type { SVGFont } from './svgexport';
4
+ export type { PublicationRegion, PublicationView } from './publicationview';
5
+ /** Paper, staff height (four spaces), margins, and inter-system gaps are measured in millimeters. */
6
+ export interface PublicationOptions extends PublicationView {
7
+ paper?: 'A4' | 'Letter' | {
8
+ width: number;
9
+ height: number;
10
+ };
11
+ staffSize?: number;
12
+ margins?: Partial<Record<'top' | 'right' | 'bottom' | 'left', number>>;
13
+ title?: string;
14
+ subtitle?: string;
15
+ header?: string;
16
+ footer?: string;
17
+ pageNumbers?: boolean;
18
+ systemGap?: number;
19
+ maxExtraGap?: number;
20
+ justifyLast?: boolean;
21
+ }
22
+ export interface PublicationDiagnostic {
23
+ code: 'PageOverflow' | 'SystemOverflow' | 'TextOverflow' | 'ForbiddenTurn' | 'ExcludedAnchor' | 'Engraving';
24
+ measures: number[];
25
+ detail: string;
26
+ page?: number;
27
+ }
28
+ export interface PublicationPage {
29
+ svg: SVGSVGElement;
30
+ number: number;
31
+ systems: {
32
+ measures: number[];
33
+ x: number;
34
+ y: number;
35
+ width: number;
36
+ height: number;
37
+ }[];
38
+ }
39
+ /** Public result uses the same SVGs for display, serialization and browser print/PDF. */
40
+ export declare class PublicationResult {
41
+ readonly pages: PublicationPage[];
42
+ readonly diagnostics: PublicationDiagnostic[];
43
+ readonly paper: {
44
+ width: number;
45
+ height: number;
46
+ };
47
+ constructor(pages: PublicationPage[], diagnostics: PublicationDiagnostic[], paper: {
48
+ width: number;
49
+ height: number;
50
+ });
51
+ /** Supply outline fonts for a portable standalone SVG, with per-page semantic metadata retained. */
52
+ toSVG(pageNumber: number, fonts?: SVGFont[]): string;
53
+ /** A separate print document avoids inheriting the application's styles and external font dependencies. */
54
+ toPrintHTML(fonts: SVGFont[]): string;
55
+ }
56
+ /** Attach one physical SVG per page. Render again with different options to build an independent part. */
57
+ export declare class Publication {
58
+ private readonly source;
59
+ constructor(source: EasyScoreCompositionSpec);
60
+ render(target: HTMLElement, options?: PublicationOptions): PublicationResult;
61
+ }
@@ -0,0 +1,27 @@
1
+ import type { EasyScoreComposition, EasyScoreCompositionSpec, EasyScoreStaveSpec } from './easyscore';
2
+ /** A small written-pitch reference staff over one source measure. Cues do not change the player's rest. */
3
+ export interface PublicationRegion {
4
+ kind: 'cue' | 'ossia';
5
+ staff: string;
6
+ measure: number;
7
+ label: string;
8
+ scale?: number;
9
+ }
10
+ /** All measure references are one-based. A page turn follows its named measure. */
11
+ export interface PublicationView {
12
+ staves?: readonly string[];
13
+ systemBreaks?: readonly number[];
14
+ pageBreaks?: readonly number[];
15
+ preferredTurns?: readonly number[];
16
+ forbiddenTurns?: readonly number[];
17
+ regions?: readonly PublicationRegion[];
18
+ }
19
+ export declare function invalidPage(message: string): never;
20
+ /** Validate view references before a new rendering replaces an existing one. */
21
+ export declare function checkView(source: EasyScoreCompositionSpec, view: PublicationView): void;
22
+ /** Track only declared IDs for relationships. The score's native lookup also handles IDs in EasyScore strings. */
23
+ export declare function projectScore(source: EasyScoreCompositionSpec, view: PublicationView, width: number, reference?: EasyScoreComposition, omitted?: (id: string, measures: number[]) => void): EasyScoreCompositionSpec;
24
+ /** Carry written clef, key and meter into a one-measure inset, including preceding inline changes. */
25
+ export declare function insetStaff(staff: EasyScoreStaveSpec, measure: number): EasyScoreStaveSpec;
26
+ /** Conservative playable turn: every timed event in every performing voice is a rest in the preceding measure. */
27
+ export declare function restingMeasure(score: EasyScoreComposition, number: number): boolean;
@@ -0,0 +1,33 @@
1
+ import { Bounds } from './boundingbox';
2
+ import type { EasyScoreComposition, EasyScoreStaveSpec } from './easyscore/composition';
3
+ import { GeometryDiagnostic } from './engravinggeometry';
4
+ /** Rational times are in whole notes. Measure and voice numbers start at one. */
5
+ export interface ScoreReadingEvent {
6
+ id: string;
7
+ source?: string;
8
+ staff: string;
9
+ measure: number;
10
+ voice: number;
11
+ onset: string;
12
+ duration: string;
13
+ label: string;
14
+ }
15
+ /** Layout coordinates belong to one snapshot. A wrapped relationship can have several regions. */
16
+ export interface ScoreHitRegion extends Bounds {
17
+ id: string;
18
+ kind: 'event' | 'span';
19
+ source?: string;
20
+ /** Targeted strings for a technique span. */
21
+ strings?: readonly number[];
22
+ /** Row index of a continuous span fragment, counted from zero. */
23
+ row?: number;
24
+ }
25
+ /** Build after layout; rebuild after reflow and retain selection by authored ID across snapshots. */
26
+ export declare class ScoreNavigation {
27
+ readonly events: readonly ScoreReadingEvent[];
28
+ readonly regions: readonly ScoreHitRegion[];
29
+ readonly diagnostics: readonly GeometryDiagnostic[];
30
+ constructor(score: EasyScoreComposition, staves: readonly Pick<EasyScoreStaveSpec, 'id' | 'name'>[], sources?: Readonly<Record<string, string>>);
31
+ /** Points use score coordinates. Event targets precede spanners; prefer the smallest overlapping target. */
32
+ hitTest(x: number, y: number): ScoreHitRegion | undefined;
33
+ }
@@ -1,3 +1,4 @@
1
+ import type { ContinuousLayout } from './continuouslayout';
1
2
  import { Factory } from './factory';
2
3
  import { System, SystemOptions } from './system';
3
4
  /** Dimensions are in rendering units (normally pixels). */
@@ -23,6 +24,10 @@ export interface SheetRow {
23
24
  /** Arrange measure-sized Systems left to right, wrapping at a requested width. */
24
25
  export declare class Sheet {
25
26
  private options;
27
+ private continuous?;
28
+ /** Composition installs a score-aware layout while retaining the native sheet resize and draw API. */
29
+ setContinuousLayout(layout: ContinuousLayout): this;
30
+ getContinuousLayout(): ContinuousLayout | undefined;
26
31
  private systems;
27
32
  private rows;
28
33
  constructor(options: SheetOptions);
@@ -9,6 +9,11 @@ export interface StaveLineConfig {
9
9
  export interface StaveOptions {
10
10
  /** Musical state when a repeated clef glyph is intentionally omitted. */
11
11
  clef?: string;
12
+ /** Optional barline endpoints, in staff spaces down from the top line. */
13
+ barlineSpan?: {
14
+ top: number;
15
+ bottom: number;
16
+ } | null;
12
17
  bottomTextPosition?: number;
13
18
  lineConfig?: StaveLineConfig[];
14
19
  spaceBelowStaffLn?: number;
@@ -28,6 +33,9 @@ export declare class Stave extends Element {
28
33
  protected clef: string;
29
34
  protected endClef?: string;
30
35
  protected formatted: boolean;
36
+ private boundaryModifiers;
37
+ /** Replace only the derived row-start and courtesy signs on a responsive sheet. */
38
+ setBoundaryModifiers(modifiers: StaveModifier[]): void;
31
39
  protected measure: number;
32
40
  protected bounds: Bounds;
33
41
  protected readonly modifiers: StaveModifier[];
@@ -48,6 +56,11 @@ export declare class Stave extends Element {
48
56
  getTieEndX(): number;
49
57
  getNumLines(): number;
50
58
  setNumLines(n: number): this;
59
+ /** Written extent of barlines, including shortened bars on a one-line percussion stave. */
60
+ getBarlineBounds(): {
61
+ topY: number;
62
+ botY: number;
63
+ };
51
64
  getTopLineTopY(): number;
52
65
  getBottomLineBottomY(): number;
53
66
  setX(x: number): this;
@@ -1,3 +1,4 @@
1
+ import { BoundingBox } from './boundingbox';
1
2
  import { Element } from './element';
2
3
  import { Note } from './note';
3
4
  import { RenderContext } from './rendercontext';
@@ -45,6 +46,23 @@ export declare class StaveHairpin extends Element {
45
46
  * @param {!Object} notes The start and end notes.
46
47
  */
47
48
  setNotes(notes: Record<string, Note>): this;
49
+ /** Both endpoints are required for a complete wedge on a single system. */
50
+ getNotes(): readonly (Note | undefined)[];
51
+ private layoutBaseline?;
52
+ private layoutLeft;
53
+ private layoutRight;
54
+ /** A phrase baseline passes through the middle of the wedge; trims clear adjacent dynamics. */
55
+ setLayoutBaseline(y?: number, left?: number, right?: number): void;
56
+ private parameters;
57
+ private edges;
58
+ /** Signed endpoint order is available to diagnose a wedge squeezed between two dynamics. */
59
+ getLayoutEdges(): {
60
+ top: number;
61
+ left: number;
62
+ right: number;
63
+ height: number;
64
+ };
65
+ getBoundingBox(): BoundingBox;
48
66
  renderHairpin(params: {
49
67
  firstX: number;
50
68
  lastX: number;
@@ -57,6 +57,11 @@ export declare class StaveTie extends Element {
57
57
  * @param params.lastX is specified in pixels.
58
58
  */
59
59
  private tieCurves;
60
+ private layoutRise;
61
+ /** Fit the tied head pairs together without changing their pitch or authored offsets. */
62
+ setLayoutRise(rise: number): void;
63
+ hasManualControls(): boolean;
64
+ getRouteParts(): BoundingBox[];
60
65
  /** Conservative convex hull of filled ribbons, excluding optional tie text. */
61
66
  getRibbonBounds(): BoundingBox;
62
67
  renderTie(params: {
@@ -2,6 +2,7 @@ import { BoundingBox } from './boundingbox';
2
2
  import { Element } from './element';
3
3
  import { Factory } from './factory';
4
4
  import { FormatParams, Formatter, FormatterOptions } from './formatter';
5
+ import { PhraseLayout } from './phraselayout';
5
6
  import { RenderContext } from './rendercontext';
6
7
  import { Stave, StaveOptions } from './stave';
7
8
  import { StaveConnector, StaveConnectorType } from './staveconnector';
@@ -115,8 +116,14 @@ export declare class System extends Element {
115
116
  * Add voices to the system with stave already assigned.
116
117
  */
117
118
  addVoices(voices: Voice[]): void;
119
+ private phrase?;
120
+ /** Opt in to local phrase placement on this system and register its verses and spans. */
121
+ getPhraseLayout(): PhraseLayout;
118
122
  /** Format the system. */
119
- format(): void;
123
+ format(row?: {
124
+ staffOffsets?: readonly number[];
125
+ endPadding?: number;
126
+ }): void;
120
127
  /** Get the boundingBox. */
121
128
  getBoundingBox(): BoundingBox;
122
129
  /** Render the system. */
@@ -0,0 +1,9 @@
1
+ /** One drawable measure or one compressed rest, with its extra width at a row boundary. */
2
+ export interface BreakUnit {
3
+ width: number;
4
+ start: number;
5
+ end: number;
6
+ breakBefore?: 'force' | 'keep';
7
+ }
8
+ /** Both modes use identical reservations. An inseparable oversized group occupies a row by itself. */
9
+ export declare function chooseSystemBreaks(units: BreakUnit[], width: number, gap: number, indent: (first: number) => number, mode: 'balanced' | 'greedy'): number[][];
@@ -1,3 +1,4 @@
1
+ import { BoundingBox } from './boundingbox';
1
2
  import { Element } from './element';
2
3
  import { Note } from './note';
3
4
  import { RenderContext } from './rendercontext';
@@ -41,5 +42,11 @@ export declare class TextBracket extends Element {
41
42
  applyStyle(ctx: RenderContext): this;
42
43
  setDashed(dashed: boolean, dash?: number[]): this;
43
44
  setLine(line: number): this;
45
+ private layoutBaseline?;
46
+ /** Shared baseline for automatic ottava placement. */
47
+ setLayoutBaseline(y?: number): void;
48
+ private geometry;
49
+ /** Text, superscript, horizontal line and hook share the same placement as drawing. */
50
+ getBoundingBox(): BoundingBox;
44
51
  draw(): void;
45
52
  }
@@ -73,5 +73,9 @@ export declare class TimeSignature extends StaveModifier {
73
73
  */
74
74
  draw(): void;
75
75
  drawAt(ctx: RenderContext, stave: Stave, x: number): void;
76
+ /** Compute the top row baseline for fractional and single-row numeric meters. */
77
+ private topBaseline;
78
+ /** Positioned ink before drawing, including additive meters and cut time. */
79
+ getInkBounds(): BoundingBox;
76
80
  getBoundingBox(): BoundingBox;
77
81
  }
@@ -1,4 +1,5 @@
1
1
  import { Accidental } from './accidental';
2
+ import { AlternatingTremolo } from './alternatingtremolo';
2
3
  import { Annotation, AnnotationHorizontalJustify, AnnotationVerticalJustify } from './annotation';
3
4
  import { Articulation } from './articulation';
4
5
  import { BarNote } from './barnote';
@@ -20,6 +21,7 @@ import { Factory } from './factory';
20
21
  import { Font, FontStyle, FontWeight } from './font';
21
22
  import { Formatter } from './formatter';
22
23
  import { Fraction } from './fraction';
24
+ import { FretDiagram } from './fretdiagram';
23
25
  import { FretHandFinger } from './frethandfinger';
24
26
  import { GhostNote } from './ghostnote';
25
27
  import { GlyphNote } from './glyphnote';
@@ -27,6 +29,7 @@ import { Glyphs } from './glyphs';
27
29
  import { GraceNote } from './gracenote';
28
30
  import { GraceNoteGroup } from './gracenotegroup';
29
31
  import { GraceTabNote } from './gracetabnote';
32
+ import { FrettedInstrument, PercussionMap } from './instrumentprofile';
30
33
  import { KeyManager } from './keymanager';
31
34
  import { KeySignature } from './keysignature';
32
35
  import { KeySigNote } from './keysignote';
@@ -34,6 +37,7 @@ import { Modifier, ModifierPosition } from './modifier';
34
37
  import { ModifierContext } from './modifiercontext';
35
38
  import { MultiMeasureRest } from './multimeasurerest';
36
39
  import { Music } from './music';
40
+ import { NotationSpelling, WrittenAccidentalState } from './notationspelling';
37
41
  import { Note } from './note';
38
42
  import { NoteHead } from './notehead';
39
43
  import { NoteSubGroup } from './notesubgroup';
@@ -41,10 +45,13 @@ import { Ornament } from './ornament';
41
45
  import { Parenthesis } from './parenthesis';
42
46
  import { Parser } from './parser';
43
47
  import { PedalMarking } from './pedalmarking';
48
+ import { PhraseLayout } from './phraselayout';
49
+ import { Publication } from './publication';
44
50
  import { Registry } from './registry';
45
51
  import { RenderContext } from './rendercontext';
46
52
  import { Renderer, RendererBackends, RendererLineEndType } from './renderer';
47
53
  import { RepeatNote } from './repeatnote';
54
+ import { ScoreNavigation } from './scorenavigation';
48
55
  import { Sheet } from './sheet';
49
56
  import { Stave } from './stave';
50
57
  import { Barline, BarlineType, RepeatBracketType } from './stavebarline';
@@ -88,6 +95,7 @@ export declare class VexFlow {
88
95
  INFO: string;
89
96
  };
90
97
  static measureEngraving: typeof measureEngraving;
98
+ static PhraseLayout: typeof PhraseLayout;
91
99
  static EngravingProfile: typeof EngravingProfile;
92
100
  static Accidental: typeof Accidental;
93
101
  static Annotation: typeof Annotation;
@@ -150,7 +158,15 @@ export declare class VexFlow {
150
158
  static Stroke: typeof Stroke;
151
159
  static SVGContext: typeof SVGContext;
152
160
  static System: typeof System;
161
+ static ScoreNavigation: typeof ScoreNavigation;
153
162
  static Sheet: typeof Sheet;
163
+ static FrettedInstrument: typeof FrettedInstrument;
164
+ static PercussionMap: typeof PercussionMap;
165
+ static FretDiagram: typeof FretDiagram;
166
+ static AlternatingTremolo: typeof AlternatingTremolo;
167
+ static WrittenAccidentalState: typeof WrittenAccidentalState;
168
+ static NotationSpelling: typeof NotationSpelling;
169
+ static Publication: typeof Publication;
154
170
  static TabNote: typeof TabNote;
155
171
  static TabSlide: typeof TabSlide;
156
172
  static TabStave: typeof TabStave;
@@ -103,6 +103,8 @@ export declare class Voice extends Element {
103
103
  /** Preformat the voice by applying the voice's stave to each note. */
104
104
  preFormat(): this;
105
105
  checkStave(): Stave;
106
+ /** Preserve per-event cross-staff assignments when drawing a continuous score. */
107
+ preserveStaveAssignments: boolean;
106
108
  /**
107
109
  * Render the voice onto the canvas `context` and an optional `stave`.
108
110
  * If `stave` is omitted, it is expected that the notes have staves
@@ -1,3 +1,11 @@
1
+ # 5.4.0
2
+
3
+ - Lay out lyrics, curves, and markings across a system. Break continuous scores into systems, then paginate full scores and individual parts for print.
4
+ - Add instrument profiles and playable reference scores. The guitar studies show how to lay out bends, slides, and other gestures in tablature.
5
+ - Expose a renderer-independent score reader for accessible navigation. Qualify web rendering in Chromium, Firefox, and WebKit.
6
+ - Learn VexFlow through progressive, editable examples in the [user guide](https://vexflow.com/guide/). Experiment in the [Explorer](https://vexflow.com/explorer/) or browse the [visual tests and example scores](https://vexflow.com/tests/).
7
+ - Read the [illustrated history of changes since VexFlow 5.0](https://vexflow.com/reports/ai2026) and the [5.4.0 code quality report](https://vexflow.com/reports/5.4.0/).
8
+
1
9
  # 5.3.0
2
10
 
3
11
  ## Engraving
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vexflow",
3
- "version": "5.3.0",
3
+ "version": "5.4.0",
4
4
  "description": "A JavaScript library for rendering music notation and guitar tablature.",
5
5
  "exports": {
6
6
  ".": {
@@ -105,6 +105,7 @@
105
105
  "grunt-contrib-qunit": "11.0.0",
106
106
  "grunt-eslint": "^25.0.0",
107
107
  "grunt-webpack": "^7.0.0",
108
+ "istanbul-lib-instrument": "6.0.3",
108
109
  "jsdom": "^26.1.0",
109
110
  "jspdf": "^4.0.0",
110
111
  "opener": "^1.5.2",
@@ -145,7 +146,13 @@
145
146
  "guide": "node guide/cli.mjs serve",
146
147
  "guide:build": "node guide/cli.mjs build",
147
148
  "guide:test": "node guide/test.mjs",
148
- "guide:upload": "node guide/cli.mjs upload"
149
+ "guide:upload": "node guide/cli.mjs upload",
150
+ "improvements:upload": "node tools/improvements/upload.mjs",
151
+ "report": "node tools/reports/cli.mjs build",
152
+ "report:upload": "node tools/reports/cli.mjs upload",
153
+ "report:release": "node tools/reports/cli.mjs release",
154
+ "release:github": "node tools/reports/cli.mjs github",
155
+ "report:test": "node --test tools/reports/report.test.mjs"
149
156
  },
150
157
  "homepage": "https://vexflow.com/",
151
158
  "keywords": [