Skip to content

Commit bd95a23

Browse files
authored
Merge pull request #1495 from rvilarl/feature/glypharticulation
GlyphArticulation support
2 parents f634110 + b2e195e commit bd95a23

File tree

7 files changed

+140
-15
lines changed

7 files changed

+140
-15
lines changed

src/articulation.ts

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -295,13 +295,17 @@ export class Articulation extends Modifier {
295295

296296
/**
297297
* Create a new articulation.
298-
* @param type entry in `Vex.Flow.articulationCodes` in `tables.ts`
298+
* @param type entry in `Vex.Flow.articulationCodes` in `tables.ts` or Glyph code.
299+
*
300+
* Notes (by default):
301+
* - Glyph codes ending with 'Above' will be positioned ABOVE
302+
* - Glyph codes ending with 'Below' will be positioned BELOW
299303
*/
300304
constructor(type: string) {
301305
super();
302306

303307
this.type = type;
304-
this.position = BELOW;
308+
this.position = ABOVE;
305309
this.render_options = {
306310
font_scale: 38,
307311
};
@@ -311,13 +315,26 @@ export class Articulation extends Modifier {
311315

312316
protected reset(): void {
313317
this.articulation = Tables.articulationCodes(this.type);
314-
const articulation = defined(this.articulation, 'ArgumentError', `Articulation not found: ${this.type}`);
315-
const code = (this.position === ABOVE ? articulation.aboveCode : articulation.belowCode) || articulation.code;
318+
// Use type as glyph code, if not defined as articulation code
319+
if (!this.articulation) {
320+
this.articulation = { code: this.type, between_lines: false };
321+
if (this.type.endsWith('Above')) this.position = ABOVE;
322+
if (this.type.endsWith('Below')) this.position = BELOW;
323+
}
324+
const code =
325+
(this.position === ABOVE ? this.articulation.aboveCode : this.articulation.belowCode) || this.articulation.code;
316326
this.glyph = new Glyph(code ?? '', this.render_options.font_scale);
327+
defined(this.glyph, 'ArgumentError', `Articulation not found: ${this.type}`);
317328

318329
this.setWidth(defined(this.glyph.getMetrics().width));
319330
}
320331

332+
/** Set if articulation should be rendered between lines. */
333+
setBetweenLines(betweenLines = true): this {
334+
this.articulation.between_lines = betweenLines;
335+
return this;
336+
}
337+
321338
/** Render articulation in position next to note. */
322339
draw(): void {
323340
const ctx = this.checkContext();

src/factory.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -391,15 +391,11 @@ export class Factory {
391391
return chordSymbol;
392392
}
393393

394-
Articulation(params?: { type?: string; position?: string | number }): Articulation {
395-
const p = {
396-
type: 'a.',
397-
position: 'above',
398-
...params,
399-
};
394+
Articulation(params?: { betweenLines?: boolean; type?: string; position?: string | number }): Articulation {
395+
const articulation = new Articulation(params?.type ?? 'a.');
400396

401-
const articulation = new Articulation(p.type);
402-
articulation.setPosition(p.position);
397+
if (params?.position != undefined) articulation.setPosition(params.position);
398+
if (params?.betweenLines != undefined) articulation.setBetweenLines(params.betweenLines);
403399
articulation.setContext(this.context);
404400
return articulation;
405401
}

src/fonts/bravura_glyphs.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -968,6 +968,22 @@ export const BravuraFont = {
968968
ha: 408,
969969
o: 'm 606 -84 b 521 0 606 -39 569 0 b 439 -84 475 0 439 -39 b 521 -167 439 -130 475 -167 b 606 -84 569 -167 606 -130 z m 815 -389 b 891 -347 858 -389 891 -370 l 891 -22 b 854 -1 891 -10 876 -1 b 816 -22 834 -1 816 -10 l 816 -217 b 514 -245 816 -235 665 -245 b 213 -217 363 -245 213 -235 l 213 -22 b 174 -1 213 -10 196 -1 b 138 -22 154 -1 138 -10 l 138 -347 b 215 -389 138 -370 171 -389 z m 953 -588 b 1030 -546 995 -588 1030 -569 l 1030 -22 b 991 -1 1030 -10 1012 -1 b 955 -22 971 -1 955 -10 l 955 -431 b 514 -458 955 -449 734 -458 b 75 -431 294 -458 75 -449 l 75 -22 b 37 -1 75 -10 59 -1 b 0 -22 17 -1 0 -10 l 0 -546 b 76 -588 0 -569 35 -588 z',
970970
},
971+
fermataVeryShortAbove: {
972+
x_min: 0,
973+
x_max: 726,
974+
y_min: 0,
975+
y_max: 449,
976+
ha: 449,
977+
o: 'm 46 0 b 59 7 50 0 52 4 b 516 517 120 59 507 517 b 975 4 527 517 920 52 b 988 0 979 1 988 0 l 1041 0 b 1045 6 1041 0 1045 1 b 1043 13 1045 7 1045 10 b 516 647 962 91 536 647 b 3 13 504 647 91 98 b 0 7 0 10 0 9 b 6 0 0 3 6 0 z m 238 0 b 248 6 240 0 242 3 b 516 236 292 43 494 236 b 786 3 539 236 746 37 b 796 0 789 1 796 0 l 865 0 b 870 4 865 0 870 1 b 867 10 870 6 868 9 b 516 409 806 68 531 409 b 166 10 497 409 229 73 b 163 4 164 9 163 6 b 167 0 163 1 167 0 z m 592 91 b 516 167 592 132 557 167 b 438 91 472 167 438 132 b 516 13 438 48 472 13 b 592 91 557 13 592 48 z',
978+
},
979+
fermataVeryShortBelow: {
980+
x_min: 0,
981+
x_max: 726,
982+
y_min: -449,
983+
y_max: 0,
984+
ha: 449,
985+
o: 'm 167 0 b 163 -4 167 0 163 -1 b 166 -10 163 -6 164 -9 b 516 -409 229 -73 497 -409 b 867 -10 531 -409 806 -68 b 870 -4 868 -9 870 -6 b 865 0 870 -1 865 0 l 796 0 b 786 -3 796 0 789 -1 b 516 -236 746 -37 539 -236 b 248 -6 494 -236 292 -43 b 238 0 242 -3 240 0 z m 6 0 b 0 -7 6 0 0 -3 b 3 -13 0 -9 0 -10 b 516 -647 91 -98 504 -647 b 1043 -13 536 -647 962 -91 b 1045 -6 1045 -10 1045 -7 b 1041 0 1045 -1 1041 0 l 988 0 b 975 -4 988 0 979 -1 b 516 -517 920 -52 527 -517 b 59 -7 507 -517 120 -59 b 46 0 52 -4 50 0 z m 592 -91 b 516 -13 592 -48 557 -13 b 438 -91 472 -13 438 -48 b 516 -167 438 -132 472 -167 b 592 -91 557 -167 592 -132 z',
986+
},
971987
fermataShortAbove: {
972988
x_min: 0,
973989
x_max: 604,
@@ -3515,5 +3531,5 @@ export const BravuraFont = {
35153531
},
35163532
fontFamily: 'Bravura',
35173533
resolution: 1000,
3518-
generatedOn: '2022-12-19T23:52:23.215Z',
3534+
generatedOn: '2022-12-18T09:06:51.407Z',
35193535
};

src/fonts/gonville_glyphs.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -696,6 +696,22 @@ export const GonvilleSmuflFont = {
696696
ha: 412,
697697
o: 'm -375 -2 b -367 0 -372 -1 -370 0 b -348 -13 -359 0 -350 -5 b -346 -223 -346 -17 -346 -17 l -346 -429 l 0 -429 l 346 -429 l 346 -223 b 348 -13 346 -17 346 -17 b 367 0 351 -5 359 0 b 386 -13 375 0 383 -5 b 388 -297 387 -16 388 -156 b 386 -580 388 -437 387 -578 b 375 -592 384 -585 379 -590 l 371 -593 l 0 -593 l -371 -593 l -375 -592 b -386 -580 -379 -590 -384 -585 b -388 -297 -387 -578 -388 -437 b -386 -13 -388 -156 -387 -16 b -375 -2 -384 -9 -379 -4 z m -272 -2 b -265 0 -270 -1 -267 0 b -245 -13 -256 0 -248 -5 b -244 -123 -244 -16 -244 -18 l -244 -229 l 0 -229 l 244 -229 l 244 -123 b 244 -76 244 -104 244 -89 b 249 -6 244 -4 244 -12 b 264 0 254 -2 259 0 b 283 -13 272 0 280 -5 b 285 -181 284 -16 285 -99 b 283 -349 285 -264 284 -347 b 272 -361 282 -354 277 -359 b 0 -362 269 -362 135 -362 b -272 -361 -135 -362 -269 -362 b -283 -349 -277 -359 -282 -354 b -285 -181 -284 -347 -285 -264 b -283 -13 -285 -99 -284 -16 b -272 -2 -282 -9 -277 -4 z m -14 -1 b 0 0 -9 0 -5 0 b 77 -41 29 0 60 -16 b 93 -93 88 -57 93 -75 b 0 -185 93 -141 55 -185 b -93 -93 -55 -185 -93 -141 b -77 -41 -93 -75 -88 -57 b -14 -1 -63 -20 -40 -6 z',
698698
},
699+
fermataVeryShortAbove: {
700+
x_min: -330,
701+
x_max: 330,
702+
y_min: 0,
703+
y_max: 536,
704+
ha: 536,
705+
o: 'm -8 771 b 0 772 -6 772 -3 772 b 8 771 3 772 6 772 b 33 738 14 769 16 766 b 63 689 42 724 56 702 b 92 643 71 677 84 656 b 138 570 100 630 121 597 b 181 500 154 543 174 511 b 213 448 188 488 203 465 b 295 317 260 372 283 336 b 340 244 302 306 322 273 b 382 177 358 216 376 185 b 410 132 387 168 400 148 b 475 23 470 34 475 28 b 474 21 475 23 474 22 b 462 2 474 12 469 4 b 423 0 459 1 441 0 b 384 2 405 0 387 1 b 359 35 379 4 376 7 b 329 83 350 49 337 71 b 300 130 321 96 308 117 b 255 203 292 143 272 175 b 211 273 238 230 218 261 b 179 324 204 284 190 307 b 98 456 133 399 110 436 b 7 601 69 502 23 576 b -20 645 -2 616 -14 635 b -31 662 -26 654 -31 662 b -42 645 -31 662 -36 654 b -69 601 -48 635 -60 616 b -159 456 -84 577 -125 511 b -191 404 -166 444 -181 421 b -273 273 -238 330 -261 292 b -316 203 -280 261 -300 230 b -362 130 -333 175 -354 143 b -390 83 -370 117 -383 96 b -421 35 -398 71 -412 49 b -446 2 -438 7 -440 4 b -454 0 -449 1 -451 0 b -474 21 -465 0 -474 9 b -475 23 -474 22 -475 23 b -410 132 -475 28 -470 34 b -382 177 -400 148 -387 168 b -340 244 -376 185 -358 216 b -295 317 -322 273 -302 306 b -213 448 -283 336 -260 372 b -181 500 -203 465 -188 488 b -138 570 -174 511 -154 543 b -92 643 -121 597 -100 630 b -63 689 -84 656 -71 677 b -33 738 -56 702 -42 724 b -8 771 -16 765 -14 769 z m -34 476 b -26 477 -31 477 -29 477 b -11 472 -20 477 -15 475 b 263 28 -8 468 261 34 b 264 21 264 26 264 24 b 252 2 264 13 259 4 b 213 0 249 1 231 0 b 174 2 195 0 177 1 b 54 188 168 4 171 -1 b -56 366 -6 286 -56 366 b -167 188 -57 366 -107 286 b -287 2 -284 -1 -281 4 b -295 0 -290 1 -292 0 b -316 21 -306 0 -316 10 b -314 28 -316 23 -315 26 b -40 472 -312 34 -43 468 b -34 476 -38 474 -36 475 z m -52 184 b -39 185 -48 185 -43 185 b 31 153 -13 185 14 173 b 54 93 47 136 54 114 b 14 16 54 63 40 33 b -38 0 -3 5 -21 0 b -131 93 -86 0 -131 38 b -52 184 -131 139 -99 176 z',
706+
},
707+
fermataVeryShortBelow: {
708+
x_min: -330,
709+
x_max: 330,
710+
y_min: 0,
711+
y_max: 536,
712+
ha: 536,
713+
o: 'm -8 771 b 0 772 -6 772 -3 772 b 8 771 3 772 6 772 b 33 738 14 769 16 766 b 63 689 42 724 56 702 b 92 643 71 677 84 656 b 138 570 100 630 121 597 b 181 500 154 543 174 511 b 213 448 188 488 203 465 b 295 317 260 372 283 336 b 340 244 302 306 322 273 b 382 177 358 216 376 185 b 410 132 387 168 400 148 b 475 23 470 34 475 28 b 474 21 475 23 474 22 b 462 2 474 12 469 4 b 423 0 459 1 441 0 b 384 2 405 0 387 1 b 359 35 379 4 376 7 b 329 83 350 49 337 71 b 300 130 321 96 308 117 b 255 203 292 143 272 175 b 211 273 238 230 218 261 b 179 324 204 284 190 307 b 98 456 133 399 110 436 b 7 601 69 502 23 576 b -20 645 -2 616 -14 635 b -31 662 -26 654 -31 662 b -42 645 -31 662 -36 654 b -69 601 -48 635 -60 616 b -159 456 -84 577 -125 511 b -191 404 -166 444 -181 421 b -273 273 -238 330 -261 292 b -316 203 -280 261 -300 230 b -362 130 -333 175 -354 143 b -390 83 -370 117 -383 96 b -421 35 -398 71 -412 49 b -446 2 -438 7 -440 4 b -454 0 -449 1 -451 0 b -474 21 -465 0 -474 9 b -475 23 -474 22 -475 23 b -410 132 -475 28 -470 34 b -382 177 -400 148 -387 168 b -340 244 -376 185 -358 216 b -295 317 -322 273 -302 306 b -213 448 -283 336 -260 372 b -181 500 -203 465 -188 488 b -138 570 -174 511 -154 543 b -92 643 -121 597 -100 630 b -63 689 -84 656 -71 677 b -33 738 -56 702 -42 724 b -8 771 -16 765 -14 769 z m -34 476 b -26 477 -31 477 -29 477 b -11 472 -20 477 -15 475 b 263 28 -8 468 261 34 b 264 21 264 26 264 24 b 252 2 264 13 259 4 b 213 0 249 1 231 0 b 174 2 195 0 177 1 b 54 188 168 4 171 -1 b -56 366 -6 286 -56 366 b -167 188 -57 366 -107 286 b -287 2 -284 -1 -281 4 b -295 0 -290 1 -292 0 b -316 21 -306 0 -316 10 b -314 28 -316 23 -315 26 b -40 472 -312 34 -43 468 b -34 476 -38 474 -36 475 z m -52 184 b -39 185 -48 185 -43 185 b 31 153 -13 185 14 173 b 54 93 47 136 54 114 b 14 16 54 63 40 33 b -38 0 -3 5 -21 0 b -131 93 -86 0 -131 38 b -52 184 -131 139 -99 176 z',
714+
},
699715
fermataShortAbove: {
700716
x_min: -269,
701717
x_max: 269,
@@ -1083,5 +1099,5 @@ export const GonvilleSmuflFont = {
10831099
},
10841100
fontFamily: 'GonvilleSmufl',
10851101
resolution: 1000,
1086-
generatedOn: '2022-12-15T17:35:56.890Z',
1102+
generatedOn: '2022-12-18T09:06:20.008Z',
10871103
};

src/fonts/petaluma_glyphs.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -968,6 +968,22 @@ export const PetalumaFont = {
968968
ha: 457,
969969
o: 'm 56 -615 b 282 -612 132 -612 207 -613 b 924 -606 497 -608 710 -606 b 973 -570 953 -606 968 -593 b 988 -455 984 -533 991 -494 b 982 -262 984 -390 982 -327 b 976 -69 982 -197 981 -134 b 976 -14 975 -50 976 -33 b 966 43 976 4 975 23 b 940 20 953 37 943 35 b 933 -76 936 -12 933 -45 b 935 -121 933 -91 933 -107 b 940 -307 940 -183 940 -245 l 940 -435 b 919 -458 940 -451 935 -458 b 894 -459 910 -458 903 -458 b 206 -467 665 -461 435 -467 b 88 -467 167 -467 127 -468 b 45 -425 45 -467 42 -465 b 46 -400 46 -416 46 -408 b 43 -325 46 -376 43 -350 b 42 -59 42 -236 42 -148 b 22 17 42 -32 36 -6 b 0 -27 -1 7 0 -10 b 7 -420 0 -158 7 -289 l 7 -474 b 16 -579 7 -510 7 -544 b 56 -615 22 -603 27 -615 z m 789 -390 b 835 -357 816 -392 829 -380 b 850 -256 844 -324 850 -291 b 848 -230 850 -248 850 -239 b 845 -135 845 -199 845 -167 l 845 -72 b 837 23 845 -40 848 -9 b 809 -27 809 14 809 -7 l 809 -222 b 788 -242 809 -238 805 -242 l 203 -229 b 180 -209 186 -229 180 -223 l 180 -160 b 179 -115 180 -145 180 -131 b 179 -50 177 -94 179 -72 b 163 24 179 -26 176 0 b 137 -6 145 19 140 10 b 134 -39 134 -17 134 -27 b 138 -105 134 -60 137 -82 l 138 -197 b 145 -343 138 -246 138 -294 b 179 -377 148 -364 151 -377 b 789 -390 383 -377 586 -380 z m 480 -164 b 566 -65 549 -164 566 -140 b 527 1 566 -10 564 1 b 436 -71 426 1 436 -9 l 436 -88 l 436 -143 b 454 -163 436 -153 439 -161 b 480 -164 464 -163 472 -164 z',
970970
},
971+
fermataVeryShortAbove: {
972+
x_min: 0,
973+
x_max: 711,
974+
y_min: -31,
975+
y_max: 496,
976+
ha: 527,
977+
o: 'm 1018 -45 b 1024 -1 1021 -29 1024 -14 b 986 105 1024 40 1008 75 b 557 688 845 302 701 495 b 520 714 544 706 531 714 b 480 687 505 714 492 706 b 340 490 433 621 387 556 b 73 127 252 367 168 243 b 0 22 48 95 22 63 b 68 60 33 27 52 42 b 167 170 101 96 132 135 b 494 503 276 279 384 393 b 518 518 504 513 511 518 b 543 501 526 518 533 513 b 923 63 670 356 799 212 b 1018 -45 952 29 984 -4 z m 837 -16 b 838 1 838 -10 838 -4 b 799 82 838 37 818 60 b 560 369 721 179 639 274 b 541 396 553 377 546 386 b 518 422 533 413 527 422 b 491 400 511 422 503 415 b 347 229 445 341 396 285 b 203 45 297 170 239 117 b 184 17 199 36 184 26 b 189 9 184 14 186 12 b 226 26 200 -1 215 19 l 238 35 b 494 245 321 107 408 176 b 510 253 501 251 505 253 b 526 245 514 253 520 251 b 729 73 592 186 660 130 z m 495 0 b 511 6 500 0 505 1 b 556 32 526 16 540 30 b 586 68 583 35 586 50 b 579 115 586 86 582 101 b 533 190 566 168 553 190 b 459 154 516 190 494 177 b 442 122 448 145 442 135 b 445 105 442 117 442 111 b 477 17 456 76 465 46 b 495 0 481 7 487 0 z',
978+
},
979+
fermataVeryShortBelow: {
980+
x_min: 0,
981+
x_max: 697,
982+
y_min: -475,
983+
y_max: 13,
984+
ha: 488,
985+
o: 'm 507 -383 b 530 -369 514 -383 521 -377 b 775 -130 611 -288 694 -210 b 824 3 811 -94 822 -48 b 789 -7 808 6 799 0 b 521 -212 698 -72 611 -143 b 488 -226 508 -222 498 -226 b 452 -209 477 -226 467 -220 b 202 7 370 -135 285 -65 b 187 19 197 10 193 19 b 179 14 184 19 181 17 b 171 -3 174 10 171 4 b 173 -13 171 -6 171 -9 b 235 -122 186 -53 206 -94 l 484 -370 b 507 -383 492 -379 500 -383 z m 503 -684 b 539 -647 517 -674 528 -661 b 917 -153 665 -482 793 -318 b 999 -24 948 -112 984 -73 b 1004 -10 1001 -20 1004 -16 b 999 -3 1004 -7 1002 -4 b 973 -10 991 1 981 -1 l 963 -23 b 552 -505 825 -184 688 -344 b 528 -521 543 -517 536 -521 b 505 -505 521 -521 514 -516 b 156 -128 393 -374 274 -253 b 27 6 114 -84 72 -39 b 16 17 24 9 22 17 b 9 13 13 17 12 16 b 0 -3 6 10 0 3 b 1 -9 0 -4 0 -7 b 14 -36 4 -17 9 -27 b 117 -179 45 -86 81 -132 b 482 -667 242 -338 360 -504 b 503 -684 487 -672 491 -683 z m 487 -164 b 552 -98 523 -164 552 -137 b 544 -30 550 -78 549 -55 b 521 -1 541 -19 537 -1 l 517 -1 b 446 -29 492 -9 462 0 b 445 -42 444 -32 445 -37 b 464 -145 451 -76 458 -111 b 487 -164 468 -157 467 -164 z',
986+
},
971987
fermataShortAbove: {
972988
x_min: 0,
973989
x_max: 545,
@@ -1611,5 +1627,5 @@ export const PetalumaFont = {
16111627
},
16121628
fontFamily: 'Petaluma',
16131629
resolution: 1000,
1614-
generatedOn: '2022-12-19T23:53:12.904Z',
1630+
generatedOn: '2022-12-18T09:07:50.817Z',
16151631
};

tests/articulation_tests.ts

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ const ArticulationTests = {
2525
QUnit.module('Articulation');
2626
const run = VexFlowTests.runTests;
2727
run('Articulation - Vertical Placement', verticalPlacement);
28+
run('Articulation - Vertical Placement (Glyph codes)', verticalPlacement2);
2829
run('Articulation - Staccato/Staccatissimo', drawArticulations, { sym1: 'a.', sym2: 'av' });
2930
run('Articulation - Accent/Tenuto', drawArticulations, { sym1: 'a>', sym2: 'a-' });
3031
run('Articulation - Marcato/L.H. Pizzicato', drawArticulations, { sym1: 'a^', sym2: 'a+' });
@@ -241,6 +242,67 @@ function verticalPlacement(options: TestOptions, contextBuilder: ContextBuilder)
241242
ok(true, ' Annotation Placement');
242243
}
243244

245+
function verticalPlacement2(options: TestOptions, contextBuilder: ContextBuilder): void {
246+
const ctx = contextBuilder(options.elementId, 750, 300);
247+
248+
const staveNote = (noteStruct: StaveNoteStruct) => new StaveNote(noteStruct);
249+
const stave = new Stave(10, 50, 750).addClef('treble').setContext(ctx).draw();
250+
251+
const notes = [
252+
staveNote({ keys: ['f/4'], duration: 'q' })
253+
.addModifier(new Articulation('fermataBelow'), 0)
254+
.addModifier(new Articulation('augmentationDot').setPosition(ModifierPosition.BELOW), 0)
255+
.addModifier(new Articulation('articTenutoBelow'), 0),
256+
staveNote({ keys: ['g/4'], duration: 'q', stem_direction: Stem.DOWN })
257+
.addModifier(new Articulation('fermataShortBelow'), 0)
258+
.addModifier(new Articulation('augmentationDot').setPosition(ModifierPosition.BELOW), 0)
259+
.addModifier(new Articulation('articTenutoBelow'), 0),
260+
staveNote({ keys: ['c/5'], duration: 'q' })
261+
.addModifier(new Articulation('fermataLongBelow'), 0)
262+
.addModifier(new Articulation('augmentationDot').setPosition(ModifierPosition.BELOW), 0)
263+
.addModifier(new Articulation('articTenutoBelow'), 0),
264+
staveNote({ keys: ['f/4'], duration: 'q' })
265+
.addModifier(new Articulation('augmentationDot').setPosition(ModifierPosition.BELOW), 0)
266+
.addModifier(new Articulation('articTenutoBelow'), 0)
267+
.addModifier(new Articulation('fermataVeryShortBelow'), 0),
268+
staveNote({ keys: ['g/4'], duration: 'q', stem_direction: Stem.DOWN })
269+
.addModifier(new Articulation('augmentationDot').setPosition(ModifierPosition.BELOW), 0)
270+
.addModifier(new Articulation('articTenutoBelow'), 0)
271+
.addModifier(new Articulation('fermataVeryLongBelow'), 0),
272+
staveNote({ keys: ['c/5'], duration: 'q' })
273+
.addModifier(new Articulation('augmentationDot').setPosition(ModifierPosition.BELOW).setBetweenLines(), 0)
274+
.addModifier(new Articulation('articTenutoBelow').setBetweenLines(), 0)
275+
.addModifier(new Articulation('fermataBelow'), 0),
276+
staveNote({ keys: ['a/5'], duration: 'q', stem_direction: Stem.DOWN })
277+
.addModifier(new Articulation('fermataAbove'), 0)
278+
.addModifier(new Articulation('augmentationDot').setPosition(ModifierPosition.ABOVE), 0)
279+
.addModifier(new Articulation('articTenutoAbove'), 0),
280+
staveNote({ keys: ['f/5'], duration: 'q' })
281+
.addModifier(new Articulation('fermataShortAbove'), 0)
282+
.addModifier(new Articulation('augmentationDot').setPosition(ModifierPosition.ABOVE), 0)
283+
.addModifier(new Articulation('articTenutoAbove'), 0),
284+
staveNote({ keys: ['b/4'], duration: 'q', stem_direction: Stem.DOWN })
285+
.addModifier(new Articulation('fermataLongAbove'), 0)
286+
.addModifier(new Articulation('augmentationDot').setPosition(ModifierPosition.ABOVE), 0)
287+
.addModifier(new Articulation('articTenutoAbove'), 0),
288+
staveNote({ keys: ['a/5'], duration: 'q', stem_direction: Stem.DOWN })
289+
.addModifier(new Articulation('augmentationDot').setPosition(ModifierPosition.ABOVE), 0)
290+
.addModifier(new Articulation('articTenutoAbove'), 0)
291+
.addModifier(new Articulation('fermataVeryShortAbove'), 0),
292+
staveNote({ keys: ['f/5'], duration: 'q' })
293+
.addModifier(new Articulation('augmentationDot').setPosition(ModifierPosition.ABOVE), 0)
294+
.addModifier(new Articulation('articTenutoAbove'), 0)
295+
.addModifier(new Articulation('fermataVeryLongAbove'), 0),
296+
staveNote({ keys: ['b/4'], duration: 'q', stem_direction: Stem.DOWN })
297+
.addModifier(new Articulation('augmentationDot').setPosition(ModifierPosition.ABOVE).setBetweenLines(), 0)
298+
.addModifier(new Articulation('articTenutoAbove').setBetweenLines(), 0)
299+
.addModifier(new Articulation('fermataAbove'), 0),
300+
];
301+
302+
Formatter.FormatAndDraw(ctx, stave, notes);
303+
ok(true, ' Annotation Placement (Glyph codes)');
304+
}
305+
244306
function drawArticulations2(options: TestOptions): void {
245307
expect(0);
246308
const scale = 0.8;

tools/fonts/config/valid_codes.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,8 @@ module.exports = {
162162
fermataLongBelow: 'v5f',
163163
fermataVeryLongAbove: 'v32',
164164
fermataVeryLongBelow: 'vbd',
165+
fermataVeryShortAbove: 'vxx',
166+
fermataVeryShortBelow: 'vxx',
165167
fermataShortAbove: 'vac',
166168
fermataShortBelow: 'v7e',
167169
breathMarkComma: 'v6c',

0 commit comments

Comments
 (0)