1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
// abc2svg - deco.js - decorations
//
// Copyright (C) 2014-2019 Jean-Francois Moine
// Copyright (C) 2014-2020 Jean-Francois Moine
//
// This file is part of abc2svg-core.
//
// abc2svg-core is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// abc2svg-core is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with abc2svg-core. If not, see <http://www.gnu.org/licenses/>.
// Decoration objects
// dd { // decoration definition (static)
// dd_en, // definition of the ending decoration
// dd_st, // definition of the starting decoration
// func, // function
// glyph, // glyph
// h, // height / ascent
// hd, // descent
// inv, // inverted glyph
// name, // name
// str, // string
// wl, // left width
// wr, // right width
// }
// de { // decoration elements (in an array - one list per music line)
// dd, // definition of the decoration
// defl { // flags
// noen, // no end of this decoration
// nost, // no start of this decoration
// },
// has_val, // defined value
// ix, // index of the decoration in the 'de' list
// lden, // end of a long decoration
// ldst, // start of a long decoration if true
// m, // note index when note decoration
// prev, // previous decoration (hack for 'tr~~~~~')
// s, // symbol
// start, // start of the decoration (in the ending element)
// up, // above the symbol
// val, // value
// x, // x offset
// y, // y offset
// }
var dd_tb = {}, // definition of the decorations
a_de // array of the decoration elements
// decorations - populate with standard decorations
var decos = {
dot: "0 stc 5 1 1",
|
| ︙ | | |
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
|
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
|
-
-
+
+
-
-
+
+
|
"D.S.": "3 dsgn 16 10 10",
"D.C.alcoda": "3 dacs 16 38 38 D.C. al Coda",
"D.S.alcoda": "3 dacs 16 38 38 D.S. al Coda",
"D.C.alfine": "3 dacs 16 38 38 D.C. al Fine",
"D.S.alfine": "3 dacs 16 38 38 D.S. al Fine",
fine: "3 dacs 16 10 10 Fine",
turn: "3 turn 10 0 5",
"trill(": "3 ltr 8 0 0",
"trill)": "3 ltr 8 0 0",
"trill(": "3 ltr 8 4 0",
"trill)": "3 ltr 8 4 0",
f: "6 f 18 1 7",
ff: "6 ff 18 2 10",
fff: "6 fff 18 4 13",
ffff: "6 ffff 18 6 16",
mf: "6 mf 18 6 13",
mp: "6 mp 18 6 16",
p: "6 p 18 2 8",
pp: "6 pp 18 5 14",
ppp: "6 ppp 18 8 20",
pppp: "6 pppp 18 10 25",
pralltriller: "3 umrd 10 5 5",
sfz: "6 sfz 18 4 10",
ped: "4 ped 18 6 10",
"ped-up": "4 pedoff 12 4 4",
"ped(": "4 lped 20 1 1",
"ped)": "4 lped 20 1 1",
"ped(": "4 lped 20 5 5",
"ped)": "4 lped 20 5 5",
"crescendo(": "6 cresc 18 0 0",
"crescendo)": "6 cresc 18 0 0",
"<(": "6 cresc 18 0 0",
"<)": "6 cresc 18 0 0",
"diminuendo(": "6 dim 18 0 0",
"diminuendo)": "6 dim 18 0 0",
">(": "6 dim 18 0 0",
|
| ︙ | | |
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
|
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
|
-
+
+
+
+
+
+
+
+
+
|
rbstop: "37 0 0 0 0",
"/": "38 0 0 6 6",
"//": "38 0 0 6 6",
"///": "38 0 0 6 6",
"beam-accel": "39 0 0 0 0",
"beam-rall": "39 0 0 0 0",
stemless: "40 0 0 0 0",
rbend: "41 0 0 0 0"},
rbend: "41 0 0 0 0",
editorial: "42 0 0 0 0",
"sacc-1": "3 sacc-1 6,4 4 4",
sacc3: "3 sacc3 6,5 4 4",
sacc1: "3 sacc1 6,4 4 4",
courtesy: "43 0 0 0 0",
"cacc-1": "3 cacc-1 0 0 0",
cacc3: "3 cacc3 0 0 0",
cacc1: "3 cacc1 0 0 0"},
// types of decoration per function
f_near = [true, true, true],
f_note = [false, false, false, true, true, true, false, false, true],
f_staff = [false, false, false, false, false, false, true, true]
/* -- get the max/min vertical offset -- */
|
| ︙ | | |
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
|
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
|
-
+
|
if (y > -6 && y < 24) {
if (up)
y += 3;
y = (((y + 6) / 6) | 0) * 6 - 6 /* between lines */
}
if (up)
s.ymx = y + dd.h
else if (dd.name[0] == 'w')
else if (dd.name[0] == 'w') // wedge
s.ymn = y - dd.h
else
s.ymn = y
de.y = y
if (s.type == C.NOTE)
de.x += s.notes[s.stem >= 0 ? 0 : s.nhd].shhd
if (dd.name[0] == 'd' /* if dot decoration */
|
| ︙ | | |
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
|
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
|
+
-
-
-
+
+
+
+
+
|
// special case for long decoration
function d_trill(de) {
if (de.ldst)
return
var up, y, w, tmp,
dd = de.dd,
de2 = de.prev,
s2 = de.s,
st = s2.st,
s = de.start.s,
x = s.x
if (de.prev) { // hack 'tr~~~~~'
x = de.prev.x + 10;
y = de.prev.y
if (de2) { // same height
x = de2.s.x + de.dd.wl + 2
de2.val -= de2.dd.wr
if (de2.val < 8)
de2.val = 8
}
de.st = st
if (dd.func != 4) { // if not below
switch (dd.glyph) {
case "8va":
case "15ma":
|
| ︙ | | |
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
|
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
|
-
-
-
+
+
+
-
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
x = de.x - 20 - 3;
w = 20
}
} else {
w = s2.x - x - 6
if (s2.type == C.NOTE)
w -= 6
if (w < 20) {
x -= (20 - w) * .5;
w = 20
if (w < 10) {
x -= 10 - w
w = 10
}
}
dd = de.dd;
if (!y)
y = y_get(st, up, x, w)
y = y_get(st, up, x - dd.wl - 5, w)
if (up) {
tmp = staff_tb[s.st].topbar + 2
if (y < tmp)
y = tmp
} else {
y -= dd.h;
tmp = staff_tb[s.st].botbar - 2
if (y > tmp)
y = tmp
y -= dd.h
}
if (de2) { // if same height
if (up) {
if (y < de2.y)
y = de2.y // (only on one note)
} else {
if (y >= de2.y) {
y = de2.y
} else {
do {
de2.y = y
de2 = de2.prev // go backwards
} while (de2)
}
}
}
de.lden = false;
de.has_val = true;
de.val = w;
de.x = x;
de.y = y
if (up)
y += dd.h;
|
| ︙ | | |
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
|
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
|
-
+
+
|
if (de.start) { // if long decoration
d_trill(de)
return
}
var yc, up, inv,
s = de.s,
dd = de.dd,
x = s.x,
// x = s.x,
x = de.x,
w = dd.wl + dd.wr,
stafft = staff_tb[s.st].topbar + 2,
staffb = staff_tb[s.st].botbar - 2
if (s.nhd)
x += s.notes[s.stem >= 0 ? 0 : s.nhd].shhd;
up = -1
|
| ︙ | | |
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
|
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
|
-
+
-
+
-
+
|
break
default:
if (dd.name.indexOf("invert") == 0)
inv = true
if (dd.name != "invertedfermata"
&& (up > 0
|| (up < 0 && s.multi >= 0))) {
yc = y_get(s.st, true, s.x - dd.wl, w) + 2
yc = y_get(s.st, true, s.x - dd.wl, w) + 2 + dd.hd
if (yc < stafft)
yc = stafft;
y_set(s.st, true, s.x - dd.wl, w, yc + dd.h);
s.ymx = yc + dd.h
} else {
yc = y_get(s.st, false, s.x - dd.wl, w) - 2
yc = y_get(s.st, false, s.x - dd.wl, w) - 3 + dd.hd
if (yc > staffb)
yc = staffb;
yc -= dd.h;
y_set(s.st, false, s.x - dd.wl, w, yc)
y_set(s.st, false, s.x - dd.wl, w, yc - dd.hd)
if (dd.name == "fermata")
inv = true;
s.ymn = yc
}
break
}
if (inv) {
|
| ︙ | | |
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
|
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
|
+
-
+
-
+
-
+
-
-
+
+
-
-
-
+
+
+
+
+
+
-
+
+
|
d_pf, /* 6 - tied to staff (dynamic marks) */
d_cresc /* 7 */
]
// add a decoration
/* syntax:
* %%deco <name> <c_func> <glyph> <h> <wl> <wr> [<str>]
* "<h>" may be followed by ",<hd>" (descent)
*/
function deco_add(param) {
var dv = param.match(/(\S*)\s+(.*)/);
decos[dv[1]] = dv[2]
}
// define a decoration
function deco_def(nm) {
var a, dd, dd2, name2, c, i, elts, str,
var a, dd, dd2, name2, c, i, elts, str, hd,
text = decos[nm]
if (!text) {
if (cfmt.decoerr)
error(1, null, "Unknown decoration '$1'", nm)
return //undefined
}
// extract the values
a = text.match(/(\d+)\s+(.+?)\s+([0-9.]+)\s+([0-9.]+)\s+([0-9.]+)/)
a = text.match(/(\d+)\s+(.+?)\s+([0-9.,]+)\s+([0-9.]+)\s+([0-9.]+)/)
if (!a) {
error(1, null, "Invalid decoration '$1'", nm)
return //undefined
}
var c_func = Number(a[1]),
// glyph = a[2],
h = parseFloat(a[3]),
h = a[3],
wl = parseFloat(a[4]),
wr = parseFloat(a[5])
if (isNaN(c_func)) {
error(1, null, "%%deco: bad C function value '$1'", a[1])
return //undefined
}
if ((c_func < 0 || c_func > 10)
&& (c_func < 32 || c_func > 41)) {
if (c_func > 10
&& (c_func < 32 || c_func > 43)) {
error(1, null, "%%deco: bad C function index '$1'", c_func)
return //undefined
}
if (c_func == 5) // old !trill(!
c_func = 3
if (c_func == 7) // old !cresc(!
c_func = 6
if (h < 0 || wl < 0 || wr < 0) {
error(1, null, "%%deco: cannot have a negative value '$1'", text)
return //undefined
if (h.indexOf(',') > 0) {
h = h.split(',')
hd = h[1]
h = h[0]
} else {
hd = 0
}
if (h > 50 || wl > 80 || wr > 80) {
error(1, null, "%%deco: abnormal h/wl/wr value '$1'", text)
return //undefined
}
// create/redefine the decoration
dd = dd_tb[nm]
if (!dd) {
dd = {
name: nm
}
dd_tb[nm] = dd
}
/* set the values */
dd.func = dd.name.indexOf("head-") == 0 ? 9 : c_func;
dd.glyph = a[2];
dd.h = h;
dd.h = Number(h)
dd.hd = Number(hd)
dd.wl = wl;
dd.wr = wr;
str = text.replace(a[0], '').trim()
if (str) { // optional string
if (str[0] == '"')
str = str.slice(1, -1);
dd.str = str
|
| ︙ | | |
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
|
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
|
-
+
|
for (j = 0; j <= s.nhd; j++)
s.notes[j].dur *= 2;
for (j = 0; j <= prev.nhd; j++)
prev.notes[j].dur *= 2
continue
case 35: /* xstem */
if (s.type != C.NOTE) {
error(1, s, "!xstem! must be on a note")
error(1, s, errs.must_note, dd.name)
continue
}
s.xstem = true;
continue
case 36: /* beambr1 / beambr2 */
if (s.type != C.NOTE) {
error(1, s, errs.must_note, dd.name)
|
| ︙ | | |
864
865
866
867
868
869
870
871
872
873
874
875
876
877
|
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
continue
case 40: /* stemless */
s.stemless = true
continue
case 41: /* rbend */
s.rbstop = 2 // with end
continue
case 42: // editorial
if (!s.notes[0].acc)
continue
dcn = "sacc" + s.notes[0].acc.toString() // small accidental
dd = dd_tb[dcn]
if (!dd) {
dd = deco_def(dcn)
if (!dd) {
error(1, s, errs.bad_val, "!editorial!")
continue
}
}
delete s.notes[0].acc
curvoice.acc[s.notes[0].pit + 19] = 0 // ignore the accidental
break
case 43: // courtesy
j = curvoice.acc[s.notes[0].pit + 19]
if (s.notes[0].acc || !j)
continue
if (!s.notes[0].a_dcn)
s.notes[0].a_dcn = []
s.notes[0].a_dcn.push("cacc" + j)
continue
}
// add the decoration in the symbol
if (!s.a_dd)
s.a_dd = []
s.a_dd.push(dd)
}
|
| ︙ | | |
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
|
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
|
-
-
+
+
|
if (wl != 0 && s.prev && s.prev.type == C.BAR)
wl -= 3
return wl
}
/* -- draw the decorations -- */
/* (the staves are defined) */
function draw_all_deco() {
if (a_de.length == 0)
Abc.prototype.draw_all_deco = function() {
if (!a_de.length)
return
var de, de2, dd, s, note, f, st, x, y, y2, ym, uf, i, str, a,
new_de = [],
ymid = []
if (!cfmt.dynalign) {
st = nstaff;
|
| ︙ | | |
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
|
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
|
-
+
-
+
|
else
set_scale(s);
st = de.st;
if (!staff_tb[st].topbar)
continue // invisible staff
x = de.x;
// y = de.y + staff_tb[st].y / staff_tb[st].staffscale
y = de.y + staff_tb[st].y
// update the coordinates if head decoration
if (de.m != undefined) {
note = s.notes[de.m];
if (note.shhd)
x += note.shhd * stv_g.scale;
x += note.shhd * stv_g.scale;
/* center the dynamic marks between two staves */
/*fixme: KO when deco on other voice and same direction*/
} else if (f_staff[dd.func] && !cfmt.dynalign
&& ((de.up && st > 0)
|| (!de.up && st < nstaff))) {
if (de.up)
|
| ︙ | | |
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
|
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
|
+
+
|
st: s.st,
ix: a_de.length,
defl: {},
x: s.x,
y: s.y,
// dy: 0
}
if (s.type == C.BAR)
de.x -= s.wl / 2 - 2
a_de.push(de)
if (dd.dd_en) {
de.ldst = true
} else if (dd.dd_st) {
//fixme: pb with "()"
de.lden = true;
de.defl.nost = true
|
| ︙ | | |
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
|
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
|
-
-
-
+
|
de.defl.nost = true
}
}
} // create_dh()
// create all decorations of a note (chord and heads)
function create_all(s) {
var m
if (s.a_dd)
create_deco(s)
if (s.notes) {
for (m = 0; m < s.notes.length; m++) {
for (var m = 0; m < s.notes.length; m++) {
if (s.notes[m].a_dcn)
create_dh(s, m)
}
}
} // create_all()
// link the long decorations
|
| ︙ | | |
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
|
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
|
-
+
-
+
-
-
-
+
+
+
+
+
|
if (!de2.start
&& de2.dd == dd2 && de2.s.st == st)
break
}
}
if (j == n_de) { // no end, insert one
de2 = {
s: de.s,
s: s,
st: de.st,
dd: dd2,
ix: a_de.length - 1,
x: realwidth - 6,
y: de.s.y,
y: s.y,
lden: true,
defl: {
noen: true
}
}
if (de2.x < s.x + 10)
de2.x = s.x + 10
if (de.m != undefined)
de2.m = de.m;
a_de.push(de2)
}
de2.start = de;
de2.defl.nost = de.defl.nost
// handle 'tr~~~~~'
if (dd.name == "trill("
&& i > 0 && a_de[i - 1].dd.name == "trill")
// handle same decoration type at a same time
if (i > 0
&& a_de[i - 1].s.time == de.s.time
&& a_de[i - 1].dd.name.slice(0, dd.name.length - 1) ==
dd.name.slice(0, dd.name.length - 1))
de2.prev = a_de[i - 1]
}
// add starting decorations
for (i = 0; i < n_de; i++) {
de2 = a_de[i]
if (!de2.lden // not the end of long decoration
|
| ︙ | | |
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
|
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
|
-
+
+
|
case C.CLEF:
case C.KEY:
case C.METER:
continue
}
break
}
if (a_de.length != 0)
if (a_de.length)
ldeco_update(s)
for ( ; s; s = s.ts_next) {
switch (s.type) {
case C.BAR:
case C.MREST:
case C.NOTE:
case C.REST:
case C.SPACE:
break
case C.GRACE:
for (g = s.extra; g; g = g.next)
create_all(g)
break
default:
continue
}
create_all(s)
}
ll_deco() // link the long decorations
}
|
| ︙ | | |
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
|
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
|
-
+
-
-
-
+
+
-
+
|
// -- define the music elements tied to the staff --
// - decoration tied to the staves
// - chord symbols
// - repeat brackets
/* (the staves are not yet defined) */
/* (unscaled delayed output) */
function draw_deco_staff() {
var s, first_gchord, p_voice, x, y, w, i, v, de, dd,
var s, p_voice, y, i, v, de, dd,
gch, gch2, ix, top, bot,
minmax = new Array(nstaff + 1),
nd = a_de.length
minmax = new Array(nstaff + 1),
nd = a_de.length
/* draw the repeat brackets */
function draw_repbra(p_voice) {
var s, s1, y, y2, i, p, w, wh, first_repeat;
var s, s1, x, y, y2, i, p, w, wh, first_repeat;
/* search the max y offset */
y = staff_tb[p_voice.st].topbar + 25 // 20 (vert bar) + 5 (room)
for (s = p_voice.sym; s; s = s.next) {
if (s.type != C.BAR)
continue
if (!s.rbstart || s.norepbra)
|
| ︙ | | |
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
|
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
|
-
-
+
+
|
y2 = y_get(p_voice.st, true, s1.x, s.x - s1.x)
if (y < y2)
y = y2
/* have room for the repeat numbers */
if (s1.text) {
wh = strwh(s1.text);
y2 = y_get(p_voice.st, true, s1.x + 4, wh[0]);
y2 += wh[1]
y2 = y_get(p_voice.st, true, s1.x + 4, wh[0]) +
wh[1]
if (y < y2)
y = y2
}
if (s.rbstart)
s = s.prev
}
|
| ︙ | | |
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
|
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
|
+
-
-
+
+
|
s = s.next
if (s.rbstop)
break
}
if (s1 == s)
break
x = s1.x
if (cfmt.measurenb > 0 & s.bar_num
// if (s1.bar_type[0] == ":")
// x -= 4;
&& s.bar_num % cfmt.measurenb)
x += 6
if (s.type != C.BAR) {
w = s.rbstop ? 0 : s.x - realwidth + 4
} else if ((s.bar_type.length > 1 // if complex bar
&& s.bar_type != "[]")
|| s.bar_type == "]") {
// if (s.bar_type == "]")
// s.invis = true
|
| ︙ | | |
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
|
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
|
y = de.y
}
if (de.up)
y += dd.h;
y_set(de.st, de.up, de.x, de.val, y)
}
// search the vertical offset for the chord symbols
for (i = 0; i <= nstaff; i++)
minmax[i] = {
ymin: 0,
ymax: 24
}
for (s = tsfirst; s; s = s.ts_next) {
if (!s.a_gch)
continue
if (!first_gchord)
first_gchord = s;
gch2 = null
for (ix = 0; ix < s.a_gch.length; ix++) {
gch = s.a_gch[ix]
if (gch.type != 'g')
continue
gch2 = gch // chord closest to the staff
if (gch.y < 0)
break
}
if (gch2) {
w = gch2.wh[0]
if (gch2.y >= 0) {
y = y_get(s.st, true, s.x, w)
if (y > minmax[s.st].ymax)
minmax[s.st].ymax = y
} else {
y = y_get(s.st, false, s.x, w)
if (y < minmax[s.st].ymin)
minmax[s.st].ymin = y
}
}
}
draw_all_chsy() // draw all chord symbols
// draw the chord symbols if any
if (first_gchord) {
for (i = 0; i <= nstaff; i++) {
bot = staff_tb[i].botbar;
if (minmax[i].ymin > bot - 4)
minmax[i].ymin = bot - 4
top = staff_tb[i].topbar;
if (minmax[i].ymax < top + 4)
minmax[i].ymax = top + 4
}
set_dscale(-1) /* restore the scale parameters */
for (s = first_gchord; s; s = s.ts_next) {
if (!s.a_gch)
continue
self.draw_gchord(s, minmax[s.st].ymin, minmax[s.st].ymax)
}
}
/* draw the repeat brackets */
for (v = 0; v < voice_tb.length; v++) {
p_voice = voice_tb[v]
if (p_voice.second || !p_voice.sym)
continue
draw_repbra(p_voice)
|
| ︙ | | |
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
|
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
|
-
-
-
+
+
-
-
-
+
+
+
-
+
-
-
-
-
-
+
-
+
|
if (y < staff_tb[st].topbar + 14)
y = staff_tb[st].topbar + 14;
xy_str(0, y, bar_num.toString());
y_set(st, true, 0, 20, y + gene.curfont.size + 2)
} else if (bar_num % cfmt.measurenb == 0) {
for ( ; ; s = s.ts_next) {
switch (s.type) {
case C.TIMESIG:
case C.CLEF:
case C.KEYSIG:
case C.FMTCHG:
case C.KEY:
case C.METER:
case C.STBRK:
continue
}
break
}
// don't display the number twice
if (s.type != C.BAR || !s.bar_num) {
if (s.prev)
s = s.prev;
x = s.x + s.wr;
any_nb = true;
w = w0
if (bar_num >= 10)
w *= bar_num >= 100 ? 3 : 2
if (gene.curfont.box)
w += 4;
if (gene.curfont.pad)
w += gene.curfont.pad * 2
x = s.x + s.wr + 1 // if clef, shift a bit
y = y_get(st, true, x, w)
if (y < staff_tb[st].topbar + 6)
y = staff_tb[st].topbar + 6;
y += 2;
y += 2 + gene.curfont.pad
xy_str(x, y, bar_num.toString())
if (gene.curfont.box) {
y += 2;
w += 3
}
y += gene.curfont.size;
y += gene.curfont.size + gene.curfont.pad
y_set(st, true, x, w, y);
s.ymx = y
// s.ymx = y
}
}
}
for ( ; s; s = s.ts_next) {
switch (s.type) {
case C.STAVES:
|
| ︙ | | |
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
|
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
|
+
+
-
+
-
+
-
-
-
-
-
+
-
-
-
+
-
-
-
+
+
+
-
+
|
|| s.bar_mrep)
continue
if (!any_nb)
any_nb = true;
w = w0
if (bar_num >= 10)
w *= bar_num >= 100 ? 3 : 2
if (gene.curfont.pad)
w += gene.curfont.pad * 2
x = s.x - w * .4;
x = s.x - w * (s.text ? .6 : .4)
y = y_get(st, true, x, w)
if (y < staff_tb[st].topbar + 3)
y = staff_tb[st].topbar + 3
if (s.next.type == C.NOTE) {
if (s.next.stem > 0) {
if (y < s.next.ys - gene.curfont.size)
y = s.next.ys - gene.curfont.size
} else {
if (y < s.next.y)
y = s.next.y
}
}
y += 2;
y += 2 + gene.curfont.pad
if (gene.curfont.box) {
y += 2;
w += 3
}
xy_str(x, y, bar_num.toString())
y += gene.curfont.size;
y += gene.curfont.size + gene.curfont.pad
if (gene.curfont.box)
y += 2;
y_set(st, true, x, w, y);
s.ymx = y
// s.ymx = y
}
gene.nbar = bar_num
if (font_size)
param_set_font("measurefont", "* " + font_size.toString());
}
/* -- draw the parts and the tempo information -- */
/* (the staves are being defined) */
function draw_partempo(st, top) {
var s, some_part, some_tempo, h, w, y,
dy = 0, /* put the tempo indication at top */
ht = 0
var s, some_part, some_tempo, h, w, y,
dy = 0, /* put the tempo indication at top */
ht = 0
/* get the minimal y offset */
var ymin = staff_tb[st].topbar + 8,
dosh = 0,
shift = 1,
x = -100 // (must be negative for %%soloffs)
for (s = tsfirst; s; s = s.ts_next) {
if (s.type != C.TEMPO || s.del)
if (s.type != C.TEMPO || s.invis)
continue
if (!some_tempo)
some_tempo = s;
w = s.tempo_wh[0]
if (s.time == 0 && s.x > 40) // at start of tune and no %%soloffs,
s.x = 40; // shift the tempo over the key signature
y = y_get(st, true, s.x - 16, w)
|
| ︙ | | |
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
|
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
|
-
+
+
+
-
+
-
-
+
+
-
-
-
+
-
+
+
+
|
ht *= 2
if (top < ymin + ht)
dy = ymin + ht - top
/* draw the tempo indications */
for (s = some_tempo; s; s = s.ts_next) {
if (s.type != C.TEMPO
|| s.del) // (displayed by %%titleformat)
|| s.invis) // (displayed by %%titleformat)
continue
if (user.anno_start || user.anno_stop) {
s.wl = 16;
s.wr = 30;
s.ymn = (dosh & 1) ? h : y;
s.ymx = s.ymn + 14;
anno_start(s)
}
writempo(s, s.x - 16, (dosh & 1) ? h : y);
anno_stop(s);
dosh >>= 1
while (s.ts_next && s.ts_next.type == C.TEMPO)
s = s.ts_next
}
}
/* then, put the parts */
/*fixme: should reduce vertical space if parts don't overlap tempo...*/
ymin = staff_tb[st].topbar + 6
for (s = tsfirst; s; s = s.ts_next) {
if (s.type != C.PART)
if (s.type != C.PART || s.invis)
continue
if (!some_part) {
some_part = s;
set_font("parts");
h = gene.curfont.size + 2
/* + cfmt.partsspace ?? */
h = gene.curfont.size + 2 +
gene.curfont.pad * 2
}
w = strwh(s.text)[0];
y = y_get(st, true, s.x - 10, w + 3)
if (ymin < y)
ymin = y
}
if (some_part) {
set_sscale(-1)
if (gene.curfont.box)
h += 2
if (top < ymin + h + ht)
if (top + dy < ymin + h + ht)
dy = ymin + h + ht - top
for (s = some_part; s; s = s.ts_next) {
if (s.type != C.PART)
if (s.type != C.PART || s.invis)
continue
s.x -= 10;
if (user.anno_start || user.anno_stop) {
w = strwh(s.text)[0];
s.wl = 0;
s.wr = w;
s.ymn = -ht - h;
s.ymx = s.ymn + h;
anno_start(s)
}
xy_str(s.x, 2 - ht - h, s.text);
anno_stop(s)
while (s.ts_next && s.ts_next.type == C.PART)
s = s.ts_next
}
}
return dy
}
|
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
+
|
// abc2svg - draw.js - draw functions
//
// Copyright (C) 2014-2019 Jean-Francois Moine
// Copyright (C) 2014-2020 Jean-Francois Moine
//
// This file is part of abc2svg-core.
//
// abc2svg-core is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
|
| ︙ | | |
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
-
+
+
|
BEAM_OFFSET = .25, /* pos of flat beam relative to staff line */
BEAM_SHIFT = 5, /* shift of second and third beams */
BEAM_STUB = 8, /* length of stub for flag under beam */
SLUR_SLOPE = .5, /* max slope of a slur */
GSTEM = 15, /* grace note stem length */
GSTEM_XOFF = 2.3 /* x offset for grace note stem */
var cache
var cache,
anno_a = [] // symbols with annotations
/* -- compute the best vertical offset for the beams -- */
function b_pos(grace, stem, nflags, b) {
var top, bot, d1, d2,
shift = !grace ? BEAM_SHIFT : 3.5,
depth = !grace ? BEAM_DEPTH : 1.8
|
| ︙ | | |
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
|
+
|
s = clone(s)
s.invis = true
delete s.extra;
delete s.text
delete s.a_gch
delete s.a_ly
delete s.a_dd;
delete s.tp
s.notes = clone(s.notes)
for (m = 0; m <= s.nhd; m++) {
note = s.notes[m] = clone(s.notes[m])
delete note.a_dcn
}
return s
}
|
| ︙ | | |
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
|
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
|
-
-
+
|
x1 += 5;
x2 -= 6
}
}
y1 = bm.a * x1 + bm.b - dy;
x2 -= x1;
//--fixme: scale (bm.a already scaled!)
x2 /= stv_g.scale;
dy2 = bm.a * x2 * stv_g.scale;
dy2 = bm.a * x2
xypath(x1, y1, true);
output += 'l' + x2.toFixed(1) + ' ' + (-dy2).toFixed(1) +
'v' + h.toFixed(1) +
'l' + (-x2).toFixed(1) + ' ' + dy2.toFixed(1) +
'z"/>\n'
} // draw_beam()
|
| ︙ | | |
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
|
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
|
-
+
|
anno_stop(s1, 'beam')
}
/* -- draw the left side of the staves -- */
function draw_lstaff(x) {
// if (cfmt.alignbars)
// return
var i, j, yb, h,
var i, j, yb, h, fl,
nst = cur_sy.nstaff,
l = 0
/* -- draw a system brace or bracket -- */
function draw_sysbra(x, st, flag) {
var i, st_end, yt, yb
|
| ︙ | | |
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
|
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
|
+
-
+
-
+
-
+
+
-
+
-
+
-
+
-
+
-
+
|
if (flag & (CLOSE_BRACE | CLOSE_BRACE2))
out_brace(x, yb, yt - yb)
else
out_bracket(x, yt, yt - yb)
}
for (i = 0; ; i++) {
fl = cur_sy.staves[i].flags
if (cur_sy.staves[i].flags & (OPEN_BRACE | OPEN_BRACKET))
if (fl & (OPEN_BRACE | OPEN_BRACKET))
l++
if (cur_sy.st_print[i])
break
if (cur_sy.staves[i].flags & (CLOSE_BRACE | CLOSE_BRACKET))
if (fl & (CLOSE_BRACE | CLOSE_BRACKET))
l--
if (i == nst)
break
}
for (j = nst; j > i; j--) {
if (cur_sy.st_print[j])
break
}
if (i == j && l == 0)
return
yb = staff_tb[j].y + staff_tb[j].botbar * staff_tb[j].staffscale;
h = staff_tb[i].y + staff_tb[i].topbar * staff_tb[i].staffscale - yb;
xypath(x, yb);
output += "v" + (-h).toFixed(1) + '"/>\n'
for (i = 0; i <= nst; i++) {
if (cur_sy.staves[i].flags & OPEN_BRACE)
fl = cur_sy.staves[i].flags
if (fl & OPEN_BRACE)
draw_sysbra(x, i, CLOSE_BRACE)
if (cur_sy.staves[i].flags & OPEN_BRACKET)
if (fl & OPEN_BRACKET)
draw_sysbra(x, i, CLOSE_BRACKET)
if (cur_sy.staves[i].flags & OPEN_BRACE2)
if (fl & OPEN_BRACE2)
draw_sysbra(x - 6, i, CLOSE_BRACE2)
if (cur_sy.staves[i].flags & OPEN_BRACKET2)
if (fl & OPEN_BRACKET2)
draw_sysbra(x - 6, i, CLOSE_BRACKET2)
}
}
/* -- draw the time signature -- */
function draw_meter(x, s) {
function draw_meter(s) {
if (!s.a_meter)
return
var dx, i, j, meter,
var dx, i, j, meter, x,
st = s.st,
p_staff = staff_tb[st],
y = p_staff.y;
// adjust the vertical offset according to the staff definition
if (p_staff.stafflines != '|||||')
y += (p_staff.topbar + p_staff.botbar) / 2 - 12 // bottom
|
| ︙ | | |
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
|
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
|
+
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
-
-
+
+
+
-
+
-
-
+
+
+
+
-
+
+
+
+
-
-
+
+
+
+
+
+
-
-
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
|
out_XYAB('\
<text x="X" y="Y" text-anchor="middle">A</text>\n',
x, y + 12, m_gl(meter.top))
}
}
}
var acc_nd = {} // cache of the microtonal accidentals
/* -- draw an accidental -- */
function draw_acc(x, y, acc,
micro_n,
micro_d) {
if (micro_n) {
if (micro_n == micro_d) {
acc = acc == -1 ? // flat
function draw_acc(x, y, a) {
if (typeof a != "number") { // if microtone
var c,
n = a[0],
d = a[1]
c = n + '_' + d
a = acc_nd[c]
if (!a) {
a = abc2svg.rat(Math.abs(n), d)
d = a[1]
-2 : 2 // double flat : sharp
} else if (micro_n * 2 != micro_d) {
xygl(x, y, "acc" + acc + '_' + micro_n + '_' + micro_d)
return
}
a = (n < 0 ? -a[0] : a[0]).toString()
if (d != 1)
a += '_' + d
acc_nd[c] = a
}
}
xygl(x, y, "acc" + a)
}
// memorize the helper/ledger lines
function set_hl(p_st, n, x, dx1, dx2) {
var i, hl
if (n >= 0) {
hl = p_st.hlu[n]
if (!hl)
hl = p_st.hlu[n] = []
} else {
hl = p_st.hld[-n]
if (!hl)
hl = p_st.hld[-n] = []
}
xygl(x, y, "acc" + acc)
}
for (i = 0; i < hl.length; i++) {
if (x >= hl[i][0])
break
}
if (i == hl.length) {
hl.push([x, dx1, dx2])
} else if (x > hl[i][0]) {
hl.splice(++i, 0, [x, dx1, dx2])
} else {
if (dx1 < hl[i][1])
hl[i][1] = dx1
if (dx2 > hl[i][2])
hl[i][2] = dx2
}
} // set_hl()
// draw helper lines
//fixme: double lines when needed for different voices
// (possible hook)
Abc.prototype.draw_hl = function(x, s, hltype) {
var i, j, n,
Abc.prototype.draw_hl = function(s) {
var i, j, n, note,
hla = [],
st = s.st,
p_staff = staff_tb[st]
// check if any helper line
if (!p_staff.hll)
return // no helper line (no line)
for (i = 0; i <= s.nhd; i++) {
note = s.notes[i]
if (!p_staff.hlmap[s.notes[i].pit - p_staff.hll])
hla.push((s.notes[i].pit - 18) * 3)
if (!p_staff.hlmap[note.pit - p_staff.hll])
hla.push([note.pit - 18,
note.shhd * stv_g.scale])
}
n = hla.length
if (!n)
return // no
// handle the helper lines out of the staff
var staffb = p_staff.y,
var dx1, dx2, hl, shhd,hlp,
stafflines = p_staff.stafflines,
top = (stafflines.length - 1) * 6,
bot = p_staff.botline,
top = stafflines.length - 1,
yu = top,
bot = p_staff.botline / 6,
yl = bot,
dx = s.grace ? 4 : hw_tb[s.head] * 1.3
yu = top
// get the x start and x stop of the intermediate helper lines
note = s.notes[s.stem < 0 ? s.nhd : 0]
shhd = note.shhd
for (i = 0; i < hla.length; i++) {
if (hla[i] < yl) {
yl = (((hla[i] + 51) / 6) | 0) * 6 - 48;
hlp = hla[i][0]
dx1 = (hla[i][1] < shhd ? hla[i][1] : shhd) - dx
dx2 = (hla[i][1] > shhd ? hla[i][1] : shhd) + dx
if (hlp < bot * 2) {
if (hlp < yl * 2)
yl = ++hlp >> 1
n--
} else if (hla[i] > yu) {
yu = ((hla[i] / 6) | 0) * 6;
} else if (hlp > top * 2) {
yu = hlp >> 1
n--
}
set_hl(p_staff, hlp >> 1, s.x, dx1, dx2)
}
dx1 = shhd - dx
dx2 = shhd + dx
for (; yl < bot; yl += 6)
xygl(x, staffb + yl, hltype)
for (; yu > top; yu -= 6)
xygl(x, staffb + yu, hltype)
while (++yl < bot)
set_hl(p_staff, yl,
s.x, dx1, dx2)
while (--yu > top)
set_hl(p_staff, yu,
s.x, dx1, dx2)
if (!n)
return // no more helper lines
// draw the helper lines inside the staff
i = yl;
j = yu
while (i > bot && stafflines[i / 6] == '-')
i -= 6
while (j < top && stafflines[j / 6] == '-')
j += 6
for ( ; i < j; i += 6) {
if (stafflines[i / 6] == '-')
xygl(x, staffb + i, hltype) // hole
while (i > bot && stafflines[i] == '-')
i--
while (j < top && stafflines[j] == '-')
j++
for ( ; i < j; i++) {
if (stafflines[i] == '-')
set_hl(p_staff, i, s.x, dx1, dx2)
}
}
/* -- draw a key signature -- */
// (possible hook)
var sharp_cl = new Int8Array([24, 9, 15, 21, 6, 12, 18]),
flat_cl = new Int8Array([12, 18, 24, 9, 15, 21, 6]),
|
| ︙ | | |
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
|
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
|
+
-
+
-
+
-
|
if (i != 0
&& (shift > last_shift + 18
|| shift < last_shift - 18))
x -= 5.5 // no clash
else if (acc.acc != last_acc)
x += 3;
last_acc = acc.acc;
s2.x = x
s2.notes[0].pit = shift / 3 + 18;
self.draw_hl(x, s2, "hl");
self.draw_hl(s2)
last_shift = shift;
draw_acc(x, staffb + shift,
draw_acc(x, staffb + shift, acc.acc)
acc.acc, acc.micro_n, acc.micro_d);
x += 5.5
}
}
}
/* -- convert the standard measure bars -- */
function bar_cnv(bar_type) {
|
| ︙ | | |
936
937
938
939
940
941
942
943
944
945
946
947
948
949
|
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
|
+
+
+
+
+
+
+
+
+
+
+
|
case ":::|":
return bar_type + "]" /* :..| -> :..|] */
case "::":
return cfmt.dblrepbar /* :: -> double repeat bar */
}
return bar_type
}
// output the measure repeat number
function nrep_out(x, y, n) {
y -= 3
if (n < 10) {
xygl(x - 4, y, "mtr" + n)
} else {
xygl(x - 10, y, "mtr" + ((n / 10) | 0))
xygl(x - 2, y, "mtr" + (n % 10))
}
} // nrep_out()
/* -- draw a rest -- */
/* (the staves are defined) */
var rest_tb = [
"r128", "r64", "r32", "r16", "r8",
"r4",
"r2", "r1", "r0", "r00"]
|
| ︙ | | |
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
|
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
|
-
-
-
+
+
+
+
-
+
|
s.nflags = -3
else
s.nflags = -4;
s.dots = 0;
/* don't use next/prev: there is no bar in voice overlay */
s2 = s.ts_next
while (s2 && s2.time != s.time + s.dur)
s2 = s2.ts_next;
x = s2 ? s2.x : realwidth;
while (s2.time != s.time + s.dur
&& s2.ts_next)
s2 = s2.ts_next
x = s2.x - s2.wl
s2 = s
while (!s2.seqst)
s2 = s2.ts_prev;
s2 = s2.ts_prev;
x = (x + s2.x) / 2
x = (x + s2.x + s2.wr) / 2
/* center the associated decorations */
if (s.a_dd)
deco_update(s, x - s.x);
s.x = x
} else {
x = s.x
|
| ︙ | | |
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
|
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
|
-
-
-
+
+
+
-
-
-
-
+
-
-
-
-
+
-
-
+
+
-
+
-
+
-
+
-
-
+
+
+
+
-
+
-
+
|
yb += 12
else
yb += (p_staff.topbar + p_staff.botbar) / 2
if (s.rep_nb < 0) {
xygl(x, yb, "srep")
} else {
xygl(x, yb, "mrep")
if (s.rep_nb > 2 && s.v == cur_sy.top_voice) {
set_font("annotation");
if (gene.curfont.box) {
if (s.rep_nb > 2 && s.v == cur_sy.top_voice
&& cfmt.measrepnb > 0
&& !(s.rep_nb % cfmt.measrepnb))
gene.curfont.box = false;
bx = true
}
xy_str(x, yb + p_staff.topbar - 9,
nrep_out(x, yb + p_staff.topbar, s.rep_nb)
s.rep_nb.toString(), "c")
if (bx)
gene.curfont.box = true
}
}
}
anno_stop(s)
anno_a.push(s)
return
}
set_scale(s);
anno_start(s);
if (s.notes[0].color)
set_color(s.notes[0].color);
y = s.y;
i = 5 - s.nflags /* rest_tb index (5 = C_XFLAGS) */
if (i == 7 && y == 12
&& p_staff.stafflines.length <= 2)
y -= 6 /* semibreve a bit lower */
// draw the rest
if (!s.notes[0].invis) // if not head replacement
xygl(x, y + yb, s.notes[0].head || rest_tb[i])
xygl(x, y + yb, rest_tb[i])
/* output ledger line(s) when greater than minim */
if (i >= 6) {
j = y / 6
switch (i) {
default:
switch (p_staff.stafflines[j + 1]) {
case '|':
case '[':
break
default:
xygl(x, y + 6 + yb, "hl1")
set_hl(p_staff, j + 1, x, -7, 7)
break
}
if (i == 9) { /* longa */
y -= 6;
j--
}
break
case 7: /* semibreve */
y += 6;
j++
case 6: /* minim */
break
}
switch (p_staff.stafflines[j]) {
case '|':
case '[':
break
default:
xygl(x, y + yb, "hl1")
set_hl(p_staff, j, x, -7, 7)
break
}
}
if (s.dots) {
x += 8;
y += yb + 3
for (i = 0; i < s.dots; i++) {
xygl(x, y, "dot");
j = s.dots
i = (s.dur_orig / 12) >> ((5 - s.nflags) - j)
while (j-- > 0) {
xygl(x, y, (i & (1 << j)) ? "dot" : "dot+")
x += 3.5
}
}
set_color();
anno_stop(s)
anno_a.push(s)
}
/* -- draw grace notes -- */
/* (the staves are defined) */
function draw_gracenotes(s) {
var yy, x0, y0, x1, y1, x2, y2, x3, y3, bet1, bet2, slur,
dy1, dy2, g, last, note,
bm = {}
/* draw the notes */
// bm.s2 = undefined /* (draw flags) */
for (g = s.extra; g; g = g.next) {
if (g.beam_st && !g.beam_end) {
if (self.calculate_beam(bm, g))
draw_beams(bm)
}
anno_start(g);
draw_note(g, !bm.s2)
if (g == bm.s2)
bm.s2 = null /* (draw flags again) */
anno_stop(g)
anno_a.push(s)
if (g.sls || g.sl2)
slur = true
if (!g.next)
break /* (keep the last note) */
}
// if an acciaccatura, draw a bar
|
| ︙ | | |
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
|
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
|
-
+
|
note = g.notes[g.stem < 0 ? 0 : g.nhd];
out_acciac(x_head(g, note), y_head(g, note),
x1, y1, g.stem > 0)
}
/* slur */
//fixme: have a full key symbol in voice
if (s.p_v.key.k_bagpipe /* no slur when bagpipe */
if (s.p_v.ckey.k_bagpipe /* no slur when bagpipe */
|| !cfmt.graceslurs
|| slur // explicit slur
|| s.tie_s // some tie
|| !s.next
|| s.next.type != C.NOTE)
return
last = g
|
| ︙ | | |
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
|
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
|
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
|
y_note = y + staffb
// /* special case for voice unison */
// if (s.nohdi1 != undefined
// && m >= s.nohdi1 && m < s.nohdi2)
// return
var elts = identify_note(s, note.dur),
var elts = identify_note(s, note.dur),
head = elts[0],
dots = elts[1],
nflags = elts[2]
/* output a ledger line if horizontal shift / chord
* and note on a line */
if (y % 6 == 0
&& shhd != (s.stem > 0 ? s.notes[0].shhd : s.notes[s.nhd].shhd)) {
yy = 0
if (y >= 30) {
yy = y
if (yy % 6)
yy -= 3
} else if (y <= -6) {
yy = y
if (yy % 6)
yy += 3
}
if (yy)
xygl(x_note, yy + staffb, "hl")
}
/* draw the head */
if (note.invis) {
;
} else if (s.grace) { // don't apply %%map to grace notes
p = "ghd";
x_note -= 4.5 * stv_g.scale
} else if (note.map && note.map[0]) {
|
| ︙ | | |
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
|
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
|
-
+
+
|
break
}
// fall thru
case C.SQUARE:
if (nflags > -4) {
p = "breve"
} else {
p = "longa"
p = "longa"
inv = s.stem > 0
}
/* don't display dots on last note of the tune */
if (!tsnext && s.next
&& s.next.type == C.BAR && !s.next.next)
dots = 0
x_note += 1
break
case C.EMPTY:
p = "Hd" // white note
break
default: // black note
p = "hd"
break
|
| ︙ | | |
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
|
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
|
-
+
-
-
+
-
-
-
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
|
}
}
/* draw the accidental */
if (note.acc) {
x -= note.shac * stv_g.scale
if (!s.grace) {
draw_acc(x, y + staffb,
draw_acc(x, y + staffb, note.acc)
note.acc, note.micro_n, note.micro_d)
} else {
g_open(x, y + staffb, 0, .75);
draw_acc(0, 0, note.acc, note.micro_n, note.micro_d);
draw_acc(0, 0, note.acc)
g_close()
}
}
if (old_color != false)
set_color(old_color)
}
/* -- draw a note or a chord -- */
/* (the staves are defined) */
function draw_note(s,
fl) { // draw flags
var s2, i, m, y, staffb, slen, c, hltype, nflags,
x, y, note, x_hl,
y_tb = new Array(s.nhd + 1)
var s2, i, m, y, staffb, slen, c, nflags,
x, y, note,
y_tb = new Array(s.nhd + 1)
if (s.dots)
setdoty(s, y_tb)
note = s.notes[s.stem < 0 ? s.nhd : 0]; // master note head
x_hl = x = x_head(s, note);
x = x_head(s, note)
staffb = staff_tb[s.st].y
/* output the ledger lines */
if (s.grace) {
hltype = "ghl";
x_hl += 1.5
} else {
hltype = "hl"
switch (s.head) {
case C.OVALBARS:
case C.OVAL:
x_hl -= .3;
hltype = "hl1"
break
case C.SQUARE:
x_hl -= 2;
hltype = "hl1"
break
}
}
self.draw_hl(x_hl, s, hltype)
self.draw_hl(s)
/* draw the stem and flags */
y = y_head(s, note)
if (!s.stemless) {
slen = s.ys - s.y;
nflags = s.nflags
if (s.ntrem)
|
| ︙ | | |
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
|
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
|
-
-
-
-
+
+
+
+
|
yy1 = y1 + beta * (yy1 - y1)
var xx2 = mx + alfa * (x2 - mx),
yy2 = my + alfa * (y2 - my) + height;
xx2 = x2 + beta * (xx2 - x2);
yy2 = y2 + beta * (yy2 - y2);
dx = .03 * (x2 - x1);
// if (dx > 10.)
// dx = 10.
// dy = 1.6 * dir
dy = 2 * dir;
dz = .2 + .001 * (x2 - x1)
dz = .2 + .001 * dx
if (dz > .6)
dz = .6;
dz *= dir
dx *= .03
// if (dx > 10.)
// dx = 10.
// var scale_y = stv_g.st < 0 ? stv_g.scale : 1
var scale_y = 1 // (see set_dscale())
if (!dotted)
output += '<path d="M'
else
output += '<path class="stroke" stroke-dasharray="5,5" d="M';
|
| ︙ | | |
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
|
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
|
-
+
|
output += '\n\tv' +
(-dz).toFixed(1) + 'c' +
((xx2 - dx - x2) / stv_g.scale).toFixed(1) + ' ' +
((y2 + dz - yy2 - dy) / scale_y).toFixed(1) + ' ' +
((xx1 + dx - x2) / stv_g.scale).toFixed(1) + ' ' +
((y2 + dz - yy1 - dy) / scale_y).toFixed(1) + ' ' +
((x1 - x2) / stv_g.scale).toFixed(1) + ' ' +
((y2 + dz - y1) / scale_y).toFixed(1);
((y2 - y1) / scale_y).toFixed(1)
output += '"/>\n'
}
// draw a slur between two chords / notes
/* (the staves are not yet defined) */
/* (delayed output) */
/* (not a pretty routine, this) */
|
| ︙ | | |
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
|
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
|
+
-
+
|
k.ymx = y
else if (k.ymn > y)
k.ymn = y
if (i == i2 - 1) {
dx = x2
if (k2.sl1)
dx -= 5;
if (i)
y -= height / 3
y -= height / 3
} else {
dx = path[i + 1].x
}
if (i != 0)
x1 = k.x
else
y -= height / 3
|
| ︙ | | |
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
|
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
|
-
-
+
+
-
-
-
+
+
+
+
+
+
-
+
|
}
// set the slur position
switch (sl.ty & 0x07) {
case C.SL_ABOVE: dir = 1; break
case C.SL_BELOW: dir = -1; break
default:
if (s.v != s2.v)
dir = -1 // always above ?
dir = s.v != s2.v ?
1 : // always above ?
else
dir = slur_direction(s, s2);
sl.ty &= ~0x07;
slur_direction(s, s2)
sl.ty &= ~0x07
sl.ty |= dir > 0 ? C.SL_ABOVE : C.SL_BELOW
break
}
// build the path of the symbols under the slur
if (s.v == s2.v) {
v = s.v
} if (!cur_sy.voices[s.v] || !cur_sy.voices[s2.v]) {
v = s.v > s2.v ? s.v : s2.v
if (dir * // if slur on first voice
} else if (dir * // if slur on first voice
(cur_sy.voices[s.v].range <= cur_sy.voices[s2.v].range ?
1 : -1) > 0)
v = s.v
else
v = s2.v
if (gr1 // if start on a grace note
|
| ︙ | | |
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
|
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
|
-
+
-
+
|
if (s.grace)
s = s.next
else
s = s.ts_next
}
if (!s2.grace) { // if end on a normal note
while (1) {
while (s) {
if (s.v == v)
path.push(s)
if (s == s2)
break
s = s.ts_next
}
} else if (s.grace) { // if start/end in the same sequence
while (1) {
if (s.v == v)
// if (s.v == v)
path.push(s)
if (s == s2)
break
s = s.next
}
} else { // end on a grace note
k = s2
|
| ︙ | | |
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
|
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
|
-
+
-
-
-
-
-
-
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
|
}
/* -- draw a tuplet -- */
/* (the staves are not yet defined) */
/* (delayed output) */
/* See http://moinejf.free.fr/abcm2ps-doc/tuplets.xhtml
* for the value of 'tp.f' */
function draw_tuplet(s1, tp) {
function draw_tuplet(s1) {
var s2, s3, g, upstaff, nb_only, some_slur,
x1, x2, y1, y2, xm, ym, a, s0, yy, yx, dy, a, dir, r,
tp = s1.tp.shift() // tuplet parameters
if (!s1.tp.length)
delete s1.tp // last tuplet
// treat the slurs and the nested tuplets
upstaff = s1.st
set_dscale(s1.st)
for (s2 = s1; s2; s2 = s2.next) {
if (s2.type != C.NOTE && s2.type != C.REST) {
if (s2.type == C.GRACE) {
for (g = s2.extra; g; g = g.next) {
if (g.sls || g.sl1)
draw_slurs(g)
}
switch (s2.type) {
case C.GRACE:
for (g = s2.extra; g; g = g.next) {
if (g.sls || g.sl1)
draw_slurs(g)
}
}
// fall thru
default:
continue
case C.NOTE:
case C.REST:
break
}
if (s2.sls || s2.sl1)
draw_slurs(s2)
if (s2.st < upstaff)
upstaff = s2.st
if (s2.tp)
draw_tuplet(s2)
if (s2.tpe)
break
}
if (s2)
s2.tpe--
if (tp.f[0] == 1) // if 'when' == never
return // accept tuplets on many lines
if (!s2) {
error(1, s1, "No end of tuplet in this music line")
return
}
s2.tpe--
if (tp.f[0] == 1) /* if 'when' == never */
return
dir = tp.f[3] // 'where'
if (!dir) { // if auto
s3 = s1
while (s3.type != C.NOTE)
s3 = s3.next
dir = s3.stem > 0 ? C.SL_ABOVE : C.SL_BELOW
}
|
| ︙ | | |
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
|
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
|
+
-
-
-
+
+
-
+
+
-
-
+
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
|
}
}
/* if number only, draw it */
if (nb_only) {
if (tp.f[2] == 1) /* if 'which' == none */
return
set_font("tuplet")
xm = (s2.x + s1.x) / 2
a = s2.x - s1.x // width around the middle
if (dir == C.SL_ABOVE)
ym = y_get(upstaff, 1, xm - a / 2, a) + 2
if (dir == C.SL_ABOVE) // 8 = width around the middle
ym = y_get(upstaff, 1, xm - 4, 8)
else
ym = y_get(upstaff, 0, xm - a / 2, a) - 10
ym = y_get(upstaff, 0, xm - 4, 8) -
gene.curfont.size
if (s1.stem * s2.stem > 0) {
if (s1.stem > 0)
xm += 1.5
else
xm -= 1.5
}
if (tp.f[2] == 0) /* if 'which' == number */
out_bnum(xm, ym, tp.p)
if (tp.f[2] == 0) // if 'which' == number
xy_str(xm, ym, tp.p.toString(), 'c')
else
out_bnum(xm, ym, tp.p + ':' + tp.q)
xy_str(xm, ym, tp.p+':'+tp.q, 'c')
for (s3 = s1; ; s3 = s3.next) {
if (s3.x >= xm)
break
}
if (dir == C.SL_ABOVE) {
ym += 10
ym += gene.curfont.size
if (s3.ymx < ym)
s3.ymx = ym;
y_set(upstaff, true, xm - 3, 6, ym)
} else {
if (s3.ymn > ym)
s3.ymn = ym;
y_set(upstaff, false, xm - 3, 6, ym)
}
return
}
// here, what is square bracket
/*fixme: two staves not treated*/
/*fixme: to optimize*/
// first, get the x offsets
x1 = s1.x - 4
// end the bracket according to the last note duration
if (s2.dur > s2.prev.dur) {
s3 = s2.next
if (!s3 // maybe a note in an overlay voice
|| s3.time != s2.time + s2.dur) {
for (s3 = s2.ts_next; s3; s3 = s3.ts_next) {
if (s3.seqst
&& s3.time >= s2.time + s2.dur)
break
}
}
//fixme: s3 cannot be null (bar at end of staff)
x2 = s3 ? s3.x - s3.wl - 5 : realwidth - 6
} else {
x2 = s2.x + 4
r = s2.stem >= 0 ? 0 : s2.nhd
if (s2.notes[r].shhd > 0)
x2 += s2.notes[r].shhd
if (s2.st == upstaff
&& s2.stem > 0)
x2 += 3.5
}
// above
if (dir == C.SL_ABOVE) {
/* sole or upper voice: the bracket is above the staff */
if (s1.st == s2.st) {
y1 = y2 = staff_tb[upstaff].topbar + 4
y1 = y2 = staff_tb[upstaff].topbar + 2
} else {
y1 = s1.ymx;
y2 = s2.ymx
}
x1 = s1.x - 4;
if (s1.st == upstaff) {
for (s3 = s1; !s3.dur; s3 = s3.next)
;
ym = y_get(upstaff, 1, s3.x - 4, 8)
if (ym > y1)
y1 = ym
if (s1.stem > 0)
x1 += 3
}
if (s2.st == upstaff) {
for (s3 = s2; !s3.dur; s3 = s3.prev)
;
ym = y_get(upstaff, 1, s3.x - 4, 8)
if (ym > y2)
y2 = ym
}
// end the bracket according to the last note duration
if (s2.dur > s2.prev.dur) {
if (s2.next)
x2 = s2.next.x - s2.next.wl - 5
else
x2 = realwidth - 6
} else {
x2 = s2.x + 4;
r = s2.stem >= 0 ? 0 : s2.nhd
if (s2.notes[r].shhd > 0)
x2 += s2.notes[r].shhd
if (s2.st == upstaff
&& s2.stem > 0)
x2 += 3.5
}
xm = .5 * (x1 + x2);
ym = .5 * (y1 + y2);
a = (y2 - y1) / (x2 - x1);
s0 = 3 * (s2.notes[s2.nhd].pit - s1.notes[s1.nhd].pit) / (x2 - x1)
if (s0 > 0) {
if (a < 0)
|
| ︙ | | |
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
|
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
|
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
|
}
ym += dy;
y1 = ym + a * (x1 - xm);
y2 = ym + a * (x2 - xm);
/* shift the slurs / decorations */
ym += 8
ym += 6
for (s3 = s1; ; s3 = s3.next) {
if (s3.st == upstaff) {
yy = ym + (s3.x - xm) * a
if (s3.ymx < yy)
s3.ymx = yy
if (s3 == s2)
break
y_set(upstaff, true, s3.x, s3.next.x - s3.x, yy)
} else if (s3 == s2) {
break
}
}
// below
} else { /* lower voice of the staff: the bracket is below the staff */
/*fixme: think to all of that again..*/
x1 = s1.x - 7
if (s2.dur > s2.prev.dur) {
if (s2.next)
x2 = s2.next.x - s2.next.wl - 8
else
x2 = realwidth - 6
} else {
x2 = s2.x + 2
if (s2.notes[s2.nhd].shhd > 0)
x2 += s2.notes[s2.nhd].shhd
}
if (s1.stem >= 0) {
x1 += 2;
if (s1.stem < 0)
x1 -= 2
x2 += 2
}
if (s1.st == upstaff) {
for (s3 = s1; !s3.dur; s3 = s3.next)
;
y1 = y_get(upstaff, 0, s3.x - 4, 8)
} else {
y1 = 0
|
| ︙ | | |
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
|
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
|
-
+
|
yx = y_get(upstaff, 0, s3.x - 4, 8)
if (yx - yy < dy)
dy = yx - yy
if (s3 == s2)
break
}
ym += dy - 10;
ym += dy - 8
y1 = ym + a * (x1 - xm);
y2 = ym + a * (x2 - xm);
/* shift the slurs / decorations */
ym -= 2
for (s3 = s1; ; s3 = s3.next) {
if (s3.st == upstaff) {
|
| ︙ | | |
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
|
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
|
-
+
-
+
|
if (s1.notes[m + 1].shhd > sh)
sh = s1.notes[m + 1].shhd
} else {
if (m > 0 && p == s1.notes[m - 1].pit + 1)
if (s1.notes[m - 1].shhd > sh)
sh = s1.notes[m - 1].shhd
}
x1 = s1.x + sh * .6
x1 = s1.x + sh // * .6
if (job != 2) {
for (m = 0; m < s2.nhd; m++)
if (s2.notes[m] == not2)
break
sh = s2.notes[m].shhd
if (dir > 0) {
if (m < s2.nhd && p + 1 == s2.notes[m + 1].pit)
if (s2.notes[m + 1].shhd < sh)
sh = s2.notes[m + 1].shhd
} else {
if (m > 0 && p == s2.notes[m - 1].pit + 1)
if (s2.notes[m - 1].shhd < sh)
sh = s2.notes[m - 1].shhd
}
x2 += sh * .6
x2 += sh // * .6
}
switch (job) {
case 0:
p = (not1.pit & 1) ? not1.pit : not2.pit
break
case 3: /* clef or staff change */
|
| ︙ | | |
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
|
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
|
-
+
-
+
|
}
if (s1.dots && !(not1.pit & 1)
&& ((dir > 0 && !s1.dot_low)
|| (dir < 0 && s1.dot_low)))
x1 += 5
y = staff_tb[st].y + 3 * (p - 18)
y = staff_tb[st].y + 3 * (p - 18) + /* 1.0 * */ dir
h = (.03 * (x2 - x1) + 16) * dir
h = (.03 * (x2 - x1) + 16) * dir * cfmt.tieheight
// anno_start(k1, 'slur')
slur_out(x1, y, x2, y, dir, h, not1.tie_ty & C.SL_DOTTED)
// anno_stop(k1, 'slur')
}
/* -- draw ties between neighboring notes/chords -- */
function draw_ties(k1, k2,
|
| ︙ | | |
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
|
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
|
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
|
* - chord symbols
* - staff decorations
* - lyrics
* - measure numbers
* The buffer output is delayed until the definition of the staff system
*/
function draw_sym_near() {
var p_voice, p_st, s, v, st, y, g, w, i, st, dx, top, bot,
var p_voice, p_st, s, v, st, y, g, w, i, st, dx, top, bot, ymn,
output_sav = output;
// set the staff offsets of a beam
function set_yab(s1, s2) {
var y,
k = realwidth / YSTEP,
i = (s1.x / k) | 0,
j = (s2.x / k) | 0,
a = (s1.ys - s2.ys) / (s1.xs - s2.xs),
b = s1.ys - s1.xs * a,
p_st = staff_tb[s1.st]
k *= a
if (s1.stem > 0) {
while (i <= j) {
y = k * i + b
if (p_st.top[i] < y)
p_st.top[i] = y
i++
}
} else {
while (i <= j) {
y = k * i + b
if (p_st.bot[i] > y)
p_st.bot[i] = y
i++
}
}
} // set_yab()
output = ""
// initialize the min/max vertical offsets in the staves
for (st = 0; st <= nstaff; st++) {
p_st = staff_tb[st]
if (!p_st.top) {
p_st.top = new Float32Array(YSTEP)
p_st.bot = new Float32Array(YSTEP)
}
for (i = 0; i < YSTEP; i++) {
p_st.top[i] = 0
p_st.bot[i] = 24
}
// p_st.top.fill(0.)
// p_st.bot.fill(24.)
}
/* calculate the beams but don't draw them (the staves are not yet defined) */
for (v = 0; v < voice_tb.length; v++) {
var bm = {},
first_note = true;
p_voice = voice_tb[v]
for (s = p_voice.sym; s; s = s.next) {
switch (s.type) {
case C.GRACE:
for (g = s.extra; g; g = g.next) {
if (g.beam_st && !g.beam_end)
if (g.beam_st && !g.beam_end) {
self.calculate_beam(bm, g)
if (bm.s2)
set_yab(g, bm.s2)
}
}
break
case C.NOTE:
if ((s.beam_st && !s.beam_end)
|| (first_note && !s.beam_st)) {
first_note = false;
self.calculate_beam(bm, s)
if (bm.s2)
set_yab(s, bm.s2)
}
break
}
}
}
/* initialize the min/max vertical offsets */
for (st = 0; st <= nstaff; st++) {
p_st = staff_tb[st]
if (!p_st.top) {
p_st.top = new Float32Array(YSTEP);
p_st.bot = new Float32Array(YSTEP)
}
for (i = 0; i < YSTEP; i++) {
p_st.top[i] = 0;
p_st.bot[i] = 24
}
// p_st.top.fill(0.);
// p_st.bot.fill(24.)
}
set_tie_room();
draw_deco_near()
/* set the min/max vertical offsets */
for (s = tsfirst; s; s = s.ts_next) {
if (s.invis)
continue
switch (s.type) {
case C.GRACE:
for (g = s.extra; g; g = g.next) {
y_set(s.st, true, g.x - 2, 4, g.ymx + 1);
y_set(s.st, false, g.x - 2, 4, g.ymn - 1)
y_set(s.st, false, g.x - 2, 4,
//fixme: hack for slur/accidental far under the staff
// g.ymn - 1)
g.ymn - 5)
}
continue
case C.MREST:
y_set(s.st, true, s.x + 16, 32, s.ymx + 2)
continue
default:
y_set(s.st, true, s.x - s.wl, s.wl + s.wr, s.ymx + 2);
|
| ︙ | | |
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
|
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
|
+
+
+
+
-
+
|
dx = 3;
w = s.beam_end ? 4 : 10
} else {
dx = -8;
w = s.beam_end ? 11 : 16
}
y_set(s.st, true, s.x + dx, w, s.ymx);
ymn = s.ymn
if (s.notes[0].acc // set room for the accidental
&& ymn > 3 * (s.notes[0].pit - 18) - 9)
ymn = 3 * (s.notes[0].pit - 18) - 9
y_set(s.st, false, s.x - s.wl, s.wl + s.wr, s.ymn)
y_set(s.st, false, s.x - s.wl, s.wl + s.wr, ymn)
} else {
y_set(s.st, true, s.x - s.wl, s.wl + s.wr, s.ymx);
if (s.stemless) {
dx = -5;
w = 10
} else if (s.beam_st) {
dx = -6;
|
| ︙ | | |
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
|
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
|
+
+
|
// if (st == undefined) {
//error(1, s, "BUG: no staff for voice " + p_voice.id)
// continue
// }
// draw the slurs and tuplets
for ( ; s; s = s.next) {
if (s.play)
continue
if (s.tp)
draw_tuplet(s)
if (s.sls || s.sl1)
draw_slurs(s)
}
}
set_color()
|
| ︙ | | |
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
|
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
|
-
+
-
-
+
+
-
+
-
+
-
+
-
+
-
+
-
-
+
+
+
+
-
+
-
+
-
-
+
+
+
+
-
+
-
+
|
}
set_dscale(-1);
output = output_sav
}
/* -- draw the name/subname of the voices -- */
function draw_vname(indent) {
function draw_vname(indent, stl) {
var p_voice, n, st, v, a_p, p, y, name_type, h, h2,
staff_d = []
for (st = cur_sy.nstaff; st >= 0; st--) {
if (cur_sy.st_print[st])
for (st = stl.length; st >= 0; st--) {
if (stl[st])
break
}
if (st < 0)
return
// check if full or sub names
for (v = 0; v < voice_tb.length; v++) {
p_voice = voice_tb[v]
if (!p_voice.sym || !cur_sy.voices[v])
continue
st = cur_sy.voices[v].st
if (!cur_sy.st_print[st])
if (!stl[st])
continue
if (p_voice.new_name) {
name_type = 2
break
}
if (p_voice.snm)
name_type = 1
}
if (!name_type)
return
for (v = 0; v < voice_tb.length; v++) {
p_voice = voice_tb[v]
if (!p_voice.sym || !cur_sy.voices[v])
continue
st = cur_sy.voices[v].st
if (!cur_sy.st_print[st])
if (!stl[st])
continue
if (p_voice.new_name)
delete p_voice.new_name;
p = name_type == 2 ? p_voice.nm : p_voice.snm
if (!p)
continue
if (!staff_d[st])
staff_d[st] = p
else
staff_d[st] += "\\n" + p
staff_d[st] += "\n" + p
}
if (staff_d.length == 0)
if (!staff_d.length)
return
set_font("voice");
h = gene.curfont.size
h2 = h / 2
indent = -indent * .5 /* center */
for (st = 0; st < staff_d.length; st++) {
if (!staff_d[st])
continue
a_p = staff_d[st].split('\\n');
a_p = staff_d[st].split("\n");
y = staff_tb[st].y
+ staff_tb[st].topbar * .5
* staff_tb[st].staffscale
+ h2 * (a_p.length - 2)
// if instrument with 2 staves, center the voice name
if ((cur_sy.staves[st].flags & OPEN_BRACE)
&& (cur_sy.staves[st + 1].flags & CLOSE_BRACE)
&& !staff_d[st + 1])
y -= (staff_tb[st].y - staff_tb[st + 1].y) * .5
for (n = 0; n < a_p.length; n++) {
p = a_p[n];
xy_str(indent, y, p, "c");
y -= h
}
}
}
// -- set the y offset of the staves and return the height of the whole system --
function set_staff() {
var s, i, st, prev_staff, v,
y, staffsep, dy, maxsep, mbot, val, p_voice, p_staff
var s, i, st, prev_staff, v,
y, staffsep, dy, maxsep, mbot, val, p_voice, p_staff,
sy = cur_sy
/* set the scale of the voices */
for (v = 0; v < voice_tb.length; v++) {
p_voice = voice_tb[v]
if (p_voice.scale != 1)
p_voice.scale_str =
'transform="scale(' + p_voice.scale.toFixed(2) + ')"'
}
// search the top staff
for (st = 0; st <= nstaff; st++) {
if (gene.st_print[st])
break
}
y = 0
if (st > nstaff) {
st--; /* one staff, empty */
p_staff = staff_tb[st]
}
} else {
// else {
p_staff = staff_tb[st]
for (i = 0; i < YSTEP; i++) {
val = p_staff.top[i]
if (y < val)
y = val
}
}
// }
/* draw the parts and tempo indications if any */
y += draw_partempo(st, y)
if (!gene.st_print[st])
return y;
if (!gene.st_print[st]) {
p_staff.y = -y
return y
}
/* set the vertical offset of the 1st staff */
y *= p_staff.staffscale;
staffsep = cfmt.staffsep * .5 +
p_staff.topbar * p_staff.staffscale
if (y < staffsep)
y = staffsep
if (y < p_staff.ann_top) // absolute annotation
y = p_staff.ann_top;
p_staff.y = -y;
/* set the offset of the other staves */
prev_staff = st
var sy_staff_prev = cur_sy.staves[prev_staff]
var sy_staff_prev = sy.staves[prev_staff]
for (st++; st <= nstaff; st++) {
p_staff = staff_tb[st]
if (!gene.st_print[st])
continue
p_staff = staff_tb[st]
staffsep = sy_staff_prev.sep || cfmt.sysstaffsep;
maxsep = sy_staff_prev.maxsep || cfmt.maxsysstaffsep;
dy = 0
if (p_staff.staffscale == staff_tb[prev_staff].staffscale) {
for (i = 0; i < YSTEP; i++) {
val = p_staff.top[i] -
|
| ︙ | | |
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
|
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
|
+
-
+
+
+
+
+
|
maxsep += p_staff.topbar * p_staff.staffscale
if (dy > maxsep)
dy = maxsep;
y += dy;
p_staff.y = -y;
prev_staff = st;
while (1) {
sy_staff_prev = cur_sy.staves[prev_staff]
sy_staff_prev = sy.staves[prev_staff]
if (sy_staff_prev)
break
sy = sy.next
}
}
mbot = 0
for (i = 0; i < YSTEP; i++) {
val = staff_tb[prev_staff].bot[i]
if (mbot > val)
mbot = val
}
|
| ︙ | | |
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
|
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
|
+
|
}
/* -- draw the staff systems and the measure bars -- */
function draw_systems(indent) {
var s, s2, st, x, x2, res, sy,
staves_bar, bar_force,
xstaff = [],
stl = [], // all staves in the line
bar_bot = [],
bar_height = [],
ba = [], // bars [symbol, bottom, height]
sb = [],
thb = []
/* -- set the bottom and height of the measure bars -- */
|
| ︙ | | |
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
|
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
|
-
+
|
} // bar_set()
/* -- draw a staff -- */
function draw_staff(st, x1, x2) {
var w, ws, i, dy, ty,
y = 0,
ln = "",
stafflines = cur_sy.staves[st].stafflines,
stafflines = staff_tb[st].stafflines,
l = stafflines.length
if (!/[\[|]/.test(stafflines))
return // no line
w = x2 - x1;
set_sscale(st);
ws = w / stv_g.scale
|
| ︙ | | |
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
|
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
|
-
+
-
|
if (s.bar_mrep == 1) {
for (s2 = s.prev; s2.type != C.REST; s2 = s2.prev)
;
xygl(s2.x, yb, "mrep")
} else {
xygl(x, yb, "mrep2")
if (s.v == cur_sy.top_voice)
xy_str(x, yb + p_staff.topbar - 9,
nrep_out(x, yb + p_staff.topbar, s.bar_mrep)
s.bar_mrep.toString(), "c")
}
}
if (bar_type == '||:')
bar_type = '[|:'
for (i = bar_type.length; --i >= 0; ) {
|
| ︙ | | |
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
|
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
|
-
-
+
+
+
-
-
-
+
|
// output all the bars
function out_bars() {
var i, b, bx,
l = ba.length
set_font("annotation");
if (gene.curfont.box) {
gene.curfont.box = false
bx = gene.curfont.box
if (bx)
gene.curfont.box = 0
bx = true
}
for (i = 0; i < l; i++) {
b = ba[i]; // symbol, bottom, height
draw_bar(b[0], b[1], b[2])
}
if (bx)
gene.curfont.box = true
gene.curfont.box = bx
set_sscale(-1)
l = sb.length
if (l) { // single bars [x, y, h]
output += '<path class="bW" d="'
for (i = 0; i < l; i++) {
b = sb[i];
|
| ︙ | | |
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
|
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
|
-
+
-
-
+
+
+
|
b = thb[i];
out_XYAB('MX Yv-F', b[0], b[1], b[2])
}
output += '"/>\n'
}
} // out_bars()
// draw_systems()
// ---- draw_systems() ----
draw_vname(indent)
/* draw the staff, skipping the staff breaks */
for (st = 0; st <= nstaff; st++)
for (st = 0; st <= nstaff; st++) {
xstaff[st] = !cur_sy.st_print[st] ? -1 : 0;
stl[st] = cur_sy.st_print[st] // staff in the line
}
bar_set();
draw_lstaff(0)
for (s = tsfirst; s; s = s.ts_next) {
if (bar_force && s.time != bar_force) {
bar_force = 0
for (st = 0; st <= nstaff; st++) {
if (!cur_sy.st_print[st])
|
| ︙ | | |
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
|
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
|
-
+
+
+
|
if (!s2)
staves_bar = realwidth;
}
sy = s.sy
for (st = 0; st <= nstaff; st++) {
x = xstaff[st]
if (x < 0) { // no staff yet
if (sy.st_print[st])
if (sy.st_print[st]) {
xstaff[st] = staves_bar ?
staves_bar : (s.x - s.wl - 2)
stl[st] = true
}
continue
}
if (sy.st_print[st] // if not staff stop
&& sy.staves[st].stafflines ==
cur_sy.staves[st].stafflines)
continue
if (staves_bar) {
|
| ︙ | | |
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
|
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
|
-
-
-
-
-
-
+
+
+
+
+
+
-
+
-
-
+
+
|
break
nv--
}
if (nv == 0)
draw_lstaff(s.x)
}
}
s2 = s.prev
if (!s2)
break
x2 = s2.x
if (s2.type != C.BAR)
x2 += s2.wr;
st = s.st;
x = xstaff[st]
if (x >= 0) {
s2 = s.prev
if (!s2)
break
x2 = s2.type == C.BAR ?
s2.x :
s.x - s.xmx
if (x >= x2)
continue
break
draw_staff(st, x, x2)
}
xstaff[st] = s.x
xstaff[st] = s.x
}
break
// default:
//fixme:does not work for "%%staves K: M: $" */
//removed for K:/M: in empty staves
// if (!cur_sy.st_print[st])
// s.invis = true
// break
|
| ︙ | | |
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
|
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
|
+
+
+
-
+
-
+
-
-
+
-
|
if (x < 0 || x >= realwidth)
continue
draw_staff(st, x, realwidth)
}
// and the bars
out_bars()
draw_vname(indent, stl)
// set_sscale(-1)
}
/* -- draw remaining symbols when the staves are defined -- */
// (possible hook)
Abc.prototype.draw_symbols = function(p_voice) {
var bm = {},
s, g, x, y, st;
// bm.s2 = undefined
for (s = p_voice.sym; s; s = s.next) {
if (s.invis) {
switch (s.type) {
case C.KEY:
p_voice.key = s
p_voice.ckey = s
default:
continue
case C.NOTE: // (beams may start on invisible notes)
break
}
}
st = s.st
x = s.x;
set_color(s.color)
switch (s.type) {
case C.NOTE:
//--fixme: recall set_scale if different staff
set_scale(s)
if (s.beam_st && !s.beam_end) {
if (self.calculate_beam(bm, s))
draw_beams(bm)
}
if (!s.invis) {
anno_start(s);
draw_note(s, !bm.s2);
anno_stop(s)
anno_a.push(s)
}
if (s == bm.s2)
bm.s2 = null
break
case C.REST:
if (s.invis
|| !staff_tb[st].topbar)
if (!staff_tb[st].topbar)
break
draw_rest(s);
break
case C.BAR:
break /* drawn in draw_systems */
case C.CLEF:
if (s.time >= staff_tb[st].clef.time)
staff_tb[st].clef = s
if (s.second
|| s.invis
|| !staff_tb[st].topbar)
break
set_color();
set_sscale(st);
anno_start(s);
y = staff_tb[st].y
if (s.clef_name)
|
| ︙ | | |
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
|
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
|
-
+
-
-
-
+
+
-
+
-
-
+
-
+
|
} else {
y += s.ymn + 6
if (s.clef_small)
y += 1
}
xygl(x - 2, y, "oct")
}
anno_stop(s)
anno_a.push(s)
break
case C.METER:
p_voice.meter = s
if (s.second
// || s.invis
|| !staff_tb[s.st].topbar)
break
set_color();
set_sscale(s.st);
anno_start(s);
draw_meter(x, s);
anno_stop(s)
draw_meter(s);
anno_a.push(s)
break
case C.KEY:
p_voice.key = s
p_voice.ckey = s
if (s.second
|| s.invis
|| !staff_tb[s.st].topbar)
break
set_color();
set_sscale(s.st);
anno_start(s);
self.draw_keysig(x, s);
anno_stop(s)
anno_a.push(s)
break
case C.MREST:
set_scale(s);
x += 32;
anno_start(s);
xygl(x, staff_tb[s.st].y + 12, "mrest");
out_XYAB('<text style="font:bold 15px serif"\n\
x ="X" y="Y" text-anchor="middle">A</text>\n',
x, staff_tb[s.st].y + 28, s.nmes);
anno_stop(s)
anno_a.push(s)
break
case C.GRACE:
set_scale(s);
draw_gracenotes(s)
break
case C.SPACE:
case C.STBRK:
|
| ︙ | | |
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
|
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
|
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
-
-
-
+
+
+
+
+
+
+
|
break
default:
error(2, s, "draw_symbols - Cannot draw symbol " + s.type)
break
}
}
set_scale(p_voice.sym);
draw_all_ties(p_voice);
// no need to reset the scale as in abcm2ps
set_color()
}
/* -- draw all symbols -- */
function draw_all_sym() {
var p_voice, v,
n = voice_tb.length
var p_voice, v,
n = voice_tb.length
// draw all the helper/ledger lines
function draw_all_hl() {
var st, p_st
function hlud(hla, d) {
var hl, hll, i, xp, dx2, x2,
n = hla.length
if (!n)
return
for (i = 0; i < n; i++) { // for all lines
hll = hla[i]
if (!hll || !hll.length)
continue
xp = sx(hll[0][0]) // previous x
output +=
'<path class="stroke" stroke-width="1" d="M' +
xp.toFixed(1) + ' ' +
sy(p_st.y + d * i).toFixed(1)
dx2 = 0
while (1) {
hl = hll.shift()
if (!hl)
break
x2 = sx(hl[0])
output += 'm' +
(x2 - xp + hl[1] - dx2).toFixed(1) +
' 0h' + (-hl[1] + hl[2]).toFixed(1)
xp = x2
dx2 = hl[2]
}
output += '"/>\n'
}
} // hlud()
for (st = 0; st <= nstaff; st++) {
p_st = staff_tb[st]
if (!p_st.hlu)
continue // (staff not yet displayed)
set_sscale(st)
hlud(p_st.hlu, 6)
hlud(p_st.hld, -6)
}
} // draw_all_hl()
for (v = 0; v < n; v++) {
p_voice = voice_tb[v]
if (p_voice.sym
&& p_voice.sym.x != undefined)
&& p_voice.sym.x != undefined) {
self.draw_symbols(p_voice)
draw_all_ties(p_voice);
// no need to reset the scale as in abcm2ps
set_color()
}
draw_all_deco();
}
}
self.draw_all_deco()
draw_all_hl()
glout() // output the symbols
anno_put() // before outputting the symbol annotations
set_sscale(-1) /* restore the scale */
}
/* -- set the tie directions for one voice -- */
function set_tie_dir(s) {
var i, ntie, dir, sec, pit, ty
|
| ︙ | | |
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
+
|
// abc2svg - format.js - formatting functions
//
// Copyright (C) 2014-2019 Jean-Francois Moine
// Copyright (C) 2014-2021 Jean-Francois Moine
//
// This file is part of abc2svg-core.
//
// abc2svg-core is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
|
| ︙ | | |
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
-
+
|
'sans-serifBold': 1,
Palatino: 1.1,
monospace: 1.35
},
fmt_lock = {}
var cfmt = {
annotationfont: {name: "sans-serif", size: 12 },
annotationfont: {name: "sans-serif", size: 12},
aligncomposer: 1,
beamslope: .4, // max slope of a beam
// botmargin: .7 * IN, // != 1.8 * CM,
breaklimit: .7,
breakoneoln: true,
cancelkey: true,
composerfont: { name: "serif", style: "italic", size: 14 },
|
| ︙ | | |
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
+
+
|
keywarn: true,
leftmargin: 1.4 * CM,
lineskipfac: 1.1,
linewarn: true,
maxshrink: .65, // nice scores
maxstaffsep: 2000,
maxsysstaffsep: 2000,
measrepnb: 1,
measurefont: {name: "serif", style: "italic", size: 10},
measurenb: -1,
musicfont: {name: "music", src: musicfont, size: 24},
musicspace: 6,
// notespacingfactor: 1.33
partsfont: {name: "serif", size: 15},
parskipfac: .4,
partsspace: 8,
// pageheight: 29.7 * CM,
pagewidth: 21 * CM,
|
| ︙ | | |
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
|
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
|
+
+
|
subtitlefont: {name: "serif", size: 16},
subtitlespace: 3,
sysstaffsep: 34,
tempofont: {name: "serif", weight: "bold", size: 12},
textfont: {name: "serif", size: 16},
// textoption: undefined,
textspace: 14,
tieheight: 1.0,
titlefont: {name: "serif", size: 20},
// titleleft: false,
titlespace: 6,
titletrim: true,
// transp: 0, // global transpose
// topmargin: .7 * IN,
topspace: 22,
tuplets: [0, 0, 0, 0],
tupletfont: {name: "serif", style: "italic", size: 12},
vocalfont: {name: "serif", weight: "bold", size: 13},
vocalspace: 10,
voicefont: {name: "serif", weight: "bold", size: 13},
// voicescale: 1,
writefields: "CMOPQsTWw",
wordsfont: {name: "serif", size: 16},
wordsspace: 5
|
| ︙ | | |
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
|
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
|
-
+
+
+
-
+
+
-
+
+
-
-
+
+
+
+
+
+
+
+
+
|
return
xxxfont = "u" + n + "font"
}
// create a new font
font = cfmt[xxxfont];
if (!font) { // set-font-<n> or new element
font = {}
font = {
pad: 0
}
} else {
font = {
name: font.name,
size: font.size,
box: font.box
box: font.box,
pad: font.pad
}
}
cfmt[xxxfont] = font;
// fill the values
a = p.match(/\s+(no)?box(\s|$)/)
if (a) { // if box
if (a[1])
if (a[1]) {
font.box = false // nobox
font.pad = 0
else
font.box = true;
} else {
font.box = true
font.pad = font.size * .4 - 3
}
p = p.replace(a[0], a[2])
}
a = p.match(/\s+padding=([\d.]+)(\s|$)/)
if (a) { // if padding
font.pad = a[1] ? Number(a[1]) : 0
p = p.replace(a[0], a[2])
}
a = p.match(/\s+class=(.*?)(\s|$)/)
if (a) {
font.class = a[1];
p = p.replace(a[0], a[2])
|
| ︙ | | |
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
|
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
|
-
+
-
-
|
}
p = p.replace(a[0], a[2])
}
// the font size is the last item
a = p.match(/\s+([0-9.]+|\*)$/)
if (a) {
if (a[1] != "*") {
if (a[1] != "*")
font.size = Number(a[1])
font.swfac = 0
}
p = p.replace(a[0], "")
}
a = p.match(/[- ]?[nN]ormal/)
if (a) {
font.normal = true
p = p.replace(a[0], '')
|
| ︙ | | |
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
|
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
|
+
+
+
+
+
+
+
-
+
+
+
+
+
-
+
+
+
+
-
+
-
-
-
+
-
-
-
-
-
+
+
+
+
+
-
-
+
-
-
+
|
p = p.replace(a[0], '')
}
a = p.match(/[- ]?[oO]blique/)
if (a) {
font.style = "oblique"
p = p.replace(a[0], '')
}
if (font.size)
set_font_fac(font)
else
font.swfac = 0
switch (p) {
case "":
case "*": return
case "Times-Roman":
case "Times": p = "serif"; break
case "Helvetica": p = "sans-serif"; break
case "Courier": p = "monospace"; break
}
// accept url(...) as the font name
if (p[3] == '(') {
font.swfac = 0
font.src = p
font.fid = font_tb.length
font_tb.push(font)
p = 'ft' + font.fid
}
font.name = p
}
// get a length with a unit - return the number of pixels
function get_unit(param) {
var v = parseFloat(param)
var v = param.toLowerCase().match(/([\d.]+)(.*)/)
if (!v)
return NaN
v[1] = Number(v[1])
switch (param.slice(-2)) {
switch (v[2]) {
case "CM":
case "cm":
v *= CM
break
return v[1] * CM
case "IN":
case "in":
v *= IN
break
case "PT": // paper point in 1/72 inch
case "pt":
return v[1] * IN
case "pt": // paper point in 1/72 inch
return v[1] * .75
case "px": // screen pixel in 1/96 inch
case "":
v *= .75
break
return v[1]
// default: // ('px') // screen pixel in 1/96 inch
}
return v
return NaN
}
// set the infoname
function set_infoname(param) {
//fixme: check syntax: '<letter> ["string"]'
var tmp = cfmt.infoname.split("\n"),
letter = param[0]
|
| ︙ | | |
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
|
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
|
-
-
-
-
-
+
-
-
+
-
-
-
+
-
+
|
cfmt.writefields = cfmt.writefields.replace(c, '')
}
}
}
// set a voice specific parameter
function set_v_param(k, v) {
if (curvoice) {
self.set_vp([k + '=', v])
return
}
k = [k + '=', v];
k = [k + '=', v]
var vid = '*'
if (!info.V)
if (curvoice)
info.V = {}
if (info.V[vid])
Array.prototype.push.apply(info.V[vid], k)
set_kv_parm(k)
else
info.V[vid] = k
memo_kv_parm('*', k)
}
function set_page() {
if (!img.chg)
return
img.chg = false;
img.lm = cfmt.leftmargin - cfmt.printmargin
|
| ︙ | | |
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
|
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
|
+
+
+
-
+
+
-
-
-
-
-
-
-
-
+
-
-
+
+
+
|
// set a format parameter
// (possible hook)
Abc.prototype.set_format = function(cmd, param) {
var f, f2, v, i
//fixme: should check the type and limits of the parameter values
if (/.+font(-[\d])?$/.test(cmd)) {
if (cmd == "soundfont")
cfmt.soundfont = param
else
param_set_font(cmd, param)
param_set_font(cmd, param)
return
}
switch (cmd) {
case "aligncomposer":
case "barsperstaff":
case "infoline":
case "measurenb":
case "rbmax":
case "rbmin":
case "measrepnb":
case "shiftunison":
v = parseInt(param)
if (isNaN(v)) {
syntax(1, "Bad integer value");
break
}
cfmt[cmd] = v
break
case "microscale":
f = parseInt(param)
if (isNaN(f) || f < 4 || f > 256 || f % 1) {
syntax(1, errs.bad_val, "%%" + cmd)
break
}
set_v_param("uscale", f)
break
case "bgcolor":
case "fgcolor":
case "dblrepbar":
case "titleformat":
cfmt[cmd] = param
break
case "beamslope":
case "breaklimit": // float values
case "lineskipfac":
case "maxshrink":
case "pagescale":
case "parskipfac":
case "scale":
case "slurheight":
case "stemheight":
case "stretchlast":
case "tieheight":
f = parseFloat(param)
if (isNaN(f)) {
syntax(1, errs.bad_val, '%%' + cmd)
break
}
switch (cmd) {
case "scale": // old scale
f /= .75
case "pagescale":
cmd = "scale";
img.chg = true
break
}
cfmt[cmd] = f
break
case "annotationbox":
case "gchordbox":
case "measurebox":
case "partsbox":
cfmt[cmd.replace("box", "font")] // font
.box = get_bool(param)
param_set_font(cmd.replace("box", "font"), // font
"* * " + (get_bool(param) ? "box" : "nobox"))
break
case "bstemdown":
case "breakoneoln":
case "cancelkey":
case "checkbars":
case "contbarnb":
case "custos":
case "decoerr":
case "dynalign":
case "flatbeams":
case "graceslurs":
case "graceword":
|
| ︙ | | |
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
|
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
|
-
-
+
+
-
-
-
+
+
+
+
|
case "straightflags":
case "stretchstaff":
case "timewarn":
case "titlecaps":
case "titleleft":
cfmt[cmd] = get_bool(param)
break
case "chordnames":
v = param.split(',')
case "chordalias":
v = param.split(/\s+/)
cfmt.chordnames = {}
for (i = 0; i < v.length; i++)
cfmt.chordnames['CDEFGAB'[i]] = v[i]
if (!v.length)
syntax(1, errs.bad_val, "%%chordalias")
else
abc2svg.ch_alias[v[0]] = v[1] || ""
break
case "composerspace":
case "indent":
case "infospace":
case "maxstaffsep":
case "maxsysstaffsep":
case "musicspace":
|
| ︙ | | |
497
498
499
500
501
502
503
504
505
506
507
508
509
510
|
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
|
+
+
+
|
case "wordsspace":
f = get_unit(param) // normally, unit in points - 72 DPI accepted
if (isNaN(f))
syntax(1, errs.bad_val, '%%' + cmd)
else
cfmt[cmd] = f
break
case "page-format":
user.page_format = get_bool(param)
break
case "print-leftmargin": // to remove
syntax(0, "$1 is deprecated - use %%printmargin instead", '%%' + cmd)
cmd = "printmargin"
// fall thru
case "printmargin":
// case "botmargin":
case "leftmargin":
|
| ︙ | | |
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
|
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
|
-
-
+
+
+
-
-
+
+
+
+
-
-
+
+
+
+
-
-
+
+
+
+
+
+
+
|
var n = font.name,
r = ""
if (font.weight)
r += font.weight + " "
if (font.style)
r += font.style + " "
if (n.indexOf(' ') > 0)
n = '"' + n.replace(/"/g, "") + '"' // '
if (n.indexOf('"') < 0 && n.indexOf(' ') > 0)
n = '"' + n + '"'
return r + font.size.toFixed(1) + 'px ' + n
}
function style_font(font) {
return 'font:' + st_font(font)
}
Abc.prototype.style_font = style_font
// build a font class
function font_class(font) {
var f = 'f' + font.fid + cfmt.fullsvg
if (font.class)
return 'f' + font.fid + cfmt.fullsvg + ' ' + font.class
return 'f' + font.fid + cfmt.fullsvg
f += ' ' + font.class
if (font.box)
f += ' ' + 'box'
return f
}
// use the font
function use_font(font) {
if (!font.used) {
font.used = true;
if (font.fid == undefined) {
font.fid = font_tb.length;
if (font.fid == undefined) { // if default font
font.fid = font_tb.length
font_tb.push(font)
if (!font.swfac)
set_font_fac(font)
if (!font.pad)
font.pad = 0
}
font_style += "\n.f" + font.fid + cfmt.fullsvg +
" {" + style_font(font) + "}"
add_fstyle(".f" + font.fid +
(typeof document == "undefined" ? cfmt.fullsvg : "") +
"{" + style_font(font) + "}")
if (font.src)
add_fstyle("@font-face{\n\
font-family:" + font.name + ";\n\
src:" + font.src + "}")
}
}
// get the font of the 'xxxfont' parameter
function get_font(fn) {
var font, font2, fid, st
|
| ︙ | | |
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
|
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
|
-
-
+
+
+
+
+
+
-
+
|
font2.style = null
} else {
if (font.weight)
font2.weight = font.weight
if (font.style)
font2.style = font.style
}
if (font.class)
font2.class = font.class
// if (font.class)
// font2.class = font.class
if (font.size)
font2.size = font.size
st = st_font(font2)
if (font.class) {
font2.class = font.class
st += ' '+ font.class
}
fid = font_st[st]
if (fid != undefined)
return font_tb[fid]
font_st[st] = font_tb.length
font_st[st] = font_tb.length // will be the font id
font2.fid = font2.used = undefined
font = font2
}
use_font(font)
return font
}
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
-
+
-
-
+
+
-
+
-
-
+
+
-
+
-
-
+
-
-
-
+
+
+
-
-
-
-
-
-
+
+
|
// abc2svg - gchord.js - chord symbols
//
// Copyright (C) 2014-2019 Jean-Francois Moine
// Copyright (C) 2014-2020 Jean-Francois Moine
//
// This file is part of abc2svg-core.
//
// abc2svg-core is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// abc2svg-core is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with abc2svg-core. If not, see <http://www.gnu.org/licenses/>.
// -- parse a chord symbol / annotation --
// the result is added in the global variable a_gch
// 'type' may be a single '"' or a string '"xxx"' created by U:
function parse_gchord(type) {
var c, text, gch, x_abs, y_abs, type,
i, istart, iend,
var c, text, gch, x_abs, y_abs, type,
i, j, istart, iend,
ann_font = get_font("annotation"),
h_ann = ann_font.size,
line = parse.line
function get_float() {
var txt = ''
while (1) {
c = text[i++]
if ("1234567890.-".indexOf(c) < 0)
return parseFloat(txt)
txt += c
}
} // get_float()
istart = parse.bol + line.index
if (type.length > 1) { // U:
text = type.slice(1, -1);
iend = istart + 1
} else {
text = ""
i = ++line.index // search the ending double quote
while (1) {
c = line.next_char()
if (!c) {
j = line.buffer.indexOf('"', i)
if (j < 0) {
syntax(1, "No end of guitar chord")
return
}
if (c == '"')
if (line.buffer[j - 1] != '\\')
break
if (c == '\\') {
text += c;
i = j + 1
c = line.next_char()
}
text += c
}
text = cnv_escape(line.buffer.slice(line.index, j))
line.index = j
}
iend = parse.bol + line.index + 1
}
if (curvoice.pos.gch == C.SL_HIDDEN)
return
if (ann_font.box)
h_ann += 3;
if (ann_font.pad)
h_ann += ann_font.pad
i = 0;
type = 'g'
while (1) {
c = text[i]
if (!c)
break
gch = {
|
| ︙ | | |
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
|
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
|
+
-
+
-
+
-
+
|
break
case ';':
break
}
i++
break
}
gch.otext = gch.text // save for play accompaniment
if (!a_gch)
a_gch = []
a_gch.push(gch)
}
}
// transpose a chord symbol
var note_names = "CDEFGAB",
acc_name = ["bb", "b", "", "#", "##"]
function gch_tr1(p, transp) {
var i, o, n, a, ip, b40,
csa = p.split('/')
for (i = 0; i < csa.length; i++) { // main and optional bass
p = csa[i];
o = p.search(/[ABCDEFG]/);
o = p.search(/[A-G]/)
if (o < 0)
continue // strange chord symbol!
ip = o + 1
a = 0
while (p[ip] == '#') {
while (p[ip] == '#' || p[ip] == '\u266f') {
a++;
ip++
}
while (p[ip] == 'b') {
while (p[ip] == 'b' || p[ip] == '\u266d') {
a--;
ip++
}
n = note_names.indexOf(p[o]) + 16
b40 = (abc2svg.pab40(n, a) + transp + 200) % 40
b40 = abc2svg.b40k[b40]
csa[i] = p.slice(0, o) +
|
| ︙ | | |
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
|
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
|
+
+
+
+
+
-
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
+
-
-
+
+
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
+
-
-
-
-
-
-
-
-
-
-
+
+
+
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
-
-
-
+
+
+
+
+
+
+
+
|
while (--i >= 0) {
gch = s.a_gch[i]
if (gch.type == 'g')
gch.text = gch_tr1(gch.text, curvoice.vtransp)
}
}
// parser: add the parsed list of chord symbols and annotations
// to the symbol (note, rest or bar)
function csan_add(s) {
s.a_gch = a_gch;
a_gch = null
// -- build the chord indications / annotations --
if (curvoice.vtransp)
gch_transp(s)
} // csan_add
// generator: build the chord symbols / annotations
// (possible hook)
Abc.prototype.gch_build = function(s) {
/* split the chord indications / annotations
/* split the chord symbols / annotations
* and initialize their vertical offsets */
var gch, wh, xspc, ix,
pos = curvoice.pos.gch == C.SL_BELOW ? -1 : 1,
y_above = 0,
y_below = 0,
y_left = 0,
y_right = 0,
GCHPRE = .4; // portion of chord before note
s.a_gch = a_gch;
a_gch = null
if (curvoice.vtransp)
gch_transp(s)
// change the accidentals in the chord symbols,
// convert the escape sequences in annotations, and
// set the offsets
for (ix = 0; ix < s.a_gch.length; ix++) {
gch = s.a_gch[ix]
if (gch.type == 'g') {
if (cfmt.chordnames) {
gch.otext = gch.text; // save for %%diagram
gch.text = gch.text.replace(/A|B|C|D|E|F|G/g,
function(c){return cfmt.chordnames[c]})
if (cfmt.chordnames.B == 'H')
gch.text = gch.text.replace(/Hb/g, 'Bb')
}
gch.text = gch.text.replace(/##|#|=|bb|b| /g,
function(x) {
switch (x) {
case '##': return "𝄪"
case '#': return "\u266f"
case '=': return "\u266e"
case 'b': return "\u266d"
case ' ': return ' '
}
return "𝄫"
});
} else {
if (gch.type == '@'
&& !user.anno_start && !user.anno_stop) {
set_font(gch.font)
gch.text = str2svg(gch.text)
gch.wh = [0, 0]
gch.text.wh = [0, 0]
continue /* no width */
}
}
/* set the offsets and widths */
set_font(gch.font);
wh = strwh(gch.text);
gch.wh = wh
gch.text = str2svg(gch.text)
wh = gch.text.wh
if (gch.font.box)
wh[1] += 4
wh[1] += gch.font.pad * 2
switch (gch.type) {
case '@':
break
case '^': /* above */
xspc = wh[0] * GCHPRE
if (xspc > 8)
xspc = 8;
gch.x = -xspc;
y_above -= wh[1];
gch.y = y_above
break
case '_': /* below */
xspc = wh[0] * GCHPRE
if (xspc > 8)
xspc = 8;
gch.x = -xspc;
y_below -= wh[1];
gch.y = y_below
break
case '<': /* left */
gch.x = -(wh[0] + 6);
y_left -= wh[1];
gch.y = y_left + wh[1] / 2
break
case '>': /* right */
gch.x = 6;
y_right -= wh[1];
gch.y = y_right + wh[1] / 2
break
default: // chord symbol
xspc = wh[0] * GCHPRE
if (xspc > 8)
xspc = 8;
gch.x = -xspc;
if (pos < 0) { /* below */
y_below -= wh[1];
gch.y = y_below
} else {
y_above -= wh[1];
gch.y = y_above
}
break
}
}
/* move upwards the top and middle texts */
y_left /= 2;
y_right /= 2
for (ix = 0; ix < s.a_gch.length; ix++) {
gch = s.a_gch[ix]
switch (gch.type) {
case '^': /* above */
gch.y -= y_above
break
case '<': /* left */
gch.y -= y_left
break
case '>': /* right */
gch.y -= y_right
break
case 'g': // chord symbol
if (pos > 0)
gch.y -= y_above
break
}
}
}
// -- draw the chord symbols and annotations
// (the staves are not yet defined)
// (unscaled delayed output)
// (possible hook)
Abc.prototype.draw_gchord = function(s, gchy_min, gchy_max) {
Abc.prototype.draw_gchord = function(i, s, x, y) {
var gch, text, ix, x, y, y2, hbox, h, y_above, y_below,
var y2,
// adjust the vertical offset according to the chord symbols
w = 0,
yav = s.dur ?
(((s.notes[s.nhd].pit + s.notes[0].pit) >> 1) - 18) * 3 :
12 // fixed offset on measure bars
for (ix = 0; ix < s.a_gch.length; ix++) {
gch = s.a_gch[ix]
if (gch.wh[0] > w)
w = gch.wh[0]
an = s.a_gch[i],
h = an.text.wh[1],
pad = an.font.pad,
}
y_above = y_get(s.st, 1, s.x - 3, w);
y_below = y_get(s.st, 0, s.x - 3, w)
if (y_above < gchy_max)
y_above = gchy_max
if (y_below > gchy_min)
y_below = gchy_min;
w = an.text.wh[0] + pad * 2
set_dscale(s.st);
for (ix = 0; ix < s.a_gch.length; ix++) {
gch = s.a_gch[ix];
use_font(gch.font);
set_font(gch.font);
h = gch.font.size;
hbox = gch.font.box ? 2 : 0;
w = gch.wh[0];
x = s.x + gch.x;
text = gch.text
switch (gch.type) {
case '_': /* below */
y = gch.y + y_below;
y_set(s.st, 0, x, w, y - hbox)
break
case '^': /* above */
y = gch.y + y_above + hbox;
y_set(s.st, 1, x, w, y + h + hbox)
break
case '<': /* left */
switch (an.type) {
case '_': // below
y -= h + pad
y_set(s.st, 0, x, w, y - pad)
break
case '^': // above
y = y_get(s.st, 1, x, w)
y += pad
y_set(s.st, 1, x, w, y + h + pad)
break
case '<': // left
case '>': // right
if (an.type == '<') {
/*fixme: what symbol space?*/
if (s.notes[0].acc)
x -= s.notes[0].shac;
x -= s.notes[0].shac
y = gch.y + yav - h / 2
break
case '>': /* right */
x -= pad
} else {
if (s.xmx)
x += s.xmx
if (s.dots)
x += 1.5 + 3.5 * s.dots;
y = gch.y + yav - h / 2
break
default: // chord symbol
if (gch.y >= 0) {
y = gch.y + y_above + hbox;
y_set(s.st, true, x, w, y + h + hbox)
} else {
y = gch.y + y_below;
y_set(s.st, false, x, w, y - hbox)
}
break
case '@': /* absolute */
y = gch.y + yav
if (y > 0) {
y2 = y + h
if (y2 > staff_tb[s.st].ann_top)
staff_tb[s.st].ann_top = y2
x += 1.5 + 3.5 * s.dots
x += pad
}
y += (s.type == C.NOTE ?
(((s.notes[s.nhd].pit + s.notes[0].pit) >> 1) -
18) * 3 :
12) // fixed offset on rests and bars
- h / 2
break
default: // chord symbol
if (y >= 0) {
y += pad
y_set(s.st, 1, x, w, y + h + pad)
} else {
y -= h + pad
y_set(s.st, 0, x, w, y - pad)
}
break
case '@': // absolute
y += (s.type == C.NOTE ?
(((s.notes[s.nhd].pit + s.notes[0].pit) >> 1) -
18) * 3 :
12) // fixed offset on rests and bars
+ h * .2
if (y > 0) {
y2 = y + h * .8
if (y2 > staff_tb[s.st].ann_top)
staff_tb[s.st].ann_top = y2
} else {
y2 = y
if (y2 < staff_tb[s.st].ann_bot)
staff_tb[s.st].ann_bot = y2
}
break
}
use_font(an.font)
set_font(an.font)
set_dscale(s.st)
if (user.anno_start)
user.anno_start("annot", an.istart, an.iend,
x - 2, y + h + 2, w + 4, h + 4, s)
xy_str(x, y, an.text)
if (user.anno_stop)
user.anno_stop("annot", an.istart, an.iend,
x - 2, y + h + 2, w + 4, h + 4, s)
} // draw_gchord()
// draw all chord symbols
function draw_all_chsy() {
var s, san1, an, i, y, w,
pos = curvoice.pos.gch == C.SL_BELOW ? -1 : 1,
n_an = 0, // max number of annotations
minmax = new Array(nstaff + 1)
if (curvoice.pos.gch == C.SL_HIDDEN)
pos = 0
// set a vertical offset to all the chord symbols/annotations
function set_an_yu(j) {
var an, i, s, x, y, w
for (s = san1 ; s; s = s.ts_next) {
an = s.a_gch
if (!an)
continue
i = an.length - j - 1
an = an[i]
if (!an)
continue
if ((an.type == 'g' && pos > 0)
|| an.type == '^') {
x = s.x + an.x
w = an.text.wh[0]
if (w && x + w > realwidth)
x = realwidth - w // let the text in the page
y = y_get(s.st, 1, x, w) // y / staff
if (an.type == 'g' && y < minmax[s.st].yup)
y = minmax[s.st].yup
} else if ((an.type == 'g' && pos <= 0)
|| an.type == '_') {
continue
} else {
x = s.x + an.x
y = an.y
}
self.draw_gchord(i, s, x, y)
}
} // set_an_yu()
if (y < staff_tb[s.st].ann_bot)
staff_tb[s.st].ann_bot = y
}
break
}
function set_an_yl(i) {
var an, x, y, w
for (var s = san1 ; s; s = s.ts_next) {
an = s.a_gch
if (!an)
continue
an = an[i]
if (!an
|| !((an.type == 'g' && pos < 0)
|| an.type == '_'))
continue
x = s.x + an.x
w = an.text.wh[0]
if (w && x + w > realwidth) // let the text inside the page
x = realwidth - w
y = y_get(s.st, 0, x, w) // y / staff
if (an.type == 'g' && y > minmax[s.st].ydn)
y = minmax[s.st].ydn
self.draw_gchord(i, s, x, y)
}
} // set_an_yl()
// get the number of chord symbols / annotations
// and the vertical offset for the chord symbols
for (i = 0; i <= nstaff; i++)
minmax[i] = {
ydn: staff_tb[i].botbar - 3,
yup: staff_tb[i].topbar + 4
}
for (s = tsfirst; s; s = s.ts_next) {
an = s.a_gch
if (!an)
continue
if (!san1)
san1 = s // first chord symbol / annotation
i = an.length
if (i > n_an)
n_an = i
while (--i >= 0) {
if (an[i].type == 'g') {
an = an[i]
w = an.text.wh[0]
if (pos > 0) {
y = y_get(s.st, true, s.x, w)
if (y > minmax[s.st].yup)
minmax[s.st].yup = y
} else if (pos < 0) {
y = y_get(s.st, false, s.x, w)
if (y < minmax[s.st].ydn)
minmax[s.st].ydn = y
}
break
}
if (user.anno_start)
user.anno_start("annot", gch.istart, gch.iend,
x - 2, y + h + 2, w + 4, h + 4, s)
xy_str(x, y, text, null, null, gch.wh)
if (user.anno_stop)
user.anno_stop("annot", gch.istart, gch.iend,
}
}
if (!san1)
return // no chord symbol nor annotation
x - 2, y + h + 2, w + 4, h + 4, s)
}
}
// draw the elements
set_dscale(-1) // restore the scale parameters
for (i = 0; i < n_an; i++) {
set_an_yu(i) // upper offsets
set_an_yl(i) // lower offsets
}
} // draw_all_chsy()
|
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
+
|
// abc2svg - music.js - music generation
//
// Copyright (C) 2014-2019 Jean-Francois Moine
// Copyright (C) 2014-2021 Jean-Francois Moine
//
// This file is part of abc2svg-core.
//
// abc2svg-core is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
|
| ︙ | | |
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
-
+
-
+
-
-
+
+
|
// accidental x offset - index = note head type
var dx_tb = new Float32Array([
10, // FULL
10, // EMPTY
11, // OVAL
13, // OVALBARS
13 // SQUARE
15 // SQUARE
])
// head width - index = note head type
var hw_tb = new Float32Array([
4.5, // FULL
4.7, // FULL
5, // EMPTY
6, // OVAL
7, // OVALBARS
8 // SQUARE
7.2, // OVALBARS
7.5 // SQUARE
])
/* head width for voice overlap - index = note head type */
var w_note = new Float32Array([
3.5, // FULL
3.7, // EMPTY
5, // OVAL
|
| ︙ | | |
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
|
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
|
-
-
+
+
+
+
-
+
|
if (!dur)
error(1, s, "Note too short")
for (flags = 5; dur != 0; dur >>= 1, flags--) {
if (dur & 1)
break
}
dur >>= 1
if ((dur + 1) & dur)
error(0, s, "Non standard note duration $1", dur_o)
if ((dur + 1) & dur) {
if (s.type != C.REST || dur_o != s.p_v.wmeasure)
error(0, s, "Non standard note duration $1", dur_o)
}
while (dur >> dots > 0)
dots++
flags -= dots
if (flags >= 0) {
head = C.FULL
} else switch (flags) {
default:
error(1, s, "Note too long");
error(1, s, "Note too long")
flags = -4
/* fall thru */
case -4:
head = C.SQUARE
break
case -3:
head = cfmt.squarebreve ? C.SQUARE : C.OVALBARS
|
| ︙ | | |
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
|
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
|
+
-
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
if (s.prev)
s.prev.next = s
else
s.p_v.sym = s;
next.prev = s
}
function lktsym(s, next) { // time linkage
s.ts_next = next
if (next) {
s.ts_next = next;
s.ts_prev = next.ts_prev
if (s.ts_prev)
s.ts_prev.ts_next = s;
next.ts_prev = s
} else {
//fixme
error(2, s, "Bad linkage")
s.ts_next = s.ts_prev = null
s.ts_prev = null
}
s.seqst = !s.ts_prev
|| s.time != s.ts_prev.time
|| ((w_tb[s.ts_prev.type] != w_tb[s.type]
&& w_tb[s.ts_prev.type] != 0)
|| s.ts_prev.v == s.v) // case cut bar
if (!next)
return
next.seqst = next.time != s.time ||
(w_tb[s.type] != w_tb[next.type]
&& w_tb[s.type] != 0)
if (next.seqst) {
self.set_width(next)
next.shrink = next.wl
if (next.prev)
next.shrink += next.prev.wr
next.space = 0
}
}
/* -- unlink a symbol -- */
function unlksym(s) {
if (s.next)
s.next.prev = s.prev
|
| ︙ | | |
362
363
364
365
366
367
368
369
370
371
372
373
374
375
|
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
|
+
+
+
+
+
+
+
+
|
s.ts_next.shrink += s.shrink;
s.ts_next.space += s.space
} else {
s.ts_next.seqst = true;
s.ts_next.shrink = s.shrink;
s.ts_next.space = s.space
}
} else {
if (s.ts_next.seqst
&& s.ts_prev && s.ts_prev.seqst
&& !w_tb[s.ts_prev.type]) {
s.ts_next.seqst = false
s.shrink = s.ts_next.shrink
s.space = s.ts_next.space
}
}
s.ts_next.ts_prev = s.ts_prev
}
if (s.ts_prev)
s.ts_prev.ts_next = s.ts_next
if (tsfirst == s)
tsfirst = s.ts_next
|
| ︙ | | |
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
|
437
438
439
440
441
442
443
444
445
446
447
448
449
450
|
-
-
|
}
new_s.nhd = 0;
/* link in time */
while (!s.seqst)
s = s.ts_prev;
lktsym(new_s, s)
if (new_s.ts_prev.type != C.CLEF)
new_s.seqst = true
return new_s
}
/* -- set the staff of the floating voices -- */
/* this function is called only once per tune */
function set_float() {
var p_voice, st, staff_chg, v, s, s1, up, down
|
| ︙ | | |
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
|
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
|
-
+
+
+
+
-
+
+
-
+
-
+
-
+
|
}
if (!s.a_gch)
continue
for (i = 0; i < s.a_gch.length; i++) {
ch = s.a_gch[i]
if (ch.type != 'g' || ch.y < 0) // upper chord symbol only
continue
if (w0) {
if (w0) { // width of the previous chord symbol
if (w0 > x + ch.x) {
if (s.prev // (if not at start of a secondary voice)
&& s.prev.type == C.BAR) // don't move away
n-- // the symbol from a bar
dw = (w0 - x - ch.x) / n
while (1) {
s0 = s0.ts_next
if (s0.shrink)
s0.shrink += dw
if (s0 == s)
if (s0 == s
|| s0.type == C.BAR)
break
}
}
}
s0 = s;
w0 = ch.wh[0];
w0 = ch.text.wh[0];
n = 0;
// x = ch.font.box ? -2 : 0
x = 0
break
}
}
}
// compute the width needed by the left and right annotations
function gchord_width(s, wlnote, wlw) {
var gch, w, ix,
arspc = 0
for (ix = 0; ix < s.a_gch.length; ix++) {
gch = s.a_gch[ix]
switch (gch.type) {
case '<': /* left */
w = gch.wh[0] + wlnote
w = gch.text.wh[0] + wlnote
if (w > wlw)
wlw = w
break
case '>': /* right */
w = gch.wh[0] + s.wr
w = gch.text.wh[0] + s.wr
if (w > arspc)
arspc = w
break
}
}
if (s.wr < arspc)
s.wr = arspc
|
| ︙ | | |
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
|
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
|
-
+
+
-
+
|
}
for (m = 0; m <= s.nhd; m++) {
xx = s.notes[m].shhd
if (xx < 0) {
if (wlnote < -xx + 5)
wlnote = -xx + 5
}
if (s.notes[m].acc) {
acc = s.notes[m].acc
if (acc) {
tmp = s.notes[m].shac +
(s.notes[m].micro ? 5.5 : 3.5)
(typeof acc != "number" ? 5.5 : 3.5)
if (wlnote < tmp)
wlnote = tmp
}
}
if (s2) {
switch (s2.type) {
case C.BAR:
|
| ︙ | | |
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
|
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
|
+
+
+
-
-
+
+
+
+
|
s.wl += deco_width(s)
/* have room for the repeat numbers / chord indication */
if (s.text && s.text.length < 4
&& s.next && s.next.a_gch) {
set_font("repeat");
s.wr += strwh(s.text)[0] + 2
if (cfmt.measurenb > 0 & s.bar_num
&& s.bar_num % cfmt.measurenb)
s.wr += 4
}
return
case C.CLEF:
// (there may be invisible clefs in empty staves)
if (s.invis) {
s.wl = s.wr = 1 // (!! not 0 !!)
return
}
s.wl = s.clef_small ? 9 : 12
s.wr = s.clef_small ? 7 : 12
s.wl = s.clef_small ? 11 : 12
s.wr = s.clef_small ? 10 : 12
if (s.next && s.next.type == C.BAR)
s.wr -= 4
return
case C.KEY:
if ((!s.k_a_acc && !s.k_sf && !s.k_old_sf) // if no accidental
|| s.k_none // or no key
|| s.k_play) { // or key for play
s.wl = s.wr = 0 // no width
return
|
| ︙ | | |
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
|
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
|
-
-
+
+
-
-
-
-
-
-
-
+
|
l / ((C.BLEN / 16 / 8) << i)
}
}
return space
}
// set the natural space
function set_space(s) {
var space, prev_time, len,
function set_space(s, ptime) {
var space, len, s2, stemdir
s2 = s.ts_prev
if (s.play)
return 0
while (s2.play) // if play symbol
s2 = s2.ts_prev
prev_time = s2.time
len = s.time - prev_time // time skip
len = s.time - ptime // time skip
if (!len) {
switch (s.type) {
case C.MREST:
return s.wl
///*fixme:do same thing at start of line*/
// case C.NOTE:
|
| ︙ | | |
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
|
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
|
-
+
-
+
|
}
}
/* decrease spacing when stem down followed by stem up */
/*fixme:to be done later, after x computed in sym_glue*/
if (s.type == C.NOTE && s.nflags >= -1
&& s.stem > 0) {
var stemdir = true
stemdir = true
for (s2 = s.ts_prev;
s2 && s2.time == prev_time;
s2 && s2.time == ptime;
s2 = s2.ts_prev) {
if (s2.type == C.NOTE
&& (s2.nflags < -1 || s2.stem > 0)) {
stemdir = false
break
}
}
|
| ︙ | | |
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
|
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
|
-
+
-
-
-
+
+
-
-
+
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
+
-
-
+
-
-
+
-
-
-
+
+
+
+
+
-
+
-
+
-
+
-
-
-
-
+
+
+
-
-
-
-
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
+
-
-
-
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
|
if (stemdir)
space *= .9
}
}
return space
}
// set a fixed spacing inside tuplets
// set the spacing inside tuplets or L: factor
function set_sp_tup(s, s_et) {
var s2,
tim = s.time,
endtime = s_et.time + s_et.dur,
var tim = s.time,
ttim = s_et.time - tim,
ttim = endtime - tim,
space = time2space(s, ttim / s.tp[0].q) * s.tp[0].q / ttim
sp = time2space(s, ttim), // whole time spacing
// start on the second note/rest
do {
s = s.ts_next
s2 = s,
} while (!s.seqst)
//fixme: problem when BAR inside the tuplet sequence (in case user error)
// while (!s.dur)
// s = s.ts_next
// while (!s.seqst)
// s = s.ts_prev
// stop outside the tuplet sequence
// and add a measure bar when at end of tune
do {
if (!s_et.ts_next) {
s2 = add_end_bar(s_et);
s_et = s2
wsp = 0
} else {
s_et = s_et.ts_next
}
} while (!s_et.seqst)
// compute the whole spacing
// check the minimum spacing
s2 = s
while (1) {
s2 = s2.ts_next
if (s2.dur
&& s2.dur * space < s2.shrink)
space = s2.shrink / s2.dur
if (s2.seqst) {
wsp += s2.space
if (s2.bar_type)
wsp += 10 // (fixme: not exact)
}
if (s2 == s_et)
break
s2 = s2.ts_next
}
sp = (sp + wsp) / 2 / ttim // mean spacing per time unit
// set the space values
while (1) {
s = s.ts_next
if (s.seqst) {
s.space = (s.time - tim) * space;
s.space = sp * (s.time - tim)
tim = s.time
}
if (s == s_et)
break
s = s.ts_next
}
}
// create an invisible bar for end of music lines
function add_end_bar(s) {
var bar = {
// return an empty bar
function _bar(s) {
return {
type: C.BAR,
bar_type: "|",
fname: s.fname,
istart: s.istart,
iend: s.iend,
v: s.v,
p_v: s.p_v,
st: s.st,
dur: 0,
seqst: true,
invis: true,
time: s.time + s.dur,
nhd: 0,
notes: [{
pit: s.notes[0].pit
pit: s.notes ? s.notes[0].pit : 22
}],
wl: 0,
wr: 0,
prev: s,
ts_prev: s,
shrink: s.wr + 3
}
s.next = s.ts_next = bar
return bar
prev: s
}
} // _bar()
// create an invisible bar for end of music lines
function add_end_bar(s) {
var b = _bar(s)
b.seqst = true
b.invis = true
b.time = s.time + s.dur / 2
b.wl = 0
b.wr = 0
b.ts_prev = s
b.next = s.next
b.ts_next = s.ts_next
b.shrink = s.wr + 3
if (s.next)
s.next.prev = b
if (s.ts_next)
s.ts_next.ts_prev = b
s.next = s.ts_next = b
b.space = set_space(b, s.time)
return b
}
/* -- set the width and space of all symbols -- */
// this function is called once for the whole tune
function set_allsymwidth() {
var maxx, new_val, s_tupc, s_tupn, st, s_chs,
var maxx, val, st, s_chs, tim, stup,
s = tsfirst,
s2 = s,
xa = 0,
xl = [],
wr = [],
wr = []
ntup = 0
/* loop on all symbols */
maxx = xa
tim = s.time
while (1) {
do {
if (s.a_gch && !s_chs)
s_chs = s;
self.set_width(s);
st = s.st
if (xl[st] == undefined)
xl[st] = 0
if (wr[st] == undefined)
wr[st] = 0;
new_val = xl[st] + wr[st] + s.wl
if (new_val > maxx)
maxx = new_val;
val = xl[st] + wr[st] + s.wl
if (val > maxx)
maxx = val
s = s.ts_next
} while (s && !s.seqst);
// set the spaces of the time sequence
s2.shrink = maxx - xa
if (!ntup) // if not inside a tuplet sequence
s2.space = s2.ts_prev ? set_space(s2) : 0
s2.space = s2.ts_prev ? set_space(s2, tim) : 0
if (s2.dur && s2.dur != s2.notes[0].dur) {
if (!stup) {
stup = s2
while (stup.prev
&& stup.prev.dur
&& stup.prev.dur != stup.prev.notes[0].dur)
stup = stup.prev
while (!stup.seqst)
stup = stup.ts_prev
}
} else if (stup && stup.v == s2.v) {
set_sp_tup(stup, s2)
stup = null
}
if (!s2.shrink && !s2.space && s2.type == C.CLEF) {
delete s2.seqst; /* no space */
s2.time = s2.ts_prev.time
s2.time = tim
}
tim = s2.time
if (!s)
break
// update the min left space per staff
for (st = 0; st < wr.length; st++)
wr[st] = 0;
xa = maxx
do {
st = s2.st;
xl[st] = xa
if (s2.wr > wr[st])
wr[st] = s2.wr
if (s2.tp) { // start of tuplet
if (!ntup
&& !s_tupc)
s_tupc = s2 // keep the first tuplet address
ntup += s2.tp.length
}
if (s2.tpe) // end of tuplet
ntup -= s2.tpe;
s2 = s2.ts_next
} while (!s2.seqst)
}
// let the chord symbols at the same offset
if (s_chs)
set_w_chs(s_chs)
// adjust the spacing inside the tuplets
s = s_tupc
if (!s)
return
do {
s2 = s; // start of tuplet
ntup = 0
while (1) { // search the end of the tuplet sequence
if (s.tp)
ntup += s.tp.length
if (s.tpe)
ntup -= s.tpe
if (!ntup)
break
s = s.ts_next
}
set_sp_tup(s2, s)
do { // search next tuplet
s = s.ts_next
} while (s && !s.tp)
} while (s)
}
// insert a rest, this one replacing a sequence or a measure
function to_rest(so) {
var s = clone(so)
s.prev.next = so.ts_prev = so.prev = s.ts_prev.ts_next = s
|
| ︙ | | |
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
|
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
|
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
+
-
-
-
-
-
-
-
+
+
+
-
-
-
+
-
-
-
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
-
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
+
-
+
+
+
+
+
+
-
+
-
-
+
-
+
-
+
+
-
+
+
+
+
-
+
|
// p_voice.sym = null;
p_voice.time = s.time;
new_s = sym_add(p_voice, C.CUSTOS);
new_s.next = s;
s.prev = new_s;
lktsym(new_s, s);
new_s.seqst = true;
new_s.shrink = s.shrink
if (new_s.shrink < 8 + 4)
new_s.shrink = 8 + 4;
new_s.space = s2.space;
new_s.wl = 0;
new_s.wr = 4;
new_s.nhd = s2.nhd;
new_s.notes = []
for (i = 0; i < s.notes.length; i++) {
new_s.notes[i] = {
pit: s2.notes[i].pit,
shhd: 0,
dur: C.BLEN / 4
}
}
new_s.stemless = true
}
/* -- define the beginning of a new music line -- */
function set_nl(s) {
var s2, s3, p_voice, done
function set_nl(s) { // s = start of line
var p_voice, done, tim, ptyp
// divide the left repeat (|:) or variant bars (|1)
// the new bars go in the next line
function bardiv(so) { // start of next line
var s, s1, s2, t1, t2, i
function new_type(s) {
var t = s.bar_type.match(/(:*)([^:]*)(:*)/)
// [1] = starting ':'s, [2] = middle, [3] = ending ':'s
if (!t[3]) { // if start of variant
// |1 -> | [1
// :|]1 -> :|] [1
t1 = t[1] + t[2]
t2 = '['
} else if (!t[1]) { // if left repeat only
// [|: -> | [|:
// ||: -> || [|:
t1 = t[2][0] == '[' ? t[2].slice(1) : t[2]
t2 = '[|' + t[3]
} else {
// :][: -> :|] [|:
i = (t[2].length / 2) | 0
t1 = t[1] + '|' + t[2].slice(0, i)
t2 = t[2].slice(i) +'|' + t[3]
}
} // new_typ()
s = so // start of sequence
while (s.ts_prev
&& s.ts_prev.time == so.time) {
s = s.ts_prev
if (s.bar_type)
s1 = s // first previous bar
}
if (!s1)
return so
// search the insertion point in the new line
for (s = so; ; s = s.ts_next) {
switch (s.type) {
default:
if (w_tb[s.type])
break
case C.KEY:
case C.METER:
case C.CLEF:
continue
}
break
}
while (s1 != so) {
if (s1.bar_type
&& (s1.bar_type.slice(-1) == ':'
|| s1.text)
&& s1.bar_type != ':') {
new_type(s1) // return t1 and t2
s2 = clone(s1)
s1.bar_type = t1
s2.bar_type = t2
lkvsym(s2, s1.next) // voice
while (1) {
if (s.type != C.BAR
|| s.v > s2.v)
break
s = s.ts_next
}
lktsym(s2, s) // time
if (s == so)
so = s2
if (s1.text) {
s2.invis = true
delete s1.text
delete s1.rbstart
}
delete s2.a_dd
}
s1 = s1.ts_next
}
return so
} // bardiv()
// set the end of line marker
// set the start of line marker
function set_eol(s) {
if (cfmt.custos && voice_tb.length == 1)
custos_add(s)
s.nl = true
s = s.ts_prev
if (s.type != C.BAR)
add_end_bar(s)
} // set_eol()
// set the eol on the next symbol
// put the warning symbols
function set_eol_next(s) {
if (!s.next) { // special case: the voice stops here
set_eol(s)
return s
}
for (s = s.ts_next; s; s = s.ts_next) {
if (s.seqst) {
set_eol(s)
break
}
}
return s
} // set_eol_next()
// the new symbols go in the previous line
// go to the end of the time sequence
// for adding keywarn or timewarn
while (s) {
function do_warn(s) { // start of next line
if (!s.ts_next)
return // null
if (s.ts_next.seqst)
break
s = s.ts_next
}
var s1, s2, s3
// advance in the next line
// if keywarn or timewarn, move K: and M: to the end of the previous line
if (cfmt.keywarn || cfmt.timewarn) {
for (s2 = s.ts_next; s2; s2 = s2.ts_next) {
for (s2 = s; s2; s2 = s2.ts_next) {
switch (s2.type) {
case C.BAR:
case C.CLEF:
continue
case C.KEY:
if (!cfmt.keywarn
|| (!s2.k_a_acc && !s2.k_sf && !s2.k_old_sf)
|| s2.k_none
|| s2.k_play) // play only
continue
for (s1 = s.ts_prev; s1 ;s1 = s1.ts_prev) {
if (s1.type != C.METER)
break
}
// fall thru
case C.METER:
if (s2.type == C.METER && !cfmt.timewarn)
continue
s3 = s2.ts_prev;
if (s3 == s) { // if next symbol
s = s2 // advance the eol
if (s2.type == C.METER) {
if (!cfmt.timewarn)
continue
s1 = s.ts_prev
}
// fall thru
case C.CLEF:
if (!s2.prev) // start of voice
continue
if (s2.type == C.CLEF) {
for (s1 = s.ts_prev; s1; s1 = s1.ts_prev) {
switch (s1.type) {
case C.BAR:
case C.KEY:
case C.METER:
continue
}
unlksym(s2); // remove
lktsym(s2, s.ts_next); // link in time at eol
s = s2
while (1) { // link in voice
s2 = s2.ts_prev
if (s2.v == s.v) {
}
break
}
}
// put the warning symbol at end of line
s3 = clone(s2) // duplicate the K:/M:/clef
lktsym(s3, s1.ts_next) // time link
if (s3.ts_next == s)
s.seqst = true // (M: eol M:)
s1 = s3
while (1) {
s1 = s1.ts_next
if (s1.v == s2.v)
s.next = s2.next;
s.prev = s2;
s.next.prev = s;
s2.next = s
break
}
}
}
lkvsym(s3, s1) // voice link
// care with spacing
if (s.type != s.ts_prev.type) {
if (!s.seqst) {
s.seqst = true;
s.shrink = s.wl + s.prev.wr;
s.space = s.ts_next.space;
s.ts_next.space = 0
}
if (s3.seqst) {
s3.shrink = s3.wl
if (s3.prev) // if not start of voice
s3.shrink += s3.prev.wr
s3.space = set_space(s3, s3.ts_prev.time)
s3.next.shrink = s3.wr + s3.next.wl
}
} else {
delete s.seqst
}
s2 = s3 // restart
continue
}
if (w_tb[s2.type])
break // symbol with a width
}
} // do_warn()
}
// divide the left repeat and a variant bars
s = bardiv(s)
// add the warning symbols at the end of the previous line
do_warn(s)
/* if normal symbol, cut here */
switch (s.type) {
switch (s.ts_prev.type) {
case C.CLEF:
case C.BAR:
case C.STAVES:
break
case C.GRACE: /* don't cut on a grace note */
s = s.next
if (!s)
return s
/* fall thru */
default:
set_eol(s)
return set_eol_next(s)
return s
}
/* go back to handle the staff breaks at end of line */
for (; s; s = s.ts_prev) {
for (s = s.ts_prev; s; s = s.ts_prev) {
if (s.seqst && s.type != C.CLEF)
break
}
done = 0
ptyp = s.type
for ( ; ; s = s.ts_next) {
if (!s)
return s
if (!s.seqst)
if (s.type == ptyp)
continue
ptyp = s.type
if (done < 0)
break
switch (s.type) {
case C.STAVES:
if (!s.ts_prev)
return // null // no music yet
if (s.ts_prev && s.ts_prev.type == C.BAR)
if (s.ts_prev.type == C.BAR)
break
while (s.ts_next) {
if (w_tb[s.ts_next.type] != 0
&& s.ts_next.type != C.CLEF)
break
s = s.ts_next
}
|
| ︙ | | |
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
|
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
|
-
+
-
+
-
+
-
+
-
+
-
-
-
-
-
+
+
+
-
+
-
+
+
+
+
-
+
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
-
-
-
+
+
+
-
+
-
-
-
-
+
+
+
+
-
-
+
-
-
-
-
-
-
-
-
+
+
-
-
+
|
// r[0] = width of clef and key signature
// r[1] = width of the meter
function get_ck_width() {
var r0, r1,
p_voice = voice_tb[0]
self.set_width(p_voice.clef);
self.set_width(p_voice.key);
self.set_width(p_voice.ckey);
self.set_width(p_voice.meter)
return [p_voice.clef.wl + p_voice.clef.wr +
p_voice.key.wl + p_voice.key.wr,
p_voice.ckey.wl + p_voice.ckey.wr,
p_voice.meter.wl + p_voice.meter.wr]
}
// get the width of the symbols up to the next eoln or eof
// get the width of the symbols up to the next soln or eof
// also, set a x (nice spacing) to all symbols
// two returned values: width of nice spacing, width with max shrinking
function get_width(s, last) {
function get_width(s, next) {
var shrink, space,
w = 0,
wmx = 0,
sp_fac = (1 - cfmt.maxshrink)
do {
while (s != next) {
if (s.seqst) {
shrink = s.shrink
wmx += shrink
if ((space = s.space) < shrink)
w += shrink
else
w += shrink * cfmt.maxshrink
+ space * sp_fac
s.x = w
}
if (s == last)
break
s = s.ts_next
} while (s)
if (last)
wmx += last.wr // big key signatures may be wide enough
}
if (next)
wmx += next.wr // big key signatures may be wide enough
return [w, wmx]
}
/* -- search where to cut the lines according to the staff width -- */
function set_lines( s, /* first symbol */
last, /* last symbol / null */
next, /* symbol of the next line / null */
lwidth, /* w - (clef & key sig) */
indent) { /* for start of tune */
var first, s2, s3, x, xmin, xmid, xmax, wwidth, shrink, space, ws,
nlines, cut_here
nlines,
last = next ? next.ts_prev : null
ws = get_width(s, next) // 2 widths: nice and shrinked
// take care of big key signatures at end of line
if (cfmt.keywarn && last && last.type == C.BAR
if (cfmt.keywarn && next
&& last.next && last.next.time == last.next.time
&& last.next.type == C.KEY)
last = last.next
&& next.type == C.KEY && !last.dur) {
ws[0] += next.wr
ws[1] += next.wr
}
ws = get_width(s, last) // 2 widths: nice and shrinked
// check if the symbols can enter in one line
if (ws[1] + indent < lwidth) {
if (last)
last = set_nl(last)
return last
if (next)
next = set_nl(next)
return next || last
}
/* loop on cutting the tune into music lines */
wwidth = ws[0] + indent
while (1) {
nlines = Math.ceil(wwidth / lwidth)
if (nlines <= 1) {
if (last)
last = set_nl(last)
return last
if (next)
next = set_nl(next)
return next || last
}
s2 = first = s;
xmin = s.x - s.shrink - indent;
xmax = xmin + lwidth;
xmid = xmin + wwidth / nlines;
xmin += wwidth / nlines * cfmt.breaklimit;
for (s = s.ts_next; s != last ; s = s.ts_next) {
for (s = s.ts_next; s != next ; s = s.ts_next) {
if (!s.x)
continue
if (s.type == C.BAR)
s2 = s
if (s.x >= xmin)
break
}
//fixme: can this occur?
if (s == last) {
if (last)
last = set_nl(last)
return last
if (s == next) {
if (next)
next = set_nl(next)
return next
}
/* try to cut on a measure bar */
cut_here = false;
s3 = null
for ( ; s != last; s = s.ts_next) {
for ( ; s != next; s = s.ts_next) {
x = s.x
if (!x)
continue
if (x > xmax)
break
if (s.type != C.BAR)
continue
// cut on the bar closest to the middle
if (x < xmid) {
s3 = s // closest bar before middle
continue
}
if (!s3 || x - xmid < xmid - s3.x)
s3 = s // closest bar after middle
break
}
/* if a bar, cut here */
if (s3) {
s = s3;
cut_here = true
}
/* try to avoid to cut a beam or a tuplet */
if (!cut_here) {
// no bar, try to avoid to cut a beam or a tuplet */
if (!s3) {
var beam = 0,
bar_time = s2.time;
xmax -= 8; // (left width of the inserted bar in set_allsymwidth)
s = s2; // restart from start or last bar
s3 = null
for ( ; s != last; s = s.ts_next) {
for ( ; s != next; s = s.ts_next) {
if (s.beam_st)
beam++
if (s.beam_end && beam > 0)
beam--
x = s.x
if (!x)
continue
|
| ︙ | | |
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
|
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
|
-
-
-
-
-
+
-
+
+
-
+
+
+
+
+
-
+
-
+
|
if (s3 > xmid)
break
if (xmid - s3.x < s.x - xmid)
break
s3 = s
break
}
if (s3) {
s = s3;
cut_here = true
}
}
// cut anyhere
if (!cut_here) {
if (!s3) {
s3 = s = s2
for ( ; s != last; s = s.ts_next) {
for ( ; s != next; s = s.ts_next) {
x = s.x
if (!x)
continue
if (s.x < xmid) {
s3 = s
continue
}
if (s3 > xmid)
break
if (xmid - s3.x < s.x - xmid)
break
s3 = s
break
}
}
s = s3
s = s3
while (s.ts_next) {
s = s.ts_next
if (s.seqst)
break
}
if (s.nl) { /* already set here - advance */
error(0, s,
"Line split problem - adjust maxshrink and/or breaklimit");
nlines = 2
for (s = s.ts_next; s != last; s = s.ts_next) {
for (s = s.ts_next; s != next; s = s.ts_next) {
if (!s.x)
continue
if (--nlines <= 0)
break
}
}
s = set_nl(s)
if (!s
|| (last && s.time >= last.time))
|| (next && s.time >= next.time))
break
wwidth -= s.x - first.x;
indent = 0
}
return s
}
|
| ︙ | | |
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
|
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
|
+
+
+
-
+
|
if (cfmt.barsperstaff) {
i = cfmt.barsperstaff;
for (s2 = s; s2; s2 = s2.ts_next) {
if (s2.type != C.BAR
|| !s2.bar_num
|| --i > 0)
continue
while (s2.ts_next && s2.ts_next.type == C.BAR)
s2 = s2.ts_next
if (s2.ts_next)
s2.eoln = true;
s2.ts_next.soln = true
i = cfmt.barsperstaff
}
}
/* cut at explicit end of line, checking the line width */
s2 = s
for ( ; s; s = s.ts_next) {
|
| ︙ | | |
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
|
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
|
-
+
-
+
-
-
+
+
+
+
+
+
+
-
-
-
-
-
+
-
-
+
+
|
// case "scale":
// case "staffwidth":
// set_format(s.subtype, s.param)
// break
// }
// continue
// }
if (!s.ts_next)
if (!s.ts_next) {
s = null
else if (!s.eoln)
} else if (!s.soln) {
continue
else
s.eoln = false
} else {
s.soln = false
while (!s.seqst)
// || s.ts_prev.type == C.GRACE
// || s.ts_prev.type == C.SPACE)
s = s.ts_prev
}
s2 = set_lines(s2, s, lwidth, indent)
if (!s2)
break
// (s2 may be tsfirst - no ts_prev - when only one
// embedded info in the first line after the first K:)
if (!s2.ts_prev) {
delete s2.nl
continue
//--fixme
}
s = s2.ts_prev; // don't miss an eoln
// s = s2.ts_prev; // don't miss an eoln
s = s2
indent = 0
}
//fixme: not usable yet
// // restore the page parameters at start of line
// cfmt.leftmargin = pg_sav.leftmargin;
// cfmt.rightmargin = pg_sav.rightmargin;
|
| ︙ | | |
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
|
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
|
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
switch (s.type) {
case C.REST:
if (voice_tb.length == 1)
break
case C.NOTE:
delta = staff_d[st]
if (delta
&& !s.p_v.key.k_drum) {
&& !s.p_v.ckey.k_drum) {
for (m = s.nhd; m >= 0; m--) {
note = s.notes[m];
if (!note.opit)
note.opit = note.pit;
note.pit += delta
}
}
break
case C.GRACE:
for (g = s.extra; g; g = g.next) {
delta = staff_d[st]
if (delta
&& !s.p_v.key.k_drum) {
&& !s.p_v.ckey.k_drum) {
for (m = 0; m <= g.nhd; m++) {
note = g.notes[m]
if (!note.opit)
note.opit = note.pit
note.pit += delta
}
}
}
break
}
}
}
// expand the multi-rests as needed
function mrest_expand() {
var s, s2
// expand a multi-rest into a set of rest + bar
function mexp(s) {
var s2, s3, s4, next, tim, nbar,
nb = s.nmes,
dur = s.dur / nb
// change the multi-rest into a single rest
s.type = C.REST
s.dur = s.dur_orig = dur
s.nflags = -2
s.head = C.FULL
/* add the bar(s) and rest(s) */
tim = s.time + dur
s2 = next = s.next // bar (always)
while (!s2.bar_num) // get the bar number
s2 = s2.ts_prev
nbar = s2.bar_num - s.nmes
s3 = s2 = s
while (--nb > 0) {
// add the bar
if (next) {
s2 = clone(next)
delete s2.soln
delete s2.a_gch
delete s2.a_dd
lkvsym(s2, next)
} else {
s2 = _bar(s) // end of tune
s.next = s2
}
s2.time = tim
while (s3.time < tim)
s3 = s3.ts_next // bar at end of measure
while (s3 && s3.v < s.v && s3.type == C.BAR)
s3 = s3.ts_next // keep in order
if (s3) {
lktsym(s2, s3)
if (s3.type == C.BAR)
delete s3.bar_num
} else {
s3 = s
while (s3.ts_next)
s3 = s3.ts_next
s3.ts_next = s2
s2.ts_prev = s3
s2.ts_next = null
}
nbar++
if (s2.seqst) {
s2.bar_num = nbar
s4 = s2.ts_next
} else {
delete s2.bar_num
s4 = s2.ts_prev
}
s2.bar_type = s4.bar_type || "|"
if (s4.bar_num && !s4.seqst)
delete s4.bar_num
// add the rest
s4 = clone(s)
delete s4.a_dd
delete s4.soln
if (s2.next) {
s4.next = s2.next
s4.next.prev = s4
} else {
s4.next = null
}
s2.next = s4
s4.prev = s2
s4.time = tim
while (s3 && !s3.dur && s3.time == tim)
s3 = s3.ts_next
while (s3 && s3.v < s.v) {
s3 = s3.ts_next // keep in order
if (s3 && s3.seqst)
break
}
if (s3) {
lktsym(s4, s3)
} else {
s3 = s
while (s3.ts_next)
s3 = s3.ts_next
s3.ts_next = s4
s4.ts_prev = s3
s4.ts_next = null
}
tim += dur
s = s3 = s4
}
} // mexp()
for (s = tsfirst; s; s = s.ts_next) {
if (s.type != C.MREST)
continue
if (!s.seqst && w_tb[s.ts_prev.type]) {
s2 = s
} else {
s2 = s.ts_next
while (!s2.seqst) {
if (s2.type != C.MREST
|| s2.nmes != s.nmes)
break
s2 = s2.ts_next
}
}
if (!s2.seqst) {
while (s.type == C.MREST) {
mexp(s)
s = s.ts_next
}
} else {
s = s2.ts_prev
}
}
} // mrest_expand()
// set the clefs (treble or bass) in a 'auto clef' sequence
// return the starting clef type
function set_auto_clef(st, s_start, clef_type_start) {
var s, min, max, time, s2, s3;
/* get the max and min pitches in the sequence */
|
| ︙ | | |
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
|
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
|
-
+
|
break
unlksym(s)
}
continue
}
if (s.notes[0].pit < min)
min = s.notes[0].pit
else if (s.notes[s.nhd].pit > max)
if (s.notes[s.nhd].pit > max)
max = s.notes[s.nhd].pit
}
if (min >= 19 /* upper than 'F' */
|| (min >= 13 && clef_type_start != 'b')) /* or 'G,' */
return 't'
if (max <= 13 /* lower than 'G,' */
|
| ︙ | | |
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
|
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
|
-
-
+
|
// set the starting clefs of the staves
for (v = 0; v < voice_tb.length; v++) {
p_voice = voice_tb[v]
if (!sy.voices[v])
continue
st = sy.voices[v].st
if (!sy.voices[v].second) { // main voices
if (p_voice.staffnonote != undefined)
sy.staves[st].staffnonote = p_voice.staffnonote
sy.staves[st].staffnonote = p_voice.staffnonote
if (p_voice.staffscale)
sy.staves[st].staffscale = p_voice.staffscale
if (sy.voices[v].sep)
sy.staves[st].sep = sy.voices[v].sep
if (sy.voices[v].maxsep)
sy.staves[st].maxsep = sy.voices[v].maxsep;
|
| ︙ | | |
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
|
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
|
-
-
+
|
staff_clef[st].autoclef = true
for (v = 0; v < voice_tb.length; v++) {
if (!sy.voices[v])
continue
p_voice = voice_tb[v];
st = sy.voices[v].st
if (!sy.voices[v].second) {
if (p_voice.staffnonote != undefined)
sy.staves[st].staffnonote = p_voice.staffnonote
sy.staves[st].staffnonote = p_voice.staffnonote
if (p_voice.staffscale)
sy.staves[st].staffscale = p_voice.staffscale
if (sy.voices[v].sep)
sy.staves[st].sep = sy.voices[v].sep
if (sy.voices[v].maxsep)
sy.staves[st].maxsep = sy.voices[v].maxsep
}
|
| ︙ | | |
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
|
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
|
-
+
|
}
set_yval(s)
break
case C.GRACE:
for (g = s.extra; g; g = g.next) {
delta = staff_delta[g.st]
if (delta
&& !s.p_v.key.k_drum) {
&& !s.p_v.ckey.k_drum) {
for (m = 0; m <= g.nhd; m++) {
note = g.notes[m];
note.opit = note.pit
note.pit += delta
}
}
g.ymn = 3 * (g.notes[0].pit - 18) - 2;
|
| ︙ | | |
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
|
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
|
-
+
-
-
-
-
+
+
+
+
+
|
s.ymn = 0
break
}
// fall thru
case C.NOTE:
delta = staff_delta[st]
if (delta
&& !s.p_v.key.k_drum) {
&& !s.p_v.ckey.k_drum) {
for (m = s.nhd; m >= 0; m--) {
note = s.notes[m]
note.opit = note.pit
note.pit += delta
}
}
if (s.type == C.NOTE) {
s.ymx = 3 * (s.notes[s.nhd].pit - 18) + 4;
s.ymn = 3 * (s.notes[0].pit - 18) - 4;
} else {
// if (s.type == C.NOTE) {
// s.ymx = 3 * (s.notes[s.nhd].pit - 18) + 4;
// s.ymn = 3 * (s.notes[0].pit - 18) - 4;
// } else {
if (s.type == C.REST) {
s.y = (((s.notes[0].pit - 18) / 2) | 0) * 6;
s.ymx = s.y + rest_sp[5 - s.nflags][0];
s.ymn = s.y - rest_sp[5 - s.nflags][1]
}
if (s.dur < dur)
dur = s.dur
break
|
| ︙ | | |
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
|
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
|
-
+
|
} else {
s.multi = 1 /* first voice(s) */
/* if 3 voices, and vertical space enough,
* have stems down for the middle voice */
if (i != 0 && i + 2 == st_v.length) {
if (st_v[i].ymn - cfmt.stemheight
> st_v[i + 1].ymx)
>= st_v[i + 1].ymx)
s.multi = -1;
/* special case for unison */
t = s.ts_next
//fixme: pb with ../lacerda/evol-7.5.5.abc
if (s.ts_prev
&& s.ts_prev.time == s.time
|
| ︙ | | |
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
|
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
|
-
-
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
-
-
|
s.next.prev = s;
p_v.last_sym.next = s;
s.prev = p_v.last_sym
}
p_v.last_sym = s;
lktsym(s, last_s)
if (s.ts_prev.type != s.type)
s.seqst = true
if (last_s.type == s.type && s.v != last_s.v) {
delete last_s.seqst;
last_s.shrink = 0
}
}
/* -- init the symbols at start of a music line -- */
function init_music_line() {
var p_voice, s, s2, s3, last_s, v, st, shr, shrmx,
nv = voice_tb.length
var p_voice, s, s1, s2, s3, last_s, v, st, shr, shrmx, shl,
shlp, p_st, top,
nv = voice_tb.length
/* initialize the voices */
for (v = 0; v < nv; v++) {
if (!cur_sy.voices[v])
continue
p_voice = voice_tb[v];
p_voice.second = cur_sy.voices[v].second;
p_voice.last_sym = p_voice.sym;
/* move the voice to a printed staff */
st = cur_sy.voices[v].st
while (st < nstaff && !cur_sy.st_print[st])
st++;
p_voice.st = st
if (!p_voice.second) {
staff_tb[st].key = p_voice.ckey
staff_tb[st].meter = p_voice.meter
}
/* add a clef at start of the main voices */
last_s = tsfirst
while (last_s && last_s.type == C.CLEF) { // move the starting clefs
v = last_s.v
if (cur_sy.voices[v]
&& !cur_sy.voices[v].second) {
delete last_s.clef_small; /* normal clef */
p_voice = last_s.p_v;
p_voice.last_sym = p_voice.sym = last_s
}
last_s = last_s.ts_next
}
}
}
// move the first clefs, key signatures and time signatures
// to the staves
s = tsfirst
while (s) {
switch (s.type) {
case C.CLEF:
case C.KEY:
case C.METER:
switch (s.type) {
case C.CLEF:
staff_tb[s.st].clef = s
break
case C.KEY:
s.p_v.ckey = s
break
case C.METER:
s.p_v.meter = s
insert_meter |= 1
break
}
unlksym(s)
// fall thru
case C.PART:
case C.TEMPO:
case C.BLOCK:
case C.REMARK:
s = s.ts_next
continue
}
break
}
// generate the starting clefs, key signatures and time signatures
// add a clef at start of the main voices
last_s = tsfirst
for (v = 0; v < nv; v++) {
p_voice = voice_tb[v]
if (p_voice.sym && p_voice.sym.type == C.CLEF)
continue
if (!cur_sy.voices[v]
|| (cur_sy.voices[v].second
&& !p_voice.bar_start)) // needed for correct linkage
continue
st = cur_sy.voices[v].st
if (!staff_tb[st]
|| !staff_tb[st].clef)
continue
s = clone(staff_tb[st].clef);
s.v = v;
s.p_v = p_voice;
s.st = st;
s.time = tsfirst.time;
s.prev = null;
s.next = p_voice.sym
if (s.next)
s.next.prev = s;
p_voice.sym = s;
p_voice.sym = p_voice.last_sym = s
p_voice.last_sym = s;
s.ts_next = last_s;
if (last_s)
s.ts_prev = last_s.ts_prev
else
s.ts_prev = null
if (!s.ts_prev) {
tsfirst = s;
s.seqst = true
} else {
s.ts_prev.ts_next = s
delete s.seqst
}
if (last_s) {
last_s.ts_prev = s
if (last_s.type == C.CLEF)
|
| ︙ | | |
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
|
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
|
-
-
-
-
-
-
-
+
+
-
-
-
-
-
|
/* add keysig */
for (v = 0; v < nv; v++) {
if (!cur_sy.voices[v]
|| cur_sy.voices[v].second
|| !cur_sy.st_print[cur_sy.voices[v].st])
continue
p_voice = voice_tb[v]
if (last_s && last_s.v == v && last_s.type == C.KEY) {
p_voice.last_sym = last_s;
last_s.k_old_sf = last_s.k_sf; // no key cancel
last_s = last_s.ts_next
continue
}
s2 = p_voice.key
s2 = p_voice.ckey
if (s2.k_sf || s2.k_a_acc) {
s = clone(s2)
new_sym(s, p_voice, last_s)
delete s.invis
s.k_old_sf = s2.k_sf // no key cancel
}
}
/* add time signature (meter) if needed */
if (insert_meter & 1) {
for (v = 0; v < nv; v++) {
p_voice = voice_tb[v];
s2 = p_voice.meter
if (!cur_sy.voices[v]
|| cur_sy.voices[v].second
|| !cur_sy.st_print[cur_sy.voices[v].st]
|| !s2.a_meter.length)
continue
if (last_s && last_s.v == v && last_s.type == C.METER) {
p_voice.last_sym = last_s;
last_s = last_s.ts_next
continue
}
s = clone(s2)
new_sym(s, p_voice, last_s)
}
insert_meter &= ~1 // no meter any more
}
// add an invisible bar for the various continued elements
|
| ︙ | | |
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
|
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
|
-
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
-
+
-
+
-
-
+
+
+
-
-
-
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
|
sls: p_voice.sls
}
new_sym(s, p_voice, last_s)
p_voice.sls = []
}
}
/* add bar if needed (for repeat bracket) */
// add a bar for the continuation of repeat brackets
for (v = 0; v < nv; v++) {
p_voice = voice_tb[v];
s2 = p_voice.bar_start;
p_voice.bar_start = null
// if bar already, keep it in sequence
if (last_s && last_s.v == v && last_s.type == C.BAR) {
p_voice.last_sym = last_s;
last_s = last_s.ts_next
continue
if (last_s && last_s.v == v) {
for (s3 = last_s; s3; s3 = s3.ts_next) {
if (s3.v != v)
break
switch (s3.type) {
case C.PART:
case C.TEMPO:
continue
case C.BAR:
p_voice.last_sym = s3
last_s = s3.ts_next
break
}
break
}
}
if (!s2)
continue
if (!cur_sy.voices[v]
|| !cur_sy.st_print[cur_sy.voices[v].st])
continue
if (p_voice.last_sym.type == C.BAR) {
if (!p_voice.last_sym.rbstop)
p_voice.last_sym.rbstart = 1
} else {
new_sym(s2, p_voice, last_s)
new_sym(s2, p_voice, last_s)
}
}
// compute the spacing of the added symbols
self.set_pitch(last_s);
s = tsfirst
s.seqst = true
shlp = 0
while (1) {
s2 = s;
shrmx = 0
shl = shrmx = 0
do {
self.set_width(s);
shr = s.wl
shr = s.wl + shlp
if (s.prev)
shr += s.prev.wr
if (shr > shrmx)
shrmx = shr;
if (s.wr > shl)
shl = s.wr // left width for next symbol
s = s.ts_next
} while (s != last_s && !s.seqst);
s2.shrink = shrmx;
s2.space = 0
if (s == last_s)
break
shlp = shl
}
// update the spacing before the first old time sequence
if (!s)
return
shr = 0
do {
self.set_width(s)
if (shr < s.wl)
shr = s.wl;
s = s.ts_next
} while (s && !s.seqst);
last_s.shrink = s2.wr + shr
last_s.shrink = shl + shr
last_s.space = 0
} // init_music_line()
}
// check if the tune ends on a measure bar
function check_end_bar() {
var s2,
s = tsfirst
while (s.ts_next)
s = s.ts_next
if (s.type != C.BAR) {
s2 = _bar(s)
s2.seqst = true
s2.invis = true
s2.time = s.time + (s.dur || 0)
s2.ts_prev = s
s.next = s.ts_next = s2
}
} // check_end_bar()
/* -- set a pitch in all symbols and the start/stop of the beams -- */
// and sort the pitches in the chords
// and build the chord symbols / annotations
// this function is called only once per tune
function set_words(p_voice) {
var s, s2, nflags, lastnote, res,
start_flag = true,
pitch = 127 /* no note */
for (s = p_voice.sym; s; s = s.next) {
if (s.type == C.NOTE) {
pitch = s.notes[0].pit
break
}
}
for (s = p_voice.sym; s; s = s.next) {
if (s.a_gch)
self.gch_build(s)
switch (s.type) {
case C.MREST:
start_flag = true
break
case C.BAR:
s.bar_type = bar_cnv(s.bar_type)
if (!s.beam_on)
start_flag = true
if (!s.next && s.prev
// && s.prev.type == C.NOTE
&& !s.invis
// && s.prev.dur >= C.BLEN * 2)
&& s.prev.head == C.OVALBARS)
s.prev.head = C.SQUARE
break
case C.GRACE:
for (s2 = s.extra; s2; s2 = s2.next)
s2.notes.sort(abc2svg.pitcmp)
break
|
| ︙ | | |
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
|
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
|
-
+
+
-
+
-
+
|
break
}
nflags = s.nflags
if (s.ntrem)
nflags += s.ntrem
if (s.type == C.REST && s.beam_end) {
if (s.type == C.REST && s.beam_end
&& !s.beam_on) {
s.beam_end = false;
start_flag = true
}
if (start_flag
|| nflags <= 0) {
if (lastnote) {
lastnote.beam_end = true;
lastnote = null
}
if (nflags <= 0) {
s.beam_st = true;
s.beam_end = true
} else if (s.type == C.NOTE) {
} else if (s.type == C.NOTE || s.beam_on) {
s.beam_st = true;
start_flag = false
}
}
if (s.beam_end)
start_flag = true
if (s.type == C.NOTE)
if (s.type == C.NOTE || s.beam_on)
lastnote = s
break
}
if (s.type == C.NOTE) {
if (s.nhd)
s.notes.sort(abc2svg.pitcmp)
pitch = s.notes[0].pit
|
| ︙ | | |
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
|
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
|
-
+
-
-
+
+
-
-
-
-
+
+
+
+
-
+
+
+
-
+
+
-
+
+
+
+
+
+
|
break
}
}
}
}
/* -- initialize the generator -- */
/* this function is called only once per tune */
// this function is called only once per tune
var delpit = [0, -7, -14, 0]
function set_global() {
var p_voice, st, v, nv, sy
var p_voice, v,
nv = voice_tb.length,
/* get the max number of staves */
sy = cur_sy;
st = sy.nstaff;
// sy.st_print = new Uint8Array(sy.staves.length)
sy = cur_sy,
st = sy.nstaff
/* get the max number of staves */
while (1) {
sy = sy.next
if (!sy)
break
// sy.st_print = new Uint8Array(sy.staves.length)
if (sy.nstaff > st)
st = sy.nstaff
}
nstaff = st;
// there must be a bar at end of tune
check_end_bar()
/* set the pitches, the words (beams) and the repeat brackets */
nv = voice_tb.length
for (v = 0; v < nv; v++) {
p_voice = voice_tb[v];
set_words(p_voice)
p_voice.ckey = p_voice.key // starting key
// (test removed because v.second may change after %%staves)
// if (!p_voice.second && !p_voice.norepbra)
set_rb(p_voice)
}
/* set the staff of the floating voices */
if (nv > 1) {
set_float();
set_float()
// expand the multi-rests as needed
if (glovar.mrest_p)
mrest_expand()
}
if (glovar.ottava && cfmt.sound != "play")
set_ottava();
// set the clefs and adjust the pitches of all symbol
set_clefs();
self.set_pitch(null)
|
| ︙ | | |
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
|
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
|
-
+
|
continue
if (!font) {
set_font("voice");
font = gene.curfont
}
i = 0
while (1) {
j = p.indexOf("\\n", i)
j = p.indexOf("\n", i)
if (j < 0)
w = strwh(p.slice(i))
else
w = strwh(p.slice(i, j))
w = w[0]
if (w > maxw)
maxw = w
|
| ︙ | | |
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
|
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
|
-
+
-
+
+
-
+
+
-
+
|
s1.notes[i1].shhd += sh2
}
return true
}
/* handle unison with different accidentals */
function unison_acc(s1, s2, i1, i2) {
var m, d
var m, d, acc
if (!s2.notes[i2].acc) {
acc = s2.notes[i2].acc
if (!acc) {
d = w_note[s2.head] * 2 + s2.xmx + s1.notes[i1].shac + 2
if (s1.notes[i1].micro)
acc = s1.notes[i1].acc
if (typeof acc != "number") // microtone
d += 2
if (s2.dots)
d += 6
for (m = 0; m <= s1.nhd; m++) {
s1.notes[m].shhd += d;
s1.notes[m].shac -= d
}
s1.xmx += d
} else {
d = w_note[s1.head] * 2 + s1.xmx + s2.notes[i2].shac + 2
if (s2.notes[i2].micro)
if (typeof acc != "number") // microtone
d += 2
if (s1.dots)
d += 6
for (m = 0; m <= s2.nhd; m++) {
s2.notes[m].shhd += d;
s2.notes[m].shac -= d
}
|
| ︙ | | |
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
|
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
|
+
-
-
-
+
+
+
+
+
-
-
-
-
+
+
+
-
|
s3 = null
}
d = -10
for (i = 0; i < MAXPIT; i++) {
if (left2[i] + right1[i] > d)
d = left2[i] + right1[i]
}
if (d < -3) { // no clash if no dots clash
if (!s1.dots || !s2.dots
|| !s2.dot_low
if (d < -3 // no clash if no dots clash
&& ((s2.notes[0].pit & 1)
|| !(s1.dots || s2.dots)
|| (!(s1.notes[s1.nhd].pit == s2.notes[0].pit + 2
&& s1.dot_low)
|| s1.stem > 0 || s2.stem < 0
|| s1.notes[s1.nhd].pit + 2 != s2.notes[0].pit
|| (s2.notes[0].pit & 1))
continue
&& !(s1.notes[s1.nhd].pit + 2 == s2.notes[0].pit
&& s2.dot_low))))
continue
}
right2 = set_right(s2);
left1 = set_left(s1)
if (s3) {
right3 = set_left(s3)
for (i = 0; i < MAXPIT; i++) {
if (right3[i] > left1[i])
|
| ︙ | | |
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
|
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
|
+
+
+
+
+
+
+
+
+
+
-
-
+
-
-
-
-
+
+
+
-
-
-
-
-
+
-
-
-
|
* and clash of dots */
t = 0;
i1 = s1.nhd;
i2 = s2.nhd
while (1) {
dp = s1.notes[i1].pit - s2.notes[i2].pit
switch (dp) {
case 2:
if (!(s1.notes[i1].pit & 1))
s1.dot_low = false
break
case 1:
if (s1.notes[i1].pit & 1)
s2.dot_low = true
else
s1.dot_low = false
break
case 0:
if (s1.notes[i1].acc != s2.notes[i2].acc
&& !s1.notes[i1].acc && !s2.notes[i2].acc) {
t = -1
break
}
if (s2.notes[i2].acc) {
if (!s1.notes[i1].acc)
s1.notes[i1].acc = s2.notes[i2].acc
s2.notes[i2].acc = 0
}
if (s1.dots && s2.dots
&& (s1.notes[i1].pit & 1))
t = 1
break
case -1:
if (s1.dots && s2.dots) {
if (s1.notes[i1].pit & 1) {
if (s1.notes[i1].pit & 1)
s1.dot_low = false;
s2.dot_low = false
} else {
s1.dot_low = true;
s2.dot_low = false
else
s1.dot_low = true
s2.dot_low = true
}
}
break
case -2:
if (s1.dots && s2.dots
&& !(s1.notes[i1].pit & 1)) {
if (!(s1.notes[i1].pit & 1))
s1.dot_low = false;
s2.dot_low = false
break
}
break
}
if (t < 0)
break
if (dp >= 0) {
if (--i1 < 0)
break
|
| ︙ | | |
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
|
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
|
-
-
|
if (s.stem >= 0) {
s.y = ymn;
s.ys = ymx
} else {
s.ys = ymn;
s.y = ymx
}
if (nflags == -4) /* if longa */
ymn -= 6;
s.ymx = ymx + 4;
s.ymn = ymn - 4
} else if (s.stem >= 0) {
if (s.notes[s.nhd].pit > 26
&& (nflags <= 0
|| !s.beam_st
|| !s.beam_end)) {
|
| ︙ | | |
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
|
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
|
if (s.notes[s.nhd].tie)
ymx += 3;
s.ymx = ymx + 4
}
}
}
/* -- split up unsuitable bars at end of staff -- */
// return true if the bar type has changed
function check_bar(s) {
var bar_type, i, b1, b2, s_bs, s2,
p_voice = s.p_v
/* search the last bar */
while (s.type == C.CLEF || s.type == C.KEY || s.type == C.METER) {
if (s.type == C.METER
&& s.time > p_voice.sym.time) /* if not empty voice */
insert_meter |= 1; /* meter in the next line */
s = s.prev
if (!s)
return
}
if (s.type != C.BAR)
return
if (s.text != undefined) { // if repeat bar
p_voice.bar_start = clone(s);
p_voice.bar_start.bar_type = ""
delete s.text
delete s.a_gch
// return
}
bar_type = s.bar_type
if (bar_type == ":")
return
if (bar_type.slice(-1) != ':') // if not left repeat bar
return
// add a left repeat bar in the next music line
s2 = p_voice.s_next
while (1) {
switch (s2.type) {
case C.BAR:
case C.GRACE:
case C.NOTE:
case C.REST:
break
default:
s2 = s2.next
if (!s2)
return
}
break
}
if (s2.type == C.BAR) {
s_bs = s2 // bar start
} else {
s_bs = clone(s)
s_bs.next = s2
s_bs.prev = s2.prev
if (s2 == p_voice.s_next)
p_voice.s_next = s_bs
else
s2.prev.next = s_bs
s2.prev = s_bs
while (!s2.seqst)
s2 = s2.ts_prev
s_bs.ts_next = s2
s_bs.ts_prev = s2.ts_prev
if (s2 == tsnext)
tsnext = s_bs
else
s2.ts_prev.ts_next = s_bs
s2.ts_prev = s_bs
delete s_bs.seqst
if (s_bs == tsnext || s2.ts_prev.type != C.BAR) {
if (s2.seqst) {
s_bs.seqst = true
} else {
s2.seqst = true
s2.shrink = s_bs.wr + s2.wl
s2.space = 0
}
}
}
if (bar_type[0] != ':') { // 'xx:' (not ':xx:')
if (bar_type == "||:") {
s_bs.bar_type = "[|:"
s.bar_type = "||"
return true
}
s_bs.bar_type = bar_type
if (s.prev && s.prev.type == C.BAR)
unlksym(s)
else
s.bar_type = "|"
return
}
// ':xx:' -> ':x|]' and '[|x:'
i = 0
while (bar_type[i] == ':')
i++
if (i < bar_type.length) {
s.bar_type = bar_type.slice(0, i) + '|]';
i = bar_type.length - 1
while (bar_type[i] == ':')
i--;
s_bs.bar_type = '[|' + bar_type.slice(i + 1)
} else {
i = (bar_type.length / 2) |0; // '::::' !
s.bar_type = bar_type.slice(0, i) + '|]';
s_bs.bar_type = '[|' + bar_type.slice(i)
}
return true
}
/* -- move the symbols of an empty staff to the next one -- */
function sym_staff_move(st) {
for (var s = tsfirst; s; s = s.ts_next) {
if (s.nl)
break
if (s.st == st
&& s.type != C.CLEF) {
s.st++;
s.invis = true
}
}
}
// generate a block symbol
var blocks = [] // array of delayed block symbols
// (possible hook)
function block_gen(s) {
Abc.prototype.block_gen = function(s) {
switch (s.subtype) {
case "leftmargin":
case "rightmargin":
case "pagescale":
case "pagewidth":
case "scale":
case "staffwidth":
svg_flush();
blk_flush()
self.set_format(s.subtype, s.param)
break
case "mc_start": // multicol start
multicol = {
posy: posy,
maxy: posy,
lmarg: cfmt.leftmargin,
rmarg: cfmt.rightmargin
}
break
case "mc_new": // multicol new
if (!multicol) {
error(1, s, "%%multicol new without start")
break
}
if (posy > multicol.maxy)
multicol.maxy = posy
cfmt.leftmargin = multicol.lmarg
cfmt.rightmargin = multicol.rmarg
img.chg = true
set_page()
posy = multicol.posy
break
case "mc_end": // multicol end
if (!multicol) {
error(1, s, "%%multicol new without start")
break
}
if (posy < multicol.maxy)
posy = multicol.maxy
cfmt.leftmargin = multicol.lmarg
cfmt.rightmargin = multicol.rmarg
multicol = undefined
blk_flush()
img.chg = true
set_page()
break
case "ml":
svg_flush();
blk_flush()
user.img_out(s.text)
break
case "newpage":
blk_flush();
block.newpage = true;
blk_out()
svg_flush()
if (!user.page_format)
break
if (blkdiv < 0) // split the tune
user.img_out('</div>')
blkdiv = 2 // start the next SVG in a new page
break
case "sep":
set_page();
vskip(s.sk1);
output += '<path class="stroke"\n\td="M';
out_sxsy((img.width -s.l) / 2 - img.lm, ' ', 0)
output += 'h' + s.l.toFixed(1) + '"/>\n';
vskip(s.sk2);
break
case "text":
set_font(s.font)
write_text(s.text, s.opt)
break
case "title":
write_title(s.text, true)
break
case "vskip":
vskip(s.sk);
// blk_out()
break
}
}
/* -- define the start and end of a piece of tune -- */
/* tsnext becomes the beginning of the next line */
function set_piece() {
var s, last, p_voice, st, v, nst, nv, tmp,
non_empty = [],
non_empty_gl = [],
sy = cur_sy
var s, last, p_voice, st, v, nv, tmp,
non_empty = [],
non_empty_gl = [],
sy = cur_sy
function reset_staff(st) {
var p_staff = staff_tb[st],
sy_staff = sy.staves[st]
if (!p_staff)
p_staff = staff_tb[st] = {}
|
| ︙ | | |
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
|
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
|
+
+
+
+
+
+
+
|
// set the top and bottom of the staves
function set_top_bot() {
var st, p_staff, i, j, l
for (st = 0; st <= nstaff; st++) {
p_staff = staff_tb[st]
// ledger lines
// index = line number
// values = [x symbol, x start, x stop]
p_staff.hlu = [] // above the staff
p_staff.hld = [] // under the staff
if (!non_empty_gl[st]) {
p_staff.botbar = p_staff.topbar = 0
continue
}
l = p_staff.stafflines.length;
p_staff.topbar = 6 * (l - 1)
|
| ︙ | | |
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
|
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
|
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
-
-
|
p_staff.hlmap[j] = 1;
p_staff.hlmap[j + 1] = 1
break
}
}
}
} // set_top_bot()
// remove the staff system at start of line
if (tsfirst.type == C.STAVES) {
s = tsfirst
tsfirst = tsfirst.ts_next
tsfirst.ts_prev = null
if (s.seqst)
tsfirst.seqst = true
s.p_v.sym = s.next
if (s.next)
s.next.prev = null
}
/* reset the staves */
nstaff = nst = sy.nstaff
for (st = 0; st <= nst; st++)
nstaff = sy.nstaff
for (st = 0; st <= nstaff; st++)
reset_staff(st);
/*
* search the next end of line,
* and mark the empty staves
*/
for (s = tsfirst; s; s = s.ts_next) {
if (s.nl) {
if (s.nl)
//fixme: not useful
// // delay the next block symbols
// while (s && s.type == C.BLOCK) {
// blocks.push(s);
// unlksym(s);
// s = s.ts_next
// }
break
}
if (!s.ts_next)
last = s // keep the last symbol of the tune
switch (s.type) {
case C.STAVES:
set_brace();
sy.st_print = new Uint8Array(non_empty);
sy = s.sy;
nst = sy.nstaff
if (nstaff < nst) {
while (nstaff < sy.nstaff)
for (st = nstaff + 1; st <= nst; st++)
reset_staff(st);
reset_staff(++nstaff)
nstaff = nst
}
non_empty = []
continue
// the block symbols will be treated after music line generation
case C.BLOCK:
if (!s.play)
if (!s.play) {
blocks.push(s)
unlksym(s)
}
continue
}
st = s.st
if (st > nstaff) {
switch (s.type) {
case C.CLEF:
staff_tb[st].clef = s // clef warning/change for new staff
break
case C.KEY:
s.p_v.ckey = s
break
//useless ?
case C.METER:
s.p_v.meter = s
break
}
unlksym(s)
continue
}
if (non_empty[st])
continue
switch (s.type) {
default:
continue
case C.CLEF:
if (st > nstaff) { // if clef warning/change for new staff
staff_tb[st].clef = s;
unlksym(s)
}
continue
case C.BAR:
if (s.bar_mrep
|| sy.staves[st].staffnonote > 1)
break
continue
case C.GRACE:
break
case C.NOTE:
case C.REST:
case C.SPACE:
case C.MREST:
if (sy.staves[st].staffnonote > 1)
break
if (s.invis)
continue
if (sy.staves[st].staffnonote != 0
if (sy.staves[st].staffnonote
|| s.type == C.NOTE)
break
continue
}
non_empty_gl[st] = non_empty[st] = true
}
tsnext = s;
/* set the last empty staves */
set_brace()
// for (st = 0; st <= nstaff; st++)
// sy.st_print[st] = non_empty[st];
sy.st_print = new Uint8Array(non_empty);
/* define the offsets of the measure bars */
set_top_bot()
/* move the symbols of the empty staves to the next staff */
//fixme: could be optimized (use a old->new staff array)
|
| ︙ | | |
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
|
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
|
p_voice = voice_tb[v]
if (p_voice.sym
&& p_voice.sym.time <= tsnext.time) {
for (s = tsnext.ts_prev; s; s = s.ts_prev) {
if (s.v == v) {
p_voice.s_next = s.next;
s.next = null;
if (check_bar(s)) {
tmp = s.wl;
self.set_width(s);
s.shrink += s.wl - tmp
}
break
}
}
if (s)
continue
}
p_voice.s_next = p_voice.sym;
p_voice.sym = null
}
}
// if the last symbol is not a bar, add an invisible bar
if (last.type != C.BAR) {
s = add_end_bar(last);
s.space = set_space(s)
if (s.space < s.shrink
&& last.type != C.KEY)
s.space = s.shrink
}
}
/* -- position the symbols along the staff -- */
// (possible hook)
Abc.prototype.set_sym_glue = function(width) {
var s, g, ll,
some_grace,
|
| ︙ | | |
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
|
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
|
+
-
+
+
-
+
-
+
+
-
-
+
-
+
-
+
|
set_page()
return
}
switch (s.type) {
case C.NOTE:
case C.REST:
case C.MREST:
case C.SPACE:
set_page()
return
default:
continue
case C.STAVES:
cur_sy = s.sy
break
// break
continue
case C.BLOCK:
if (s.play)
continue // keep for play
block_gen(s)
self.block_gen(s)
break
}
unlksym(s)
if (s.p_v.s_next == s)
s.p_v.s_next = s.next
}
tsfirst = null /* no more notes */
}
/* -- generate the music -- */
// (possible hook)
Abc.prototype.output_music = function() {
var v, lwidth, indent, line_height, ts1st, tslast, p_v
var v, lwidth, indent, line_height, ts1st, tslast, p_v,
nv = voice_tb.length
gen_init()
if (!tsfirst)
return
tunes.push([tsfirst, voice_tb]) // keep tune data for playing
set_global()
if (voice_tb.length > 1) /* if many voices */
if (nv > 1) // if many voices
self.set_stem_dir() // set the stems direction in 'multi'
for (v = 0; v < voice_tb.length; v++)
for (v = 0; v < nv; v++)
set_beams(voice_tb[v].sym); /* decide on beams */
self.set_stems() // set the stem lengths
if (voice_tb.length > 1) { /* if many voices */
if (nv > 1) { // if many voices
set_rest_offset(); /* set the vertical offset of rests */
set_overlap(); /* shift the notes on voice overlap */
// set_rp_bars() // set repeat bars
}
set_acc_shft(); // set the horizontal offset of accidentals
set_allsymwidth(); /* set the width of all symbols */
|
| ︙ | | |
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
|
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
|
-
+
|
/* else, split the tune into music lines */
lwidth = get_lwidth();
cut_tune(lwidth, indent)
}
// save symbol pointers for play
ts1st = tsfirst
v = voice_tb.length
v = nv
while (--v >= 0)
voice_tb[v].osym = voice_tb[v].sym
spf_last = 1.2 // last spacing factor
while (1) { /* loop per music line */
set_piece();
self.set_sym_glue(lwidth - indent)
|
| ︙ | | |
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
|
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
|
-
+
-
-
+
-
-
-
+
|
delayed_update();
vskip(line_height)
if (indent) {
posx -= indent;
insert_meter &= ~2 // no more indentation
}
while (blocks.length)
block_gen(blocks.shift())
self.block_gen(blocks.shift())
}
if (cfmt.splittune)
blk_flush()
blk_flush()
else
svg_flush()
if (tslast)
tslast.ts_next.ts_prev = tslast
if (!tsnext)
break
tsnext.ts_prev.ts_next = // (restore for play)
tsfirst = tsnext
// next line
gen_init()
if (!tsfirst)
break
tslast = tsfirst.ts_prev
tsfirst.ts_prev = null;
set_sym_line();
lwidth = get_lwidth() // the image size may have changed
indent = set_indent()
}
// restore for play
tsfirst = ts1st
v = voice_tb.length
v = nv
while (--v >= 0) {
p_v = voice_tb[v]
if (p_v.sym && p_v.s_prev)
p_v.sym.prev = p_v.s_prev
p_v.sym = p_v.osym
}
}
|
| ︙ | | |
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
+
|
// abc2svg - parse.js - ABC parse
//
// Copyright (C) 2014-2019 Jean-Francois Moine
// Copyright (C) 2014-2020 Jean-Francois Moine
//
// This file is part of abc2svg-core.
//
// abc2svg-core is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
|
| ︙ | | |
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
|
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
|
+
+
+
+
-
+
-
+
|
if (clef_def[i + 1] != '8')
return s
switch (clef_def[i]) { // octave
case '^':
s.clef_oct_transp = true
case '+':
s.clef_octave = 7
if (!s.clef_oct_transp)
curvoice.snd_oct = 12 // MIDI higher octave
break
case '_':
s.clef_oct_transp = true
case '-':
s.clef_octave = -7
if (!s.clef_oct_transp)
curvoice.snd_oct = -12 // MIDI lower octave
break
}
return s
}
// convert an interval to a base-40 interval
function get_interval(param, score) {
var i, val, tmp, note, pit
tmp = new scanBuf;
tmp.buffer = param
pit = []
for (i = 0; i < 2; i++) {
note = tmp.buffer[tmp.index] ? parse_acc_pit(tmp) : null
if (!note) {
if (i != 1 || !score) {
syntax(1, "Bad transpose value")
syntax(1, errs.bad_transp)
return
}
pit[i] = 23 // 'c' (C5)
pit[i] = 242 // 'c' (C5)
} else {
pit[i] = abc2svg.pab40(note.pit, note.acc)
}
}
return pit[1] - pit[0]
}
|
| ︙ | | |
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
|
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
|
-
+
|
char_tb[item.charCodeAt(0)] = '\n'
}
}
// set a new user character (U: or %%user)
function set_user(parm) {
var k, c, v,
a = parm.match(/(.)[= ]*(\[I:.+\]|".+"|!.+!)$/)
a = parm.match(/(.)[=\s]*(\[I:.+\]|".+"|!.+!)$/)
if (!a) {
syntax(1, 'Lack of starting [, ! or " in U: / %%user')
return
}
c = a[1];
v = a[2]
|
| ︙ | | |
256
257
258
259
260
261
262
263
264
265
266
267
268
269
|
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
|
+
+
|
type: C.BLOCK,
subtype: subtype,
dur: 0
}
if (parse.state == 2)
goto_tune()
if (subtype.slice(0, 4) != "midi") // if not a play command
curvoice = voice_tb[0] // set the block in the first voice
sym_link(s)
return s
}
// set the voice parameters
// (possible hook)
Abc.prototype.set_vp = function(a) {
|
| ︙ | | |
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
|
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
|
-
-
+
|
clefpit = 4 - val // 4 = 'G'
break
}
}
syntax(1, errs.bad_val, item)
break
case "octave=":
case "uscale=": // %%microscale
val = parseInt(a.shift())
if (isNaN(val))
syntax(1, errs.bad_val, item)
else
curvoice[item.slice(0, -1)] = val
curvoice.octave = val
break
case "cue=":
curvoice.scale = a.shift() == 'on' ? .7 : 1
break
case "instrument=":
// instrument=M/N => score=MN and sound=cN
|
| ︙ | | |
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
|
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
|
-
-
+
+
-
+
+
+
+
+
-
+
+
+
+
+
+
-
+
+
+
|
case "name=":
case "nm=":
curvoice.nm = a.shift()
if (curvoice.nm[0] == '"')
curvoice.nm = curvoice.nm.slice(1, -1);
curvoice.new_name = true
break
case "stem=":
case "pos=":
case "stem=": // compatibility
case "pos=": // from %%pos only
if (item == "pos=")
item = a.shift().split(' ')
else
item = ["stm", a.shift()];
val = posval[item[1]]
if (val == undefined) {
syntax(1, errs.bad_val, item[0])
break
}
if (!pos)
pos = {}
pos[item[0]] = val
break
case "scale=": // %%voicescale
val = parseFloat(a.shift())
if (isNaN(val) || val < .6 || val > 1.5)
if (isNaN(val) || val < .5 || val > 2)
syntax(1, errs.bad_val, "%%voicescale")
else
curvoice.scale = val
break
case "score=":
if (cfmt.nedo) {
syntax(1, errs.notransp)
break
}
// score=MN
// (score=M == score=Mc)
item = a.shift()
if (cfmt.sound)
break
curvoice.transp = get_transp(item)
curvoice.transp = get_interval(item, true)
break
case "shift=":
if (cfmt.nedo) {
syntax(1, errs.notransp)
break
}
curvoice.shift = curvoice.sndsh = get_interval(a.shift())
break
case "sound=":
if (cfmt.nedo) {
case "transpose=": // (abcMIDI compatibility)
syntax(1, errs.notransp)
break
}
// concert-score display: apply sound=
// sounding-score display: apply sound= only if M != c/C
// sound: apply sound=
curvoice.sndtran = get_interval(a.shift())
if (cfmt.sound)
curvoice.transp = curvoice.sndtran
break
|
| ︙ | | |
407
408
409
410
411
412
413
414
415
416
417
418
419
420
|
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
break
case "staffscale=":
val = parseFloat(a.shift())
if (isNaN(val) || val < .3 || val > 2)
syntax(1, "Bad %%staffscale value")
else
curvoice.staffscale = val
break
case "transpose=": // (abcMIDI compatibility)
if (cfmt.nedo) {
syntax(1, errs.notransp)
break
}
val = get_transp(a.shift())
if (val == undefined) {
syntax(1, errs.bad_transp)
} else {
curvoice.sndtran = val
if (cfmt.sound)
curvoice.transp = val
}
break
default:
switch (item.slice(0, 4)) {
case "treb":
case "bass":
case "alto":
case "teno":
|
| ︙ | | |
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
|
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
|
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
// return the key and the voice/clef parameters
function new_key(param) {
var i, clef, key_end, c, tmp, exp,
sf = "FCGDAEB".indexOf(param[0]) - 1,
mode = 0,
s = {
type: C.KEY,
dur:0
dur: 0
}
// set the accidentals when K: with modified accidentals
function set_k_acc(s, sf) {
var i, j, n, nacc, p_acc,
accs = [],
pits = [],
pits = []
m_n = [],
m_d = []
if (sf > 0) {
for (nacc = 0; nacc < sf; nacc++) {
accs[nacc] = 1; // sharp
pits[nacc] = [26, 23, 27, 24, 21, 25, 22][nacc]
}
} else {
for (nacc = 0; nacc < -sf; nacc++) {
accs[nacc] = -1; // flat
pits[nacc] = [22, 25, 21, 24, 20, 23, 26][nacc]
}
}
n = s.k_a_acc.length
for (i = 0; i < n; i++) {
p_acc = s.k_a_acc[i]
for (j = 0; j < nacc; j++) {
if (pits[j] == p_acc.pit) {
accs[j] = p_acc.acc
if (p_acc.micro_n) {
m_n[j] = p_acc.micro_n;
m_d[j] = p_acc.micro_d
}
break
}
}
if (j == nacc) {
accs[j] = p_acc.acc;
pits[j] = p_acc.pit
if (p_acc.micro_n) {
m_n[j] = p_acc.micro_n;
m_d[j] = p_acc.micro_d
}
nacc++
}
}
for (i = 0; i < nacc; i++) {
p_acc = s.k_a_acc[i]
if (!p_acc)
p_acc = s.k_a_acc[i] = {}
p_acc.acc = accs[i];
p_acc.pit = pits[i]
if (m_n[i]) {
p_acc.micro_n = m_n[i];
p_acc.micro_d = m_d[i]
} else {
delete p_acc.micro_n
delete p_acc.micro_d
}
}
} // set_k_acc()
// code of new_key()
set_ref(s);
// tonic
i = 1
if (sf < -1) {
switch (param[0]) {
case 'H': // bagpipe
switch (param[1]) {
case 'P':
case 'p':
s.k_bagpipe = param[1];
sf = param[1] == 'P' ? 0 : 2;
i++
if (param[1].toLowerCase() != 'p') {
syntax(1, "Unknown bagpipe-like key")
key_end = true
break
}
s.k_bagpipe = param[1];
sf = param[1] == 'P' ? 0 : 2;
i++
break
default:
syntax(1, "Unknown bagpipe-like key")
key_end = true
break
}
// initialize the temperament if not done yet
if (!cfmt.temper)
// detune in cents for just intonation in A
// C ^C D _E E F ^F G _A A _B B
// 15.3 -14.0 -2.0 -10.0 1.9 13.3 -16.0 -31.8 -12.0 0.0 11.4 3.8
// (C is ^C, F is ^F and G is =G)
// 86 84
// temp = [100-14, -14, -2, -10, 2, 100-16, -16, -32, -12, 0, 11, 4]
// but 'A' bagpipe = 480Hz => raise Math.log2(480/440)*1200 = 151
cfmt.temper = new Float32Array([
// 2.37, 1.37, 1.49, 1.41, 1.53, 2.35, 1.35, 1.19, 1.39, 1.51, 1.62, 1.55
// C ^C D _E E F ^F G _A A _B B
11.62, 12.55,
2.37, 2.37, 3.49, 0,
2.37, 2.37, 3.49, 4.41, 5.53, 0,
3.49, 4.41, 5.53, 7.35, 7.35,
4.41, 5.53, 7.35, 7.35, 8.19, 0,
7.35, 7.35, 8.19, 9.39, 10.51, 0,
8.19, 9.39, 10.51, 11.62, 12.55, 0,
10.51, 11.62, 12.55,
2.37, 2.37
])
break
case 'P':
syntax(1, "K:P is deprecated");
sf = 0;
s.k_drum = true;
key_end = true
break
case 'n': // none
if (param.indexOf("none") == 0) {
sf = 0;
s.k_none = true;
i = 4
break
}
// fall thru
default:
s.k_map = []
s.k_mode = 0
return [s, info_split(param)]
}
}
if (!key_end) {
switch (param[i]) {
case '#': sf += 7; i++; break
|
| ︙ | | |
853
854
855
856
857
858
859
860
861
862
863
864
865
866
|
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
|
+
|
}
}
}
/* Q: tempo */
function new_tempo(text) {
var i, c, d, nd,
txt = text, // (for info.Q)
s = {
type: C.TEMPO,
dur: 0
}
// get a note duration
function get_nd(p) {
|
| ︙ | | |
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
|
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
|
-
+
|
}
syntax(1, "Invalid note duration $1", c)
} // get_nd()
set_ref(s)
if (cfmt.writefields.indexOf('Q') < 0)
s.del = true // don't display
s.invis = true // don't display
/* string before */
if (text[0] == '"') {
c = text.match(/"([^"]*)"/) // "
if (!c) {
syntax(1, "Unterminated string in Q:")
return
|
| ︙ | | |
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
|
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
|
-
+
-
-
-
-
+
+
+
-
+
+
+
+
+
-
+
-
-
-
-
-
+
|
return
}
}
}
if (parse.state != 3) {
if (parse.state == 1) { // tune header
info.Q = text;
info.Q = txt
glovar.tempo = s
return
}
goto_tune()
}
if (curvoice.v == par_sy.top_voice) { /* tempo only for first voice */
sym_link(s)
if (glovar.tempo && curvoice.time == 0)
glovar.tempo.del = true
sym_link(s)
if (glovar.tempo && curvoice.time == 0)
glovar.tempo.invis = true
}
}
// treat the information fields which may embedded
function do_info(info_type, text) {
var s, d1, d2, a, vid
// skip this line if the current voice is ignored
if (curvoice && curvoice.ignore
&& info_type != 'V')
return
switch (info_type) {
// info fields in any state
case 'I':
self.do_pscom(text)
break
case 'L':
//fixme: ??
if (parse.state == 2)
goto_tune();
a = text.match(/^1\/(\d+)(=(\d+)\/(\d+))?$/)
if (a) {
d1 = Number(a[1])
if (!d1 || (d1 & (d1 - 1)) != 0)
break
d1 = C.BLEN / d1
if (a[2]) {
if (a[2]) { // if '='
d2 = Number(a[4])
if (!d2 || (d2 & (d2 - 1)) != 0) {
d2 = 0
break
}
d2 = Number(a[3]) / d2 * C.BLEN
d2 = d2 ? Number(a[3]) / d2 * C.BLEN : 0
} else {
d2 = d1
}
} else if (text == "auto") {
d1 = d2 = -1
}
if (!d2) {
|
| ︙ | | |
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
|
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
|
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
+
-
+
+
|
break
if (parse.state == 1) {
info.P = text
break
}
if (parse.state == 2)
goto_tune()
if (cfmt.writefields.indexOf(info_type) < 0)
break
s = {
type: C.PART,
text: text,
dur: 0
}
if (cfmt.writefields.indexOf(info_type) < 0)
/*
* If not in the main voice, then,
* if the voices are synchronized and no P: yet in the main voice,
* the misplaced P: goes into the main voice.
*/
var p_voice = voice_tb[par_sy.top_voice]
if (curvoice.v != p_voice.v) {
if (curvoice.time != p_voice.time)
break
if (p_voice.last_sym && p_voice.last_sym.type == C.PART)
break // already a P:
var voice_sav = curvoice;
curvoice = p_voice;
s.invis = true
sym_link(s);
curvoice = voice_sav
} else {
sym_link(s)
sym_link(s)
}
break
case 'Q':
if (parse.state == 0)
break
new_tempo(text)
break
case 'V':
get_voice(text)
if (parse.state == 3)
curvoice.ignore = !par_sy.voices[curvoice.v]
break
// key signature at end of tune header or in tune body
case 'K':
if (!parse.state) // ignore if in file header
break
get_key(text)
|
| ︙ | | |
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
|
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
|
-
+
+
+
|
for (i = 0; i <= s2.nhd; i++)
s2.notes[i].dur *= fac
}
curvoice.time = s.time = time
}
/* -- parse a bar -- */
function new_bar() {
function new_bar(dotted) {
var s2, c, bar_type,
line = parse.line,
s = {
type: C.BAR,
fname: parse.fname,
istart: parse.bol + line.index,
dur: 0,
multi: 0 // needed for decorations
}
if (dotted)
s.bar_dotted = true
if (vover && vover.bar) // end of voice overlay
get_vover('|')
if (glovar.new_nbar) { // %%setbarnb
s.bar_num = glovar.new_nbar;
glovar.new_nbar = 0
}
bar_type = line.char()
|
| ︙ | | |
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
|
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
|
-
+
-
+
|
} else {
s.rbstop = 2 // right repeat with end
if (curvoice.tie_s)
curvoice.tie_s.tie_s = s
}
}
// set the guitar chord and the decorations
// set the annotations and the decorations
if (a_gch)
self.gch_build(s)
csan_add(s)
if (a_dcn) {
deco_cnv(a_dcn, s);
a_dcn = null
}
// set the start/stop of ottava
if (parse.ottava.length) {
|
| ︙ | | |
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
|
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
|
-
+
-
-
+
-
-
-
+
+
-
-
|
}
s2.ottava = parse.ottava
parse.ottava = []
}
/* if the last element is '[', it may start
* a chord or an embedded header */
switch (bar_type.slice(-1)) {
if (bar_type.slice(-1) == '['
case '[':
if (/[0-9" ]/.test(c)) // "
&& !(/[0-9" ]/.test(c))) { // "
break
bar_type = bar_type.slice(0, -1);
line.index--;
c = '['
break
case ':': // left repeat
}
if (bar_type.slice(-1) == ':') // left repeat
s.rbstop = 2 // with bracket end
break
}
// check if repeat bar
if (c > '0' && c <= '9') {
s.text = c
while (1) {
c = line.next_char()
if ("0123456789,.-".indexOf(c) < 0)
|
| ︙ | | |
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
|
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
|
-
+
+
|
if (s.rbstart
&& curvoice.norepbra
&& !curvoice.second)
s.norepbra = true
// handle the accidentals (ties and repeat)
if (s.text) {
if (bar_type.slice(-1) == '[')
if (bar_type.slice(-1) == '['
&& bar_type != '[')
bar_type = bar_type.slice(0, -1)
if (s.text[0] == '1') {
if (curvoice.tie_s)
curvoice.tie_s_rep = curvoice.tie_s
if (curvoice.acc_tie)
curvoice.acc_tie_rep = curvoice.acc_tie.slice()
else if (curvoice.acc_tie_rep)
|
| ︙ | | |
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
|
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
|
-
-
+
+
-
-
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
|
curvoice.tie_s
}
}
if (curvoice.acc_tie_rep)
curvoice.acc_tie = curvoice.acc_tie_rep.slice()
}
}
curvoice.acc = [] // no accidental anymore
if (curvoice.ulen < 0) // L:auto
adjust_dur(s);
if ((bar_type == "[" || bar_type == "|:")
&& !curvoice.eoln) {
s2 = curvoice.last_sym
if (s2 && s2.time == curvoice.time) {
s2 = curvoice.last_sym
if (s2 && s2.time == curvoice.time) {
if (bar_type == "["
|| bar_type == "|:") {
// search if a previous bar at this time
do {
if (s2.type == C.BAR)
break
if (w_tb[s2.type]) // symbol with a width
break
s2 = s2.prev
} while (s2)
// do {
// if (s2.type == C.BAR)
// break
// if (w_tb[s2.type]) // symbol with a width
// break
// s2 = s2.prev
// } while (s2)
if (s2 && s2.type == C.BAR) {
// && !s2.a_gch && !s2.a_dd
// && !s.a_gch && !s.a_dd) {
// remove the invisible repeat bars
// when no shift is needed
if (bar_type == "["
|
| ︙ | | |
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
|
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
|
+
+
+
-
+
+
|
rbstart: 2
}
sym_link(s2);
s2.st = curvoice.st
delete s.text;
s.rbstart = 0
}
if (!s.bar_dotted && !s.invis)
curvoice.acc = [] // no accidental anymore
}
// parse %%staves / %%score
// return an array of [vid, flags] / null
function parse_staves(p) {
var v, vid,
var v, vid,
vids = {},
a_vf = [],
err = false,
flags = 0,
brace = 0,
bracket = 0,
parenth = 0,
flags_st = 0,
|
| ︙ | | |
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
|
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
|
+
+
+
+
+
-
+
+
-
+
|
continue
case '|':
flags |= STOP_BAR
continue
}
break
}
if (vids[vid]) {
syntax(1, "Double voice in %%score")
// err = true
} else {
vids[vid] = true
a_vf.push([vid, flags]);
a_vf.push([vid, flags])
}
flags = 0
if (!e)
break
a.unshift(e)
break
}
}
if (flags_st != 0) {
syntax(1, "'}', ')' or ']' missing in %%score");
err = true
}
if (err || !a_vf.length)
return //null
return a_vf
}
// split an info string
function info_split(text) {
if (!text)
return []
var a = text.match(/=?[^\s"=]+=?|".+?"/g) // "
var a = text.match(/[^\s"=]+=?|"[^"]+"/g) // "
if (!a) {
//fixme: bad error text
syntax(1, "Unterminated string")
return []
}
return a
}
|
| ︙ | | |
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
|
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
|
-
-
+
+
|
den *= 1 << res[2].length;
line.index = reg_dur.lastIndex
return [num, den]
}
// parse the note accidental and pitch
function parse_acc_pit(line) {
var note, acc, micro_n, micro_d, pit, nd,
c = line.char()
var note, acc, pit, d, nd,
c = line.char()
// optional accidental
switch (c) {
case '^':
c = line.next_char()
if (c == '^') {
acc = 2;
|
| ︙ | | |
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
|
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
|
+
-
-
+
+
+
+
+
-
-
-
+
+
+
+
-
-
-
+
|
} else {
acc = -1
}
break
}
/* look for microtone value */
if (acc == 1 || acc == -1) {
if (acc && acc != 3 && (c >= '1' && c <= '9')
|| c == '/') { // compatibility
if ((c >= '1' && c <= '9')
|| c == '/') { // shortcut
nd = parse_dur(line);
if (acc < 0)
nd[0] = -nd[0]
if (cfmt.nedo && nd[1] == 1) {
micro_n = nd[0];
micro_d = nd[1]
if (micro_d == 1)
nd[0] *= 12
nd[1] *= cfmt.nedo
}
acc = nd
micro_d = curvoice ? curvoice.uscale : 1
else
micro_d *= 2; // 1/2 tone fraction -> tone fraction
c = line.char()
}
}
/* get the pitch */
pit = ntb.indexOf(c) + 16;
c = line.next_char()
if (pit < 16) {
syntax(1, "'$1' is not a note", line.buffer[line.index - 1])
|
| ︙ | | |
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
|
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
|
-
+
-
-
-
-
-
-
+
-
-
+
+
-
-
+
+
-
-
-
+
+
+
-
+
+
-
+
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
|
c = line.next_char()
}
note = {
pit: pit,
shhd: 0,
shac: 0
}
if (acc) {
if (acc)
note.acc = acc
if (micro_n) {
note.micro_n = micro_n;
note.micro_d = micro_d
}
}
return note
}
/* set the mapping of a note */
// return the mapping of a note
//
// The global 'maps' object is indexed by the map name.
// Its content is an object ('map') indexed from the map type:
// - normal = b40 pitch
// - octave = 'o' + b40 pitch in C..B interval
// - normal = ABC note
// - octave = 'o' + ABC note in C..B interval
// - key = 'k' + scale index
// - all = 'all'
// The 'map' is stored in the note. It is an array of
// [0] array of heads (glyph names)
// [1] print (note)
// [2] color
// [3] play (b40)
function set_map(note) {
// [3] play (note)
function set_map(note, acc) {
var map = maps[curvoice.map], // never null
n = note.b40,
nn = n.toString()
var pit = note.pit,
nn = not2abc(pit, acc),
map = maps[curvoice.map] // never null
if (!map[nn]) {
nn = 'o' + (n % 40).toString() // octave
nn = 'o' + nn.replace(/[',]+/, '') // ' octave
if (!map[nn]) {
nn = 'k' + ntb[(pit + 75 -
n += 2 - curvoice.ckey.k_b40 // key
curvoice.ckey.k_sf * 11) % 7]
nn = 'k' + (abc2svg.b40_p[n % 40]).toString()
if (!map[nn]) {
nn = 'all' // 'all'
if (!map[nn])
return
}
}
}
note.map = map[nn]
if (note.map[1]) { // if print map
note.pit = note.map[1].pit
note.acc = note.map[1].acc
note.map = map = map[nn]
if (map[1]) { // if print map
note.pit = pit = map[1].pit
note.acc = map[1].acc
if (!note.acc // if no accidental
&& curvoice.acc[pit + 19]) // but one in the measure
note.acc = 3
curvoice.acc[pit + 19] = note.acc == 3 ? 0 : note.acc
}
if (note.map[2]) // if color
note.color = note.map[2]
nn = note.map[3]
if (nn) // if play map
note.b40 = nn
if (map[2]) // if color
note.color = map[2]
nn = map[3]
if (nn) // if play map
note.midi = pit2mid(nn.pit + 19, nn.acc)
}
/* -- parse note or rest with pitch and length -- */
// 'line' is not always 'parse.line'
function parse_basic_note(line, ulen) {
var nd,
note = parse_acc_pit(line)
|
| ︙ | | |
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
|
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
|
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
-
+
-
+
|
ty: C.SL_AUTO
})
if (e_is_note)
s.sls[s.sls.length - 1].is_note = e_is_note
return
}
}
syntax(1, "End of slur without start")
}
syntax(1, "Lack of starting slur")
}
// convert a diatonic pitch and accidental to a MIDI pitch with cents
function pit2mid(pit, acc) {
var p = [0, 2, 4, 5, 7, 9, 11][pit % 7], // chromatic pitch
o = ((pit / 7) | 0) * 12, // octave
p0, p1, s, b40
if (curvoice.snd_oct)
o += curvoice.snd_oct
if (acc == 3) // if natural accidental
acc = 0
if (acc) {
if (typeof acc != "number") {
s = acc[0] / acc[1] // microtonal accidental
if (acc[1] == 100) // in cents
return p + o + s
} else {
s = acc // simple accidental
}
} else {
if (cfmt.temper)
return cfmt.temper[abc2svg.p_b40[pit % 7]] + o
return p + o
}
if (!cfmt.nedo) { // non equal temperament
if (!cfmt.temper) {
p += o + s // standard temperament
return p
}
} else { // equal temperament
if (typeof acc == "number") { // if not a fraction
b40 = abc2svg.p_b40[pit % 7] + acc
return cfmt.temper[b40] + o
}
if (acc[1] == cfmt.nedo) { // fraction of the edo divider
b40 = abc2svg.p_b40[pit % 7]
return cfmt.temper[b40] + o + s
}
}
p0 = cfmt.temper[abc2svg.p_b40[pit % 7]] // main note
if (s > 0) { // sharp
p1 = cfmt.temper[(abc2svg.p_b40[pit % 7] + 1) % 40]
if (p1 < p0)
p1 += 12
} else { // flat
p1 = cfmt.temper[(abc2svg.p_b40[pit % 7] + 39) % 40]
if (p1 > p0)
p1 -= 12
s = -s
}
return p0 + o + (p1 - p0) * s
} // pit2mid()
// (possible hook)
Abc.prototype.new_note = function(grace, sls) {
var note, s, in_chord, c, dcn, type, tie_s, acc_tie,
i, n, s2, nd, res, num, dur, apit,
sl1 = [],
line = parse.line,
a_dcn_sav = a_dcn // save parsed decoration names
if (!grace
&& curvoice.tie_s) { // if tie from previous note / grace note
tie_s = curvoice.tie_s
curvoice.tie_s = null
}
// handle the ties
function do_ties(s, tie_s) {
var m, note
var m, note, mid
for (m = 0; m <= s.nhd; m++) {
note = s.notes[m]
mid = note.midi
if (tie_s.type != C.GRACE) {
for (i = 0; i <= tie_s.nhd; i++) {
if (!tie_s.notes[i].tie_ty)
continue
// (tie_s.notes[i].tie_n may exist
// on repeat restart)
if (tie_s.notes[i].b40 == note.b40) {
if (tie_s.notes[i].midi == mid) {
tie_s.notes[i].tie_n = note
note.s = s
tie_s.tie_s = s
break
}
}
} else {
for (s2 = tie_s.extra; s2; s2 = s2.next) {
if (!s2.notes[0].tie_ty)
continue
if (s2.notes[0].b40 == note.b40) {
if (s2.notes[0].midi == mid) {
s2.tie_s = s
s2.notes[0].tie_n = note
note.s = s
s2.notes[0].s = s2
tie_s.tie_s = s
break
}
|
| ︙ | | |
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
|
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
|
+
+
+
+
-
+
|
xmx: 0
}
s.istart = parse.bol + line.index
if (curvoice.color)
s.color = curvoice.color
if (curvoice.tie_s) { // if tie from previous note / grace note
tie_s = curvoice.tie_s
curvoice.tie_s = null
}
if (grace) {
s.grace = true
} else {
if (a_gch)
self.gch_build(s)
csan_add(s)
if (parse.repeat_n) {
s.repeat_n = parse.repeat_n;
s.repeat_k = parse.repeat_k;
parse.repeat_n = 0
}
}
c = line.char()
|
| ︙ | | |
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
|
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
|
+
+
-
+
+
+
|
if (s.nmes == 1) {
s.type = C.REST;
s.dur_orig = s.dur;
s.notes = [{
pit: 18,
dur: s.dur
}]
} else {
glovar.mrest_p = true
}
break
case 'y':
s.type = C.SPACE;
s.invis = true;
s.dur = 0;
c = line.next_char()
if (c >= '0' && c <= '9')
s.width = line.get_int()
else
s.width = 10
if (tie_s)
if (tie_s) {
curvoice.tie_s = tie_s
tie_s = null
}
break
case 'x':
s.invis = true
case 'z':
s.type = C.REST;
line.index++;
nd = parse_dur(line);
|
| ︙ | | |
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
|
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
|
-
-
|
c = line.next_char()
// fall thru
default: // accidental, chord, note
if (curvoice.acc_tie) {
acc_tie = curvoice.acc_tie
curvoice.acc_tie = null
}
if (curvoice.uscale)
s.uscale = curvoice.uscale;
s.notes = []
// loop on the chord
while (1) {
// when in chord, get the slurs and decorations
if (in_chord) {
|
| ︙ | | |
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
|
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
|
-
+
-
+
+
+
-
+
+
-
+
|
// transpose
if (curvoice.octave)
note.pit += curvoice.octave * 7
apit = note.pit + 19 // pitch from C-1
// get the explicit or implicit accidental
// and keep the absolute pitch in base-40
// and keep the absolute pitch in (MIDI + cents) format
i = note.acc
if (i) {
curvoice.acc[apit] = i
} else {
i = curvoice.acc[apit]
if (!i && acc_tie)
i = acc_tie[apit]
if (!i)
i = curvoice.ckey.k_map[apit % 7] || 0
i = curvoice.ckey.k_map[apit % 7] || 0
}
note.midi = pit2mid(apit, i)
if (curvoice.ckey.k_sndtran)
note.b40 = abc2svg.pab40(note.pit, i)
note.midi += abc2svg.b40m(curvoice.ckey.k_sndtran +
122) - 36
if (curvoice.map
&& maps[curvoice.map])
set_map(note)
set_map(note, i)
// starting slurs
if (sl1.length) {
while (1) {
i = sl1.shift()
if (!i)
break
|
| ︙ | | |
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
|
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
|
+
+
+
+
|
// the duration of the chord is the duration of the 1st note
s.dur_orig = s.notes[0].dur;
s.dur = s.notes[0].dur * curvoice.dur_fact
}
if (s.grace && s.type != C.NOTE) {
syntax(1, errs.bad_grace)
return //null
}
if (tie_s && s.type != C.NOTE) {
syntax(1, "Bad tie")
tie_s = null
}
if (s.notes) { // if note or rest
if (!grace) {
switch (curvoice.pos.stm) {
case C.SL_ABOVE: s.stem = 1; break
case C.SL_BELOW: s.stem = -1; break
|
| ︙ | | |
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
|
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
|
+
+
+
-
+
-
+
-
+
-
|
if (!curvoice.sym_restart)
curvoice.sym_restart = s
}
if (a_dcn_sav)
deco_cnv(a_dcn_sav, s, s.prev)
if (parse.ottava.length) {
if (grace)
grace.ottava = parse.ottava
else
s.ottava = parse.ottava
s.ottava = parse.ottava
parse.ottava = []
}
if (parse.stemless)
s.stemless = true
s.iend = parse.bol + line.index
return s
}
// adjust the duration of the elements in a tuplet
function tp_adj(s, fact) {
var tim = s.time
curvoice.time = s.time + (curvoice.time - s.time) * fact
curvoice.time = tim + (curvoice.time - tim) * fact
while (1) {
//fixme: tuplets in grace notes?
s.in_tuplet = true
if (!s.grace) {
s.time = tim
if (s.dur) {
s.dur = Math.round(s.dur * fact)
s.dur *= fact
tim += s.dur
}
}
if (!s.next) {
s.dur = curvoice.time - s.time
if (s.tpe)
s.tpe++
else
s.tpe = 1
break
}
s = s.next
|
| ︙ | | |
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
|
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
|
+
+
+
+
+
+
+
+
+
+
+
+
+
|
function parse_seq(in_mac) {
var c, idx, type, k, s, dcn, i, n, text, note
while (1) {
c = line.char()
if (!c)
break
// skip definitions if the current voice is ignored
if (curvoice.ignore) {
while (1) {
if (c == '['
&& line.buffer[line.index + 1] == 'V'
&& line.buffer[line.index + 2] == ':')
break // [V:nn] found
c = line.next_char()
if (!c)
return
}
}
// special case for '.' (dot)
if (c == '.') {
switch (line.buffer[line.index + 1]) {
case '(':
case '-':
case '|':
|
| ︙ | | |
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
|
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
|
-
+
-
-
+
|
grace.gr_shift = true
}
break
case '\n': // line break
if (cfmt.barsperstaff)
break
if (par_sy.voices[curvoice.v]
&& par_sy.voices[curvoice.v].range == 0
&& par_sy.voices[curvoice.v].range == 0)
&& curvoice.last_sym)
curvoice.last_sym.eoln = true
curvoice.eoln = true
break
case '&': // voice overlay
if (grace) {
syntax(1, errs.bad_grace)
break
}
c = line.next_char()
|
| ︙ | | |
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
|
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
|
-
-
|
get_vover('(')
break
}
line.index--;
sls.push(parse_vpos())
continue
case ')': // slur end
if (curvoice.ignore)
break
s = curvoice.last_sym
if (s) {
switch (s.type) {
case C.SPACE:
if (!s.notes) {
s.notes = []
s.notes[0] = {}
|
| ︙ | | |
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
|
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
|
-
+
-
-
-
|
}
continue
case '|':
if (grace) {
syntax(1, errs.bar_grace)
break
}
c = line.buffer[line.index - 1];
new_bar(line.buffer[line.index - 1] == '.')
new_bar()
if (c == '.')
curvoice.last_sym.bar_dotted = true
continue
case '}':
s = curvoice.last_note
if (!grace || !s) {
syntax(1, errs.bad_char, c)
break
}
|
| ︙ | | |
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
|
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
|
+
+
+
+
-
+
-
-
+
|
if (parse.state != 2)
return
goto_tune()
}
if (parse.tp) {
tp = parse.tp
tpn = parse.tpn
tps = parse.tps
parse.tp = null
}
parse_seq()
if (tp.length) {
parse.tp = tp
parse.tps = tps
parse.tpn = tpn
}
if (sls.length)
syntax(1, "Start of slur without note")
if (grace) {
syntax(1, "No end of grace note sequence");
curvoice.last_sym = grace.prev;
curvoice.last_note = last_note_sav
if (grace.prev)
grace.prev.next = null
}
if (cfmt.breakoneoln && curvoice.last_note)
curvoice.last_note.beam_end = true
if (no_eol || cfmt.barsperstaff)
return
if (char_tb['\n'.charCodeAt(0)] == '\n'
&& par_sy.voices[curvoice.v]
&& par_sy.voices[curvoice.v].range == 0
&& par_sy.voices[curvoice.v].range == 0)
&& curvoice.last_sym)
curvoice.last_sym.eoln = true
curvoice.eoln = true
}
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
// abc2svg - subs.js - text output
//
// Copyright (C) 2014-2019 Jean-Francois Moine
// Copyright (C) 2014-2020 Jean-Francois Moine
//
// This file is part of abc2svg-core.
//
// abc2svg-core is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// abc2svg-core is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with abc2svg-core. If not, see <http://www.gnu.org/licenses/>.
// add font styles
var sheet
var add_fstyle = typeof document != "undefined" ?
function(s) {
var e
if (!sheet) {
if (abc2svg.sheet) { // if styles from a previous generation
sheet = abc2svg.sheet
e = sheet.cssRules.length
while (--e >= 0)
sheet.deleteRule(e)
} else {
e = document.createElement('style')
document.head.appendChild(e)
abc2svg.sheet = sheet = e.sheet
}
}
s = s.match(/[^{]+{[^}]+}/g) // insert each style
while (1) {
e = s.shift()
if (!e)
break
sheet.insertRule(e, sheet.cssRules.length)
}
} // add_fstyle()
: function(s) { font_style += "\n" + s }
// width of characters according to the font type
// these tables were created from the font 'Liberation'
// serif
var
sw_tb = new Float32Array([
.000,.000,.000,.000,.000,.000,.000,.000, // 00
|
| ︙ | | |
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
|
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
|
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
|
return cwid(c) * gene.curfont.swfac
}
// estimate the width and height of a string ..
var strwh = typeof document != "undefined" ?
// .. by the browser
(function(el) {
el.style.position = 'absolute';
el.style.top = '-1000px';
el.style.padding = '0';
(function() {
// (re)create a text element
var el = document.createElement('text')
el.style.position = 'absolute'
el.style.top = '-1000px'
el.style.padding = '0'
document.body.appendChild(el)
return function(str) {
if (str.wh)
return str.wh
var c,
font = gene.curfont,
h = font.size,
w = 0,
n = str.length,
i0 = 0,
i = 0
el.className = font_class(font)
el.style.lineHeight = 1
el.style.font = style_font(font).slice(5);
if (typeof str == "object") { // if string already converted
el.innerHTML = str
str.wh = [ el.clientWidth, el.clientHeight ]
return str.wh
}
str = str.replace(/<|>|&[^&]*?;|&| /g, function(c){
switch (c) {
case '<': return "<"
case '>': return ">"
case '&': return "&"
case " ": return ' ' // space + nbspace
|
| ︙ | | |
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
|
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
|
+
-
+
|
font = get_font("u" + c)
} else {
i++
continue
}
el.innerHTML = str.slice(i0, i);
w += el.clientWidth
//fixme: bad result if space(s) at end of string
if (font.size > h)
h = font.size;
el.style.font = style_font(font).slice(5);
i += 2;
i0 = i
}
el.innerHTML = str.slice(i0);
w += el.clientWidth;
gene.curfont = font
return [w, h]
}
})(document.createElement('div')) :
})() :
// .. by internal tables
function(str) {
var font = gene.curfont,
swfac = font.swfac,
h = font.size,
w = 0,
|
| ︙ | | |
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
|
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
|
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
-
+
-
-
+
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
-
+
|
}
w += cwid(c) * swfac
}
gene.curfont = font
return [w, h]
}
// set the default and current font
function set_font(xxx) {
if (typeof xxx == "string")
xxx = get_font(xxx);
cw_tb = xxx.name.slice(0, 4) == 'sans' ? ssw_tb : sw_tb;
gene.curfont = gene.deffont = xxx
}
// convert a string to a SVG text, handling the font changes
// The string size is memorized into the String.
function str2svg(str) {
// check if the string is already converted
if (typeof str == "object")
return str
var o, n_font, wh,
o_font = gene.curfont,
c_font = o_font
// start a '<tspan>' element
// output a string handling the font changes
function out_str(str) {
var n_font,
o_font = gene.curfont,
c_font = o_font;
function tspan(nf, of) {
var cl
if (nf.class
&& nf.name == of.name
&& nf.size == of.size
&& nf.weight == of.weight
&& nf.style == of.style)
cl = nf.class // change only the class
else
cl = font_class(nf)
return '<tspan\n\tclass="' + cl + '">'
} // tspan()
output += str.replace(/<|>|&[^&]*?;|&| |\$./g, function(c){
o = str.replace(/<|>|&[^&]*?;|&| |\$./g, function(c){
switch (c) {
case '<': return "<"
case '>': return ">"
case '&':
case '&': return "&"
return "&"
case ' ':
case ' ': return ' ' // space + nbspace
return ' ' // space + nbspace
default:
if (c[0] != '$')
break
if (c[1] == '0')
n_font = gene.deffont
else if (c[1] >= '1' && c[1] <= '9')
n_font = get_font("u" + c[1])
else
break
c = ''
if (n_font == c_font)
return c
if (c_font != o_font)
c = "</tspan>";
c = "</tspan>"
c_font = n_font
if (c_font == o_font)
return c
return c + '<tspan\n\tclass="' +
return c + tspan(c_font, o_font)
font_class(n_font) + '">'
}
return c // &xxx;
})
if (c_font != o_font) {
output += "</tspan>";
o += "</tspan>"
gene.curfont = c_font // keep current font for next paragraph
}
// convert to String and memorize the string width and height
o = new String(o)
if (typeof document != "undefined")
strwh(o) // browser
else
o.wh = strwh(str) // CLI
return o
} // str2svg()
// set the default and current font
function set_font(xxx) {
if (typeof xxx == "string")
xxx = get_font(xxx)
cw_tb = xxx.name.slice(0, 4) == 'sans' ? ssw_tb : sw_tb
gene.curfont = gene.deffont = xxx
}
// output a string handling the font changes
function out_str(str) {
output += str2svg(str)
}
// output a string, handling the font changes
// the action is:
// 'c' align center
// 'r' align right
// 'j' justify - w is the line width
// otherwise align left
function xy_str(x, y, str,
function xy_str(x, y,
str, // string or object String with attribute 'wh'
action, // default: align left
w, // needed for justify
wh) { // optional [width, height]
if (!wh)
wh = strwh(str);
wh = str.wh || strwh(str)
output += '<text class="' + font_class(gene.curfont)
if (action != 'j' && str.length > 5
&& gene.curfont.wadj)
output += '" lengthAdjust="' + gene.curfont.wadj +
'" textLength="' + wh[0].toFixed(1);
output += '" x="';
|
| ︙ | | |
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
|
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
|
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
+
-
+
+
-
-
|
break
default:
output += '">'
break
}
out_str(str);
output += "</text>\n"
}
if (!w && gene.curfont.box) {
// not in the SVG documentation,
// but this works for almost all browsers but firefox
// output += '<g style="outline: solid black;\
// outline-width: 1px">\n';
// // xy_str(x, y, str, action, w);
// output += '</g>\n'
output += '<rect class="stroke" x="';
out_sxsy(x - 2, '" y="', y + wh[1]);
output += '" width="' + (wh[0] + 4).toFixed(1) +
'" height="' + (wh[1] + 2).toFixed(1) +
'"/>\n'
}
}
// move last capitalized word to front when after a comma
/* -- move trailing "The" to front, set to uppercase letters or add xref -- */
function trim_title(title, is_subtitle) {
var i
if (cfmt.titletrim) {
i = title.lastIndexOf(", ")
if (i < 0 || title[i + 2] < 'A' || title[i + 2] > 'Z') {
i = 0
} else if (cfmt.titletrim == true) { // compatibility
if (i < title.length - 7
|| title.indexOf(' ', i + 3) >= 0)
i = 0
} else {
if (i < title.length - cfmt.titletrim - 2)
i = 0
}
if (i)
title = title.slice(i + 2).trim() + ' ' + title.slice(0, i)
}
if (!is_subtitle
&& cfmt.writefields.indexOf('X') >= 0)
title = info.X + '. ' + title
if (i)
title = title.slice(i + 2).trim() + ' ' + title.slice(0, i)
if (cfmt.titlecaps)
return title.toUpperCase()
return title
}
// return the width of the music line
function get_lwidth() {
|
| ︙ | | |
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
|
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
|
-
-
+
+
+
+
-
+
-
+
-
+
-
+
-
-
-
+
-
-
+
+
-
-
+
-
-
-
-
+
+
-
-
+
-
-
+
-
-
-
-
+
+
-
-
+
-
+
-
+
-
-
-
-
-
+
+
-
+
-
-
+
+
-
-
-
-
-
+
+
-
+
-
-
+
+
+
-
+
|
if (is_subtitle) {
set_font("subtitle");
h = cfmt.subtitlespace
} else {
set_font("title");
h = cfmt.titlespace
}
wh = strwh(title);
vskip(wh[1] + h)
wh = strwh(title)
wh[1] += gene.curfont.pad * 2
vskip(wh[1] + h + gene.curfont.pad)
h = gene.curfont.pad
if (cfmt.titleleft)
xy_str(0, 0, title, null, null, wh)
xy_str(0, h, title, null, null, wh)
else
xy_str(get_lwidth() / 2, 0, title, "c", null, wh)
xy_str(get_lwidth() / 2, h, title, "c", null, wh)
}
/* -- output a header format '111 (222)' -- */
function put_inf2r(x, y, str1, str2, action) {
if (!str1) {
if (!str2)
return
str1 = str2;
str2 = null
}
if (!str2)
xy_str(x, y, str1, action)
else
xy_str(x, y, str1 + ' (' + str2 + ')', action)
}
/* -- write a text block (%%begintext / %%text / %%center) -- */
function write_text(text, action) {
if (action == 's')
return // skip
set_font("text");
set_page();
var wh, font,
var wh, font, o,
strlw = get_lwidth(),
sz = gene.curfont.size,
lineskip = sz * cfmt.lineskipfac,
parskip = sz * cfmt.parskipfac,
p_start = block.started ? function(){} : blk_out,
p_flush = block.started ? svg_flush : blk_flush,
i, j, x, words, w, k, ww, str;
p_start()
switch (action) {
default:
// case 'c':
// case 'r':
font = gene.curfont
switch (action) {
case 'c': x = strlw / 2; break
case 'r': x = strlw; break
default: x = 0; break
case 'r': x = strlw - font.pad; break
default: x = font.pad; break
}
j = 0
font = gene.curfont
while (1) {
i = text.indexOf('\n', j)
if (i < 0) {
str = text.slice(j);
str = str2svg(text.slice(j))
wh = strwh(str);
gene.curfont = font;
vskip(wh[1] * cfmt.lineskipfac);
xy_str(x, 0, str, action, null, wh);
vskip(str.wh[1] * cfmt.lineskipfac + font.pad * 2)
xy_str(x, font.pad, str, action)
font = gene.curfont
break
}
if (i == j) { // new paragraph
vskip(parskip);
p_flush();
blk_flush()
use_font(gene.curfont)
while (text[i + 1] == '\n') {
vskip(lineskip);
i++
}
if (i == text.length)
break
p_start()
} else {
str = text.slice(j, i);
str = str2svg(text.slice(j, i))
wh = strwh(str);
gene.curfont = font;
vskip(wh[1] * cfmt.lineskipfac);
xy_str(x, 0, str, action, null, wh);
vskip(str.wh[1] * cfmt.lineskipfac + font.pad * 2)
xy_str(x, font.pad, str, action)
font = gene.curfont
}
j = i + 1
}
vskip(parskip);
p_flush()
blk_flush()
break
case 'f':
case 'j':
j = 0
while (1) {
i = text.indexOf('\n\n', j)
if (i < 0)
words = text.slice(j)
else
words = text.slice(j, i);
words = words.split(/\s+/);
w = k = 0
font = gene.curfont
for (j = 0; j < words.length; j++) {
ww = strwh(words[j] + ' ')[0];
ww = strwh(words[j])[0];
w += ww
if (w >= strlw) {
str = words.slice(k, j).join(' ');
str = str2svg(words.slice(k, j).join(' '))
gene.curfont = font;
wh = strwh(str);
gene.curfont = font;
vskip(wh[1] * cfmt.lineskipfac);
xy_str(0, 0, str, action, strlw, wh);
vskip(str.wh[1] * cfmt.lineskipfac)
xy_str(0, 0, str, action, strlw)
font = gene.curfont;
k = j;
w = ww
}
w += cwidf(' ')
}
if (w != 0) {
str = words.slice(k).join(' ');
if (w != 0) { // last line
str = str2svg(words.slice(k).join(' '))
gene.curfont = font;
wh = strwh(str);
gene.curfont = font;
vskip(wh[1] * cfmt.lineskipfac);
xy_str(0, 0, str, null, null, wh)
vskip(str.wh[1] * cfmt.lineskipfac)
xy_str(0, 0, str)
}
vskip(parskip);
p_flush()
blk_flush()
if (i < 0)
break
while (text[i + 2] == '\n') {
vskip(lineskip);
i++
}
if (i == text.length)
break
p_start();
use_font(gene.curfont);
j = i + 2
}
break
}
}
/* -- output the words after tune -- */
function put_words(words) {
var p, i, j, n, nw, i2, i_end, have_text;
var p, i, j, nw, w, lw, x1, x2, i1, i2, do_flush,
maxn = 0, // max number of characters per line
n = 1 // number of verses
// output a line of words after tune
function put_wline(p, x, right) {
function put_wline(p, x) {
var i = 0, j, k
if (p[i] == '$' && p[i + 1] >= '0' && p[i + 1] <= '9')
i += 2;
k = 0;
j = i
if ((p[i] >= '0' && p[i] <= '9') || p[i + 1] == '.') {
|
| ︙ | | |
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
|
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
|
-
+
+
-
-
+
-
-
-
+
-
-
-
-
-
+
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
+
-
+
-
+
-
-
+
+
+
-
+
+
+
+
+
+
+
+
|
i++
}
if (k != 0)
xy_str(x, 0, p.slice(j, k), 'r')
if (i < p.length)
xy_str(x + 5, 0, p.slice(i), 'l')
return i >= p.length && k == 0
} // put_wline()
set_font("words")
vskip(cfmt.wordsspace)
svg_flush()
/* see if we may have 2 columns */
var middle = get_lwidth() / 2,
// estimate the width of the lines
max2col = (middle - 45.) / cwidf('a');
n = 0;
words = words.split('\n');
words = words.split('\n')
nw = words.length
for (i = 0; i < nw; i++) {
p = words[i]
/*fixme:utf8*/
if (p.length > max2col) {
n = 0
break
}
if (!p) {
while (i + 1 < nw && !words[i + 1])
if (have_text) {
n++;
have_text = false
}
i++
n++
} else if (p.length > maxn) {
maxn = p.length
i1 = i // keep this line
}
} else {
have_text = true
}
}
if (n > 0) {
i = n = ((n + 1) / 2) | 0;
}
w = get_lwidth() / 2 // half line width
lw = strwh(words[i1])[0]
i1 = i2 = 0
if (lw < w) { // if 2 columns
j = n >> 1
have_text = false
for (i_end = 0; i_end < nw; i_end++) {
p = words[i_end];
j = 0
while (p[j] == ' ')
j++
if (j == p.length) {
if (have_text && --i <= 0)
for (i = 0; i < nw; i++) {
p = words[i]
if (!p) {
if (--j <= 0)
i1 = i
while (i + 1 < nw && !words[i + 1])
i++
if (j <= 0) {
i2 = i + 1
break
}
}
}
n >>= 1
}
if (i2) {
x1 = (w - lw) / 2 + 10
have_text = false
} else {
have_text = true
x2 = x1 + w
} else { // one column
x2 = w - lw / 2 + 10
}
do_flush = true
}
}
i2 = i_end + 1
} else {
i2 = i_end = nw
}
for (i = 0; i < i1 || i2 < nw; i++, i2++) {
vskip(cfmt.lineskipfac * gene.curfont.size)
if (i < i1) {
p = words[i]
if (p)
put_wline(p, x1)
else
use_font(gene.curfont)
}
if (i2 < nw) {
/* output the text */
vskip(cfmt.wordsspace)
p = words[i2]
if (p) {
put_wline(p, x2)
} else {
for (i = 0; i < i_end || i2 < nw; i++) {
//fixme:should also permit page break on stanza start
if (i < i_end && words[i].length == 0) {
blk_out();
use_font(gene.curfont)
}
vskip(cfmt.lineskipfac * gene.curfont.size)
if (--n == 0) {
if (i < i_end)
put_wline(words[i], 45., 0)
if (i2 < nw) {
if (put_wline(words[i2], 20. + middle, 1)) {
if (--n == 0) {
if (i < i_end) {
if (i < i1) {
n++
} else if (i2 < words.length - 1) {
} else if (i2 < nw - 1) {
/* center the last words */
// center the last verse
/*fixme: should compute the width average.. */
middle *= .6
x2 = w - lw / 2 + 10
svg_flush()
}
}
}
}
i2++
if (!words[i + 1] && !words[i2 + 1]) {
if (do_flush) {
svg_flush()
do_flush = false
}
} else {
do_flush = true
}
}
}
/* -- output history -- */
function put_history() {
var i, j, c, str, font, h, w, wh, head,
|
| ︙ | | |
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
|
659
660
661
662
663
664
665
666
667
668
669
670
671
672
|
-
|
str = str.split('\n');
xy_str(w, 0, str[0])
for (j = 1; j < str.length; j++) {
vskip(h);
xy_str(w, 0, str[j])
}
vskip(h * .3);
blk_out();
use_font(gene.curfont)
}
}
/* -- write heading with format -- */
var info_font_init = {
A: "info",
|
| ︙ | | |
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
|
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
|
+
-
+
-
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
|
p = cfmt.titleformat,
j = 0,
i = 0
while (1) {
while (p[i] == ' ')
i++
c = p[i++]
if (i >= p.length)
if (!c)
break
c = p[i++]
if (c < 'A' || c > 'Z') {
switch (c) {
case '+':
if (c == '+') {
if (fmt.length == 0
|| fmt.slice(-1) == '+')
continue
fmt = fmt.slice(0, -1) + '+'
} else if (c == ',') {
if (fmt.slice(-1) == '+')
fmt = fmt.slice(0, -1) + 'l'
fmt += '\n'
align = '+'
c = p[i++]
break
case ',':
fmt += '\n'
// fall thru
default:
continue
case '<':
align = 'l'
c = p[i++]
break
case '>':
align = 'r'
c = p[i++]
break
}
} else {
switch (p[i]) { // old syntax
case '-':
align = 'l'
i++
break
case '1':
align = 'r'
i++
break
case '0':
i++
// fall thru
default:
align = 'c'
break
}
continue
}
if (!info_val[c]) {
if (!info[c])
continue
info_val[c] = info[c].split('\n');
info_nb[c] = 1
} else {
info_nb[c]++
}
fmt += c
fmt += align + c
switch (p[i]) {
case '-':
fmt += 'l'
i++
break
case '0':
fmt += 'c'
i++
break
case '1':
fmt += 'r'
i++
break
default:
fmt += 'c'
break
}
}
}
if (fmt.slice(-1) == '+')
fmt = fmt.slice(0, -1) + 'l';
fmt += '\n'
// loop on the blocks
var ya = {
l: cfmt.titlespace,
c: cfmt.titlespace,
r: cfmt.titlespace
|
| ︙ | | |
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
|
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
|
-
-
+
+
-
-
+
+
-
-
+
-
-
+
+
-
-
+
+
-
+
-
-
-
+
+
+
-
+
+
+
+
|
i = 0
while (1) {
// get the y offset of the top text
yb.l = yb.c = yb.r = y = 0;
j = i
while (1) {
c = p[j++]
if (c == '\n')
align = p[j++]
if (align == '\n')
break
align = p[j++]
if (align == '+')
c = p[j++]
if (align == '+' || yb[align])
align = p[j + 1]
else if (yb[align] != 0)
continue
str = info_val[c]
if (!str)
continue
font_name = info_font[c]
if (!font_name)
font_name = "history";
font = get_font(font_name);
sz = font.size * 1.1
if (info_sz[c])
sz += info_sz[c]
if (y < sz)
y = sz;
yb[align] = sz
}
ya.l += y - yb.l;
ya.c += y - yb.c;
ya.r += y - yb.r
while (1) {
c = p[i++]
if (c == '\n')
align = p[i++]
if (align == '\n')
break
align = p[i++]
if (info_val[c].length == 0)
c = p[i++]
if (!info_val[c].length)
continue
str = info_val[c].shift()
if (align == '+') {
if (p[i] == '+') {
info_nb[c]--;
c = p[i++];
align = p[i++]
if (info_val[c].length > 0) {
i++
c = p[i++];
if (info_val[c].length) {
if (str)
str += ' ' + info_val[c].shift()
else
str = ' ' + info_val[c].shift()
}
}
font_name = info_font[c]
if (!font_name)
font_name = "history";
font = get_font(font_name);
sz = font.size * 1.1
if (info_sz[c])
sz += info_sz[c];
set_font(font);
x = xa[align];
y = ya[align] + sz
if (c == 'Q') { /* special case for tempo */
self.set_width(glovar.tempo)
if (!glovar.tempo.del) {
if (!glovar.tempo.invis) {
if (align != 'l') {
tempo_build(glovar.tempo)
w = glovar.tempo.tempo_wh[0]
if (align == 'c')
w *= .5;
x -= w
}
writempo(glovar.tempo, x, -y)
}
} else if (str) {
if (c == 'T')
str = trim_title(str,
info_font.T[0] == 's')
xy_str(x, -y, str, align)
}
if (c == 'T') {
font_name = info_font.T = "subtitle";
info_sz.T = cfmt.subtitlespace
}
|
| ︙ | | |
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
|
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
|
-
+
-
|
info_nb[c]--;
ya[align] = y
}
if (ya.c > ya.l)
ya.l = ya.c
if (ya.r > ya.l)
ya.l = ya.r
if (i >= fmt.length)
if (i >= p.length)
break
ya.c = ya.r = ya.l
}
vskip(ya.l)
}
/* -- output the tune heading -- */
function write_heading() {
var i, j, area, composer, origin, rhythm, down1, down2,
lwidth = get_lwidth()
blk_out();
vskip(cfmt.topspace)
if (cfmt.titleformat) {
write_headform(lwidth);
vskip(cfmt.musicspace)
return
}
|
| ︙ | | |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
-
+
-
-
+
+
-
+
+
+
+
-
-
-
-
|
// abc2svg - svg.js - svg functions
//
// Copyright (C) 2014-2019 Jean-Francois Moine
// Copyright (C) 2014-2020 Jean-Francois Moine
//
// This file is part of abc2svg-core.
//
// abc2svg-core is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// abc2svg-core is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with abc2svg-core. If not, see <http://www.gnu.org/licenses/>.
var output = "", // output buffer
style = '\
\ntext, tspan{fill:currentColor}\
\n.stroke{stroke:currentColor;fill:none}\
\n.bW{stroke:currentColor;fill:none;stroke-width:1}\
\n.bthW{stroke:currentColor;fill:none;stroke-width:3}\
\n.slW{stroke:currentColor;fill:none;stroke-width:.7}\
\n.slthW{stroke:currentColor;fill:none;stroke-width:1.5}\
\n.sW{stroke:currentColor;fill:none;stroke-width:.7}\
\n.mtx{font:130% music}',
\n.box{outline: 1px solid black;outline-offset: 1px}',
font_style = '',
posx = cfmt.leftmargin / cfmt.scale, // default x offset of the images
posy = 0, // y offset in the block
img = { // image
width: cfmt.pagewidth, // width
lm: cfmt.leftmargin, // left and right margins
rm: cfmt.rightmargin
// chg: false
},
defined_glyph = {},
defs = '',
fulldefs = '', // unreferenced defs as <filter>
stv_g = { /* staff/voice graphic parameters */
scale: 1,
dy: 0,
st: -1,
v: -1,
g: 0
// color: undefined
},
blkdiv = 0 // block of contiguous SVGs
block = {} /* started & newpage */
// -1: block started
// 0: no block
// 1: start a block
// 2: start a new page
// glyphs in music font
var tgls = {
"mtr ": {x:0, y:0, c:"\u0020"}, // space
brace: {x:0, y:0, c:"\ue000"},
hl: {x:-4, y:0, c:"\ue022"},
hl1: {x:-6, y:0, c:"\ue023"},
// hl2: {x:-6, y:0, c:"\ue023"}, // (unused)
ghl: {x:-4, y:0, c:"\ue024"},
lphr: {x:0, y:24, c:"\ue030"},
mphr: {x:0, y:24, c:"\ue038"},
sphr: {x:0, y:27, c:"\ue039"},
rdots: {x:-1, y:0, c:"\ue043"}, // repeat dots
dsgn: {x:-4, y:-4, c:"\ue045"}, // D.S.
dcap: {x:-4, y:-4, c:"\ue046"}, // D.C.
sgno: {x:-6, y:0, c:"\ue047"}, // segno
|
| ︙ | | |
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
|
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
|
-
+
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
|
pfthd: {x:-3.7, y:0, c:"\ue0b3"},
x: {x:-3.7, y:0, c:"\ue0a9"}, // 'x' note head
"circle-x": {x:-3.7, y:0, c:"\ue0b3"}, // 'circle-x' note head
srep: {x:-5, y:0, c:"\ue101"},
"dot+": {x:-5, y:0, sc:.7, c:"\ue101"},
diamond: {x:-4, y:0, c:"\ue1b9"},
triangle: {x:-4, y:0, c:"\ue1bb"},
dot: {x:-2, y:0, c:"\ue1e7"},
dot: {x:-1, y:0, c:"\ue1e7"},
flu1: {x:-.3, y:0, c:"\ue240"}, // flags
fld1: {x:-.3, y:0, c:"\ue241"},
flu2: {x:-.3, y:0, c:"\ue242"},
fld2: {x:-.3, y:0, c:"\ue243"},
flu3: {x:-.3, y:3.5, c:"\ue244"},
fld3: {x:-.3, y:-4, c:"\ue245"},
flu4: {x:-.3, y:8, c:"\ue246"},
fld4: {x:-.3, y:-9, c:"\ue247"},
flu5: {x:-.3, y:12.5, c:"\ue248"},
fld5: {x:-.3, y:-14, c:"\ue249"},
"acc-1": {x:-1, y:0, c:"\ue260"}, // flat
acc3: {x:-1, y:0, c:"\ue261"}, // natural
acc1: {x:-2, y:0, c:"\ue262"}, // sharp
"acc-1": {x:-1, y:0, c:"\ue260"}, // flat
"cacc-1": {x:-18, y:0, c:"\ue26a\ue260\ue26b"}, // courtesy flat (note deco)
"sacc-1": {x:-1, y:0, sc:.7, c:"\ue260"}, // small flat (editorial)
acc3: {x:-1, y:0, c:"\ue261"}, // natural
"cacc3": {x:-18, y:0, c:"\ue26a\ue261\ue26b"}, // courtesy natural (note deco)
sacc3: {x:-1, y:0, sc:.7, c:"\ue261"}, // small natural (editorial)
acc1: {x:-2, y:0, c:"\ue262"}, // sharp
"cacc1": {x:-18, y:0, c:"\ue26a\ue262\ue26b"}, // courtesy sharp (note deco)
sacc1: {x:-2, y:0, sc: .7, c:"\ue262"}, // small sharp (editorial)
acc2: {x:-3, y:0, c:"\ue263"}, // double sharp
"acc-2": {x:-3, y:0, c:"\ue264"}, // double flat
"acc-1_1_4": {x:-2, y:0, c:"\ue280"}, // quarter-tone flat
"acc-1_3_4": {x:-3, y:0, c:"\ue281"}, // three-quarter-tones flat
acc1_1_4: {x:-1, y:0, c:"\ue282"}, // quarter-tone sharp
acc1_3_4: {x:-3, y:0, c:"\ue283"}, // three-quarter-tones sharp
"acc-1_2": {x:-2, y:0, c:"\ue280"}, // quarter-tone flat
"acc-3_2": {x:-3, y:0, c:"\ue281"}, // three-quarter-tones flat
acc1_2: {x:-1, y:0, c:"\ue282"}, // quarter-tone sharp
acc3_2: {x:-3, y:0, c:"\ue283"}, // three-quarter-tones sharp
accent: {x:-3, y:0, c:"\ue4a0"},
stc: {x:-1, y:-2, c:"\ue4a2"}, // staccato
emb: {x:-4, y:-2, c:"\ue4a4"},
wedge: {x:-1, y:0, c:"\ue4a8"},
marcato: {x:-3, y:0, c:"\ue4ac"},
hld: {x:-7, y:0, c:"\ue4c0"}, // fermata
brth: {x:0, y:0, c:"\ue4ce"},
|
| ︙ | | |
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
|
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
|
-
+
|
mtro: {x:0, y:0, c:"\ue911"}, // tempus perfectum
// "mtro|": {x:0, y:0, c:"\ue912"}, // (unused)
// "mtrc.": {x:0, y:0, c:"\ue914"}, // (unused)
mtrc: {x:0, y:0, c:"\ue915"}, // tempus imperfectum
// "mtrc|": {x:0, y:0, c:"\ue918"}, // (unused)
"mtr.": {x:0, y:0, c:"\ue920"}, // prolatione perfecta
"mtr|": {x:0, y:0, c:"\ue925"}, // (twice as fast)
longa: {x:-3.7, y:0, c:"\ue95d"},
longa: {x:-4.7, y:0, c:"\ue95d"},
custos: {x:-4, y:3, c:"\uea02"},
ltr: {x:2, y:6, c:"\ueaa4"} // long trill element
}
// glyphs to put in <defs>
var glyphs = {
}
|
| ︙ | | |
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
|
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
|
-
+
+
+
|
tag = text.slice(is + 1, i);
ie = text.indexOf('</' + tag + '>', ie)
if (ie < 0)
break
ie += 3 + tag.length
}
if (text.substr(is, 7) == '<filter')
fulldefs += '\n' + text.slice(is, ie)
fulldefs += text.slice(is, ie) + '\n'
else
glyphs[gl] = text.slice(is, ie)
}
}
// output the stop/start of a graphic sequence
function set_g() {
// close the previous sequence
if (stv_g.started) {
stv_g.started = false;
glout()
output += "</g>\n"
}
// check if new sequence needed
if (stv_g.scale == 1 && !stv_g.color)
return
// open the new sequence
glout()
output += '<g '
if (stv_g.scale != 1) {
if (stv_g.st < 0)
output += voice_tb[stv_g.v].scale_str
else if (stv_g.v < 0)
output += staff_tb[stv_g.st].scale_str
else
|
| ︙ | | |
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
|
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
|
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
staff_tb[st].output +
'</g>\n';
staff_tb[st].output = ""
}
}
// output the annotations
// !! tied to the symbol types in abc2svg.js !!
var anno_type = ['bar', 'clef', 'custos', '', 'grace',
'key', 'meter', 'Zrest', 'note', 'part',
'rest', 'yspace', 'staves', 'Break', 'tempo',
'', 'block', 'remark']
function anno_out(s, t, f) {
if (s.istart == undefined)
return
var type = s.type,
h = s.ymx - s.ymn + 4,
wl = s.wl || 2,
wr = s.wr || 2
if (s.grace)
type = C.GRACE
f(t || anno_type[type], s.istart, s.iend,
f(t || abc2svg.sym_name[type], s.istart, s.iend,
s.x - wl - 2, staff_tb[s.st].y + s.ymn + h - 2,
wl + wr + 4, h, s);
}
function a_start(s, t) {
anno_out(s, t, user.anno_start)
}
function a_stop(s, t) {
anno_out(s, t, user.anno_stop)
}
function empty_function() {
}
var anno_start = user.anno_start ? a_start : empty_function,
anno_stop = user.anno_stop ? a_stop : empty_function
// output the stop user annotations
function anno_put() {
var s
while (1) {
s = anno_a.shift()
if (!s)
break
switch (s.type) {
case C.CLEF:
case C.METER:
case C.KEY:
case C.REST:
if (s.type != C.REST || s.rep_nb) {
set_sscale(s.st)
break
}
// fall thru
case C.GRACE:
case C.NOTE:
case C.MREST:
set_scale(s)
break
// default:
// continue
}
anno_stop(s)
}
} // anno_put()
// output a string with x, y, a and b
// In the string,
// X and Y are replaced by scaled x and y
// A and B are replaced by a and b as string
// F and G are replaced by a and b as float
function out_XYAB(str, x, y, a, b) {
|
| ︙ | | |
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
|
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
|
+
+
|
default: return b.toFixed(1)
}
})
}
// open / close containers
function g_open(x, y, rot, sx, sy) {
glout()
out_XYAB('<g transform="translate(X,Y', x, y);
if (rot)
output += ') rotate(' + rot.toFixed(2)
if (sx) {
if (sy)
output += ') scale(' + sx.toFixed(2) +
', ' + sy.toFixed(2)
else
output += ') scale(' + sx.toFixed(2)
}
output += ')">\n';
stv_g.g++
}
function g_close() {
glout()
stv_g.g--;
output += '</g>\n'
}
// external SVG string
Abc.prototype.out_svg = function(str) { output += str }
|
| ︙ | | |
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
|
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
+
+
+
+
+
+
-
-
-
-
-
-
|
function xypath(x, y, fill) {
if (fill)
out_XYAB('<path d="mX Y', x, y)
else
out_XYAB('<path class="stroke" d="mX Y', x, y)
}
Abc.prototype.xypath = xypath
// output the list of glyphs and the stems
// [0] = x glyph
// [1] = y glyph
// [2] = glyph code
// [3] = x, y, h of stem (3 values per stem)
var gla = [[], [], "", [], [], []]
function glout() {
var e,
v = []
// glyphs (notes, accidentals...)
if (gla[0].length) {
while (1) {
e = gla[0].shift()
if (e == undefined)
break
v.push(e.toFixed(1))
}
output += '<text x="' + v.join(',')
v = []
while (1) {
e = gla[1].shift()
if (e == undefined)
break
v.push(e.toFixed(1))
}
output += '"\ny="' + v.join(',')
output += '"\n>' + gla[2] + '</text>\n'
gla[2] = ""
}
// stems
if (!gla[3].length)
return
output += '<path class="sW" d="'
while (1) {
e = gla[3].shift()
if (e == undefined)
break
output += 'M' + e.toFixed(1) +
' ' + gla[3].shift().toFixed(1) +
'v' + gla[3].shift().toFixed(1)
}
output += '"/>\n'
} // glout()
// output a glyph
function xygl(x, y, gl) {
// (avoid ps<->js loop)
// if (psxygl(x, y, gl))
// return
if (glyphs[gl]) {
def_use(gl)
out_XYAB('<use x="X" y="Y" xlink:href="#A"/>\n', x, y, gl)
} else {
var tgl = tgls[gl]
if (tgl) {
x += tgl.x * stv_g.scale;
y -= tgl.y
if (tgl.sc)
if (tgl.sc) {
out_XYAB('<text transform="translate(X,Y) scale(A)">B</text>\n',
x, y, tgl.sc, tgl.c);
else
out_XYAB('<text x="X" y="Y">A</text>\n', x, y, tgl.c)
} else {
// out_XYAB('<text x="X" y="Y">A</text>\n', x, y, tgl.c)
gla[0].push(sx(x))
gla[1].push(sy(y))
gla[2] += tgl.c
}
} else {
error(1, null, 'no definition of $1', gl)
}
}
}
// - specific functions -
// gua gda (acciaccatura)
function out_acciac(x, y, dx, dy, up) {
if (up) {
x -= 1;
y += 4
} else {
x -= 5;
y -= 4
}
out_XYAB('<path class="stroke" d="mX YlF G"/>\n',
x, y, dx, -dy)
}
// tuplet value - the staves are not defined
function out_bnum(x, y, str) {
out_XYAB('<text style="font:italic 12px serif"\n\
x="X" y="Y" text-anchor="middle">A</text>\n',
x, y, str.toString())
}
// staff system brace
function out_brace(x, y, h) {
//fixme: '-6' depends on the scale
x += posx - 6;
y = posy - y;
h /= 24;
output += '<text transform="translate(' +
|
| ︙ | | |
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
|
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
|
-
-
+
+
+
|
slen = -h
if (h < 0)
dx = -dx; // down
x += dx * stv_g.scale
if (stv_g.v >= 0)
slen /= voice_tb[stv_g.v].scale;
out_XYAB('<path class="sW" d="mX YvF"/>\n', // stem
x, y, slen)
gla[3].push(sx(x))
gla[3].push(sy(y))
gla[3].push(slen)
if (!nflags)
return
y += h
if (h > 0) { // up
if (!straight) {
if (!grace) {
|
| ︙ | | |
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
|
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
|
-
-
-
|
1.4 -4.8 -2.4 -5.4 -3.2 -5.2\n', x, y);
y -= 3.5
}
}
}
} else { // straight
output += '<path d="'
//fixme: to do
if (!grace) {
//fixme: check endpoints
y += 1
while (--nflags >= 0) {
out_XYAB('MX Yl7 3.2 0 3.2 -7 -3.2z\n',
x, y);
y -= 5.4
}
} else { // grace
while (--nflags >= 0) {
|
| ︙ | | |
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
|
755
756
757
758
759
760
761
762
763
764
765
766
767
768
|
-
-
|
y += 3.5
}
}
}
} else { // straight
output += '<path d="'
if (!grace) {
//fixme: check endpoints
y += 1
while (--nflags >= 0) {
out_XYAB('MX Yl7 -3.2 0 -3.2 -7 3.2z\n',
x, y);
y += 5.4
}
// } else { // grace
//--fixme: error?
|
| ︙ | | |
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
|
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
|
-
+
-
-
-
+
+
+
|
'v' + (-h).toFixed() + '"/>\n'
}
// tuplet bracket with number - the staves are not defined
function out_tubrn(x, y, dx, dy, up, str) {
var sw = str.length * 10,
h = up ? -3 : 3;
out_XYAB('<text style="font:italic 12px serif"\n\
set_font("tuplet")
x="X" y="Y" text-anchor="middle">A</text>\n',
x + dx / 2, y + dy / 2, str);
dx /= stv_g.scale
xy_str(x + dx / 2, y + dy / 2 - gene.curfont.size * .5 + 2,
str, 'c')
dx /= stv_g.scale
if (!up)
y += 6;
output += '<path class="stroke" d="m';
out_sxsy(x, ' ', y);
output += 'v' + h.toFixed(1) +
'm' + dx.toFixed(1) + ' ' + (-dy).toFixed(1) +
'v' + (-h).toFixed(1) + '"/>\n' +
|
| ︙ | | |
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
|
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
|
-
+
|
y += 4;
val = Math.ceil(val / 6)
while (--val >= 0) {
xygl(x, y, "ltr");
x += 6
}
}
function out_lped(x, y, val, defl) {
Abc.prototype.out_lped = function(x, y, val, defl) {
y += 4;
if (!defl.nost)
xygl(x, y, "ped");
if (!defl.noen)
xygl(x + val + 6, y, "pedoff")
}
function out_8va(x, y, val, defl) {
|
| ︙ | | |
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
|
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
|
+
-
+
+
|
out_XYAB('<path class="stroke" d="mX Yv-6"/>\n', x + val, y)
}
var deco_val_tb = {
arp: out_arp,
cresc: out_cresc,
dim: out_dim,
ltr: out_ltr,
lped: function(x, y, val, defl) {
lped: out_lped,
self.out_lped(x, y, val, defl)
},
"8va": out_8va,
"8vb": out_8vb,
"15ma": out_15ma,
"15mb": out_15mb
}
function out_deco_val(x, y, name, val, defl) {
|
| ︙ | | |
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
|
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
|
-
+
+
+
+
+
+
-
+
+
+
+
+
-
+
+
+
+
+
|
break
default:
p = "\ueca5"
break
}
break
}
if (elts[1])
if (elts[1]) // dot
p += '<tspan dx=".1em">\uecb7</tspan>'
return p
} // tempo_note()
// build the tempo string
function tempo_build(s) {
var i, j, bx, p, wh, dy,
w = 0,
str = []
if (s.tempo_str) // already done
return
// the music font must be defined
if (!cfmt.musicfont.used)
get_font("music")
set_font("tempo")
if (s.tempo_str1) {
str.push(s.tempo_str1)
w += strwh(s.tempo_str1)[0]
}
if (s.tempo_notes) {
dy = ' dy="-.05em"' // notes a bit higher
for (i = 0; i < s.tempo_notes.length; i++) {
p = tempo_note(s, s.tempo_notes[i])
str.push('<tspan\n\tclass="mtx"' + dy + '>' +
str.push('<tspan\nclass="' +
font_class(cfmt.musicfont) +
'" style="font-size:' +
(gene.curfont.size * 1.3).toFixed(1) + 'px"' +
dy + '>' +
p + '</tspan>')
j = p.length > 1 ? 2 : 1 // (note and optional dot)
w += j * gene.curfont.swfac
dy = ''
}
str.push('<tspan dy=".065em">=</tspan>')
w += cwidf('=')
if (s.tempo_ca) {
str.push(s.tempo_ca)
w += strwh(s.tempo_ca)[0]
j = s.tempo_ca.length + 1
}
if (s.tempo) { // with a number of beats per minute
str.push(s.tempo)
w += strwh(s.tempo.toString())[0]
} else { // with a beat as a note
p = tempo_note(s, s.new_beat)
str.push('<tspan\n\tclass="mtx" dy="-.05em">' +
str.push('<tspan\nclass="' +
font_class(cfmt.musicfont) +
'" style="font-size:' +
(gene.curfont.size * 1.3).toFixed(1) +
'px" dy="-.05em">' +
p + '</tspan>')
j = p.length > 1 ? 2 : 1
w += j * gene.curfont.swfac
dy = 'y'
}
}
if (s.tempo_str2) {
|
| ︙ | | |
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
|
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
|
-
+
+
-
+
+
+
-
+
+
+
+
-
-
+
-
+
+
+
-
-
-
+
+
+
-
-
-
-
+
+
-
-
-
-
-
-
-
+
+
-
+
+
+
+
+
+
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+
-
+
|
out_sxsy(bx - 2, '" y="', y + bh - 1)
output += '" width="' + (s.tempo_wh[0] + 2).toFixed(1) +
'" height="' + bh.toFixed(1) +
'"/>\n'
}
// don't display anymore
s.del = true
s.invis = true
} // writempo()
// update the vertical offset
function vskip(h) {
posy += h
}
// create the SVG image of the block
function svg_flush() {
if (multicol || !output || !user.img_out || posy == 0)
return
var i, font,
var head = '<svg xmlns="http://www.w3.org/2000/svg" version="1.1"\n\
head = '<svg xmlns="http://www.w3.org/2000/svg" version="1.1"\n\
xmlns:xlink="http://www.w3.org/1999/xlink"\n\
color="',
g = ''
glout()
if (cfmt.fgcolor)
head += cfmt.fgcolor + '" fill="' + cfmt.fgcolor + '"'
else
head += 'black"';
head += ' stroke-width=".7"'
if (cfmt.bgcolor)
head += ' style="background-color: ' + cfmt.bgcolor + '"';
posy *= cfmt.scale
font = get_font("music")
head += ' class="' + font_class(font) +
' tune' + tunes.length + '"\n' // tune index for play
posy *= cfmt.scale
if (user.imagesize) {
head += '\n' +
user.imagesize +
head += user.imagesize +
' viewBox="0 0 ' + img.width.toFixed(0) + ' ' +
posy.toFixed(0) + '">\n'
} else {
head += '\n\twidth="' + img.width.toFixed(0) +
head += ' width="' + img.width.toFixed(0) +
'px" height="' + posy.toFixed(0) + 'px">\n'
}
head += fulldefs
if (style || font_style || musicfont) {
head += '<style type="text/css">' + style + font_style
if (musicfont) {
if (style || font_style)
head += '<style>\n.' +
font_class(font) + // for fill color
if (musicfont.indexOf('(') > 0) {
head += '\nsvg{font:24px music}\n\
@font-face {\n\
font-family:"music";\n\
' text,tspan{fill:currentColor}' +
font_style + style +
src:' + musicfont + '}';
} else {
head += '\nsvg{font:24px '+ musicfont +'}'
}
}
head += '\n</style>\n'
}
'\n</style>\n'
defs += fulldefs
if (defs)
head += '<defs>' + defs + '\n</defs>\n'
// if %%pagescale != 1, do a global scale
// (with a container: transform scale in <svg> does not work
// the same in all browsers)
// the class is used to know that the container is global
if (cfmt.scale != 1) {
head += '<g class="g" transform="scale(' +
cfmt.scale.toFixed(2) + ')">\n';
g = '</g>\n'
}
if (psvg) // if PostScript support
psvg.ps_flush(true); // + setg(0)
// start a block if needed
if (blkdiv > 0) {
user.img_out(blkdiv == 1 ?
'<div class="nobrk">' :
'<div class="nobrk newpage">')
blkdiv = -1 // block started
}
user.img_out(head + output + g + "</svg>");
output = ""
font_style = ''
if (cfmt.fullsvg) {
if (cfmt.fullsvg && typeof document == "undefined") {
defined_glyph = {}
for (var i = 0; i < font_tb.length; i++)
for (i = 0; i < font_tb.length; i++)
font_tb[i].used = false
} else {
musicfont = '';
style = '';
fulldefs = ''
}
defs = '';
posy = 0
}
// output a part of a block of images
function blk_out() {
if (multicol || !user.img_out)
return
blk_flush()
if (user.page_format && !block.started) {
block.started = true
if (block.newpage) {
block.newpage = false;
user.img_out('<div class="nobrk newpage">')
} else {
user.img_out('<div class="nobrk">')
}
}
}
Abc.prototype.blk_out = blk_out
// output the end of a block (or tune)
// mark the end of a <div> block
function blk_flush() {
svg_flush()
if (block.started) {
if (blkdiv < 0 && (!parse.state || cfmt.splittune)) {
block.started = false;
user.img_out('</div>')
blkdiv = 0
}
}
Abc.prototype.blk_flush = blk_flush
|
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
+
|
// abc2svg - tune.js - tune generation
//
// Copyright (C) 2014-2019 Jean-Francois Moine
// Copyright (C) 2014-2020 Jean-Francois Moine
//
// This file is part of abc2svg-core.
//
// abc2svg-core is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
|
| ︙ | | |
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
-
-
+
+
+
+
|
}
}
/* -- link a ABC symbol into the current voice -- */
function sym_link(s) {
if (!s.fname)
set_ref(s)
if (!curvoice.ignore) {
parse.last_sym = s;
s.prev = curvoice.last_sym
if (curvoice.last_sym)
curvoice.last_sym.next = s
else
curvoice.sym = s;
curvoice.last_sym = s
}
s.v = curvoice.v;
s.p_v = curvoice;
s.st = curvoice.cst;
s.time = curvoice.time
if (s.dur && !s.grace)
curvoice.time += s.dur;
s.pos = curvoice.pos
if (curvoice.second)
s.second = true
if (curvoice.floating)
s.floating = true
if (curvoice.eoln) {
s.soln = true
curvoice.eoln = false
}
}
/* -- add a new symbol in a voice -- */
function sym_add(p_voice, type) {
var s = {
type:type,
dur:0
|
| ︙ | | |
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
|
102
103
104
105
106
107
108
109
110
111
112
113
114
115
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
|
s.fname = s2.fname;
s.istart = s2.istart;
s.iend = s2.iend
}
return s
}
/* -- expand a multi-rest into single rests and measure bars -- */
function mrest_expand(s) {
var p_voice, s2, next,
nb = s.nmes,
dur = s.dur / nb
/* change the multi-rest (type bar) to a single rest */
var a_dd = s.a_dd;
s.type = C.REST;
s.dur = s.dur_orig = dur;
/* add the bar(s) and rest(s) */
next = s.next;
p_voice = s.p_v;
p_voice.last_sym = s;
p_voice.time = s.time + dur;
p_voice.cst = s.st;
s2 = s
while (--nb > 0) {
s2 = sym_add(p_voice, C.BAR);
s2.bar_type = "|";
s2 = sym_add(p_voice, C.REST);
if (s.invis)
s2.invis = true;
s2.dur = s2.dur_orig = dur;
p_voice.time += dur
}
s2.next = next
if (next)
next.prev = s2;
/* copy the mrest decorations to the last rest */
s2.a_dd = a_dd
}
/* -- sort all symbols by time and vertical sequence -- */
// weight of the symbols !! depends on the symbol type !!
var w_tb = new Uint8Array([
4, // bar
1, // clef
8, // custos
0, // (free)
|
| ︙ | | |
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
|
131
132
133
134
135
136
137
138
139
140
141
142
143
144
|
-
|
function sort_all() {
var s, s2, p_voice, v, time, w, wmin, ir, multi,
prev, nb, ir2, v2, fl, new_sy,
nv = voice_tb.length,
vtb = [],
vn = [], // voice indexed by range
mrest_time = -1,
sy = cur_sy
for (v = 0; v < nv; v++)
vtb.push(voice_tb[v].sym)
// set the first symbol
ir2 = nv
|
| ︙ | | |
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
|
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
|
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
|
w = w_tb[s.type]
if (s.time < time) {
time = s.time;
wmin = w
} else if (w < wmin) {
wmin = w
}
if (s.type == C.MREST) {
if (s.nmes == 1)
mrest_expand(s)
else if (multi > 0)
mrest_time = time
}
}
}
if (wmin > 127)
break // done
/* if some multi-rest and many voices, expand */
if (time == mrest_time) {
nb = 0
for (ir = 0; ir < nv; ir++) {
v = vn[ir]
if (v == undefined)
break
s = vtb[v]
if (!s || s.time != time
|| w_tb[s.type] != wmin)
continue
if (s.type != C.MREST) {
mrest_time = -1 /* some note or rest */
break
}
if (nb == 0) {
nb = s.nmes
} else if (nb != s.nmes) {
mrest_time = -1 /* different duration */
break
}
}
if (mrest_time < 0) {
for (ir = 0; ir < nv; ir++) {
v = vn[ir]
if (v == undefined)
break
s = vtb[v]
if (s && s.type == C.MREST)
mrest_expand(s)
}
}
}
/* link the vertical sequence */
for (ir = 0; ir < nv; ir++) {
v = vn[ir]
if (v == undefined)
break
s = vtb[v]
if (!s || s.time != time
|
| ︙ | | |
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
|
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
|
+
+
+
+
+
+
-
+
+
-
+
+
+
-
+
+
+
+
-
+
-
-
+
+
-
-
-
+
+
+
-
+
-
-
|
t += d
}
}
s.dur = s.time + s.dur - t;
s.time = t
} // end set_feathered_beam()
// terminate voice cloning
if (curvoice && curvoice.clone) {
parse.istart = parse.eol
do_cloning()
}
/* if Q: from tune header, put it at start of the music */
// if Q: from tune header, put it at start of the music
// (after the staff system)
s = glovar.tempo
if (s && staves_found <= 0) { // && !s.del) { - play problem
if (s && staves_found <= 0) { // && !s.invis) { - play problem
//fixme: which play problem?
v = par_sy.top_voice;
p_voice = voice_tb[v];
if (p_voice.sym
if (p_voice.sym && p_voice.sym.type != C.TEMPO) {
&& p_voice.sym.type != C.TEMPO
&& (!p_voice.sym.next
|| p_voice.sym.next.type != C.TEMPO)) {
s = clone(s);
s.v = v;
s.p_v = p_voice;
s.st = p_voice.st;
s.time = 0;
s.prev = p_voice.sym
s.next = p_voice.sym
s.next = p_voice.sym.next
if (s.next)
s.next.prev = s;
p_voice.sym = s
s.next.prev = s
p_voice.sym.next = s
}
}
for (v = 0; v < voice_tb.length; v++) {
p_voice = voice_tb[v]
if (!sys_chg // if not %%score
&& p_voice.sls.length) { // and no end of slur
while (1) {
if (!sys_chg) { // if not %%score
delete p_voice.eoln
while (1) { // set the end of slurs
var sl = p_voice.sls.shift()
if (!sl)
break
s = sl.note.s
for (s2 = s.next; s2; s2 = s2.next) {
if (s2.bar_type && s2.bar_type[0] == ':')
break
}
if (s2) {
if (!s.sls)
s.sls = []
s.sls.push({
ty: sl.ty,
note: {s: s2}
})
} else {
syntax(1, "Lack of ending slur(s)")
}
}
}
} // not %%score
if (p_voice.ignore)
p_voice.ignore = false
for (s = p_voice.sym; s; s = s.next) {
if (s.time >= staves_found)
break
}
for ( ; s; s = s.next) {
switch (s.type) {
case C.GRACE:
|
| ︙ | | |
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
|
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
|
s.a_ly = s2.a_ly;
s2.a_ly = null
break
}
break
}
continue
case C.MREST:
if (s.next && s.next.type != C.BAR) {
syntax(1, "Lack of bar after multi-measure rest")
s2 = clone(s)
s2.type = C.BAR
s2.bar_type = '|'
s2.dur = 0
s2.time = s.next.time
s2.prev = s
s2.next = s.next
s2.next.prev = s2
s.next = s2
}
continue
}
if (s.feathered_beam)
set_feathered_beam(s)
}
}
}
/* -- duplicate the voices as required -- */
function dupl_voice() {
var p_voice, p_voice2, s, s2, g, g2, v, i,
nv = voice_tb.length
for (v = 0; v < nv; v++) {
p_voice = voice_tb[v];
p_voice2 = p_voice.clone
if (!p_voice2)
continue
p_voice.clone = null
for (s = p_voice.sym; s; s = s.next) {
//fixme: there may be other symbols before the %%staves at this same time
if (s.time >= staves_found)
break
}
p_voice2.clef = clone(p_voice.clef);
curvoice = p_voice2
for ( ; s; s = s.next) {
if (s.type == C.STAVES)
continue
s2 = clone(s)
if (s.notes) {
s2.notes = []
for (i = 0; i <= s.nhd; i++)
s2.notes.push(clone(s.notes[i]))
}
sym_link(s2)
// s2.time = s.time
if (p_voice2.second)
s2.second = true
else
delete s2.second
if (p_voice2.floating)
s2.floating = true
else
delete s2.floating
delete s2.a_ly;
g = s2.extra
if (!g)
continue
g2 = clone(g);
s2.extra = g2;
s2 = g2;
s2.v = p_voice2.v;
s2.p_v = p_voice2;
s2.st = p_voice2.st
for (g = g.next; g; g = g.next) {
g2 = clone(g)
if (g.notes) {
g2.notes = []
for (i = 0; i <= g.nhd; i++)
g2.notes.push(clone(g.notes[i]))
}
s2.next = g2;
g2.prev = s2;
s2 = g2;
s2.v = p_voice2.v;
s2.p_v = p_voice2;
s2.st = p_voice2.st
}
}
}
}
/* -- create a new staff system -- */
function new_syst(init) {
var st, v,
sy_new = {
voices: [],
staves: [],
top_voice: 0
|
| ︙ | | |
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
|
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
|
-
-
+
-
-
-
+
+
+
+
+
-
-
+
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
-
+
+
-
-
-
+
+
+
-
+
-
+
-
-
+
+
|
// update the previous system
for (v = 0; v < voice_tb.length; v++) {
if (par_sy.voices[v]) {
st = par_sy.voices[v].st
var sy_staff = par_sy.staves[st],
p_voice = voice_tb[v]
if (p_voice.staffnonote != undefined)
sy_staff.staffnonote = p_voice.staffnonote
sy_staff.staffnonote = p_voice.staffnonote
if (p_voice.staffscale)
sy_staff.staffscale = p_voice.staffscale;
}
}
for (st = 0; st < par_sy.staves.length; st++) {
sy_new.staves[st] = clone(par_sy.staves[st]);
sy_new.staves[st].flags = 0
}
par_sy.next = sy_new;
par_sy = sy_new
}
/* -- set the bar numbers -- */
// (possible hook)
Abc.prototype.set_bar_num = function() {
var s, s2, tim, bar_time, bar_num, rep_dtime,
v = cur_sy.top_voice,
wmeasure = voice_tb[v].meter.wmeasure,
var s, s2, tim, rep_tim, k, n,
bar_num = gene.nbar,
bar_tim = 0, // time of previous repeat variant
ptim = 0, // time of previous bar
wmeasure = voice_tb[cur_sy.top_voice].meter.wmeasure
bar_rep = gene.nbar
/* don't count a bar at start of line */
// don't count a bar at start of tune
for (s = tsfirst; ; s = s.ts_next) {
if (!s)
return
switch (s.type) {
case C.METER:
wmeasure = s.wmeasure
// fall thru
case C.CLEF:
case C.KEY:
case C.STBRK:
continue
case C.BAR:
if (s.bar_num) {
gene.nbar = s.bar_num /* (%%setbarnb) */
if (s.bar_num)
bar_num = s.bar_num // %%setbarnb)
break
}
if (s.text // if repeat bar
&& !cfmt.contbarnb) {
if (s.text[0] == '1') {
bar_rep = gene.nbar
} else {
gene.nbar = bar_rep; /* restart bar numbering */
s.bar_num = gene.nbar
}
}
break
}
break
}
// at start of tune, check for an anacrusis
bar_time = s.time + wmeasure
if (s.time == 0) {
for (s2 = s.ts_next; s2; s2 = s2.ts_next) {
if (s2.type == C.BAR && s2.time) {
if (s2.time < bar_time) { // if anacrusis
s = s2;
bar_time = s.time + wmeasure
}
break
for (s2 = s.ts_next; s2; s2 = s2.ts_next) {
if (s2.type == C.BAR && s2.time) {
if (s2.time < wmeasure) { // if anacrusis
s = s2
bar_tim = s.time
}
break
}
}
}
// set the measure number on the top bars
bar_num = gene.nbar
for ( ; s; s = s.ts_next) {
if (!s.seqst)
continue
switch (s.type) {
case C.METER:
bar_num += (s.time - bar_tim) / wmeasure
bar_tim = s.time
wmeasure = s.wmeasure
if (s.time < bar_time)
bar_time = s.time + wmeasure
break
case C.MREST:
bar_num += s.nmes - 1
while (s.ts_next
&& s.ts_next.type != C.BAR)
s = s.ts_next
break
case C.BAR:
if (s.invis)
break
tim = s.time
if (s.bar_num) {
bar_num = s.bar_num // (%%setbarnb)
ptim = bar_tim = tim
continue
}
if (wmeasure == 1) { // if M:none
if (s.bar_dotted)
continue
if (s.time < bar_time) { // incomplete measure
if (s.text && s.text[0] == '1') {
bar_rep = bar_num;
rep_dtime = bar_time - s.time
}
if (s.text) {
if (!cfmt.contbarnb) {
if (s.text[0] == '1')
rep_tim = bar_num
else
bar_num = rep_tim
}
break
}
/* check if any repeat bar at this time */
tim = s.time;
s2 = s
}
s.bar_num = ++bar_num
continue
}
n = bar_num + (tim - bar_tim) / wmeasure
k = n - (n | 0)
do {
if (s2.dur)
break
if (s2.type == C.BAR && s2.text) // if repeat bar
if (cfmt.checkbars
&& ((k && !s.bar_dotted && s.next)
|| (tim > ptim + wmeasure && s.prev.type != C.MREST)))
error(0, s, "Bad measure duration")
if (tim > ptim + wmeasure) { // if more than one measure
break
s2 = s2.next
} while (s2 && s2.time == tim);
if (s.bar_num)
bar_num = s.bar_num // (%%setbarnb)
else
bar_num++
if (s2 && s2.type == C.BAR && s2.text) {
if (s2.text[0] == '1') {
rep_dtime = 0;
bar_rep = bar_num
} else { // restart bar numbering
if (!cfmt.contbarnb)
bar_num = bar_rep
n |= 0
k = 0
bar_tim = tim // re-synchronize
bar_num = n
}
if (s.text) {
if (s.text[0] == '1') {
if (cfmt.contbarnb)
rep_tim = bar_tim + k * wmeasure
else
rep_tim = tim
if (!k)
s.bar_num = n
} else {
if (cfmt.contbarnb)
bar_tim = rep_tim
else
bar_tim += tim - rep_tim
n = bar_num + (tim - bar_tim) / wmeasure
if (n == (n | 0))
s.bar_num = n
}
} else {
if (k)
n -= k
s.bar_num = n
if (rep_dtime) { // [1 inside measure
if (cfmt.contbarnb)
}
if (!k)
bar_num--;
bar_time = tim + rep_dtime
break
}
}
}
s.bar_num = bar_num;
bar_time = tim + wmeasure
ptim = tim
break
}
}
}
// convert a note to ABC
function not2abc(pit, acc) {
var i,
nn = ''
// skip the bars of the other voices
while (s.ts_next
&& !s.ts_next.seqst)
s = s.ts_next
break
}
}
if (acc && acc != 3) {
if (typeof acc == "number") {
nn = ['__', '_', '', '^', '^^'][acc + 2]
} else {
i = acc[0]
if (i > 0) {
nn += '^'
} else {
nn += '_'
i = -i
}
nn += i + '/' + acc[1]
}
if (cfmt.measurenb < 0) /* if no display of measure bar */
gene.nbar = bar_num /* update in case of more music to come */
}
}
nn += ntb[(pit + 75) % 7]
for (i = pit; i >= 21; i -= 7)
nn += "'"
for (i = pit; i < 14; i += 7)
nn += ","
return nn
} // not2abc()
// note mapping
// %%map map_name note [print [note_head]] [param]*
function get_map(text) {
if (!text)
return
var i, note, notes, map, tmp, ns, ty,
a = info_split(text)
var i, note, notes, map, tmp, ns,
ty = '',
a = text.split(/\s+/)
if (a.length < 3) {
syntax(1, not_enough_p)
return
}
ns = a[1]
if (ns[0] == '*' || ns.indexOf("all") == 0) {
ns = 'all'
} else {
if (ns.indexOf("octave,") == 0 // remove the octave part
|| ns.indexOf("key,") == 0) {
ty = ns[0]
ns = ns.split(',')[1]
ns = ns.replace(/[,']+/, '').toUpperCase() //'
if (ns.indexOf("key,") == 0)
ns = ns.replace(/[,']*/, '').toUpperCase(); //'
ns = ns.replace(/[=^_]+/, '')
} else {
ty = ''
}
if (ty == 'k') {
ns = 'k' + ntb.indexOf(ns)
} else {
tmp = new scanBuf;
tmp.buffer = ns
note = parse_acc_pit(tmp)
if (!note) {
syntax(1, "Bad note in %%map")
return
}
ns = ty + abc2svg.pab40(note.pit, note.acc).toString()
tmp = new scanBuf
tmp.buffer = ns
note = parse_acc_pit(tmp)
if (!note) {
syntax(1, "Bad note in %%map")
return
}
ns = ty + not2abc(note.pit, note.acc)
}
}
notes = maps[a[0]]
if (!notes)
maps[a[0]] = notes = {}
map = notes[ns]
if (!map)
notes[ns] = map = []
// try the optional 'print' and 'heads' parameters
a.shift()
a.shift()
if (!a[2])
if (!a.length)
return
a = info_split(a.join(' '))
i = 2
if (a[2].indexOf('=') < 0) {
if (a[2][0] != '*') {
i = 0
if (a[0].indexOf('=') < 0) {
if (a[0][0] != '*') {
tmp = new scanBuf; // print
tmp.buffer = a[2];
tmp.buffer = a[0];
map[1] = parse_acc_pit(tmp)
}
if (!a[3])
if (!a[1])
return
i++
if (a[3].indexOf('=') < 0) {
map[0] = a[3].split(',') // heads
if (a[1].indexOf('=') < 0) {
map[0] = a[1].split(',') // heads
i++
}
}
for (; i < a.length; i++) {
switch (a[i]) {
case "heads=":
|
| ︙ | | |
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
|
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
|
-
+
-
+
|
}
tmp = new scanBuf;
tmp.buffer = a[i];
note = parse_acc_pit(tmp)
if (a[i - 1][1] == 'r')
map[1] = note
else
map[3] = abc2svg.pab40(note.pit, note.acc)
map[3] = note
break
case "color=":
if (!a[++i]) {
syntax(1, not_enough_p)
break
}
map[2] = a[i]
break
}
}
}
// set the transposition in the previous or first key signature
function set_transp() {
var s, transp, sndtran
if (curvoice.ckey.k_bagpipe || curvoice.ckey.k_drum)
return
if (cfmt.transp && curvoice.transp) // if %%transpose and score=
if (cfmt.transp && curvoice.shift) // if %%transpose and shift=
syntax(0, "Mix of old and new transposition syntaxes");
if (cfmt.transp != undefined
|| curvoice.transp != undefined
|| curvoice.shift != undefined)
transp = (cfmt.transp || 0) + // %%transpose
|
| ︙ | | |
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
|
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
|
-
+
|
} else {
s = curvoice.last_sym
while (1) { // set the transposition in the previous K:
if (s.type == C.KEY)
break
s = s.prev
if (!s) {
s = curvoice.key
s = curvoice.key // first key
break
}
}
}
if (transp != undefined)
s.k_transp = transp
if (sndtran != undefined)
|
| ︙ | | |
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
|
752
753
754
755
756
757
758
759
760
761
762
763
764
765
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
|
return // no change
ak = sk.k_map[(note.pit + 19) % 7]
if (ak)
an = 3 // natural
} else {
return // same accidental (in the key)
}
d = note.micro_d
if (d /* microtone */
&& a != an) { /* different accidental type */
n = note.micro_n
//fixme: double sharps/flats ?*/
//fixme: does not work in all cases (tied notes, previous accidental)
switch (an) {
case 3: // natural
if (n > d / 2) {
n -= d / 2;
note.micro_n = n;
an = a
} else {
an = -a
}
break
case 2: // double sharp
if (n > d / 2) {
note.pit += 1;
n -= d / 2
} else {
n += d / 2
}
an = a
note.micro_n = n
break
case -2: // double flat
if (n >= d / 2) {
note.pit -= 1;
n -= d / 2
} else {
n += d / 2
}
an = a
note.micro_n = n
break
}
}
note.acc = an
}
// adjust the pitches according to the transposition(s)
function pit_adj() {
var i, p_v, s, sk, g,
nv = voice_tb.length
|
| ︙ | | |
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
|
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
|
-
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
|
break
}
sk = null
}
}
} // pit_adj()
// get a transposition value as a base-40 interval
// get a abcm2ps/abcMIDI compatible transposition value as a base-40 interval
// The value may be
// - [+|-]<number of semitones>[s|f]
// - <note1>[<note2>] % <note2> default is 'c'
function get_transp(param) {
if (param[0] == '0')
return 0
if ("123456789-+".indexOf(param[0]) >= 0) { // by semi-tone
var val = parseInt(param)
if (isNaN(val) || val < -36 || val > 36) {
//fixme: no source reference...
syntax(1, "Bad transpose value")
syntax(1, errs.bad_transp)
return
}
val += 36
return (((val / 12) | 0) - 3) * 40 +
(param.slice(-1) == 'b' ?
abc2svg.ifb40 :
abc2svg.isb40)[val % 12]
}
return get_interval(param, true)
// return undefined
} // get_transp()
/* -- process a pseudo-comment (%% or I:) -- */
// (possible hook)
Abc.prototype.do_pscom = function(text) {
var h1, val, s, cmd, param, n, k, b
cmd = text.match(/(\w|-)+/)
if (!cmd)
return
cmd = cmd[0];
// ignore the command if the voice is ignored,
// but not if %%score/%%staves!
if (curvoice && curvoice.ignore) {
switch (cmd) {
case "staves":
case "score":
break
default:
return
}
}
param = text.replace(cmd, '').trim()
if (param.slice(-5) == ' lock') {
fmt_lock[cmd] = true;
param = param.slice(0, -5).trim()
} else if (fmt_lock[cmd]) {
return
}
if (cmd.slice(0, 5) == "title" && parse.state == 2)
goto_tune()
switch (cmd) {
case "center":
set_font("text")
if (parse.state >= 2) {
if (parse.state == 2)
goto_tune()
s = new_block("text");
s.text = param
s.opt = 'c'
s.font = cfmt.textfont
return
}
write_text(param, 'c')
return
case "clef":
if (parse.state >= 2) {
if (parse.state == 2)
|
| ︙ | | |
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
|
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
|
+
+
+
+
+
-
+
+
-
+
+
+
+
+
+
-
-
-
+
-
+
-
-
+
-
-
-
|
set_linebreak(param)
return
case "map":
get_map(param)
return
case "maxsysstaffsep":
if (parse.state == 3) {
val = get_unit(param)
if (isNaN(val)) {
syntax(1, errs.bad_val, "%%maxsysstaffsep")
return
}
par_sy.voices[curvoice.v].maxsep = get_unit(param)
par_sy.voices[curvoice.v].maxsep = val
return
}
break
case "multicol":
if (parse.state >= 2) {
generate(1)
if (parse.state == 2)
goto_tune()
curvoice = voice_tb[0]
s = new_block("mc_" + param)
break
}
switch (param) {
case "start":
blk_out();
multicol = {
posy: posy,
maxy: posy,
maxy: 0,
lmarg: cfmt.leftmargin,
rmarg: cfmt.rightmargin,
rmarg: cfmt.rightmargin
state: parse.state
}
break
case "new":
if (!multicol) {
syntax(1, "%%multicol new without start")
break
}
if (posy > multicol.maxy)
multicol.maxy = posy;
cfmt.leftmargin = multicol.lmarg;
cfmt.rightmargin = multicol.rmarg;
img.chg = true;
set_page();
posy = multicol.posy
posy = 0
break
case "end":
if (!multicol) {
syntax(1, "%%multicol end without start")
break
}
if (posy < multicol.maxy)
posy = multicol.maxy;
cfmt.leftmargin = multicol.lmarg;
cfmt.rightmargin = multicol.rmarg;
multicol = undefined;
blk_flush();
img.chg = true;
set_page()
break
default:
syntax(1, "Unknown keyword '$1' in %%multicol", param)
break
}
return
case "musicfont":
musicfont = param
return
case "ottava":
if (parse.state != 3) {
if (parse.state != 2)
return
goto_tune()
}
n = parseInt(param)
|
| ︙ | | |
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
|
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
|
+
+
+
+
-
+
-
|
values = param.split(/\s+/);
h1 = get_unit(values[0])
if (values[1]) {
h2 = get_unit(values[1])
if (values[2])
len = get_unit(values[2])
}
if (isNaN(h1) || isNaN(h2) || isNaN(len)) {
syntax(1, errs.bad_val, "%%sep")
return
}
}
if (h1 < 1)
h1 = 14
if (h2 < 1)
h2 = h1
if (len < 1)
len = 90
if (parse.state == 3) {
if (parse.state >= 2) {
s = new_block(cmd);
s.x = (lwidth - len) / 2 / cfmt.scale;
s.l = len / cfmt.scale;
s.sk1 = h1;
s.sk2 = h2
return
}
blk_out();
vskip(h1);
output += '<path class="stroke"\n\td="M';
out_sxsy((lwidth - len) / 2 / cfmt.scale, ' ', 0);
output += 'h' + (len / cfmt.scale).toFixed(1) + '"/>\n';
vskip(h2);
blk_flush()
return
|
| ︙ | | |
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
|
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
|
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
|
return
goto_tune()
}
s = {
type: C.STBRK,
dur:0
}
if (param[0] >= '0' && param[0] <= '9') {
s.xmx = get_unit(param)
if (param.slice(-1) == 'f')
s.stbrk_forced = true
if (param.slice(-1) == 'f') {
s.stbrk_forced = true
param = param.replace(/\sf$/, '')
}
if (param) {
val = get_unit(param)
if (isNaN(val)) {
syntax(1, errs.bad_val, "%%staffbreak")
return
}
s.xmx = val
} else {
s.xmx = 14
if (param[0] == 'f')
s.stbrk_forced = true
}
sym_link(s)
return
case "stafflines":
case "staffscale":
case "staffnonote":
set_v_param(cmd, param)
|
| ︙ | | |
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
|
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
|
+
+
+
+
+
-
+
+
-
-
+
+
+
+
+
+
+
+
+
-
-
-
+
-
+
+
+
+
+
+
-
+
-
-
-
-
+
+
+
-
+
-
+
-
+
+
-
+
-
-
-
+
-
-
+
|
} else {
get_staves(cmd, param)
}
return
case "sysstaffsep":
//--fixme: may be global
if (parse.state == 3) {
val = get_unit(param)
if (isNaN(val)) {
syntax(1, errs.bad_val, "%%sysstaffsep")
return
}
par_sy.voices[curvoice.v].sep = get_unit(param)
par_sy.voices[curvoice.v].sep = val
return
}
break
case "text":
set_font("text")
if (parse.state >= 2) {
if (parse.state == 2)
goto_tune()
s = new_block(cmd);
s.text = param
s.opt = cfmt.textoption
s.font = cfmt.textfont
return
}
write_text(param, cfmt.textoption)
return
case "transpose": // (abcm2ps compatibility)
if (cfmt.sound)
return
val = get_transp(param)
if (val == undefined) { // accept note interval
val = get_interval(param)
if (val == undefined) {
syntax(1, errs.bad_transp)
return
}
}
switch (parse.state) {
case 0:
cfmt.transp = 0
// fall thru
case 1:
case 2:
val = get_transp(param)
if (val)
cfmt.transp = (cfmt.transp || 0) + val
cfmt.transp = (cfmt.transp || 0) + val
return
}
for (s = curvoice.last_sym; s; s = s.prev) {
switch (s.type) {
case C.NOTE: // insert a key
s = clone(curvoice.okey);
s.k_old_sf = curvoice.ckey.k_sf;
sym_link(s)
break
case C.KEY:
break
default:
continue
}
break
}
do_info('V', curvoice.id + ' score=' + param)
curvoice.transp = val
set_transp()
return
case "tune":
//fixme: to do
return
case "user":
set_user(param)
return
case "voicecolor":
if (parse.state != 3) {
if (parse.state != 2)
return
goto_tune()
}
curvoice.color = param
return
case "vskip":
val = get_unit(param)
if (isNaN(val)) {
syntax(1, errs.bad_val, "%%vskip")
return
}
if (val < 0) {
syntax(1, "%%vskip cannot be negative")
return
}
if (parse.state == 3) {
if (parse.state >= 2) {
s = new_block(cmd);
s.sk = val
return
}
vskip(val);
return
case "newpage":
case "leftmargin":
case "rightmargin":
case "pagescale":
case "pagewidth":
case "printmargin":
case "scale":
case "staffwidth":
if (parse.state >= 2) {
if (parse.state == 2)
goto_tune()
s = new_block(cmd);
s.param = param
return
}
if (cmd == "newpage") {
blk_flush();
block.newpage = true;
blk_flush()
if (user.page_format)
blkdiv = 2 // start the next SVG in a new page
return
}
break
}
self.set_format(cmd, param)
}
// treat the %%beginxxx / %%endxxx sequences
// (possible hook)
Abc.prototype.do_begin_end = function(type,
opt,
text) {
var i, j, action, s
switch (type) {
case "js":
js_inject(text)
break
case "ml":
if (parse.state == 3) {
if (parse.state >= 2) {
s = new_block(type);
s.text = text
} else {
svg_flush();
blk_flush()
if (user.img_out)
user.img_out(text)
}
break
case "svg":
j = 0
while (1) {
i = text.indexOf('<style type="text/css">\n', j)
i = text.indexOf('<style', j)
if (i < 0)
break
i = text.indexOf('>', i)
j = text.indexOf('</style>', i)
if (j < 0) {
syntax(1, "No </style> in %%beginsvg sequence")
break
}
style += text.slice(i + 23, j).replace(/\s+$/, '')
style += text.slice(i + 1, j).replace(/\s+$/, '')
}
j = 0
while (1) {
i = text.indexOf('<defs>\n', j)
if (i < 0)
break
j = text.indexOf('</defs>', i)
if (j < 0) {
syntax(1, "No </defs> in %%beginsvg sequence")
break
}
defs_add(text.slice(i + 6, j))
}
break
case "text":
action = get_textopt(opt);
if (!action)
action = cfmt.textoption
if (text.indexOf('\\') >= 0) // convert the escape sequences
text = cnv_escape(text)
set_font("text")
if (parse.state >= 2) {
if (parse.state == 2)
goto_tune()
s = new_block(type);
s.text = text
s.opt = action
s.font = cfmt.textfont
break
}
write_text(text, action)
break
}
}
|
| ︙ | | |
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
|
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
|
-
+
+
+
-
+
+
+
+
|
syntax(1, "No end of voice overlay");
get_vover(vover.bar ? '|' : ')')
}
if (!voice_tb.length)
return
voice_adj();
dupl_voice();
sort_all() /* define the time / vertical sequences */
if (!tsfirst)
return
self.set_bar_num()
pit_adj()
if (info.P)
tsfirst.parts = info.P // for play
// give the parser result to the application
if (user.get_abcmodel)
user.get_abcmodel(tsfirst, voice_tb, anno_type, info)
user.get_abcmodel(tsfirst, voice_tb, abc2svg.sym_name, info)
if (user.img_out) // if SVG generation
self.output_music()
if (tsfirst) // if non void, keep tune data for upper layers
tunes.push([tsfirst, voice_tb, info, cfmt])
// if inside multicol, reset the parser
if (!in_mc)
return
voice_tb = Object.create(voice_tb)
for (v = 0; v < voice_tb.length; v++) {
p_voice = voice_tb[v];
|
| ︙ | | |
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
|
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
|
-
+
-
-
|
var s, p_voice, p_voice2, i, flags, v, vid,
st, range,
a_vf = parse_staves(parm) // array of [vid, flags]
if (!a_vf)
return
if (voice_tb.length) {
if (voice_tb.length)
voice_adj(true);
dupl_voice()
}
/* create a new staff system */
var maxtime = 0,
no_sym = true
for (v = 0; v < voice_tb.length; v++) {
p_voice = voice_tb[v]
|
| ︙ | | |
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
|
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
|
-
-
+
+
-
-
+
+
+
-
-
-
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
-
-
-
+
|
}
range = 0
for (i = 0; i < a_vf.length; i++) {
vid = a_vf[i][0];
p_voice = new_voice(vid);
p_voice.time = maxtime;
v = p_voice.v
if (i == 0)
par_sy.top_voice = p_voice.v
a_vf[i][0] = p_voice;
// if the voice is already here, clone it
if (par_sy.voices[v]) {
// set the range and add the overlay voices
while (1) {
par_sy.voices[v] = {}
p_voice2 = clone(p_voice);
// p_voice2.id += "_c" // for tests
par_sy.voices[voice_tb.length] = clone(par_sy.voices[v]);
par_sy.voices[v].range = range++
v = voice_tb.length;
p_voice2.v = v;
p_voice2.sym = p_voice2.last_sym = null;
p_voice2.time = maxtime;
voice_tb.push(p_voice2)
delete p_voice2.clone
while (p_voice.clone)
p_voice = p_voice.clone;
p_voice.clone = p_voice2;
p_voice = p_voice2
p_voice = p_voice.voice_down
if (!p_voice)
break
v = p_voice.v
} else {
par_sy.voices[v] = {}
}
a_vf[i][0] = p_voice;
par_sy.voices[v].range = range++
}
par_sy.top_voice = a_vf[0][0].v
/* change the behavior from %%staves to %%score */
if (cmd[1] == 't') { /* if %%staves */
for (i = 0; i < a_vf.length; i++) {
flags = a_vf[i][1]
if (!(flags & (OPEN_BRACE | OPEN_BRACE2)))
continue
|
| ︙ | | |
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
|
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
|
-
+
|
if (flags & FL_VOICE) {
p_voice.floating = true;
p_voice.second = true
} else {
st++;
if (!par_sy.staves[st]) {
par_sy.staves[st] = {
stafflines: '|||||',
stafflines: p_voice.stafflines || "|||||",
staffscale: 1
}
}
par_sy.staves[st].flags = 0
}
v = p_voice.v;
p_voice.st = p_voice.cst =
|
| ︙ | | |
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
|
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
|
-
+
-
-
+
+
+
+
+
+
+
+
+
+
|
if (cmd[1] == 'c') { /* if %%score */
for (st = 0; st < nstaff; st++)
par_sy.staves[st].flags ^= STOP_BAR
}
for (v = 0; v < voice_tb.length; v++) {
p_voice = voice_tb[v]
if (!par_sy.voices[v]) {
if (!par_sy.voices[v])
p_voice.ignore = true
continue
}
// set the staff of the overlay voices
p_voice2 = p_voice.voice_down
while (p_voice2) {
i = p_voice2.v
p_voice2.st = p_voice2.cst =
par_sy.voices[i].st = st
p_voice2 = p_voice2.voice_down
}
par_sy.voices[v].second = p_voice.second;
st = p_voice.st
if (st > 0 && !p_voice.norepbra
&& !(par_sy.staves[st - 1].flags & STOP_BAR))
p_voice.norepbra = true
}
|
| ︙ | | |
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
|
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
|
+
+
-
-
+
|
}
p_voice = clone(curvoice);
p_voice.v = voice_tb.length;
p_voice.id = id;
p_voice.sym = p_voice.last_sym = null;
p_voice.key = clone(curvoice.key)
p_voice.sls = []
delete p_voice.nm
delete p_voice.snm
delete p_voice.new_name
delete p_voice.lyric_restart
delete p_voice.lyric_cont
delete p_voice.ly_a_h;
delete p_voice.sym_restart
delete p_voice.sym_cont
delete p_voice.have_ly
delete p_voice.tie_s
voice_tb.push(p_voice)
return p_voice
} // clone_voice()
/* -- get a voice overlay -- */
function get_vover(type) {
var p_voice2, p_voice3, range, s, time, v, v2, v3,
line = parse.line
/* treat the end of overlay */
if (curvoice.ignore)
return
if (type == '|'
|| type == ')') {
if (!curvoice.last_note) {
syntax(1, errs.nonote_vo)
return
}
curvoice.last_note.beam_end = true
if (!vover) {
syntax(1, "Erroneous end of voice overlay")
return
}
if (curvoice.time != vover.p_voice.time) {
syntax(1, "Wrong duration in voice overlay");
if (curvoice.time > vover.p_voice.time)
vover.p_voice.time = curvoice.time
}
curvoice.acc = [] // no accidental anymore
curvoice = vover.p_voice;
vover = null
return
}
/* treat the full overlay start */
if (type == '(') {
|
| ︙ | | |
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
|
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
|
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
+
|
p_voice2.time = 0;
p_voice2.second = true;
v2 = p_voice2.v;
par_sy.voices[v2] = {
st: curvoice.st,
second: true
}
var f_clone = curvoice.clone != undefined ? 1 : 0;
range = par_sy.voices[curvoice.v].range
for (v = 0; v < par_sy.voices.length; v++) {
if (par_sy.voices[v]
&& par_sy.voices[v].range > range)
par_sy.voices[v].range += f_clone + 1
par_sy.voices[v].range++
}
par_sy.voices[v2].range = range + 1
if (f_clone) {
p_voice3 = clone_voice(p_voice2.id + 'c');
p_voice3.second = true;
v3 = p_voice3.v;
par_sy.voices[v3] = {
second: true,
range: range + 2
}
p_voice2.clone = p_voice3
}
}
p_voice2.ulen = curvoice.ulen
p_voice2.dur_fact = curvoice.dur_fact
if (curvoice.uscale)
p_voice2.uscale = curvoice.uscale
p_voice2.acc = [] // no accidental
if (!vover) { /* first '&' in a measure */
vover = {
bar: true,
p_voice: curvoice
}
time = p_voice2.time
|
| ︙ | | |
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
|
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
|
-
-
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
}
}
// check if a clef, key or time signature may go at start of the current voice
function is_voice_sig() {
var s
if (!curvoice.sym)
return true // new voice (may appear in the middle of a tune)
// if (!curvoice.sym)
// return true // new voice (may appear in the middle of a tune)
if (curvoice.time != 0)
return false
for (s = curvoice.last_sym; s; s = s.prev)
if (w_tb[s.type] != 0)
return false
return true
}
// treat a clef found in the tune body
function get_clef(s) {
var s2, s3
if (is_voice_sig()) {
curvoice.clef = s
return
}
// clef change
sym_link(s);
s.clef_small = true
// move the clef before a (not right repeat) bar
var s2 = s.prev
if (s2 && s2.type == C.BAR
&& s2.bar_type[0] != ':') {
s.next = s2
s.prev = s2.prev
if (s.prev)
s.prev.next = s
s2.prev = s
s2.next = null
curvoice.last_sym = s2
if (s.soln) {
delete s.soln
curvoice.eoln = true
}
}
}
// treat K: (kp = key signature + parameters)
function get_key(parm) {
var v, p_voice, s, transp, sndtran,
// [s_key, a] = new_key(parm) // KO with nodejs
a = new_key(parm),
|
| ︙ | | |
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
|
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
|
-
+
|
parse.state = 2; // in tune header after K:
return
case 2: // K: at start of tune body
goto_tune(true)
break
}
if (a.length)
set_kv_parm(a);
set_kv_parm(a)
if (!curvoice.ckey.k_bagpipe && !curvoice.ckey.k_drum
&& (cfmt.transp != undefined
|| curvoice.transp != undefined
|| curvoice.shift != undefined))
transp = (cfmt.transp || 0) +
(curvoice.transp || 0) +
|
| ︙ | | |
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
|
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
|
-
-
+
+
+
|
vol: 0
},
scale: 1,
// st: 0,
// cst: 0,
ulen: glovar.ulen,
dur_fact: 1,
key: clone(parse.ckey), // key at start of tune (parse) / line (gene)
ckey: clone(parse.ckey), // current key (parse)
key: clone(parse.ckey), // key at start of tune (parse / gene)
ckey: clone(parse.ckey), // current key (parse / gene)
okey: clone(parse.ckey), // key without transposition (parse)
meter: clone(glovar.meter),
wmeasure: glovar.meter.wmeasure,
staffnonote: 1,
clef: {
type: C.CLEF,
clef_auto: true,
clef_type: "a", // auto
time: 0
},
acc: [], // accidentals of the measure (parse)
|
| ︙ | | |
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
|
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
|
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
+
-
-
+
-
-
+
+
-
+
-
-
-
-
+
+
-
-
+
+
-
-
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
+
-
-
-
|
new_syst(true);
staves_found = -1;
gene = {}
a_de = [] // remove old decorations
}
// treat V: with many voices
function do_cloning(vs) {
var i, eol,
file = parse.file,
start = parse.eol + 1, // next line after V:
bol = start
function do_cloning() {
var i,
clone = curvoice.clone,
vs = clone.vs,
a = clone.a,
bol = clone.bol,
eol = parse.istart,
// search the end of the music to be cloned
while (1) {
eol = file.indexOf('\n', bol)
parse_sav = parse,
if (eol < 0) {
eol = 0
file = parse.file
break
}
delete curvoice.clone
// stop on comment, or information field
if (file[eol - 1] == '[') // if stop on [V:xx]
if (/%.*|\n.*|.:.|\[.:/.test(file.slice(eol + 1, eol + 4)))
break
bol = eol + 1
}
eol--
// insert the music sequence in each voice
include++;
tosvg(parse.fname, file, start, eol) // first voice
for (i = 0; i < vs.length; i++) {
parse = Object.create(parse_sav) // create a new parse context
parse.line = Object.create(parse_sav.line)
get_voice(vs[i]);
tosvg(parse.fname, file, start, eol)
get_voice(vs[i], a)
tosvg(parse.fname, file, bol, eol)
}
include--
parse = parse_sav // restore the parse context
}
// treat a 'V:' info
function get_voice(parm) {
var v, vs,
a = info_split(parm),
vid = a.shift()
if (!vid)
return // empty V:
// if end of sequence with many voices, load the other voices
if (curvoice && curvoice.clone)
do_cloning()
if (vid.indexOf(',') > 0) { // if many voices
vs = vid.split(',');
vid = vs.shift()
}
if (vid.indexOf(',') > 0) // if many voices
vs = vid.split(',')
else
vs = [vid]
if (parse.state < 2) {
if (a.length)
memo_kv_parm(vid, a)
if (vid != '*' && parse.state == 1)
curvoice = new_voice(vid)
if (parse.state < 2) { // memorize the voice parameters
while (1) {
vid = vs.shift()
if (!vid)
break
if (a.length)
memo_kv_parm(vid, a)
if (vid != '*' && parse.state == 1)
curvoice = new_voice(vid)
}
return
}
if (vid == '*') {
syntax(1, "Cannot have V:* in tune body")
return
}
curvoice = new_voice(vid);
curvoice = new_voice(vs[0])
// if many voice, memorize the start of sequence
if (vs.length > 1) {
vs.shift()
curvoice.clone = {
vs: vs,
a: a,
bol: parse.iend
}
if (parse.file[curvoice.clone.bol - 1] != ']')
curvoice.clone.bol++ // start of new line
}
set_kv_parm(a)
if (parse.state == 2) // if first voice
goto_tune();
set_transp();
v = curvoice.v
if (curvoice.new) { // if new voice
delete curvoice.new
if (staves_found < 0) { // if no %%score/%%staves
curvoice.st = curvoice.cst = ++nstaff;
par_sy.nstaff = nstaff;
par_sy.voices[v] = {
st: nstaff,
range: v
}
par_sy.staves[nstaff] = {
stafflines: curvoice.stafflines || "|||||",
staffscale: 1
}
}
if (!par_sy.voices[v]) {
// if (cfmt.alignbars)
// syntax(1, "V: does not work with %%alignbars")
if (staves_found >= 0)
curvoice.ignore = true
}
}
if (!curvoice.filtered
&& !curvoice.ignore
&& par_sy.voices[v]
&& (parse.voice_opts
|| parse.tune_v_opts)) {
curvoice.filtered = true;
voice_filter()
}
if (vs)
do_cloning(vs)
}
// change state from 'tune header after K:' to 'in tune body'
// curvoice is defined when called from get_voice()
function goto_tune(is_K) {
var v, p_voice,
s = {
|
| ︙ | | |
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
|
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
|
-
+
|
// nstaff = 0;
curvoice.default = true
} else if (!curvoice) {
curvoice = voice_tb[staves_found < 0 ? 0 : par_sy.top_voice]
}
if (!curvoice.init && !is_K) {
set_kv_parm([]);
set_kv_parm([])
set_transp()
}
// update some voice parameters
for (v = 0; v < voice_tb.length; v++) {
p_voice = voice_tb[v];
p_voice.ulen = glovar.ulen
|
| ︙ | | |
| ︙ | | |
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
-
+
|
Layer: 0 1 "Back" 1
Layer: 1 0 "Fore" 0
XUID: [1021 296 1430826605 13506888]
OS2Version: 0
OS2_WeightWidthSlopeOnly: 0
OS2_UseTypoMetrics: 0
CreationTime: 1433498007
ModificationTime: 1572276737
ModificationTime: 1596553937
PfmFamily: 17
TTFWeight: 400
TTFWidth: 5
LineGap: 92
VLineGap: 92
Panose: 2 0 5 3 0 0 0 0 0 0
OS2TypoAscent: 0
|
| ︙ | | |
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
-
+
-
+
|
Encoding: Custom
Compacted: 1
UnicodeInterp: none
NameList: Adobe Glyph List
DisplaySize: -96
AntiAlias: 1
FitToEm: 1
WinInfo: 128 8 2
WinInfo: 64 8 2
BeginPrivate: 0
EndPrivate
TeXData: 1 0 0 346030 173015 115343 0 1048576 115343 783286 444596 497025 792723 393216 433062 380633 303038 157286 324010 404750 52429 2506097 1059062 262144
BeginChars: 143 143
BeginChars: 142 142
StartChar: .nodef
Encoding: 0 0 0
Width: 400
Flags: M
LayerCount: 2
Fore
|
| ︙ | | |
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
|
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+
-
+
-
+
-
+
|
0 193 5 228 18 269 c 0
42 335 53 385 53 419 c 0
53 463 35 499 0 515 c 9
EndSplineSet
Validated: 1
EndChar
StartChar: uniE022
Encoding: 3 57378 3
Width: 330
Flags: MW
LayerCount: 2
Fore
SplineSet
-80 20 m 5
410 20 l 5
410 -20 l 5
-80 -20 l 5
-80 20 l 5
EndSplineSet
Validated: 1
EndChar
StartChar: uniE023
Encoding: 4 57379 4
Width: 531
Flags: MW
LayerCount: 2
Fore
SplineSet
-80 20 m 1
610 20 l 5
610 -20 l 1
-80 -20 l 1
-80 20 l 1
EndSplineSet
Validated: 1
EndChar
StartChar: uniE024
Encoding: 5 57380 5
Width: 210
Flags: HMW
LayerCount: 2
Fore
SplineSet
-80 20 m 1
290 20 l 1
290 -20 l 1
-80 -20 l 1
-80 20 l 1
EndSplineSet
Validated: 1
EndChar
StartChar: uniE030
Encoding: 6 57392 6
Encoding: 3 57392 3
Width: 35
Flags: HMW
LayerCount: 2
Fore
SplineSet
0 1000 m 5
35 1000 l 5
35 0 l 5
0 0 l 5
0 1000 l 5
EndSplineSet
Validated: 1
EndChar
StartChar: uniE038
Encoding: 7 57400 7
Encoding: 4 57400 4
Width: 35
Flags: HMW
LayerCount: 2
Fore
SplineSet
0 1000 m 1
35 1000 l 1
35 500 l 1
0 500 l 1
0 1000 l 1
EndSplineSet
Validated: 1
EndChar
StartChar: uniE039
Encoding: 8 57401 8
Encoding: 5 57401 5
Width: 35
Flags: HMW
LayerCount: 2
Fore
SplineSet
0 1100 m 1
35 1110 l 5
35 760 l 1
0 760 l 1
0 1100 l 1
EndSplineSet
Validated: 1
EndChar
StartChar: uniE043
Encoding: 9 57411 9
Encoding: 6 57411 6
Width: 100
Flags: MW
LayerCount: 2
Fore
SplineSet
50 570 m 3
22 570 0 592 0 620 c 3
0 648 22 670 50 670 c 3
78 670 100 648 100 620 c 3
100 592 78 570 50 570 c 3
50 320 m 7
22 320 0 342 0 370 c 7
0 398 22 420 50 420 c 7
78 420 100 398 100 370 c 7
100 342 78 320 50 320 c 7
EndSplineSet
Validated: 1
EndChar
StartChar: uniE045
Encoding: 10 57413 10
Encoding: 7 57413 7
Width: 1059
Flags: HMW
LayerCount: 2
Fore
SplineSet
590 0 m 24
590 160 l 24
|
| ︙ | | |
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
|
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
|
-
+
|
470 60 370 0 220 0 c 0
147 0 73 0 0 0 c 0
EndSplineSet
Validated: 1
EndChar
StartChar: uniE046
Encoding: 11 57414 11
Encoding: 8 57414 8
Width: 1061
Flags: HMW
LayerCount: 2
Fore
SplineSet
770 0 m 0
636 0 550 70 550 210 c 0
|
| ︙ | | |
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
|
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
|
-
+
|
470 60 370 0 220 0 c 0
147 0 73 0 0 0 c 0
EndSplineSet
Validated: 1
EndChar
StartChar: uniE047
Encoding: 12 57415 12
Encoding: 9 57415 9
Width: 480
Flags: HMW
LayerCount: 2
Fore
SplineSet
398 338 m 3
376 338 358 356 358 378 c 3
|
| ︙ | | |
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
|
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
|
-
+
|
328 5 299 2 271 2 c 0
203 2 167 51 167 91 c 0
EndSplineSet
Validated: 1
EndChar
StartChar: uniE048
Encoding: 13 57416 13
Encoding: 10 57416 10
Width: 862
Flags: MW
LayerCount: 2
Fore
SplineSet
472 596 m 1
512 596 l 1
|
| ︙ | | |
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
|
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
|
-
+
|
412 409 364 361 360 216 c 1
472 216 l 1
EndSplineSet
Validated: 1
EndChar
StartChar: uniE050
Encoding: 14 57424 14
Encoding: 11 57424 11
Width: 779
Flags: HMW
LayerCount: 2
Fore
SplineSet
364 851 m 0
359 812 357 782 357 751 c 0
|
| ︙ | | |
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
|
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
|
-
+
|
387 -222 397 -221 408 -220 c 0
375 138 l 1
EndSplineSet
Validated: 1
EndChar
StartChar: uniE05C
Encoding: 15 57436 15
Encoding: 12 57436 12
Width: 722
Flags: MW
LayerCount: 2
Fore
SplineSet
478 -480 m 0
567 -480 614 -375 614 -286 c 0
|
| ︙ | | |
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
|
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
|
-
+
|
0 -514 l 1
0 510 l 1
EndSplineSet
Validated: 1
EndChar
StartChar: uniE062
Encoding: 16 57442 16
Encoding: 13 57442 13
Width: 703
Flags: HMW
LayerCount: 2
Fore
SplineSet
19 29 m 0
19 161 125 255 261 255 c 0
|
| ︙ | | |
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
|
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
|
-
+
|
681 174 702 153 702 127 c 0
702 94 682 72 655 72 c 0
EndSplineSet
Validated: 1
EndChar
StartChar: uniE069
Encoding: 17 57449 17
Encoding: 14 57449 14
Width: 470
Flags: W
VStem: 0 150<-250 250> 220 150<-250 250>
LayerCount: 2
Fore
SplineSet
220 250 m 1
|
| ︙ | | |
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
|
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
|
-
+
|
0 -250 l 1
0 250 l 1
EndSplineSet
Validated: 1
EndChar
StartChar: uniE07A
Encoding: 18 57466 18
Encoding: 15 57466 15
Width: 779
Flags: MW
LayerCount: 2
Fore
SplineSet
329 117 m 1
329 117 348 -79 354 -170 c 1
|
| ︙ | | |
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
|
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
|
-
+
|
442 749 433 790 401 820 c 1
331 792 299 728 290 658 c 0
EndSplineSet
Validated: 1
EndChar
StartChar: uniE07B
Encoding: 19 57467 19
Encoding: 16 57467 16
Width: 782
Flags: MW
LayerCount: 2
Fore
SplineSet
382 -384 m 0
453 -384 491 -300 491 -229 c 0
|
| ︙ | | |
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
|
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
|
-
+
|
0 -411 l 1
0 408 l 1
EndSplineSet
Validated: 1
EndChar
StartChar: uniE07C
Encoding: 20 57468 20
Encoding: 17 57468 17
Width: 807
Flags: MW
LayerCount: 2
Fore
SplineSet
15 33 m 0
15 139 104 204 209 204 c 0
|
| ︙ | | |
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
|
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
|
-
+
|
545 139 562 123 562 102 c 0
562 76 546 58 524 58 c 0
EndSplineSet
Validated: 1
EndChar
StartChar: uniE07D
Encoding: 21 57469 21
Encoding: 18 57469 18
Width: 200
Flags: HMW
LayerCount: 2
Fore
SplineSet
80 119 m 1
55 105 45 90 45 70 c 0
|
| ︙ | | |
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
|
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
|
-
+
-
+
|
164 110 180 90 180 70 c 0
180 27 140 0 90 0 c 0
EndSplineSet
Validated: 1
EndChar
StartChar: uniE080
Encoding: 22 57472 22
Encoding: 19 57472 19
Width: 430
Flags: HMW
LayerCount: 2
Fore
SplineSet
138 0 m 1
138 -130 168 -218 215 -218 c 1
260 -218 292 -130 292 0 c 1
292 130 268 218 215 218 c 1
165 218 138 130 138 0 c 1
0 3 m 1
0 140 95 250 215 250 c 1
335 250 430 140 430 0 c 1
430 -140 335 -250 215 -250 c 1
95 -250 0 -140 0 3 c 1
EndSplineSet
Validated: 1
EndChar
StartChar: uniE081
Encoding: 23 57473 23
Encoding: 20 57473 20
Width: 290
Flags: HMW
LayerCount: 2
Fore
SplineSet
0 0 m 25
100 250 l 25
|
| ︙ | | |
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
|
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
|
-
+
|
115 100 l 29
0 0 l 25
EndSplineSet
Validated: 1
EndChar
StartChar: uniE082
Encoding: 24 57474 24
Encoding: 21 57474 21
Width: 400
Flags: HMW
HStem: -250 500
VStem: 0 400
LayerCount: 2
Fore
SplineSet
|
| ︙ | | |
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
|
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
|
-
+
|
28 25 0 60 0 128 c 0
0 213 102 250 199 250 c 0
EndSplineSet
Validated: 1
EndChar
StartChar: uniE083
Encoding: 25 57475 25
Encoding: 22 57475 22
Width: 380
Flags: HMW
HStem: -250 500
LayerCount: 2
Fore
SplineSet
102 170 m 1
|
| ︙ | | |
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
|
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
|
-
+
|
252 177 223 213 175 213 c 0
131 213 109 193 102 170 c 1
EndSplineSet
Validated: 1
EndChar
StartChar: uniE084
Encoding: 26 57476 26
Encoding: 23 57476 23
Width: 400
Flags: HMW
HStem: -250 500
VStem: 0 400
LayerCount: 2
Fore
SplineSet
|
| ︙ | | |
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
|
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
|
-
+
|
325 -160 l 5
325 -209 l 5
EndSplineSet
Validated: 1
EndChar
StartChar: uniE085
Encoding: 27 57477 27
Encoding: 24 57477 24
Width: 400
Flags: HMW
HStem: -250 500
LayerCount: 2
Fore
SplineSet
18 -95 m 0
|
| ︙ | | |
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
|
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
|
-
+
|
25 -217 0 -176 0 -152 c 0
0 -135 3 -113 18 -95 c 0
EndSplineSet
Validated: 1
EndChar
StartChar: uniE086
Encoding: 28 57478 28
Encoding: 25 57478 25
Width: 385
Flags: HMW
HStem: -250 500
LayerCount: 2
Fore
SplineSet
200 -210 m 0
|
| ︙ | | |
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
|
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
|
-
+
|
1 133 74 250 200 250 c 0
257 250 298 244 340 205 c 0
EndSplineSet
Validated: 1
EndChar
StartChar: uniE087
Encoding: 29 57479 29
Encoding: 26 57479 26
Width: 400
Flags: HMW
HStem: -250 500
LayerCount: 2
Fore
SplineSet
97 161 m 0
|
| ︙ | | |
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
|
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
|
-
+
|
305 125 280 121 268 121 c 0
194 121 173 161 97 161 c 0
EndSplineSet
Validated: 1
EndChar
StartChar: uniE088
Encoding: 30 57480 30
Encoding: 27 57480 27
Width: 400
Flags: HMW
HStem: -250 500
LayerCount: 2
Fore
SplineSet
154 -42 m 1
|
| ︙ | | |
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
|
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
|
-
+
|
93 -250 0 -194 0 -130 c 0
0 -77 50 -44 108 -16 c 1
EndSplineSet
Validated: 1
EndChar
StartChar: uniE089
Encoding: 31 57481 31
Encoding: 28 57481 28
Width: 385
Flags: HMW
HStem: -250 500
LayerCount: 2
Fore
SplineSet
185 210 m 0
|
| ︙ | | |
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
|
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
|
-
+
|
384 -133 311 -250 185 -250 c 0
128 -250 87 -244 45 -205 c 0
EndSplineSet
Validated: 1
EndChar
StartChar: uniE08A
Encoding: 32 57482 32
Encoding: 29 57482 29
Width: 409
Flags: HMW
LayerCount: 2
Fore
SplineSet
303 164 m 1
311 163 315 162 321 161 c 1
|
| ︙ | | |
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
|
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
|
-
+
|
244 130 265 164 302 164 c 2
303 164 l 1
EndSplineSet
Validated: 1
EndChar
StartChar: uniE08B
Encoding: 33 57483 33
Encoding: 30 57483 30
Width: 408
Flags: MW
LayerCount: 2
Fore
SplineSet
303 164 m 1
311 163 315 162 321 161 c 1
|
| ︙ | | |
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
|
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
|
-
+
|
119 -58 126 -133 158 -175 c 0
165 -184 172 -191 180 -197 c 1
EndSplineSet
Validated: 1
EndChar
StartChar: uniE08C
Encoding: 34 57484 34
Encoding: 31 57484 31
Width: 500
Flags: HMW
HStem: -250 500
LayerCount: 2
Fore
SplineSet
0 35 m 25
|
| ︙ | | |
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
|
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
|
-
+
-
+
-
+
|
0 -35 l 25
0 35 l 25
EndSplineSet
Validated: 1
EndChar
StartChar: uniE094
Encoding: 35 57492 35
Encoding: 32 57492 32
Width: 260
Flags: MW
HStem: -250 500
LayerCount: 2
Fore
SplineSet
220 -490 m 0
228 -500 208 -509 200 -500 c 4
105 -388 20 -171 20 0 c 0
20 170 105 388 200 500 c 0
211 513 231 503 220 490 c 0
136 388 90 170 90 0 c 0
90 -169 138 -388 220 -490 c 0
EndSplineSet
Validated: 1
EndChar
StartChar: uniE095
Encoding: 36 57493 36
Encoding: 33 57493 33
Width: 260
Flags: HMW
LayerCount: 2
Fore
SplineSet
20 -490 m 0
102 -388 150 -169 150 0 c 0
150 170 104 388 20 490 c 0
9 503 29 513 40 500 c 0
135 388 220 170 220 0 c 0
220 -171 135 -388 40 -500 c 0
32 -509 12 -500 20 -490 c 0
EndSplineSet
Validated: 1
EndChar
StartChar: uniE0A0
Encoding: 37 57504 37
Encoding: 34 57504 34
Width: 619
Flags: HMW
LayerCount: 2
Fore
SplineSet
424 -32 m 0
424 38 361 99 280 99 c 0
|
| ︙ | | |
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
|
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
|
-
+
|
87 85 176 130 312 130 c 0
448 130 537 80 537 0 c 0
EndSplineSet
Validated: 1
EndChar
StartChar: uniE0A1
Encoding: 38 57505 38
Encoding: 35 57505 35
Width: 530
Flags: HMW
LayerCount: 2
Fore
SplineSet
30 65 m 25
30 -65 l 25
|
| ︙ | | |
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
|
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
|
-
+
-
+
|
0 -220 l 25
0 220 l 29
EndSplineSet
Validated: 1
EndChar
StartChar: uniE0A2
Encoding: 39 57506 39
Encoding: 36 57506 36
Width: 450
Flags: HMW
LayerCount: 2
Fore
SplineSet
337 -30 m 4
337 40 264 101 193 101 c 4
154 101 109 75 109 31 c 4
109 -40 186 -97 257 -97 c 4
298 -97 337 -75 337 -30 c 4
450 0 m 4
450 -70 361 -129 225 -129 c 4
89 -129 0 -70 0 0 c 4
0 70 89 129 225 129 c 4
361 129 450 70 450 0 c 4
EndSplineSet
Validated: 1
EndChar
StartChar: uniE0A3
Encoding: 40 57507 40
Encoding: 37 57507 37
Width: 329
Flags: MW
LayerCount: 2
Fore
SplineSet
292 68 m 4
283 84 264 91 242 91 c 4
|
| ︙ | | |
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
|
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
|
-
+
-
+
|
0 70 105 148 198 148 c 4
245 148 288 128 313 81 c 4
EndSplineSet
Validated: 1
EndChar
StartChar: uniE0A4
Encoding: 41 57508 41
Encoding: 38 57508 38
Width: 320
Flags: HMW
LayerCount: 2
Fore
SplineSet
320 40 m 4
320 -51 231 -135 110 -135 c 4
40 -135 0 -90 0 -40 c 4
0 50 90 135 210 135 c 4
280 135 320 90 320 40 c 4
EndSplineSet
Validated: 1
EndChar
StartChar: uniE0A9
Encoding: 42 57513 42
Encoding: 39 57513 39
Width: 330
Flags: HMW
LayerCount: 2
Fore
SplineSet
-2 113 m 1
25 145 l 1
|
| ︙ | | |
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
|
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
|
-
+
|
132 -0 l 1
-2 113 l 1
EndSplineSet
Validated: 1
EndChar
StartChar: uniE0B3
Encoding: 43 57523 43
Encoding: 40 57523 40
Width: 300
Flags: HMW
LayerCount: 2
Fore
SplineSet
150 -18 m 1
79 -90 l 1
|
| ︙ | | |
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
|
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
|
-
+
-
+
-
+
-
+
-
+
-
+
|
300 -83 233 -150 150 -150 c 24
67 -150 0 -83 0 0 c 24
EndSplineSet
Validated: 1
EndChar
StartChar: uniE101
Encoding: 44 57601 44
Encoding: 41 57601 41
Width: 560
Flags: W
LayerCount: 2
Fore
SplineSet
0 -250 m 5
440 250 l 5
560 250 l 5
119 -250 l 5
0 -250 l 5
EndSplineSet
Validated: 1
EndChar
StartChar: uniE1B9
Encoding: 45 57785 45
Encoding: 42 57785 42
Width: 330
Flags: W
HStem: -140 280
VStem: 0 330
LayerCount: 2
Fore
SplineSet
0 0 m 1
165 140 l 1
330 0 l 1
165 -140 l 1
0 0 l 1
EndSplineSet
Validated: 1
EndChar
StartChar: uniE1BB
Encoding: 46 57787 46
Encoding: 43 57787 43
Width: 330
Flags: W
HStem: -140 280
VStem: 0 330
LayerCount: 2
Fore
SplineSet
0 -140 m 29
165 140 l 25
330 -140 l 29
0 -140 l 29
EndSplineSet
Validated: 1
EndChar
StartChar: uniE1E7
Encoding: 47 57831 47
Encoding: 44 57831 44
Width: 100
Flags: MW
LayerCount: 2
Fore
SplineSet
50 -50 m 3
22 -50 0 -28 0 0 c 3
0 28 22 50 50 50 c 3
78 50 100 28 100 0 c 3
100 -28 78 -50 50 -50 c 3
EndSplineSet
Validated: 1
EndChar
StartChar: uniE1F2
Encoding: 48 57842 48
Encoding: 45 57842 45
Width: 320
Flags: HMW
LayerCount: 2
Fore
SplineSet
0 680 m 1
320 680 l 1
320 40 l 2
320 -51 231 -135 110 -135 c 0
40 -135 0 -90 0 -40 c 0
0 50 90 135 210 135 c 0
244 135 271 124 290 107 c 1
290 560 l 1
0 560 l 1
0 680 l 1
EndSplineSet
Validated: 1
EndChar
StartChar: uniE1F4
Encoding: 49 57844 49
Encoding: 46 57844 46
Width: 320
Flags: HMW
LayerCount: 2
Fore
SplineSet
0 680 m 1
320 680 l 1
|
| ︙ | | |
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
|
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
|
-
+
-
+
-
+
-
+
-
+
|
0 560 l 1
0 680 l 1
EndSplineSet
Validated: 1
EndChar
StartChar: uniE1F7
Encoding: 50 57847 50
Encoding: 47 57847 47
Width: 320
Flags: HMW
LayerCount: 2
Fore
SplineSet
0 680 m 25
320 680 l 29
320 560 l 25
0 560 l 25
0 680 l 25
EndSplineSet
Validated: 1
EndChar
StartChar: uniE1F9
Encoding: 51 57849 51
Encoding: 48 57849 48
Width: 320
Flags: HMW
LayerCount: 2
Fore
SplineSet
0 500 m 25
320 500 l 25
320 380 l 25
0 380 l 29
0 500 l 25
0 680 m 25
320 680 l 25
320 560 l 25
0 560 l 25
0 680 l 25
EndSplineSet
Validated: 1
EndChar
StartChar: uniE1FC
Encoding: 52 57852 52
Encoding: 49 57852 49
Width: 100
Flags: HMW
LayerCount: 2
Fore
SplineSet
50 -38 m 7
22 -38 0 -16 0 12 c 7
0 40 22 62 50 62 c 7
78 62 100 40 100 12 c 7
100 -16 78 -38 50 -38 c 7
EndSplineSet
Validated: 1
EndChar
StartChar: uniE1FE
Encoding: 53 57854 53
Encoding: 50 57854 50
Width: 310
Flags: HMW
LayerCount: 2
Fore
SplineSet
0 960 m 29
310 960 l 29
310 930 l 29
30 930 l 29
30 770 l 29
0 770 l 29
0 960 l 29
EndSplineSet
Validated: 1
EndChar
StartChar: uniE1FF
Encoding: 54 57855 54
Encoding: 51 57855 51
Width: 230
Flags: HMW
LayerCount: 2
Fore
SplineSet
80 810 m 0
27 810 0 833 0 864 c 0
|
| ︙ | | |
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
|
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
|
-
+
-
+
-
+
-
+
|
160 933 180 916 180 890 c 0
180 847 149 810 80 810 c 0
EndSplineSet
Validated: 1
EndChar
StartChar: uniE200
Encoding: 55 57856 55
Encoding: 52 57856 52
Width: 310
Flags: HMW
LayerCount: 2
Fore
SplineSet
310 960 m 25
310 770 l 25
280 770 l 25
280 930 l 25
0 930 l 25
0 960 l 25
310 960 l 25
EndSplineSet
Validated: 1
EndChar
StartChar: uniE240
Encoding: 56 57920 56
Encoding: 53 57920 53
Width: 315
Flags: HMW
LayerCount: 2
Fore
SplineSet
0 -239 m 13
0 0 l 5
30 0 l 5
51 -195 315 -321 315 -584 c 4
315 -643 302 -710 269 -785 c 5
282 -738 287 -691 287 -647 c 4
287 -452 175 -294 30 -239 c 5
0 -239 l 13
EndSplineSet
Validated: 1
EndChar
StartChar: uniE241
Encoding: 57 57921 57
Encoding: 54 57921 54
Width: 315
Flags: HMW
LayerCount: 2
Fore
SplineSet
0 0 m 1
0 239 l 1
30 239 l 1
178 280 288 445 288 642 c 0
288 688 282 736 269 785 c 1
302 711 315 647 315 588 c 0
315 328 51 195 30 0 c 0
0 0 l 1
EndSplineSet
Validated: 1
EndChar
StartChar: uniE242
Encoding: 58 57922 58
Encoding: 55 57922 55
Width: 315
Flags: HMW
LayerCount: 2
Fore
SplineSet
0 -343 m 13
0 0 l 5
|
| ︙ | | |
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
|
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
|
-
+
|
291 -485 292 -479 292 -472 c 4
292 -278 101 -171 30 -171 c 5
EndSplineSet
Validated: 1
EndChar
StartChar: uniE243
Encoding: 59 57923 59
Encoding: 56 57923 56
Width: 315
Flags: HMW
LayerCount: 2
Fore
SplineSet
0 -1 m 9
0 342 l 1
|
| ︙ | | |
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
|
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
|
-
+
|
292 479 291 484 291 491 c 1
226 365 56 278 30 171 c 1
EndSplineSet
Validated: 1
EndChar
StartChar: uniE244
Encoding: 60 57924 60
Encoding: 57 57924 57
Width: 315
Flags: HMW
LayerCount: 2
Fore
SplineSet
0 -368 m 9
0 145 l 1
|
| ︙ | | |
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
|
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
|
-
+
|
292 -135 105 -28 32 -28 c 0
31 -28 31 -28 30 -28 c 1
EndSplineSet
Validated: 1
EndChar
StartChar: uniE245
Encoding: 61 57925 61
Encoding: 58 57925 58
Width: 315
Flags: HMW
LayerCount: 2
Fore
SplineSet
0 343 m 17
30 343 l 1
|
| ︙ | | |
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
|
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
|
-
+
|
292 480 291 486 291 493 c 1
226 367 56 280 30 171 c 1
EndSplineSet
Validated: 1
EndChar
StartChar: uniE246
Encoding: 62 57926 62
Encoding: 59 57926 59
Width: 315
Flags: HMW
LayerCount: 2
Fore
SplineSet
0 -344 m 9
0 340 l 1
|
| ︙ | | |
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
|
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
|
-
+
|
291 -145 292 -139 292 -132 c 0
292 62 101 169 30 169 c 1
EndSplineSet
Validated: 1
EndChar
StartChar: uniE247
Encoding: 63 57927 63
Encoding: 60 57927 60
Width: 315
Flags: HMW
LayerCount: 2
Fore
SplineSet
0 -370 m 9
0 314 l 1
|
| ︙ | | |
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
|
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
|
-
+
|
292 450 291 457 291 464 c 1
226 338 56 251 30 142 c 1
EndSplineSet
Validated: 1
EndChar
StartChar: uniE248
Encoding: 64 57928 64
Encoding: 61 57928 61
Width: 315
Flags: HMW
LayerCount: 2
Fore
SplineSet
0 -325 m 9
0 530 l 1
|
| ︙ | | |
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
|
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
|
-
+
|
291 45 292 51 292 58 c 0
292 252 101 359 30 359 c 1
EndSplineSet
Validated: 1
EndChar
StartChar: uniE249
Encoding: 65 57929 65
Encoding: 62 57929 62
Width: 315
Flags: HMW
LayerCount: 2
Fore
SplineSet
0 -580 m 9
0 275 l 1
|
| ︙ | | |
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
|
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
|
-
+
|
292 411 291 418 291 425 c 1
226 299 56 213 30 103 c 1
EndSplineSet
Validated: 1
EndChar
StartChar: uniE260
Encoding: 66 57952 66
Encoding: 63 57952 63
Width: 269
Flags: HMW
LayerCount: 2
Fore
SplineSet
103 122 m 0
77 122 40 90 40 65 c 2
|
| ︙ | | |
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
|
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
|
-
+
|
40 108 l 1
63 142 93 160 133 160 c 0
EndSplineSet
Validated: 1
EndChar
StartChar: uniE261
Encoding: 67 57953 67
Encoding: 64 57953 64
Width: 200
Flags: MW
LayerCount: 2
Fore
SplineSet
28 -101 m 1
172 -56 l 1
|
| ︙ | | |
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
|
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
|
-
+
|
1 377 l 1
28 378 l 1
EndSplineSet
Validated: 1
EndChar
StartChar: uniE262
Encoding: 68 57954 68
Encoding: 65 57954 65
Width: 255
Flags: HMW
LayerCount: 2
Fore
SplineSet
83 70 m 21
83 -97 l 5
|
| ︙ | | |
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
|
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
|
-
+
|
83 -189 l 5
83 -360 l 5
EndSplineSet
Validated: 1
EndChar
StartChar: uniE263
Encoding: 69 57955 69
Encoding: 66 57955 66
Width: 267
Flags: MW
LayerCount: 2
Fore
SplineSet
195 -124 m 9
195 -65 l 25
|
| ︙ | | |
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
|
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
|
-
+
|
267 -124 l 1
195 -124 l 9
EndSplineSet
Validated: 1
EndChar
StartChar: uniE264
Encoding: 70 57956 70
Encoding: 67 57956 67
Width: 366
Flags: HMW
LayerCount: 2
Fore
SplineSet
78 125 m 1
55 124 31 100 31 78 c 2
|
| ︙ | | |
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
|
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
|
189 432 l 1
219 432 l 1
219 113 l 1
235 143 256 163 291 163 c 0
EndSplineSet
Validated: 1
EndChar
StartChar: uniE26a
Encoding: 68 57962 68
Width: 140
Flags: HMW
LayerCount: 2
Fore
SplineSet
140 250 m 9
140 230 l 17
110 205 60 145 60 0 c 0
60 -145 110 -206 140 -230 c 9
140 -250 l 17
90 -220 0 -160 0 0 c 0
0 160 90 220 140 250 c 9
EndSplineSet
Validated: 1
EndChar
StartChar: uniE26b
Encoding: 69 57963 69
Width: 140
Flags: HMW
LayerCount: 2
Fore
SplineSet
0 250 m 17
50 220 140 160 140 0 c 0
140 -160 50 -220 0 -250 c 9
0 -230 l 17
30 -206 80 -145 80 0 c 0
80 145 30 205 0 230 c 9
0 250 l 17
EndSplineSet
Validated: 1
EndChar
StartChar: uniE280
Encoding: 71 57984 71
Encoding: 70 57984 70
Width: 269
Flags: HMW
LayerCount: 2
Fore
SplineSet
171 122 m 0
140 122 116 92 116 57 c 0
|
| ︙ | | |
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
|
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
|
-
+
|
76 -20 50 28 50 75 c 0
50 124 97 160 141 160 c 0
EndSplineSet
Validated: 1
EndChar
StartChar: uniE281
Encoding: 72 57985 72
Encoding: 71 57985 71
Width: 366
Flags: HMW
LayerCount: 2
Fore
SplineSet
87 125 m 1
86 125 l 2
|
| ︙ | | |
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
|
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
|
-
+
|
219 113 l 1
235 143 256 163 291 163 c 0
EndSplineSet
Validated: 1
EndChar
StartChar: uniE282
Encoding: 73 57986 73
Encoding: 72 57986 72
Width: 169
Flags: HMW
LayerCount: 2
Fore
SplineSet
68 320 m 8
98 320 l 1
|
| ︙ | | |
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
|
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
|
-
+
|
68 152 l 1
68 320 l 8
EndSplineSet
Validated: 1
EndChar
StartChar: uniE283
Encoding: 74 57987 74
Encoding: 73 57987 73
Width: 314
Flags: HMW
LayerCount: 2
Fore
SplineSet
233 192 m 17
233 360 l 1
|
| ︙ | | |
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
|
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
|
-
+
|
233 101 l 1
172 83 l 9
EndSplineSet
Validated: 1
EndChar
StartChar: uniE4A0
Encoding: 75 58528 75
Encoding: 74 58528 74
Width: 320
Flags: W
HStem: 0 244<5 15>
VStem: -3 322
LayerCount: 2
Fore
SplineSet
|
| ︙ | | |
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
|
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
|
-
+
-
-
+
+
-
-
-
+
+
+
-
+
-
+
-
+
|
319 109 314 101 305 98 c 1
18 1 l 0
EndSplineSet
Validated: 1
EndChar
StartChar: uniE4A2
Encoding: 76 58530 76
Encoding: 75 58530 75
Width: 80
Flags: HMW
LayerCount: 2
Fore
SplineSet
0 40 m 24
0 63 17 80 40 80 c 24
62 80 80 63 80 40 c 24
80 18 63 0 40 0 c 24
18 0 0 18 0 40 c 24
EndSplineSet
Validated: 1
EndChar
StartChar: uniE4A4
Encoding: 77 58532 77
Width: 320
Encoding: 76 58532 76
Width: 340
Flags: HMW
LayerCount: 2
Fore
SplineSet
0 0 m 25
0 40 l 25
320 40 l 25
320 0 l 25
0 50 l 25
340 50 l 25
340 0 l 25
0 0 l 25
EndSplineSet
Validated: 1
EndChar
StartChar: uniE4A8
Encoding: 78 58536 78
Encoding: 77 58536 77
Width: 100
Flags: HMW
LayerCount: 2
Fore
SplineSet
40 0 m 25
0 280 l 25
100 280 l 25
60 0 l 25
40 0 l 25
EndSplineSet
Validated: 1
EndChar
StartChar: uniE4AC
Encoding: 79 58540 79
Encoding: 78 58540 78
Width: 280
Flags: W
HStem: 0 309
VStem: 0 280
LayerCount: 2
Fore
SplineSet
0 0 m 1
140 309 l 25
280 0 l 1
215 0 l 1
127 198 l 25
37 0 l 1
0 0 l 1
EndSplineSet
Validated: 1
EndChar
StartChar: uniE4C0
Encoding: 80 58560 80
Encoding: 79 58560 79
Width: 600
Flags: HMW
LayerCount: 2
Fore
SplineSet
0 0 m 1
0 214 150 330 300 330 c 3
|
| ︙ | | |
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
|
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
|
-
+
|
332 120 359 92 359 60 c 3
359 27 333 0 299 0 c 3
EndSplineSet
Validated: 1
EndChar
StartChar: uniE4CE
Encoding: 81 58574 81
Encoding: 80 58574 80
Width: 182
Flags: HMW
LayerCount: 2
Fore
SplineSet
86 301 m 0
123 301 136 294 156 272 c 0
|
| ︙ | | |
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
|
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
|
-
+
-
+
-
+
-
+
-
+
|
32 156 -0 184 -0 222 c 0
-0 258 27 301 86 301 c 0
EndSplineSet
Validated: 1
EndChar
StartChar: uniE4E1
Encoding: 82 58593 82
Encoding: 81 58593 81
Width: 130
Flags: HMW
LayerCount: 2
Fore
SplineSet
0 250 m 1
130 250 l 1
130 -250 l 5
0 -250 l 1
0 250 l 1
EndSplineSet
Validated: 1
EndChar
StartChar: uniE4E2
Encoding: 83 58594 83
Encoding: 82 58594 82
Width: 130
Flags: MW
LayerCount: 2
Fore
SplineSet
0 250 m 1
130 250 l 1
130 0 l 1
0 0 l 1
0 250 l 1
EndSplineSet
Validated: 1
EndChar
StartChar: uniE4E3
Encoding: 84 58595 84
Encoding: 83 58595 83
Width: 300
Flags: MW
LayerCount: 2
Fore
SplineSet
0 0 m 1
300 0 l 1
300 -125 l 1
0 -125 l 1
0 0 l 1
EndSplineSet
Validated: 1
EndChar
StartChar: uniE4E4
Encoding: 85 58596 85
Encoding: 84 58596 84
Width: 300
Flags: MW
LayerCount: 2
Fore
SplineSet
0 125 m 1
300 125 l 1
300 0 l 1
0 0 l 1
0 125 l 1
EndSplineSet
Validated: 1
EndChar
StartChar: uniE4E5
Encoding: 86 58597 86
Encoding: 85 58597 85
Width: 238
Flags: MW
LayerCount: 2
Fore
SplineSet
41 391 m 1
230 162 l 1
|
| ︙ | | |
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
|
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
|
-
+
|
122 193 l 1
41 391 l 1
EndSplineSet
Validated: 1
EndChar
StartChar: uniE4E6
Encoding: 87 58598 87
Encoding: 86 58598 86
Width: 255
Flags: W
HStem: 48 33<112 170.038>
VStem: 0 135<81.9955 177.625>
LayerCount: 2
Fore
SplineSet
|
| ︙ | | |
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
|
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
|
-
+
|
58 -227 l 1
171 60 l 1
EndSplineSet
Validated: 1
EndChar
StartChar: uniE4E7
Encoding: 88 58599 88
Encoding: 87 58599 87
Width: 329
Flags: MW
LayerCount: 2
Fore
SplineSet
171 -196 m 1
151 -202 140 -208 98 -208 c 0
|
| ︙ | | |
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
|
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
|
-
+
|
86 -488 l 1
171 -196 l 1
EndSplineSet
Validated: 1
EndChar
StartChar: uniE4E8
Encoding: 89 58600 89
Encoding: 88 58600 88
Width: 399
Flags: MW
LayerCount: 2
Fore
SplineSet
246 60 m 1
226 54 217 48 175 48 c 0
|
| ︙ | | |
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
|
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
|
-
+
|
158 -176 182 -160 188 -142 c 1
246 60 l 1
EndSplineSet
Validated: 1
EndChar
StartChar: uniE4E9
Encoding: 90 58601 90
Encoding: 89 58601 89
Width: 472
Flags: MW
LayerCount: 2
Fore
SplineSet
171 -452 m 1
151 -458 140 -464 98 -464 c 0
|
| ︙ | | |
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
|
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
|
-
+
|
86 -744 l 1
171 -452 l 1
EndSplineSet
Validated: 1
EndChar
StartChar: uniE4EA
Encoding: 91 58602 91
Encoding: 90 58602 90
Width: 472
Flags: MW
LayerCount: 2
Fore
SplineSet
319 52 m 1
299 46 288 40 246 40 c 0
|
| ︙ | | |
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
|
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
|
-
+
|
233 -178 257 -162 263 -144 c 1
319 52 l 1
EndSplineSet
Validated: 1
EndChar
StartChar: uniE4EE
Encoding: 92 58606 92
Encoding: 91 58606 91
Width: 851
Flags: W
HStem: -105 210<25 825>
VStem: 0 25<-230 -105 105 230> 825 25<-230 -105 105 230>
LayerCount: 2
Fore
SplineSet
|
| ︙ | | |
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
|
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
|
-
+
|
0 -230 l 25
0 230 l 25
EndSplineSet
Validated: 1
EndChar
StartChar: uniE500
Encoding: 93 58624 93
Encoding: 92 58624 92
Width: 563
Flags: MW
LayerCount: 2
Fore
SplineSet
55 75 m 3
22 75 -5 102 -5 135 c 3
|
| ︙ | | |
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
|
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
|
-
+
|
109 -250 l 1
-16 -250 l 1
EndSplineSet
Validated: 1
EndChar
StartChar: uniE501
Encoding: 94 58625 94
Encoding: 93 58625 93
Width: 800
Flags: W
HStem: -195 120<659.745 752.255> 75 120<-6.25464 86.2546>
VStem: -20 120<88.7454 181.255> 646 120<-181.255 -88.7454>
LayerCount: 2
Fore
SplineSet
|
| ︙ | | |
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
|
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
|
-
+
|
334 -250 l 5
212 -250 l 5
EndSplineSet
Validated: 1
EndChar
StartChar: uniE520
Encoding: 95 58656 95
Encoding: 94 58656 94
Width: 379
Flags: HMW
LayerCount: 2
Fore
SplineSet
197 40 m 0
199 39 201 39 204 39 c 0
|
| ︙ | | |
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
|
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
|
-
+
|
341 280 380 248 380 180 c 0
380 87 319 0 220 0 c 4
EndSplineSet
Validated: 1
EndChar
StartChar: uniE521
Encoding: 96 58657 96
Encoding: 95 58657 95
Width: 440
Flags: MW
LayerCount: 2
Fore
SplineSet
80 21 m 4
76 11 74 1 57 0 c 4
|
| ︙ | | |
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
|
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
|
-
+
|
170 213 153 206 148 193 c 4
80 21 l 4
EndSplineSet
Validated: 1
EndChar
StartChar: uniE522
Encoding: 97 58658 97
Encoding: 96 58658 96
Width: 278
Flags: HMW
LayerCount: 2
Fore
SplineSet
-50 -160 m 0
-90 -160 -130 -135 -130 -90 c 0
|
| ︙ | | |
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
|
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
|
-
+
|
233 230 229 230 196 230 c 1
153 -26 80 -160 -50 -160 c 0
EndSplineSet
Validated: 1
EndChar
StartChar: uniE523
Encoding: 98 58659 98
Encoding: 97 58659 97
Width: 275
Flags: HMW
LayerCount: 2
Fore
SplineSet
208 231 m 0
218 237 218 245 208 245 c 0
|
| ︙ | | |
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
|
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
|
-
+
|
212 165 190 182 190 200 c 0
190 216 196 224 208 231 c 0
EndSplineSet
Validated: 1
EndChar
StartChar: uniE524
Encoding: 99 58660 99
Encoding: 98 58660 98
Width: 220
Flags: HMW
LayerCount: 2
Fore
SplineSet
80 0 m 0
41 0 0 33 0 70 c 0
|
| ︙ | | |
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
|
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
|
-
+
|
186 137 200 115 200 85 c 0
200 26 156 0 80 0 c 0
EndSplineSet
Validated: 1
EndChar
StartChar: uniE525
Encoding: 100 58661 100
Encoding: 99 58661 99
Width: 232
Flags: HMW
LayerCount: 2
Fore
SplineSet
-10 3 m 0
-22 -6 -34 16 -23 26 c 0
|
| ︙ | | |
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
|
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
|
-
+
|
56 2 50 23 31 23 c 0
19 23 6 15 -10 3 c 0
EndSplineSet
Validated: 1
EndChar
StartChar: uniE529
Encoding: 101 58665 101
Encoding: 100 58665 100
Width: 703
Flags: HMW
LayerCount: 2
Fore
SplineSet
522 40 m 0
524.179123831 39.0525548563 526.555731167 38.5988184777 529.0907001 38.5988184777 c 0
|
| ︙ | | |
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
|
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
|
-
+
|
835.665333312 135.693575703 831.068143327 108.945807045 831.068143327 87.1471403297 c 0
831.068143327 62.5417301443 836.925393958 44.2419393862 847 40 c 0
EndSplineSet
Validated: 1
EndChar
StartChar: uniE52A
Encoding: 102 58666 102
Encoding: 101 58666 101
Width: 563
Flags: W
HStem: -120 30<-74.2249 10 108 169.668 250.775 335 433 494.668 575.775 660 758 819.668> 0 38.5988<191.014 237.319 516.014 562.319 841.014 887.319> 240 40<80.1149 147.5 239.117 318 404.386 472.5 564.117 643 729.386 797.5 889.117 973>
VStem: 120.421 60.6474<87.1471 224.606> 298.898 81.1023<108.679 217.246> 445.421 60.6474<87.1471 224.606> 623.898 81.1023<108.679 217.246> 770.421 60.6474<87.1471 224.606> 948.898 81.1023<108.462 239.669>
LayerCount: 2
Fore
SplineSet
|
| ︙ | | |
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
|
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
|
-
+
|
185.665333312 135.693575703 181.068143327 108.945807045 181.068143327 87.1471403297 c 0
181.068143327 62.5417301443 186.925393958 44.2419393862 197 40 c 0
EndSplineSet
Validated: 1
EndChar
StartChar: uniE52B
Encoding: 103 58667 103
Encoding: 102 58667 102
Width: 703
Flags: HMW
LayerCount: 2
Fore
SplineSet
200 0 m 0
183 0 173 6 153 32 c 1
|
| ︙ | | |
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
|
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
|
-
+
|
510.665333312 135.693575703 506.068143327 108.945807045 506.068143327 87.1471403297 c 0
506.068143327 62.5417301443 511.925393958 44.2419393862 522 40 c 0
EndSplineSet
Validated: 1
EndChar
StartChar: uniE52C
Encoding: 104 58668 104
Encoding: 103 58668 103
Width: 811
Flags: HMW
LayerCount: 2
Fore
SplineSet
429 119 m 0
480 232 500 280 556 280 c 0
|
| ︙ | | |
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
|
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
|
-
+
|
616.665333312 135.693575703 612.068143327 108.945807045 612.068143327 87.1471403297 c 0
612.068143327 62.5417301443 617.925393958 44.2419393862 628 40 c 0
EndSplineSet
Validated: 1
EndChar
StartChar: uniE52D
Encoding: 105 58669 105
Encoding: 104 58669 104
Width: 351
Flags: HMW
LayerCount: 2
Fore
SplineSet
80 21 m 0
76 11 74 1 57 0 c 0
|
| ︙ | | |
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
|
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
|
-
+
|
676 230 672 230 639 230 c 1
596 -26 523 -160 393 -160 c 0
EndSplineSet
Validated: 1
EndChar
StartChar: uniE52F
Encoding: 106 58671 106
Encoding: 105 58671 105
Width: 617
Flags: HMW
LayerCount: 2
Fore
SplineSet
351 230 m 9
196 230 l 1
|
| ︙ | | |
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
|
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
|
-
+
|
192 -120 202 -124 217 -124 c 0
280 -124 284 -35 351 230 c 9
EndSplineSet
Validated: 1
EndChar
StartChar: uniE530
Encoding: 107 58672 107
Encoding: 106 58672 106
Width: 351
Flags: HMW
LayerCount: 2
Fore
SplineSet
204 270 m 9
360 270 l 1
|
| ︙ | | |
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
|
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
|
-
+
|
295 400 285 404 270 404 c 0
228 404 217 332 204 270 c 9
EndSplineSet
Validated: 1
EndChar
StartChar: uniE531
Encoding: 108 58673 108
Encoding: 107 58673 107
Width: 617
Flags: HMW
LayerCount: 2
Fore
SplineSet
472 271 m 9
628 270 l 1
|
| ︙ | | |
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
|
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
|
-
+
|
562 400 552 404 537 404 c 0
495 404 485 332 472 271 c 9
EndSplineSet
Validated: 1
EndChar
StartChar: uniE539
Encoding: 109 58681 109
Encoding: 108 58681 108
Width: 351
Flags: HMW
LayerCount: 2
Fore
SplineSet
80 0 m 0xd8
41 0 0 33 0 70 c 0xe8
|
| ︙ | | |
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
|
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
|
-
+
|
465 230 461 230 428 230 c 1
385 -26 312 -160 182 -160 c 0
EndSplineSet
Validated: 1
EndChar
StartChar: uniE566
Encoding: 110 58726 110
Encoding: 109 58726 109
Width: 509
Flags: HMW
LayerCount: 2
Fore
SplineSet
310 265 m 1
183 258 l 1
|
| ︙ | | |
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
|
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
|
-
+
|
230 0 l 1
242 40 l 1
EndSplineSet
Validated: 1
EndChar
StartChar: uniE567
Encoding: 111 58727 111
Encoding: 110 58727 110
Width: 437
Flags: W
HStem: -3 72<49.5596 110.739> 0 49<319.775 397.094> 141 71<327.059 386.441> 161 47<36.904 118.027>
VStem: 0 24<64.6579 145.71> 413 24<63.9568 143.617>
LayerCount: 2
Fore
SplineSet
|
| ︙ | | |
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
|
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
|
-
+
|
323 68 l 1
342 55 353 49 368 49 c 0x5c
EndSplineSet
Validated: 1
EndChar
StartChar: uniE569
Encoding: 112 58729 112
Encoding: 111 58729 111
Width: 437
Flags: HMW
LayerCount: 2
Fore
SplineSet
77 -3 m 0
33 -3 0 54 0 102 c 0
|
| ︙ | | |
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
|
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
|
-
+
|
92 61 102 51 102 32 c 0
102 11 93 -1 77 -3 c 0
EndSplineSet
Validated: 1
EndChar
StartChar: uniE56C
Encoding: 113 58732 113
Encoding: 112 58732 112
Width: 580
Flags: W
HStem: 0 224
LayerCount: 2
Fore
SplineSet
34 46 m 13
|
| ︙ | | |
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
|
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
|
-
+
|
109 124 l 5
34 46 l 13
EndSplineSet
Validated: 1
EndChar
StartChar: uniE56D
Encoding: 114 58733 114
Encoding: 113 58733 113
Width: 580
Flags: W
HStem: -53 326<278 305> 0 21G<197.065 232.286 418.065 453.137>
VStem: 278 27<-53 70 150 273>
LayerCount: 2
Fore
SplineSet
|
| ︙ | | |
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
|
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
|
-
+
|
278 -53 l 25
278 70 l 1xa0
EndSplineSet
Validated: 1
EndChar
StartChar: uniE582
Encoding: 115 58754 115
Encoding: 114 58754 114
Width: 280
Flags: HMW
LayerCount: 2
Fore
SplineSet
123 0 m 25
123 123 l 25
|
| ︙ | | |
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
|
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
|
-
+
-
+
|
157 0 l 25
123 0 l 25
EndSplineSet
Validated: 1
EndChar
StartChar: uniE5D0
Encoding: 116 58832 116
Encoding: 115 58832 115
Width: 310
Flags: HMW
LayerCount: 2
Fore
SplineSet
0 0 m 1
0 60 l 1
93 79 229 114 280 370 c 1
310 370 l 1
310 175 152 13 0 0 c 1
EndSplineSet
Validated: 1
EndChar
StartChar: uniE5E2
Encoding: 117 58850 117
Encoding: 116 58850 116
Width: 300
Flags: W
HStem: 0 62<198.921 262.211> 96 64<38.8054 112.592>
VStem: 283 16<88.1179 101.401>
LayerCount: 2
Fore
SplineSet
|
| ︙ | | |
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
|
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
|
-
+
-
+
-
+
-
+
-
+
|
55 96 32 79 17 61 c 0
10 53 -2 61 1 70 c 0
EndSplineSet
Validated: 1
EndChar
StartChar: uniE610
Encoding: 118 58896 118
Encoding: 117 58896 117
Width: 300
Flags: HMW
LayerCount: 2
Fore
SplineSet
0 0 m 25
0 300 l 25
300 300 l 25
300 0 l 25
265 0 l 25
265 180 l 25
35 180 l 29
35 0 l 29
0 0 l 25
EndSplineSet
Validated: 1
EndChar
StartChar: uniE612
Encoding: 119 58898 119
Encoding: 118 58898 118
Width: 250
Flags: HMW
LayerCount: 2
Fore
SplineSet
105 0 m 29
0 450 l 25
40 450 l 25
125 90 l 25
210 450 l 25
250 450 l 25
145 0 l 25
105 0 l 29
EndSplineSet
Validated: 1
EndChar
StartChar: uniE614
Encoding: 120 58900 120
Encoding: 119 58900 119
Width: 200
Flags: HMW
LayerCount: 2
Fore
SplineSet
100 25 m 28
141 25 175 59 175 100 c 28
175 141 141 175 100 175 c 28
59 175 25 141 25 100 c 28
25 59 59 25 100 25 c 28
100 0 m 28
45 0 0 45 0 100 c 28
0 155 45 200 100 200 c 28
155 200 200 155 200 100 c 28
200 45 155 0 100 0 c 28
EndSplineSet
Validated: 1
EndChar
StartChar: uniE618
Encoding: 121 58904 121
Encoding: 120 58904 120
Width: 280
Flags: HMW
LayerCount: 2
Fore
SplineSet
-200 0 m 1
-200 110 -110 200 0 200 c 24
110 200 200 110 200 0 c 1
170 0 l 1
170 99 99 170 0 170 c 24
-99 170 -170 99 -170 0 c 1
-200 0 l 1
EndSplineSet
Validated: 1
EndChar
StartChar: uniE624
Encoding: 122 58916 122
Encoding: 121 58916 121
Width: 250
Flags: HMW
LayerCount: 2
Fore
SplineSet
90 120 m 0
110 120 132 165 132 200 c 28
|
| ︙ | | |
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
|
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
|
-
+
|
108 0 l 25
72 0 l 25
EndSplineSet
Validated: 1
EndChar
StartChar: uniE630
Encoding: 123 58928 123
Encoding: 122 58928 122
Width: 200
Flags: HMW
LayerCount: 2
Fore
SplineSet
84 102 m 1
37 109 -0 150 0 200 c 24
|
| ︙ | | |
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
|
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
|
-
+
|
116 127 l 1
116 126 l 1
EndSplineSet
Validated: 1
EndChar
StartChar: uniE650
Encoding: 124 58960 124
Encoding: 123 58960 123
Width: 1037
Flags: W
HStem: -2 60<361.035 435.033 953.253 1010.82> 0 49<543.265 652.027> 286 36<514.943 580.797> 359 66<58.4784 125.129> 402 58<367.211 444.917> 607 32<177.106 261>
VStem: 0 57<406 505.924> 148 26<463.933 475.584> 200 67<410.241 442> 274.641 84.3586<205.588 329> 425 56<126.64 255.856> 452 64<466.983 558.522> 585 40<194.878 284.873> 675 60<72.5613 225.441> 887 59<79.8865 267.532> 952 60<-0.820206 56.8202>
LayerCount: 2
Fore
SplineSet
|
| ︙ | | |
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
|
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
|
-
+
|
758 262 735 202 735 117 c 0
735 73 753 50 797 40 c 1
EndSplineSet
Validated: 1
EndChar
StartChar: uniE655
Encoding: 125 58965 125
Encoding: 124 58965 124
Width: 540
Flags: W
HStem: 68 93<79.5149 155.133> 182 17<220 222.173 252.655 264.303> 192 94<18.5323 100.176 375.888 460.387> 230 56<60.9363 133.273> 230 18<300.618 361.695> 274 18<213.64 227.572 256.894 258> 315 97<73.5817 155.121 322.704 406.413>
VStem: 179 23<209.875 223.47 254.181 264.625> 192 98<17.9339 97.9009 381.276 451.65> 230 18<113.95 174.519 300.936 363.797> 278 17<212.458 224.186 254.5 261>
LayerCount: 2
Fore
SplineSet
|
| ︙ | | |
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
|
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
|
-
+
|
173 186 179 196 179 204 c 0
179 219 166 230 141 230 c 0xcb40
EndSplineSet
Validated: 1
EndChar
StartChar: uniE910
Encoding: 126 59664 126
Encoding: 125 59664 125
Width: 500
Flags: HMW
LayerCount: 2
Fore
SplineSet
45 0 m 28
45 -113 137 -205 250 -205 c 28
|
| ︙ | | |
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
|
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
|
-
+
-
+
|
283 60 310 33 310 0 c 7
310 -33 283 -60 250 -60 c 7
EndSplineSet
Validated: 1
EndChar
StartChar: uniE911
Encoding: 127 59665 127
Encoding: 126 59665 126
Width: 500
Flags: HMW
LayerCount: 2
Fore
SplineSet
45 0 m 24
45 -113 137 -205 250 -205 c 24
363 -205 455 -113 455 0 c 24
455 113 363 205 250 205 c 24
137 205 45 113 45 0 c 24
0 0 m 24
0 139 111 250 250 250 c 24
388 250 500 139 500 0 c 24
500 -138 389 -250 250 -250 c 24
112 -250 0 -138 0 0 c 24
EndSplineSet
Validated: 1
EndChar
StartChar: uniE912
Encoding: 128 59666 128
Encoding: 127 59666 127
Width: 500
Flags: HMW
LayerCount: 2
Fore
SplineSet
228 350 m 5
273 350 l 5
|
| ︙ | | |
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
|
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
|
-
+
|
455 105 375 193 273 204 c 5
273 -204 l 5
EndSplineSet
Validated: 1
EndChar
StartChar: uniE914
Encoding: 129 59668 129
Encoding: 128 59668 128
Width: 500
Flags: HMW
LayerCount: 2
Fore
SplineSet
463 130 m 0
464 127 465 123 465 120 c 0
|
| ︙ | | |
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
|
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
|
-
+
|
283 60 310 33 310 0 c 3
310 -33 283 -60 250 -60 c 3
EndSplineSet
Validated: 1
EndChar
StartChar: uniE915
Encoding: 130 59669 130
Encoding: 129 59669 129
Width: 500
Flags: HMW
LayerCount: 2
Fore
SplineSet
463 130 m 0
464 127 465 123 465 120 c 0
|
| ︙ | | |
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
|
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
|
-
+
|
0 139 111 250 250 250 c 0
344 250 420 210 463 130 c 0
EndSplineSet
Validated: 1
EndChar
StartChar: uniE918
Encoding: 131 59672 131
Encoding: 130 59672 130
Width: 500
Flags: HMW
LayerCount: 2
Fore
SplineSet
273 249 m 1
356 243 424 203 463 130 c 0
|
| ︙ | | |
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
|
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
|
-
+
-
+
-
+
|
125 193 45 106 45 0 c 0
45 -106 125 -193 228 -204 c 1
EndSplineSet
Validated: 1
EndChar
StartChar: uniE920
Encoding: 132 59680 132
Encoding: 131 59680 131
Width: 120
Flags: HMW
LayerCount: 2
Fore
SplineSet
60 -60 m 3
27 -60 0 -33 0 0 c 3
0 33 27 60 60 60 c 3
93 60 120 33 120 0 c 3
120 -33 93 -60 60 -60 c 3
EndSplineSet
Validated: 1
EndChar
StartChar: uniE925
Encoding: 133 59685 133
Encoding: 132 59685 132
Width: 45
Flags: HMW
LayerCount: 2
Fore
SplineSet
45 350 m 9
45 -350 l 1
0 -350 l 9
0 350 l 1
45 350 l 9
EndSplineSet
Validated: 1
EndChar
StartChar: uniE95D
Encoding: 134 59741 134
Encoding: 133 59741 133
Width: 540
Flags: HMW
LayerCount: 2
Fore
SplineSet
30 70 m 25
30 -70 l 25
|
| ︙ | | |
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
|
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
|
-
+
|
0 -190 l 25
0 190 l 25
EndSplineSet
Validated: 1
EndChar
StartChar: uniEA02
Encoding: 135 59906 135
Encoding: 134 59906 134
Width: 250
Flags: HMW
LayerCount: 2
Fore
SplineSet
0 65 m 25
137 250 l 25
|
| ︙ | | |
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
|
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
|
-
+
|
32 41 l 25
0 65 l 25
EndSplineSet
Validated: 1
EndChar
StartChar: uniEAA4
Encoding: 136 60068 136
Encoding: 135 60068 135
Width: 250
Flags: HMW
LayerCount: 2
Fore
SplineSet
0 270 m 0
30 300 45 311 85 311 c 0
|
| ︙ | | |
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
|
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
|
-
+
-
+
|
-17 226 -24 227 -24 234 c 0
-24 241 -17 253 0 270 c 0
EndSplineSet
Validated: 1
EndChar
StartChar: uniECA2
Encoding: 137 60578 137
Encoding: 136 60578 136
Width: 450
Flags: HMW
LayerCount: 2
Fore
SplineSet
337 -20 m 4
337 50 264 111 193 111 c 4
154 111 109 85 109 41 c 4
109 -30 186 -87 257 -87 c 4
298 -87 337 -65 337 -20 c 4
450 10 m 4
450 -60 361 -119 225 -119 c 4
89 -119 0 -60 0 10 c 4
0 80 89 139 225 139 c 4
361 139 450 80 450 10 c 4
EndSplineSet
Validated: 1
EndChar
StartChar: uniECA3
Encoding: 138 60579 138
Encoding: 137 60579 137
Width: 328
Flags: HMW
LayerCount: 2
Fore
SplineSet
292 68 m 0
283 84 264 91 242 91 c 0
|
| ︙ | | |
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
|
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
|
-
+
-
+
|
237 148 273 134 298 103 c 1
299 680 l 1
EndSplineSet
Validated: 1
EndChar
StartChar: uniECA5
Encoding: 139 60581 139
Encoding: 138 60581 138
Width: 320
Flags: HMW
LayerCount: 2
Fore
SplineSet
290 680 m 1
320 680 l 1
320 40 l 2
320 -51 231 -135 110 -135 c 0
40 -135 0 -90 0 -40 c 0
0 50 90 135 210 135 c 0
244 135 271 124 290 107 c 1
290 680 l 1
EndSplineSet
Validated: 1
EndChar
StartChar: uniECA7
Encoding: 140 60583 140
Encoding: 139 60583 139
Width: 522
Flags: HMW
LayerCount: 2
Fore
SplineSet
320 441 m 1
320 40 l 2
|
| ︙ | | |
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
|
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
|
-
+
|
485 57 490 104 490 148 c 0
490 258 462 396 320 441 c 1
EndSplineSet
Validated: 1
EndChar
StartChar: uniECA9
Encoding: 141 60585 141
Encoding: 140 60585 140
Width: 522
Flags: HMW
LayerCount: 2
Fore
SplineSet
290 107 m 1
290 337 l 1
|
| ︙ | | |
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
|
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
|
-
+
+
|
494 242 495 248 495 255 c 0
495 388 391 509 320 509 c 1
EndSplineSet
Validated: 1
EndChar
StartChar: uniECB7
Encoding: 142 60599 142
Encoding: 141 60599 141
Width: 100
Flags: HMW
LayerCount: 2
Fore
SplineSet
50 -50 m 3
22 -50 0 -28 0 0 c 3
0 28 22 50 50 50 c 3
78 50 100 28 100 0 c 3
100 -28 78 -50 50 -50 c 3
EndSplineSet
Validated: 1
EndChar
EndChars
EndSplineFont
|