vexflow 4.0.1-beta.1 → 4.0.1-beta.2
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.
- package/build/cjs/vexflow-bravura.js +2 -2
- package/build/cjs/vexflow-bravura.js.map +1 -1
- package/build/cjs/vexflow-core.js +2 -2
- package/build/cjs/vexflow-core.js.map +1 -1
- package/build/cjs/vexflow-debug-with-tests.js +92 -24
- package/build/cjs/vexflow-debug-with-tests.js.map +1 -1
- package/build/cjs/vexflow-debug.js +38 -16
- package/build/cjs/vexflow-debug.js.map +1 -1
- package/build/cjs/vexflow-font-gonville.js +1 -1
- package/build/cjs/vexflow-font-gonville.js.map +1 -1
- package/build/cjs/vexflow-gonville.js +2 -2
- package/build/cjs/vexflow-gonville.js.map +1 -1
- package/build/cjs/vexflow-petaluma.js +2 -2
- package/build/cjs/vexflow-petaluma.js.map +1 -1
- package/build/cjs/vexflow.js +2 -2
- package/build/cjs/vexflow.js.map +1 -1
- package/build/esm/entry/vexflow-bravura.js +11 -0
- package/build/esm/entry/vexflow-core.js +54 -0
- package/build/esm/entry/vexflow-debug-with-tests.js +4 -0
- package/build/esm/entry/vexflow-debug.js +3 -0
- package/build/esm/entry/vexflow-font-bravura.js +7 -0
- package/build/esm/entry/vexflow-font-custom.js +7 -0
- package/build/esm/entry/vexflow-font-gonville.js +7 -0
- package/build/esm/entry/vexflow-font-petaluma.js +7 -0
- package/build/esm/entry/vexflow-gonville.js +11 -0
- package/build/esm/entry/vexflow-petaluma.js +11 -0
- package/build/esm/entry/vexflow.js +9 -0
- package/build/esm/src/accidental.js +348 -0
- package/build/esm/src/annotation.js +232 -0
- package/build/esm/src/articulation.js +267 -0
- package/build/esm/src/barnote.js +58 -0
- package/build/esm/src/beam.js +632 -0
- package/build/esm/src/bend.js +202 -0
- package/build/esm/src/boundingbox.js +59 -0
- package/build/esm/src/boundingboxcomputation.js +107 -0
- package/build/esm/src/canvascontext.js +202 -0
- package/build/esm/src/chordsymbol.js +578 -0
- package/build/esm/src/clef.js +153 -0
- package/build/esm/src/clefnote.js +65 -0
- package/build/esm/src/crescendo.js +77 -0
- package/build/esm/src/curve.js +118 -0
- package/build/esm/src/dot.js +137 -0
- package/build/esm/src/easyscore.js +374 -0
- package/build/esm/src/element.js +216 -0
- package/build/esm/src/factory.js +440 -0
- package/build/esm/src/flow.js +275 -0
- package/build/esm/src/font.js +264 -0
- package/build/esm/src/fonts/bravura_glyphs.js +3239 -0
- package/build/esm/src/fonts/bravura_metrics.js +507 -0
- package/build/esm/src/fonts/custom_glyphs.js +78 -0
- package/build/esm/src/fonts/custom_metrics.js +5 -0
- package/build/esm/src/fonts/gonville_glyphs.js +828 -0
- package/build/esm/src/fonts/gonville_metrics.js +421 -0
- package/build/esm/src/fonts/load_all.js +10 -0
- package/build/esm/src/fonts/load_bravura.js +6 -0
- package/build/esm/src/fonts/load_custom.js +6 -0
- package/build/esm/src/fonts/load_gonville.js +6 -0
- package/build/esm/src/fonts/load_petaluma.js +6 -0
- package/build/esm/src/fonts/petaluma_glyphs.js +1335 -0
- package/build/esm/src/fonts/petaluma_metrics.js +536 -0
- package/build/esm/src/fonts/petalumascript_glyphs.js +863 -0
- package/build/esm/src/fonts/robotoslab_glyphs.js +863 -0
- package/build/esm/src/fonts/textfonts.js +44 -0
- package/build/esm/src/formatter.js +568 -0
- package/build/esm/src/fraction.js +171 -0
- package/build/esm/src/frethandfinger.js +156 -0
- package/build/esm/src/ghostnote.js +50 -0
- package/build/esm/src/glyph.js +331 -0
- package/build/esm/src/glyphnote.js +55 -0
- package/build/esm/src/gracenote.js +133 -0
- package/build/esm/src/gracenotegroup.js +128 -0
- package/build/esm/src/gracetabnote.js +12 -0
- package/build/esm/src/index.js +91 -0
- package/build/esm/src/keymanager.js +99 -0
- package/build/esm/src/keysignature.js +250 -0
- package/build/esm/src/keysignote.js +28 -0
- package/build/esm/src/modifier.js +128 -0
- package/build/esm/src/modifiercontext.js +110 -0
- package/build/esm/src/multimeasurerest.js +173 -0
- package/build/esm/src/music.js +322 -0
- package/build/esm/src/note.js +371 -0
- package/build/esm/src/notehead.js +169 -0
- package/build/esm/src/notesubgroup.js +59 -0
- package/build/esm/src/ornament.js +206 -0
- package/build/esm/src/parenthesis.js +76 -0
- package/build/esm/src/parser.js +164 -0
- package/build/esm/src/pedalmarking.js +192 -0
- package/build/esm/src/registry.js +81 -0
- package/build/esm/src/rendercontext.js +24 -0
- package/build/esm/src/renderer.js +112 -0
- package/build/esm/src/repeatnote.js +22 -0
- package/build/esm/src/stave.js +547 -0
- package/build/esm/src/stavebarline.js +182 -0
- package/build/esm/src/staveconnector.js +196 -0
- package/build/esm/src/stavehairpin.js +120 -0
- package/build/esm/src/staveline.js +218 -0
- package/build/esm/src/stavemodifier.js +77 -0
- package/build/esm/src/stavenote.js +855 -0
- package/build/esm/src/staverepetition.js +155 -0
- package/build/esm/src/stavesection.js +58 -0
- package/build/esm/src/stavetempo.js +91 -0
- package/build/esm/src/stavetext.js +82 -0
- package/build/esm/src/stavetie.js +141 -0
- package/build/esm/src/stavevolta.js +67 -0
- package/build/esm/src/stem.js +131 -0
- package/build/esm/src/stemmablenote.js +193 -0
- package/build/esm/src/stringnumber.js +231 -0
- package/build/esm/src/strokes.js +200 -0
- package/build/esm/src/svgcontext.js +414 -0
- package/build/esm/src/system.js +116 -0
- package/build/esm/src/tables.js +1102 -0
- package/build/esm/src/tabnote.js +299 -0
- package/build/esm/src/tabslide.js +76 -0
- package/build/esm/src/tabstave.js +17 -0
- package/build/esm/src/tabtie.js +19 -0
- package/build/esm/src/textbracket.js +144 -0
- package/build/esm/src/textdynamics.js +81 -0
- package/build/esm/src/textformatter.js +177 -0
- package/build/esm/src/textnote.js +176 -0
- package/build/esm/src/tickable.js +214 -0
- package/build/esm/src/tickcontext.js +170 -0
- package/build/esm/src/timesigglyph.js +85 -0
- package/build/esm/src/timesignature.js +89 -0
- package/build/esm/src/timesignote.js +32 -0
- package/build/esm/src/tremolo.js +47 -0
- package/build/esm/src/tuning.js +54 -0
- package/build/esm/src/tuplet.js +240 -0
- package/build/esm/src/typeguard.js +30 -0
- package/build/esm/src/util.js +58 -0
- package/build/esm/src/version.js +3 -3
- package/build/esm/src/vex.js +51 -0
- package/build/esm/src/vibrato.js +100 -0
- package/build/esm/src/vibratobracket.js +50 -0
- package/build/esm/src/voice.js +187 -0
- package/build/esm/src/web.js +15 -0
- package/build/esm/tests/accidental_tests.js +974 -0
- package/build/esm/tests/annotation_tests.js +377 -0
- package/build/esm/tests/articulation_tests.js +365 -0
- package/build/esm/tests/auto_beam_formatting_tests.js +548 -0
- package/build/esm/tests/bach_tests.js +335 -0
- package/build/esm/tests/barline_tests.js +52 -0
- package/build/esm/tests/beam_tests.js +595 -0
- package/build/esm/tests/bend_tests.js +215 -0
- package/build/esm/tests/boundingbox_tests.js +53 -0
- package/build/esm/tests/boundingboxcomputation_tests.js +183 -0
- package/build/esm/tests/chordsymbol_tests.js +320 -0
- package/build/esm/tests/clef_tests.js +131 -0
- package/build/esm/tests/curve_tests.js +118 -0
- package/build/esm/tests/dot_tests.js +123 -0
- package/build/esm/tests/easyscore_tests.js +459 -0
- package/build/esm/tests/factory_tests.js +44 -0
- package/build/esm/tests/font_tests.js +135 -0
- package/build/esm/tests/formatter/framestack.js +61 -0
- package/build/esm/tests/formatter/tests.js +203 -0
- package/build/esm/tests/formatter_tests.js +669 -0
- package/build/esm/tests/fraction_tests.js +72 -0
- package/build/esm/tests/ghostnote_tests.js +77 -0
- package/build/esm/tests/glyphnote_tests.js +113 -0
- package/build/esm/tests/gracenote_tests.js +413 -0
- package/build/esm/tests/gracetabnote_tests.js +79 -0
- package/build/esm/tests/index.js +68 -0
- package/build/esm/tests/key_clef_tests.js +103 -0
- package/build/esm/tests/keymanager_tests.js +68 -0
- package/build/esm/tests/keysignature_tests.js +308 -0
- package/build/esm/tests/mocks.js +71 -0
- package/build/esm/tests/modifier_tests.js +24 -0
- package/build/esm/tests/multimeasurerest_tests.js +141 -0
- package/build/esm/tests/music_tests.js +161 -0
- package/build/esm/tests/notehead_tests.js +137 -0
- package/build/esm/tests/notesubgroup_tests.js +149 -0
- package/build/esm/tests/offscreencanvas_tests.js +47 -0
- package/build/esm/tests/ornament_tests.js +298 -0
- package/build/esm/tests/parser_tests.js +122 -0
- package/build/esm/tests/pedalmarking_tests.js +64 -0
- package/build/esm/tests/percussion_tests.js +180 -0
- package/build/esm/tests/registry_tests.js +64 -0
- package/build/esm/tests/renderer_tests.js +113 -0
- package/build/esm/tests/rests_tests.js +248 -0
- package/build/esm/tests/rhythm_tests.js +357 -0
- package/build/esm/tests/stave_tests.js +560 -0
- package/build/esm/tests/staveconnector_tests.js +402 -0
- package/build/esm/tests/stavehairpin_tests.js +90 -0
- package/build/esm/tests/staveline_tests.js +122 -0
- package/build/esm/tests/stavemodifier_tests.js +51 -0
- package/build/esm/tests/stavenote_tests.js +867 -0
- package/build/esm/tests/stavetie_tests.js +108 -0
- package/build/esm/tests/stringnumber_tests.js +259 -0
- package/build/esm/tests/strokes_tests.js +275 -0
- package/build/esm/tests/style_tests.js +98 -0
- package/build/esm/tests/support/qunit.js +2765 -0
- package/build/esm/tests/tabnote_tests.js +474 -0
- package/build/esm/tests/tabslide_tests.js +135 -0
- package/build/esm/tests/tabstave_tests.js +23 -0
- package/build/esm/tests/tabtie_tests.js +173 -0
- package/build/esm/tests/textbracket_tests.js +100 -0
- package/build/esm/tests/textformatter_tests.js +24 -0
- package/build/esm/tests/textnote_tests.js +215 -0
- package/build/esm/tests/threevoice_tests.js +132 -0
- package/build/esm/tests/tickcontext_tests.js +36 -0
- package/build/esm/tests/timesignature_tests.js +134 -0
- package/build/esm/tests/tremolo_tests.js +75 -0
- package/build/esm/tests/tuning_tests.js +56 -0
- package/build/esm/tests/tuplet_tests.js +450 -0
- package/build/esm/tests/typeguard_tests.js +82 -0
- package/build/esm/tests/vexflow_test_helpers.js +266 -0
- package/build/esm/tests/vf_prefix_tests.js +115 -0
- package/build/esm/tests/vibrato_tests.js +92 -0
- package/build/esm/tests/vibratobracket_tests.js +45 -0
- package/build/esm/tests/voice_tests.js +69 -0
- package/build/types/entry/vexflow-bravura.d.ts +3 -0
- package/build/types/entry/vexflow-core.d.ts +3 -0
- package/build/types/entry/vexflow-debug.d.ts +3 -0
- package/build/types/entry/vexflow-font-bravura.d.ts +3771 -0
- package/build/types/entry/vexflow-font-custom.d.ts +86 -0
- package/build/types/entry/vexflow-font-gonville.d.ts +1267 -0
- package/build/types/entry/vexflow-font-petaluma.d.ts +1896 -0
- package/build/types/entry/vexflow-gonville.d.ts +3 -0
- package/build/types/entry/vexflow-petaluma.d.ts +3 -0
- package/build/types/entry/vexflow.d.ts +3 -0
- package/build/types/src/accidental.d.ts +66 -0
- package/build/types/src/annotation.d.ts +60 -0
- package/build/types/src/articulation.d.ts +62 -0
- package/build/types/src/barnote.d.ts +29 -0
- package/build/types/src/beam.d.ts +124 -0
- package/build/types/src/bend.d.ts +73 -0
- package/build/types/src/boundingbox.d.ts +42 -0
- package/build/types/src/boundingboxcomputation.d.ts +33 -0
- package/build/types/src/canvascontext.d.ts +89 -0
- package/build/types/src/chordsymbol.d.ts +149 -0
- package/build/types/src/clef.d.ts +48 -0
- package/build/types/src/clefnote.d.ts +25 -0
- package/build/types/src/crescendo.d.ts +27 -0
- package/build/types/src/curve.d.ts +41 -0
- package/build/types/src/dot.d.ts +20 -0
- package/build/types/src/easyscore.d.ts +148 -0
- package/build/types/src/element.d.ts +202 -0
- package/build/types/src/factory.d.ts +271 -0
- package/build/types/src/flow.d.ts +245 -0
- package/build/types/src/font.d.ts +181 -0
- package/build/types/src/fonts/bravura_glyphs.d.ts +3239 -0
- package/build/types/src/fonts/bravura_metrics.d.ts +533 -0
- package/build/types/src/fonts/custom_glyphs.d.ts +78 -0
- package/build/types/src/fonts/custom_metrics.d.ts +5 -0
- package/build/types/src/fonts/gonville_glyphs.d.ts +828 -0
- package/build/types/src/fonts/gonville_metrics.d.ts +440 -0
- package/build/types/src/fonts/load_all.d.ts +1 -0
- package/build/types/src/fonts/load_bravura.d.ts +1 -0
- package/build/types/src/fonts/load_custom.d.ts +1 -0
- package/build/types/src/fonts/load_gonville.d.ts +1 -0
- package/build/types/src/fonts/load_petaluma.d.ts +1 -0
- package/build/types/src/fonts/petaluma_glyphs.d.ts +1335 -0
- package/build/types/src/fonts/petaluma_metrics.d.ts +562 -0
- package/build/types/src/fonts/petalumascript_glyphs.d.ts +863 -0
- package/build/types/src/fonts/robotoslab_glyphs.d.ts +863 -0
- package/build/types/src/fonts/textfonts.d.ts +1 -0
- package/build/types/src/formatter.d.ts +203 -0
- package/build/types/src/fraction.d.ts +62 -0
- package/build/types/src/frethandfinger.d.ts +22 -0
- package/build/types/src/ghostnote.d.ts +16 -0
- package/build/types/src/glyph.d.ts +139 -0
- package/build/types/src/glyphnote.d.ts +17 -0
- package/build/types/src/gracenote.d.ts +19 -0
- package/build/types/src/gracenotegroup.d.ts +33 -0
- package/build/types/src/gracetabnote.d.ts +5 -0
- package/build/types/src/index.d.ts +91 -0
- package/build/types/src/keymanager.d.ts +25 -0
- package/build/types/src/keysignature.d.ts +50 -0
- package/build/types/src/keysignote.d.ts +11 -0
- package/build/types/src/modifier.d.ts +97 -0
- package/build/types/src/modifiercontext.d.ts +45 -0
- package/build/types/src/multimeasurerest.d.ts +61 -0
- package/build/types/src/music.d.ts +91 -0
- package/build/types/src/note.d.ts +231 -0
- package/build/types/src/notehead.d.ts +70 -0
- package/build/types/src/notesubgroup.d.ts +18 -0
- package/build/types/src/ornament.d.ts +76 -0
- package/build/types/src/parenthesis.d.ts +22 -0
- package/build/types/src/parser.d.ts +45 -0
- package/build/types/src/pedalmarking.d.ts +69 -0
- package/build/types/src/registry.d.ts +40 -0
- package/build/types/src/rendercontext.d.ts +64 -0
- package/build/types/src/renderer.d.ts +35 -0
- package/build/types/src/repeatnote.d.ts +6 -0
- package/build/types/src/stave.d.ts +186 -0
- package/build/types/src/stavebarline.d.ts +28 -0
- package/build/types/src/staveconnector.d.ts +67 -0
- package/build/types/src/stavehairpin.d.ts +56 -0
- package/build/types/src/staveline.d.ts +57 -0
- package/build/types/src/stavemodifier.d.ts +44 -0
- package/build/types/src/stavenote.d.ts +154 -0
- package/build/types/src/staverepetition.d.ts +32 -0
- package/build/types/src/stavesection.d.ts +15 -0
- package/build/types/src/stavetempo.d.ts +25 -0
- package/build/types/src/stavetext.d.ts +25 -0
- package/build/types/src/stavetie.d.ts +59 -0
- package/build/types/src/stavevolta.d.ts +21 -0
- package/build/types/src/stem.d.ts +58 -0
- package/build/types/src/stemmablenote.d.ts +39 -0
- package/build/types/src/stringnumber.d.ts +27 -0
- package/build/types/src/strokes.d.ts +33 -0
- package/build/types/src/svgcontext.d.ts +131 -0
- package/build/types/src/system.d.ts +92 -0
- package/build/types/src/tables.d.ts +96 -0
- package/build/types/src/tabnote.d.ts +44 -0
- package/build/types/src/tabslide.d.ts +34 -0
- package/build/types/src/tabstave.d.ts +7 -0
- package/build/types/src/tabtie.d.ts +18 -0
- package/build/types/src/textbracket.d.ts +55 -0
- package/build/types/src/textdynamics.d.ts +39 -0
- package/build/types/src/textformatter.d.ts +109 -0
- package/build/types/src/textnote.d.ts +49 -0
- package/build/types/src/tickable.d.ts +140 -0
- package/build/types/src/tickcontext.d.ts +82 -0
- package/build/types/src/timesigglyph.d.ts +14 -0
- package/build/types/src/timesignature.d.ts +26 -0
- package/build/types/src/timesignote.d.ts +11 -0
- package/build/types/src/tremolo.d.ts +17 -0
- package/build/types/src/tuning.d.ts +23 -0
- package/build/types/src/tuplet.d.ts +105 -0
- package/build/types/src/typeguard.d.ts +99 -0
- package/build/types/src/util.d.ts +27 -0
- package/build/types/src/version.d.ts +3 -0
- package/build/types/src/vex.d.ts +18 -0
- package/build/types/src/vibrato.d.ts +29 -0
- package/build/types/src/vibratobracket.d.ts +33 -0
- package/build/types/src/voice.d.ts +108 -0
- package/build/types/src/web.d.ts +2 -0
- package/package.json +1 -1
- package/src/annotation.ts +27 -6
- package/src/articulation.ts +8 -2
- package/src/fonts/gonville_glyphs.ts +4 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* VexFlow 4.0.1-beta.
|
|
2
|
+
* VexFlow 4.0.1-beta.2 2022-02-27T01:14:47.524Z 567ba80618390639c170a60de47ab4d1f2eabbff
|
|
3
3
|
* Copyright (c) 2010 Mohit Muthanna Cheppudira <mohit@muthanna.com>
|
|
4
4
|
* https://www.vexflow.com https://github.com/0xfe/vexflow
|
|
5
5
|
*/
|
|
@@ -29,9 +29,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
29
29
|
/* harmony export */ "ID": () => (/* binding */ ID),
|
|
30
30
|
/* harmony export */ "DATE": () => (/* binding */ DATE)
|
|
31
31
|
/* harmony export */ });
|
|
32
|
-
const VERSION = '4.0.1-beta.
|
|
33
|
-
const ID = '
|
|
34
|
-
const DATE = '2022-02-
|
|
32
|
+
const VERSION = '4.0.1-beta.2';
|
|
33
|
+
const ID = '567ba80618390639c170a60de47ab4d1f2eabbff';
|
|
34
|
+
const DATE = '2022-02-27T01:14:47.524Z';
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
/***/ }),
|
|
@@ -780,7 +780,10 @@ class Annotation extends _modifier__WEBPACK_IMPORTED_MODULE_1__.Modifier {
|
|
|
780
780
|
static format(annotations, state) {
|
|
781
781
|
if (!annotations || annotations.length === 0)
|
|
782
782
|
return false;
|
|
783
|
-
let
|
|
783
|
+
let leftWidth = 0;
|
|
784
|
+
let rightWidth = 0;
|
|
785
|
+
let maxLeftGlyphWidth = 0;
|
|
786
|
+
let maxRightGlyphWidth = 0;
|
|
784
787
|
for (let i = 0; i < annotations.length; ++i) {
|
|
785
788
|
const annotation = annotations[i];
|
|
786
789
|
const textFormatter = _textformatter__WEBPACK_IMPORTED_MODULE_4__.TextFormatter.create(annotation.textFont);
|
|
@@ -788,6 +791,23 @@ class Annotation extends _modifier__WEBPACK_IMPORTED_MODULE_1__.Modifier {
|
|
|
788
791
|
const textLines = (5 + textFormatter.maxHeight) / _tables__WEBPACK_IMPORTED_MODULE_3__.Tables.STAVE_LINE_DISTANCE;
|
|
789
792
|
let verticalSpaceNeeded = textLines;
|
|
790
793
|
const note = annotation.checkAttachedNote();
|
|
794
|
+
const glyphWidth = note.getGlyph().getWidth();
|
|
795
|
+
// Get the text width from the font metrics.
|
|
796
|
+
const textWidth = textFormatter.getWidthForTextInPx(annotation.text);
|
|
797
|
+
if (annotation.horizontalJustification === AnnotationHorizontalJustify.LEFT) {
|
|
798
|
+
maxLeftGlyphWidth = Math.max(glyphWidth, maxLeftGlyphWidth);
|
|
799
|
+
leftWidth = Math.max(leftWidth, textWidth);
|
|
800
|
+
}
|
|
801
|
+
else if (annotation.horizontalJustification === AnnotationHorizontalJustify.RIGHT) {
|
|
802
|
+
maxRightGlyphWidth = Math.max(glyphWidth, maxLeftGlyphWidth);
|
|
803
|
+
rightWidth = Math.max(rightWidth, textWidth);
|
|
804
|
+
}
|
|
805
|
+
else {
|
|
806
|
+
leftWidth = Math.max(leftWidth, textWidth / 2);
|
|
807
|
+
rightWidth = Math.max(rightWidth, textWidth / 2);
|
|
808
|
+
maxLeftGlyphWidth = Math.max(glyphWidth / 2, maxLeftGlyphWidth);
|
|
809
|
+
maxRightGlyphWidth = Math.max(glyphWidth / 2, maxRightGlyphWidth);
|
|
810
|
+
}
|
|
791
811
|
const stave = note.getStave();
|
|
792
812
|
const stemDirection = note.hasStem() ? note.getStemDirection() : _stem__WEBPACK_IMPORTED_MODULE_2__.Stem.UP;
|
|
793
813
|
let stemHeight = 0;
|
|
@@ -812,9 +832,6 @@ class Annotation extends _modifier__WEBPACK_IMPORTED_MODULE_1__.Modifier {
|
|
|
812
832
|
if (stave) {
|
|
813
833
|
lines = stave.getNumLines();
|
|
814
834
|
}
|
|
815
|
-
// Get the text width from the font metrics.
|
|
816
|
-
const textWidth = textFormatter.getWidthForTextInPx(annotation.text);
|
|
817
|
-
width = Math.max(width, textWidth);
|
|
818
835
|
if (annotation.verticalJustification === this.VerticalJustify.TOP) {
|
|
819
836
|
let noteLine = note.getLineNumber(true);
|
|
820
837
|
if ((0,_typeguard__WEBPACK_IMPORTED_MODULE_5__.isTabNote)(note)) {
|
|
@@ -857,8 +874,10 @@ class Annotation extends _modifier__WEBPACK_IMPORTED_MODULE_1__.Modifier {
|
|
|
857
874
|
annotation.setTextLine(state.text_line);
|
|
858
875
|
}
|
|
859
876
|
}
|
|
860
|
-
|
|
861
|
-
|
|
877
|
+
const rightOverlap = Math.min(Math.max(rightWidth - maxRightGlyphWidth, 0), Math.max(rightWidth - state.right_shift, 0));
|
|
878
|
+
const leftOverlap = Math.min(Math.max(leftWidth - maxLeftGlyphWidth, 0), Math.max(leftWidth - state.left_shift, 0));
|
|
879
|
+
state.left_shift += leftOverlap / 2;
|
|
880
|
+
state.right_shift += rightOverlap / 2;
|
|
862
881
|
return true;
|
|
863
882
|
}
|
|
864
883
|
/**
|
|
@@ -1190,9 +1209,11 @@ class Articulation extends _modifier__WEBPACK_IMPORTED_MODULE_1__.Modifier {
|
|
|
1190
1209
|
if (!articulations || articulations.length === 0)
|
|
1191
1210
|
return false;
|
|
1192
1211
|
const margin = 0.5;
|
|
1212
|
+
let maxGlyphWidth = 0;
|
|
1193
1213
|
const getIncrement = (articulation, line, position) => roundToNearestHalf(getRoundingFunction(line, position), (0,_util__WEBPACK_IMPORTED_MODULE_5__.defined)(articulation.glyph.getMetrics().height) / 10 + margin);
|
|
1194
1214
|
articulations.forEach((articulation) => {
|
|
1195
1215
|
const note = articulation.checkAttachedNote();
|
|
1216
|
+
maxGlyphWidth = Math.max(note.getGlyph().getWidth(), maxGlyphWidth);
|
|
1196
1217
|
let lines = 5;
|
|
1197
1218
|
const stemDirection = note.hasStem() ? note.getStemDirection() : _stem__WEBPACK_IMPORTED_MODULE_2__.Stem.UP;
|
|
1198
1219
|
let stemHeight = 0;
|
|
@@ -1239,8 +1260,9 @@ class Articulation extends _modifier__WEBPACK_IMPORTED_MODULE_1__.Modifier {
|
|
|
1239
1260
|
const width = articulations
|
|
1240
1261
|
.map((articulation) => articulation.getWidth())
|
|
1241
1262
|
.reduce((maxWidth, articWidth) => Math.max(articWidth, maxWidth));
|
|
1242
|
-
state.left_shift
|
|
1243
|
-
state.
|
|
1263
|
+
const overlap = Math.min(Math.max(width - maxGlyphWidth, 0), Math.max(width - (state.left_shift + state.right_shift), 0));
|
|
1264
|
+
state.left_shift += overlap / 2;
|
|
1265
|
+
state.right_shift += overlap / 2;
|
|
1244
1266
|
return true;
|
|
1245
1267
|
}
|
|
1246
1268
|
static easyScoreHook({ articulations }, note, builder) {
|
|
@@ -11196,10 +11218,10 @@ const GonvilleFont = {
|
|
|
11196
11218
|
o: 'm -413 173 b -408 174 -412 174 -409 174 b -397 173 -404 174 -400 173 b -308 86 -394 172 -374 151 b -223 0 -261 37 -223 0 b -153 84 -223 0 -191 37 b -77 174 -83 173 -84 172 b -72 174 -76 174 -74 174 b -62 173 -68 174 -63 173 b 25 86 -59 172 -39 151 b 112 0 73 37 111 0 b 181 84 112 0 144 37 b 257 174 251 173 251 172 b 262 174 258 174 261 174 b 273 173 266 174 270 173 b 436 9 276 172 347 101 l 447 -1 l 477 36 b 522 79 511 79 513 79 l 522 79 b 552 51 533 79 539 73 b 596 -112 582 6 596 -51 b 567 -262 596 -161 586 -213 b 539 -322 558 -287 544 -316 b 524 -327 534 -326 529 -327 b 504 -315 515 -327 507 -323 b 503 -308 503 -312 503 -309 b 511 -285 503 -302 504 -297 b 555 -113 540 -227 555 -169 b 544 -34 555 -86 551 -59 b 522 19 540 -16 530 8 l 521 22 l 481 -26 l 405 -122 b 353 -176 366 -172 362 -176 b 349 -176 352 -176 351 -176 b 253 -87 341 -176 347 -180 b 167 0 206 -38 167 0 b 99 -86 167 0 136 -38 b 21 -174 27 -174 28 -173 b 17 -176 20 -176 19 -176 b 6 -174 13 -176 9 -174 b -81 -87 4 -173 -14 -152 b -167 0 -129 -38 -167 0 b -236 -86 -167 0 -198 -38 b -313 -174 -307 -174 -306 -173 b -318 -176 -314 -176 -315 -176 b -328 -174 -321 -176 -325 -174 b -491 -12 -330 -173 -367 -137 l -503 0 l -530 -34 b -570 -77 -562 -73 -564 -76 b -577 -79 -571 -79 -574 -79 b -597 -58 -588 -79 -597 -69 b -596 -49 -597 -55 -597 -52 b -417 172 -593 -43 -423 167 b -413 173 -417 172 -415 173 ',
|
|
11197
11219
|
},
|
|
11198
11220
|
stringsDownBow: {
|
|
11199
|
-
x_min: -
|
|
11200
|
-
x_max:
|
|
11201
|
-
ha:
|
|
11202
|
-
o: 'm -
|
|
11221
|
+
x_min: -228.671875,
|
|
11222
|
+
x_max: 227.3125,
|
|
11223
|
+
ha: 232,
|
|
11224
|
+
o: 'm -217 487 l -213 488 l 0 488 l 212 488 l 216 487 b 225 476 220 484 224 480 l 227 473 l 227 244 l 227 15 l 225 12 b 206 0 223 4 215 0 b 197 1 204 0 200 0 b 187 12 193 4 189 6 l 186 15 l 186 138 l 186 262 l -1 262 l -187 262 l -187 138 l -187 15 l -189 12 b -208 0 -193 4 -200 0 b -227 12 -216 0 -223 4 l -228 15 l -228 244 l -228 473 l -227 476 b -217 487 -225 480 -221 484 ',
|
|
11203
11225
|
},
|
|
11204
11226
|
stringsUpBow: {
|
|
11205
11227
|
x_min: -149.71875,
|
|
@@ -37677,8 +37699,8 @@ function rightJustify(options) {
|
|
|
37677
37699
|
};
|
|
37678
37700
|
renderTest({ num_beats: 4, beat_value: 4, resolution: 4 * 4096 }, 2, '2', 10, 300);
|
|
37679
37701
|
renderTest({ num_beats: 4, beat_value: 4, resolution: 4 * 4096 }, 1, 'w', 310, 300);
|
|
37680
|
-
renderTest({ num_beats:
|
|
37681
|
-
renderTest({ num_beats:
|
|
37702
|
+
renderTest({ num_beats: 4, beat_value: 4, resolution: 4 * 4096 }, 4, '4', 610, 300);
|
|
37703
|
+
renderTest({ num_beats: 4, beat_value: 4, resolution: 4 * 4096 }, 8, '8', 910, 300);
|
|
37682
37704
|
ok(true);
|
|
37683
37705
|
}
|
|
37684
37706
|
function noteHeadPadding(options) {
|
|
@@ -38605,8 +38627,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
38605
38627
|
/* harmony export */ "GraceNoteTests": () => (/* binding */ GraceNoteTests)
|
|
38606
38628
|
/* harmony export */ });
|
|
38607
38629
|
/* harmony import */ var _vexflow_test_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./vexflow_test_helpers */ "./tests/vexflow_test_helpers.ts");
|
|
38608
|
-
/* harmony import */ var
|
|
38609
|
-
/* harmony import */ var
|
|
38630
|
+
/* harmony import */ var _src_accidental__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../src/accidental */ "./src/accidental.ts");
|
|
38631
|
+
/* harmony import */ var _src_annotation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../src/annotation */ "./src/annotation.ts");
|
|
38632
|
+
/* harmony import */ var _src_articulation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../src/articulation */ "./src/articulation.ts");
|
|
38633
|
+
/* harmony import */ var _src_dot__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../src/dot */ "./src/dot.ts");
|
|
38634
|
+
/* harmony import */ var _src_formatter__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../src/formatter */ "./src/formatter.ts");
|
|
38610
38635
|
// [VexFlow](https://vexflow.com) - Copyright (c) Mohit Muthanna 2010.
|
|
38611
38636
|
// MIT License
|
|
38612
38637
|
//
|
|
@@ -38615,11 +38640,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
38615
38640
|
|
|
38616
38641
|
|
|
38617
38642
|
|
|
38643
|
+
|
|
38644
|
+
|
|
38645
|
+
|
|
38618
38646
|
const GraceNoteTests = {
|
|
38619
38647
|
Start() {
|
|
38620
38648
|
QUnit.module('Grace Notes');
|
|
38621
38649
|
const run = _vexflow_test_helpers__WEBPACK_IMPORTED_MODULE_0__.VexFlowTests.runTests;
|
|
38622
38650
|
run('Grace Note Basic', basic);
|
|
38651
|
+
run('With Articulation and Annotation on Parent Note', graceNoteModifiers);
|
|
38623
38652
|
run('Grace Note Basic with Slurs', basicSlurred);
|
|
38624
38653
|
run('Grace Note Stem', stem);
|
|
38625
38654
|
run('Grace Note Stem with Beams 1', stemWithBeamed, {
|
|
@@ -38671,7 +38700,7 @@ function basic(options) {
|
|
|
38671
38700
|
].map(f.GraceNote.bind(f));
|
|
38672
38701
|
gracenotes[1].addModifier(f.Accidental({ type: '##' }), 0);
|
|
38673
38702
|
gracenotes3[3].addModifier(f.Accidental({ type: 'bb' }), 0);
|
|
38674
|
-
|
|
38703
|
+
_src_dot__WEBPACK_IMPORTED_MODULE_4__.Dot.buildAndAttach([gracenotes4[0]], { all: true });
|
|
38675
38704
|
const notes = [
|
|
38676
38705
|
f
|
|
38677
38706
|
.StaveNote({ keys: ['b/4'], duration: '4', auto_stem: true })
|
|
@@ -38691,10 +38720,49 @@ function basic(options) {
|
|
|
38691
38720
|
.addModifier(f.GraceNoteGroup({ notes: gracenotes4 }).beamNotes(), 0),
|
|
38692
38721
|
];
|
|
38693
38722
|
const voice = f.Voice().setStrict(false).addTickables(notes);
|
|
38694
|
-
new
|
|
38723
|
+
new _src_formatter__WEBPACK_IMPORTED_MODULE_5__.Formatter().joinVoices([voice]).formatToStave([voice], stave);
|
|
38695
38724
|
f.draw();
|
|
38696
38725
|
ok(true, 'GraceNoteBasic');
|
|
38697
38726
|
}
|
|
38727
|
+
function graceNoteModifiers(options) {
|
|
38728
|
+
const f = _vexflow_test_helpers__WEBPACK_IMPORTED_MODULE_0__.VexFlowTests.makeFactory(options, 700, 130);
|
|
38729
|
+
const stave = f.Stave({ x: 10, y: 10, width: 650 });
|
|
38730
|
+
const gracenotes = [{ keys: ['b/4'], duration: '8', slash: false }].map(f.GraceNote.bind(f));
|
|
38731
|
+
const notes = [
|
|
38732
|
+
f
|
|
38733
|
+
.StaveNote({ keys: ['c/5'], duration: '4', auto_stem: true })
|
|
38734
|
+
.addModifier(f.GraceNoteGroup({ notes: gracenotes }), 0),
|
|
38735
|
+
f
|
|
38736
|
+
.StaveNote({ keys: ['c/5'], duration: '4', auto_stem: true })
|
|
38737
|
+
.addModifier(f.GraceNoteGroup({ notes: gracenotes }), 0)
|
|
38738
|
+
.addModifier(new _src_articulation__WEBPACK_IMPORTED_MODULE_3__.Articulation('a-').setPosition(3), 0),
|
|
38739
|
+
f
|
|
38740
|
+
.StaveNote({ keys: ['c/5'], duration: '4', auto_stem: true })
|
|
38741
|
+
.addModifier(f.GraceNoteGroup({ notes: gracenotes }), 0)
|
|
38742
|
+
.addModifier(new _src_articulation__WEBPACK_IMPORTED_MODULE_3__.Articulation('a-').setPosition(3), 0)
|
|
38743
|
+
.addModifier(new _src_accidental__WEBPACK_IMPORTED_MODULE_1__.Accidental('#')),
|
|
38744
|
+
f
|
|
38745
|
+
.StaveNote({ keys: ['c/5'], duration: '4', auto_stem: true })
|
|
38746
|
+
.addModifier(f.GraceNoteGroup({ notes: gracenotes }), 0)
|
|
38747
|
+
.addModifier(new _src_articulation__WEBPACK_IMPORTED_MODULE_3__.Articulation('a-').setPosition(3), 0)
|
|
38748
|
+
.addModifier(new _src_annotation__WEBPACK_IMPORTED_MODULE_2__.Annotation('words')),
|
|
38749
|
+
f
|
|
38750
|
+
.StaveNote({ keys: ['c/5'], duration: '4', auto_stem: true })
|
|
38751
|
+
.addModifier(f.GraceNoteGroup({ notes: gracenotes }), 0)
|
|
38752
|
+
.addModifier(new _src_articulation__WEBPACK_IMPORTED_MODULE_3__.Articulation('a-').setPosition(3), 0)
|
|
38753
|
+
.addModifier(new _src_articulation__WEBPACK_IMPORTED_MODULE_3__.Articulation('a>').setPosition(3), 0),
|
|
38754
|
+
f
|
|
38755
|
+
.StaveNote({ keys: ['c/5'], duration: '4', auto_stem: true })
|
|
38756
|
+
.addModifier(f.GraceNoteGroup({ notes: gracenotes }), 0)
|
|
38757
|
+
.addModifier(new _src_articulation__WEBPACK_IMPORTED_MODULE_3__.Articulation('a-').setPosition(3), 0)
|
|
38758
|
+
.addModifier(new _src_articulation__WEBPACK_IMPORTED_MODULE_3__.Articulation('a>').setPosition(3), 0)
|
|
38759
|
+
.addModifier(new _src_articulation__WEBPACK_IMPORTED_MODULE_3__.Articulation('a@a').setPosition(3), 0),
|
|
38760
|
+
];
|
|
38761
|
+
const voice = f.Voice().setStrict(false).addTickables(notes);
|
|
38762
|
+
new _src_formatter__WEBPACK_IMPORTED_MODULE_5__.Formatter().joinVoices([voice]).formatToStave([voice], stave);
|
|
38763
|
+
f.draw();
|
|
38764
|
+
ok(true, 'GraceNoteModifiers');
|
|
38765
|
+
}
|
|
38698
38766
|
function basicSlurred(options) {
|
|
38699
38767
|
const f = _vexflow_test_helpers__WEBPACK_IMPORTED_MODULE_0__.VexFlowTests.makeFactory(options, 700, 130);
|
|
38700
38768
|
const stave = f.Stave({ x: 10, y: 10, width: 650 });
|
|
@@ -38721,7 +38789,7 @@ function basicSlurred(options) {
|
|
|
38721
38789
|
gracenotes0[1].addModifier(f.Accidental({ type: '#' }), 0);
|
|
38722
38790
|
gracenotes3[3].addModifier(f.Accidental({ type: 'b' }), 0);
|
|
38723
38791
|
gracenotes3[2].addModifier(f.Accidental({ type: 'n' }), 0);
|
|
38724
|
-
|
|
38792
|
+
_src_dot__WEBPACK_IMPORTED_MODULE_4__.Dot.buildAndAttach([gracenotes4[0]], { all: true });
|
|
38725
38793
|
const notes = [
|
|
38726
38794
|
f
|
|
38727
38795
|
.StaveNote({ keys: ['b/4'], duration: '4', auto_stem: true })
|
|
@@ -38742,7 +38810,7 @@ function basicSlurred(options) {
|
|
|
38742
38810
|
f.StaveNote({ keys: ['a/4'], duration: '4', auto_stem: true }),
|
|
38743
38811
|
];
|
|
38744
38812
|
const voice = f.Voice().setStrict(false).addTickables(notes);
|
|
38745
|
-
new
|
|
38813
|
+
new _src_formatter__WEBPACK_IMPORTED_MODULE_5__.Formatter().joinVoices([voice]).formatToStave([voice], stave);
|
|
38746
38814
|
f.draw();
|
|
38747
38815
|
ok(true, 'GraceNoteBasic');
|
|
38748
38816
|
}
|