Detailed changes are listed on the wiki: https://github.com/0xfe/vexflow/wiki/Changelog-ver-4.0
- VexFlow is written in TypeScript with a ES6 target.
- Supports ES module in addition to CommonJS environments.
- Improved automatic layout of notes.
- Improved handling of music fonts and text fonts.
- Supports lazy loading of music fonts.
- Improved
setFont(...)
method in Element class.
-
The tsconfig.json
compilerOptions.target
has been updated to ES6 / ES2015. -
Stave.setNumLines(n: number)
requires a number. Previously, a string would also work. See: stave.ts and #1083. -
Note.addModifier(modifier: Modifier, index?: number): this
now throws a RuntimeError if the parameters are reversed. -
TickContext.getTickableForVoice(voiceIndex: number): Tickable
was previously namedgetTickablesForVoice(voiceIndex: number): Note
. We removed thes
because the method returns a single Tickable. You will need to update calls to this function if you are upgrading from a build from between April 2020 to August 2021. -
Element
and its subclasses have a staticCATEGORY
string property, used by VexFlow internally to differentiate objects. This string has been standardized to be singular, with UpperCamelCase capitalization.- Examples:
Accidental.CATEGORY
is now'Accidental'
instead of'accidentals'
.Modifier.CATEGORY
is now'Modifier'
instead of'none'
.
- Examples:
-
ChordSymbol
ChordSymbol.NO_TEXT_FORMAT
was previously namedChordSymbol.NOTEXTFORMAT
.ChordSymbol.metrics
was previously namedChordSymbol.chordSymbolMetrics
.
-
StaveNote.LEDGER_LINE_OFFSET
was previously namedStaveNote.DEFAULT_LEDGER_LINE_OFFSET
. -
Fonts
TextFontMetrics
has been merged intoFontGlyph
due to substantial overlap.Flow.NOTATION_FONT_SCALE
was previously namedFlow.DEFAULT_NOTATION_FONT_SCALE
.setFont(...)
inCanvasContext
andSVGContext
previously took arguments:family
,size
,weight
. Theweight
argument allowed strings like'italic bold'
. This no longer works, and'italic'
must now be passed into thestyle
argument.
-
Build Process
- Gruntfile environment variable
VEX_DEVTOOL
was previously namedVEX_GENMAP
. This environment variable sets the webpack devtool configuration option.
- Gruntfile environment variable
- Support Bravura, the reference font for Standard Music Font Layout.
Accidental.ApplyAccidentals()
no longer breaks onNotes
that ignore ticks (ie:TimeSigNote
)Accidental.applyAccidentals()
now applies accidentals toGraceNotes
- Fix a
BoundingBox#mergeWith
case when one box contains another - Fix blurry canvas rendering on retina screens
- Rebuild noteheads after
StaveNote#setKeyLine
is called - Ensure
StaveNote.extraLeftPx
andStaveNote.extraRightPx
get recalculated inStaveNote#reset
Factory
exposes a lot more elements -- API is subject to changeFactory
constructoroptions.renderer.selector
renamed tooptions.renderer.elementId
to more appropriately reflect the what the string represents- Sori and koron microtonal accidentals have been added
- Tests have been refactored to use
Factory
andEasyScore
- The font transformation tool (
transform.html
) has been refactored, and generates a font by combining both theGonville
andMicrotonal
fonts.