diff --git a/CHANGELOG.md b/CHANGELOG.md index c015b8798..d2d2d6093 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,10 +6,12 @@ As of v3.0.0 this project adheres to [Semantic Versioning](http://semver.org/). ### Fixed - Handling of the first syllable in gabc is now more consistent with the all other syllables. This centers the syllable correctly when using latin syllable centering (see [#42](https://github.com/gregorio-project/gregorio/issues/42)) and makes the use of styles less surprising in the first syllable (see [#135](https://github.com/gregorio-project/gregorio/issues/135)). - Handling of manually-placed custos is improved. In particular, a manual custos at the end of the score should no longer be lost when the bar happens to be at the end of the line. +- Improved rendering of torculus resupinus flexus figures (see [#18](https://github.com/gregorio-project/gregorio/issues/18)). ### Changed - The spacing algorithm has completely changed, expect your scores to look quite different (better we hope). - Lines are now aligned on the leftmost note instead of the leftmost letter. +- Some glyph shapes are improved a little in greciliae, it should be noticeable especially for porrectus. - The `O` modifier in gabc now has expanded uses beyond the salicus `(egOi)`. A stemmed oriscus will appear on a lone pitch `(gO)` or a followed by a lower pitch `(gOe)` (see [#76](https://github.com/gregorio-project/gregorio/issues/76)). A virga strata will appear on the second note of two ascending pitches `(giO)`. - With thanks to *Abbazia Mater Ecclesiae (IT)* for drawing the new shapes, the strophicus in greciliae has changed to better differentiate from the punctum inclinatum. Use `\grechangeglyph{Stropha}{greciliae}{.caeciliae}\grechangeglyph{StrophaAucta}{greciliae}{.caeciliae}` if you prefer the old shape. - Default initial sizes have been chosen so that they are more appropriate when an infinitely scaling font is loaded. LaTeX will make an automatic substitution of the closest avaialble size when such a font is not used. diff --git a/Makefile.am b/Makefile.am index 72d94a91d..53b9ca918 100644 --- a/Makefile.am +++ b/Makefile.am @@ -23,4 +23,8 @@ EXTRA_DIST = README.md CHANGELOG.md CONTRIBUTING.md CONTRIBUTORS.md \ UPGRADE.md COPYING.md .gregorio-version VersionManager.py \ build.sh install.sh install-gtex.sh +fonts: make-fonts +make-fonts: + make -C fonts fonts + export TOP_LEVEL_MAKE = true diff --git a/fonts/greciliae-base.sfd b/fonts/greciliae-base.sfd index 44a66aef4..c6dfefa2a 100644 --- a/fonts/greciliae-base.sfd +++ b/fonts/greciliae-base.sfd @@ -19,7 +19,7 @@ OS2Version: 0 OS2_WeightWidthSlopeOnly: 0 OS2_UseTypoMetrics: 1 CreationTime: 1176402534 -ModificationTime: 1430806480 +ModificationTime: 1430905331 OS2TypoAscent: 0 OS2TypoAOffset: 1 OS2TypoDescent: 0 @@ -41,7 +41,7 @@ NameList: Adobe Glyph List DisplaySize: -96 AntiAlias: 1 FitToEm: 1 -WinInfo: 19 19 8 +WinInfo: 0 19 8 Grid 148 1300 m 0 148 -700 l 0 @@ -49,7 +49,7 @@ Grid 17.75 -700 l 0 EndSplineSet 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: 379 134 +BeginChars: 379 139 StartChar: Punctum Encoding: 0 -1 0 @@ -846,7 +846,7 @@ SplineSet EndSplineSet EndChar -StartChar: vsbase +StartChar: VirgaLineBR Encoding: 37 -1 37 Width: 166 VWidth: 2637 @@ -918,7 +918,7 @@ SplineSet EndSplineSet EndChar -StartChar: qbase +StartChar: QuilismaLineTR Encoding: 40 -1 40 Width: 166 VWidth: 2496 @@ -946,7 +946,7 @@ SplineSet EndSplineSet EndChar -StartChar: obase +StartChar: OriscusLineTR Encoding: 41 -1 41 Width: 166 VWidth: 2537 @@ -1104,46 +1104,46 @@ EndChar StartChar: porrectus1 Encoding: 48 -1 48 -Width: 503 +Width: 447 VWidth: 2553 Flags: HW HStem: -409 15 -94 15 221 15 536 15 LayerCount: 2 Fore SplineSet -471.85 -201.2 m 4 - 315.859 -201.2 150.71 -172.379 0 -40 c 5 - 0 157.601 l 5 - 47.667 110.8 126.963 58.4531 237.85 0.299805 c 4 - 289.005 -26.5283 357 -40.7998 415.75 -40 c 4 - 451.28 -39.5166 476.333 -23.5322 485 9.40039 c 5 - 485 37.2002 l 5 - 503 37.2002 l 5 - 503 -183 l 6 - 503 -195.133 492.65 -201.2 471.85 -201.2 c 4 +415.85 -201.2 m 0 + 287 -200.5 123.5 -138.801 0 -34 c 1 + 0 157.601 l 1 + 49.5 112.45 117.5 55.5 228.85 -0.700195 c 0 + 265.646 -19.2715 321.5 -42.8004 359.75 -40 c 0 + 395.189 -37.4055 420.333 -23.5322 429 9.40039 c 1 + 429 37.2002 l 1 + 447 37.2002 l 1 + 447 -183 l 2 + 447 -195.133 436.65 -201.313 415.85 -201.2 c 0 EndSplineSet EndChar StartChar: porrectus2 Encoding: 49 -1 49 -Width: 629 +Width: 547 VWidth: 2575 Flags: HW HStem: -409 15 -94 15 221 15 536 15 LayerCount: 2 Fore SplineSet -628 -354.1 m 5 - 628.006 -361.908 616.933 -373.562 597 -374 c 5 - 512.933 -374 412.48 -336.605 295.4 -262.2 c 4 - 162.892 -177.99 65 -99.2676 0 -25.5996 c 5 - 0 172 l 5 - 139.94 -11.6719 354.969 -174.639 540.9 -201.8 c 5 - 552.601 -201.8 l 6 - 579.468 -201.8 610 -177.6 610 -152.4 c 6 - 610 -131.1 l 5 - 628 -131.1 l 5 - 628 -354.1 l 5 +547 -354.1 m 5 + 547.006 -361.908 535.933 -368.562 516 -369 c 1 + 461.933 -369 402.48 -336.605 285.4 -262.2 c 0 + 152.892 -177.99 65 -99.2676 0 -25.5996 c 1 + 0 172 l 1 + 139.94 -11.6719 374 -183 481.9 -201.8 c 1 + 493.601 -201.8 l 2 + 512.75 -201.8 529 -167.5 529 -152.4 c 2 + 529 -131.1 l 1 + 547 -131.1 l 1 + 547 -354.1 l 5 EndSplineSet EndChar @@ -1152,67 +1152,70 @@ Encoding: 50 -1 50 Width: 628 VWidth: 2556 Flags: HW -HStem: -409 15 -94 15 221 15 536 15 +VStem: 610 18<-358.804 -326.4> LayerCount: 2 Fore SplineSet -598 -550.9 m 4 - 516.533 -523.167 416.433 -458.601 297.7 -357.2 c 4 - 215.367 -288.733 116.133 -183 0 -40 c 5 - 0 157.6 l 5 - 132.601 -6.2002 233.259 -126.734 305.601 -196.601 c 4 - 440 -326.4 542 -374.4 561.7 -374.9 c 4 - 582.493 -375.428 610 -360.4 610 -340.3 c 5 - 610 -326.4 l 5 - 628 -326.4 l 5 - 628 -530.101 l 6 - 628 -545.698 622.268 -553.5 611 -553.5 c 4 - 607.533 -553.5 603.2 -552.633 598 -550.9 c 4 +598 -556 m 0 + 517 -528 416 -464 298 -362 c 0 + 215 -294 116 -188 0 -45 c 1 + 0 162 l 5 + 133 -2 233 -123 306 -193 c 4 + 440 -322 547 -370 567 -370 c 0 + 587 -370 610 -360 610 -340 c 1 + 610 -326 l 1 + 628 -326 l 1 + 628 -535 l 2 + 628 -551 622 -559 611 -559 c 0 + 608 -559 603 -558 598 -556 c 0 EndSplineSet EndChar StartChar: porrectus4 Encoding: 51 -1 51 -Width: 628 +Width: 704 VWidth: 2500 Flags: HW HStem: -409 15 -94 15 221 15 536 15 LayerCount: 2 Fore SplineSet -598 -727.399 m 0 - 448.206 -656.618 231.179 -394.498 0 -54 c 1 - 0 161.601 l 1 - 61.5332 47.2002 162.165 -98.7559 301.601 -276.5 c 0 - 392.664 -392.583 455.7 -468.199 538.9 -533.199 c 0 - 547.567 -539.267 555.367 -542.3 562.3 -542.3 c 0 - 580.5 -542.3 600.467 -537.8 610 -498.8 c 1 - 610 -477.399 l 1 - 628 -477.399 l 1 - 628 -689.899 l 2 - 628 -705.495 623.133 -713.3 613.601 -713.3 c 0 - 609.268 -713.3 604.067 -730 598 -727.399 c 0 +668 -709.399 m 0 + 518 -609 224 -393 0 -54 c 1 + 0 178.601 l 1 + 68 67 167.609 -64.1445 322.601 -228.5 c 0 + 426.333 -338.5 510 -418 625.9 -509.199 c 0 + 634.215 -515.742 642.367 -516.3 649.3 -516.3 c 0 + 667.5 -516.3 679 -509 686 -485.8 c 1 + 686 -464.399 l 1 + 704 -464.399 l 1 + 704 -684.899 l 2 + 704 -700.495 693.133 -713.3 683.601 -713.3 c 0 + 679.268 -713.3 673.486 -713.071 668 -709.399 c 0 EndSplineSet EndChar StartChar: porrectus5 Encoding: 52 -1 52 -Width: 931 +Width: 849 VWidth: 2048 Flags: HW HStem: -409 15 -94 15 221 15 536 15 LayerCount: 2 Fore SplineSet -0 -34 m 1 - 0 183 l 2 - 0 187.739 5.35547 186.627 7 182.75 c 0 - 122.5 -89.5 386.5 -592 913 -712 c 1 - 913 -669 913 -654.875 913 -612 c 1 - 923.125 -612 926.281 -611.9 931 -612 c 1 - 931 -841 l 2 - 931 -843.229 930.646 -842.992 928.76 -842.591 c 1 - 351 -717 54 -249 0 -34 c 1 +813 -847.399 m 0 + 663.206 -776.618 231.179 -394.498 0 -54 c 1 + 0 178.601 l 1 + 61.5332 64.2002 212.399 -131.5 374.5 -300 c 0 + 476.788 -406.326 650.5 -570 770.9 -647.199 c 0 + 779.807 -652.91 787.367 -654.3 794.3 -654.3 c 0 + 812.5 -654.3 824 -647 831 -623.8 c 1 + 831 -602.399 l 1 + 849 -602.399 l 1 + 849 -822.899 l 2 + 849 -838.495 838.133 -851.3 828.601 -851.3 c 0 + 824.268 -851.3 819.067 -850 813 -847.399 c 0 EndSplineSet EndChar @@ -2854,7 +2857,7 @@ StartChar: OriscusScapusLongqueue Encoding: 126 -1 123 Width: 166 VWidth: 2537 -Flags: HWO +Flags: HW HStem: -409 15 -94 15 221 15 536 15 LayerCount: 2 Fore @@ -3114,5 +3117,121 @@ SplineSet -2 64 l 25 EndSplineSet EndChar + +StartChar: porrectusam11 +Encoding: 136 -1 134 +Width: 503 +VWidth: 2553 +Flags: W +HStem: -409 15 -94 15 221 15 536 15 +LayerCount: 2 +Fore +SplineSet +471.85 -201.2 m 4 + 315.859 -201.2 150.71 -172.379 0 -40 c 5 + 0 157.601 l 5 + 47.667 110.8 126.963 58.4531 237.85 0.299805 c 4 + 289.005 -26.5283 357 -40.7998 415.75 -40 c 4 + 451.28 -39.5166 476.333 -23.5322 485 9.40039 c 5 + 485 37.2002 l 5 + 503 37.2002 l 5 + 503 -183 l 6 + 503 -195.133 492.65 -201.2 471.85 -201.2 c 4 +EndSplineSet +EndChar + +StartChar: porrectusam12 +Encoding: 137 -1 135 +Width: 629 +VWidth: 2575 +Flags: HW +LayerCount: 2 +Fore +SplineSet +628 -354.1 m 1 + 628.006 -361.908 616.933 -373.562 597 -374 c 1 + 512.933 -374 412.48 -336.605 295.4 -262.2 c 0 + 162.892 -177.99 65 -99.2676 0 -25.5996 c 1 + 0 172 l 1 + 139.94 -11.6719 354.969 -174.639 540.9 -201.8 c 1 + 552.601 -201.8 l 2 + 579.468 -201.8 610 -177.6 610 -152.4 c 2 + 610 -131.1 l 1 + 628 -131.1 l 1 + 628 -354.1 l 1 +EndSplineSet +EndChar + +StartChar: porrectusam13 +Encoding: 138 -1 136 +Width: 678 +VWidth: 2556 +Flags: HW +VStem: 612 18<-358.804 -326.4> +LayerCount: 2 +Fore +SplineSet +644 -536 m 0 + 549 -509.2 416 -459 298 -357 c 0 + 215 -289 116 -183 0 -40 c 1 + 0 158 l 1 + 133 -6 233 -127 306 -197 c 0 + 440 -326 548 -369.2 612 -375 c 0 + 631.918 -376.805 660 -360 660 -340 c 1 + 660 -326 l 1 + 678 -326 l 1 + 678 -511 l 2 + 678 -527 668 -539 657 -539 c 0 + 654 -539 649.183 -537.462 644 -536 c 0 +EndSplineSet +EndChar + +StartChar: porrectusam14 +Encoding: 139 -1 137 +Width: 721 +VWidth: 2500 +Flags: HW +HStem: -409 15 -94 15 221 15 536 15 +LayerCount: 2 +Fore +SplineSet +691 -717.399 m 0 + 370.167 -561 250 -440 0 -54 c 1 + 0 168.601 l 1 + 61.5332 54.2002 159.01 -94.2767 301.601 -269.5 c 0 + 437.5 -436.5 532.167 -502 629.9 -531.199 c 4 + 640.038 -534.228 648.367 -535.3 655.3 -535.3 c 0 + 673.5 -535.3 693.467 -530.8 703 -491.8 c 1 + 703 -470.399 l 1 + 721 -470.399 l 1 + 721 -679.899 l 2 + 721 -695.495 718.133 -722.3 708.601 -722.3 c 0 + 704.268 -722.3 696.933 -720.292 691 -717.399 c 0 +EndSplineSet +EndChar + +StartChar: porrectusam15 +Encoding: 140 -1 138 +Width: 933 +VWidth: 2048 +Flags: HW +HStem: -409 15 -94 15 221 15 536 15 +LayerCount: 2 +Fore +SplineSet +903 -842.399 m 0 + 471 -707 254 -471.751 0 -54 c 1 + 0 168.601 l 1 + 61.5332 54.2002 264.258 -242.258 424 -402 c 4 + 580 -558 667 -632 851.9 -678.199 c 0 + 862.165 -680.764 866.367 -680.3 873.3 -680.3 c 0 + 891.5 -680.3 905.467 -665.8 915 -626.8 c 1 + 915 -605.399 l 1 + 933 -605.399 l 1 + 933 -804.899 l 2 + 933 -820.495 930.133 -847.3 920.601 -847.3 c 0 + 916.268 -847.3 909.298 -844.373 903 -842.399 c 0 +EndSplineSet +EndChar EndChars EndSplineFont diff --git a/fonts/gregorio-base.sfd b/fonts/gregorio-base.sfd index 514dcc561..bacf7d7ab 100644 --- a/fonts/gregorio-base.sfd +++ b/fonts/gregorio-base.sfd @@ -41,7 +41,7 @@ NameList: Adobe Glyph List DisplaySize: -96 AntiAlias: 1 FitToEm: 1 -WinInfo: 64 8 2 +WinInfo: 0 19 8 Grid 142 1300 m 0 142 -700 l 0 @@ -49,7 +49,7 @@ Grid 22 -700 l 0 EndSplineSet 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: 375 129 +BeginChars: 375 128 StartChar: Punctum Encoding: 0 -1 0 @@ -858,7 +858,7 @@ EndSplineSet Validated: 1 EndChar -StartChar: vsbase +StartChar: VirgaLineBR Encoding: 37 -1 37 Width: 164 VWidth: 2048 @@ -930,7 +930,7 @@ EndSplineSet Validated: 33 EndChar -StartChar: qbase +StartChar: QuilismaLineTR Encoding: 40 -1 40 Width: 164 VWidth: 2048 @@ -959,7 +959,7 @@ SplineSet EndSplineSet EndChar -StartChar: obase +StartChar: OriscusLineTR Encoding: 41 -1 41 Width: 164 VWidth: 2048 @@ -1873,7 +1873,7 @@ Validated: 1 EndChar StartChar: PunctumSmall -Encoding: 81 -1 81 +Encoding: 81 -1 80 Width: 154 VWidth: 2048 Flags: HW @@ -1892,25 +1892,8 @@ SplineSet EndSplineSet EndChar -StartChar: hepisemusleft -Encoding: 82 -1 81 -Width: 1 -VWidth: 2048 -Flags: HW -HStem: -409 15 -94 15 221 15 536 15 -LayerCount: 2 -Fore -SplineSet --2 64 m 25 - 0 96 l 25 - 1 96 l 25 - 1 64 l 25 - -2 64 l 25 -EndSplineSet -EndChar - StartChar: hepisemusright -Encoding: 83 -1 82 +Encoding: 83 -1 81 Width: 2 VWidth: 2048 Flags: HW @@ -1927,7 +1910,7 @@ EndSplineSet EndChar StartChar: mpdeminutus -Encoding: 84 -1 83 +Encoding: 84 -1 82 Width: 186 VWidth: 2048 Flags: HW @@ -1950,7 +1933,7 @@ EndSplineSet EndChar StartChar: PunctumDescendens -Encoding: 85 -1 84 +Encoding: 85 -1 83 Width: 164 VWidth: 2048 Flags: HW @@ -1972,7 +1955,7 @@ EndSplineSet EndChar StartChar: PunctumAscendens -Encoding: 86 -1 85 +Encoding: 86 -1 84 Width: 164 VWidth: 2048 Flags: HW @@ -1994,7 +1977,7 @@ EndSplineSet EndChar StartChar: mnbdeminutus -Encoding: 87 -1 86 +Encoding: 87 -1 85 Width: 186 VWidth: 2048 Flags: HW @@ -2015,7 +1998,7 @@ EndSplineSet EndChar StartChar: mnbpdeminutus -Encoding: 88 -1 87 +Encoding: 88 -1 86 Width: 186 VWidth: 2048 Flags: HW @@ -2036,7 +2019,7 @@ EndSplineSet EndChar StartChar: porrectusflexusnb1 -Encoding: 89 -1 88 +Encoding: 89 -1 87 Width: 340 VWidth: 2048 Flags: HW @@ -2056,7 +2039,7 @@ EndSplineSet EndChar StartChar: porrectusflexusnb2 -Encoding: 90 -1 89 +Encoding: 90 -1 88 Width: 428 VWidth: 2048 Flags: HW @@ -2076,7 +2059,7 @@ EndSplineSet EndChar StartChar: porrectusflexusnb3 -Encoding: 91 -1 90 +Encoding: 91 -1 89 Width: 586 VWidth: 2048 Flags: HW @@ -2096,7 +2079,7 @@ EndSplineSet EndChar StartChar: porrectusflexusnb4 -Encoding: 92 -1 91 +Encoding: 92 -1 90 Width: 670 VWidth: 2048 Flags: HW @@ -2116,7 +2099,7 @@ EndSplineSet EndChar StartChar: porrectusflexusnb5 -Encoding: 93 -1 92 +Encoding: 93 -1 91 Width: 931 VWidth: 2048 Flags: HW @@ -2136,7 +2119,7 @@ EndSplineSet EndChar StartChar: p2base -Encoding: 95 -1 94 +Encoding: 95 -1 92 Width: 164 VWidth: 2048 Flags: W @@ -2156,7 +2139,7 @@ EndSplineSet EndChar StartChar: rvlbase -Encoding: 96 -1 95 +Encoding: 96 -1 93 Width: 164 VWidth: 2048 Flags: HW @@ -2179,7 +2162,7 @@ EndSplineSet EndChar StartChar: msdeminutus -Encoding: 97 -1 96 +Encoding: 97 -1 94 Width: 186 VWidth: 2048 Flags: HW @@ -2202,7 +2185,7 @@ EndSplineSet EndChar StartChar: mademinutus -Encoding: 98 -1 97 +Encoding: 98 -1 95 Width: 186 VWidth: 2048 Flags: HW @@ -2225,7 +2208,7 @@ EndSplineSet EndChar StartChar: PunctumCavumHole -Encoding: 99 -1 98 +Encoding: 99 -1 96 Width: 164 VWidth: 2048 Flags: HW @@ -2244,7 +2227,7 @@ EndSplineSet EndChar StartChar: LineaPunctumCavumHole -Encoding: 100 -1 99 +Encoding: 100 -1 97 Width: 266 VWidth: 2048 Flags: HW @@ -2263,7 +2246,7 @@ EndSplineSet EndChar StartChar: FlatHole -Encoding: 101 -1 100 +Encoding: 101 -1 98 Width: 164 VWidth: 2048 Flags: HW @@ -2280,7 +2263,7 @@ EndSplineSet EndChar StartChar: NaturalHole -Encoding: 102 -1 101 +Encoding: 102 -1 99 Width: 201 VWidth: 2048 Flags: HW @@ -2297,7 +2280,7 @@ EndSplineSet EndChar StartChar: odbase -Encoding: 103 -1 102 +Encoding: 103 -1 100 Width: 164 VWidth: 2048 Flags: HW @@ -2324,7 +2307,7 @@ EndSplineSet EndChar StartChar: DivisioDominican -Encoding: 104 -1 103 +Encoding: 104 -1 101 Width: 22 VWidth: 2048 Flags: HW @@ -2341,7 +2324,7 @@ EndSplineSet EndChar StartChar: DivisioDominicanAlt -Encoding: 105 -1 104 +Encoding: 105 -1 102 Width: 22 VWidth: 2048 Flags: HW @@ -2358,7 +2341,7 @@ EndSplineSet EndChar StartChar: Sharp -Encoding: 106 -1 105 +Encoding: 106 -1 103 Width: 258 VWidth: 2048 Flags: W @@ -2420,7 +2403,7 @@ EndSplineSet EndChar StartChar: SharpHole -Encoding: 107 -1 106 +Encoding: 107 -1 104 Width: 258 VWidth: 2048 Flags: W @@ -2437,7 +2420,7 @@ EndSplineSet EndChar StartChar: Linea -Encoding: 108 -1 107 +Encoding: 108 -1 105 Width: 431 VWidth: 2612 Flags: W @@ -2464,7 +2447,7 @@ EndSplineSet EndChar StartChar: RoundBrace -Encoding: 109 -1 108 +Encoding: 109 -1 106 Width: 937 VWidth: 2048 Flags: W @@ -2489,7 +2472,7 @@ EndSplineSet EndChar StartChar: CurlyBrace -Encoding: 110 -1 109 +Encoding: 110 -1 107 Width: 1006 VWidth: 2048 Flags: W @@ -2516,7 +2499,7 @@ EndSplineSet EndChar StartChar: BarBrace -Encoding: 111 -1 110 +Encoding: 111 -1 108 Width: 591 VWidth: 2048 Flags: W @@ -2541,7 +2524,7 @@ EndSplineSet EndChar StartChar: OriscusDeminutus -Encoding: 112 -1 111 +Encoding: 112 -1 109 Width: 187 VWidth: 2048 Flags: HW @@ -2569,7 +2552,7 @@ EndSplineSet EndChar StartChar: obase4 -Encoding: 113 -1 112 +Encoding: 113 -1 110 Width: 164 VWidth: 2048 Flags: HW @@ -2596,7 +2579,7 @@ EndSplineSet EndChar StartChar: obase8 -Encoding: 114 -1 113 +Encoding: 114 -1 111 Width: 164 VWidth: 2048 Flags: HW @@ -2622,7 +2605,7 @@ EndSplineSet EndChar StartChar: VirgaReversaDescendens -Encoding: 115 -1 114 +Encoding: 115 -1 112 Width: 164 VWidth: 2048 Flags: HW @@ -2644,7 +2627,7 @@ EndSplineSet EndChar StartChar: VirgaReversaLongqueueDescendens -Encoding: 116 -1 115 +Encoding: 116 -1 113 Width: 164 VWidth: 2048 Flags: HW @@ -2666,7 +2649,7 @@ EndSplineSet EndChar StartChar: vbase2 -Encoding: 117 -1 116 +Encoding: 117 -1 114 Width: 164 VWidth: 2048 Flags: HW @@ -2689,7 +2672,7 @@ EndSplineSet EndChar StartChar: vbase3 -Encoding: 118 -1 117 +Encoding: 118 -1 115 Width: 164 VWidth: 2048 Flags: HW @@ -2712,7 +2695,7 @@ EndSplineSet EndChar StartChar: vbase4 -Encoding: 119 -1 118 +Encoding: 119 -1 116 Width: 164 VWidth: 2048 Flags: HW @@ -2735,7 +2718,7 @@ EndSplineSet EndChar StartChar: vbase5 -Encoding: 120 -1 119 +Encoding: 120 -1 117 Width: 164 VWidth: 2048 Flags: HW @@ -2758,7 +2741,7 @@ EndSplineSet EndChar StartChar: vbase1 -Encoding: 121 -1 120 +Encoding: 121 -1 118 Width: 164 VWidth: 2048 Flags: HW @@ -2779,7 +2762,7 @@ EndSplineSet EndChar StartChar: OriscusScapusLongqueue -Encoding: 122 -1 121 +Encoding: 122 -1 119 Width: 164 VWidth: 2048 Flags: HW @@ -2806,7 +2789,7 @@ EndSplineSet EndChar StartChar: OriscusScapus -Encoding: 123 -1 122 +Encoding: 123 -1 120 Width: 164 VWidth: 2048 Flags: HW @@ -2834,7 +2817,7 @@ EndSplineSet EndChar StartChar: osbase1 -Encoding: 124 -1 123 +Encoding: 124 -1 121 Width: 164 VWidth: 2048 Flags: HW @@ -2861,7 +2844,7 @@ EndSplineSet EndChar StartChar: osbase2 -Encoding: 125 -1 124 +Encoding: 125 -1 122 Width: 164 VWidth: 2048 Flags: HW @@ -2889,7 +2872,7 @@ EndSplineSet EndChar StartChar: osbase3 -Encoding: 126 -1 125 +Encoding: 126 -1 123 Width: 164 VWidth: 2048 Flags: HW @@ -2917,7 +2900,7 @@ EndSplineSet EndChar StartChar: osbase4 -Encoding: 127 -1 126 +Encoding: 127 -1 124 Width: 164 VWidth: 2048 Flags: HW @@ -2945,7 +2928,7 @@ EndSplineSet EndChar StartChar: osbase5 -Encoding: 128 -1 127 +Encoding: 128 -1 125 Width: 164 VWidth: 2048 Flags: HW @@ -2973,7 +2956,7 @@ EndSplineSet EndChar StartChar: oslbase -Encoding: 129 -1 128 +Encoding: 129 -1 126 Width: 164 VWidth: 2048 Flags: HW @@ -2999,5 +2982,22 @@ SplineSet 0 129.75 l 21 EndSplineSet EndChar + +StartChar: hepisemusleft +Encoding: 82 -1 127 +Width: 1 +VWidth: 2048 +Flags: HW +HStem: -409 15 -94 15 221 15 536 15 +LayerCount: 2 +Fore +SplineSet +-2 64 m 25 + 0 96 l 25 + 1 96 l 25 + 1 64 l 25 + -2 64 l 25 +EndSplineSet +EndChar EndChars EndSplineFont diff --git a/fonts/parmesan-base.sfd b/fonts/parmesan-base.sfd index bdbd547da..4b7c28613 100644 --- a/fonts/parmesan-base.sfd +++ b/fonts/parmesan-base.sfd @@ -41,7 +41,7 @@ NameList: Adobe Glyph List DisplaySize: -96 AntiAlias: 1 FitToEm: 1 -WinInfo: 64 8 2 +WinInfo: 0 19 8 Grid 170 1300 m 0 170 -700 l 0 @@ -49,7 +49,7 @@ Grid 22 -700 l 0 EndSplineSet 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: 375 129 +BeginChars: 375 128 StartChar: Punctum Encoding: 0 -1 0 @@ -873,7 +873,7 @@ SplineSet EndSplineSet EndChar -StartChar: vsbase +StartChar: VirgaLineBR Encoding: 37 -1 37 Width: 161 Flags: HW @@ -939,7 +939,7 @@ SplineSet EndSplineSet EndChar -StartChar: qbase +StartChar: QuilismaLineTR Encoding: 40 -1 40 Width: 161 Flags: HW @@ -974,7 +974,7 @@ SplineSet EndSplineSet EndChar -StartChar: obase +StartChar: OriscusLineTR Encoding: 41 -1 41 Width: 192 Flags: HW @@ -1899,7 +1899,7 @@ EndSplineSet EndChar StartChar: PunctumSmall -Encoding: 81 -1 81 +Encoding: 81 -1 80 Width: 151 Flags: HW HStem: -409 15 -94 15 221 15 536 15 @@ -1918,25 +1918,8 @@ SplineSet EndSplineSet EndChar -StartChar: hepisemusleft -Encoding: 82 -1 81 -Width: 1 -VWidth: 2048 -Flags: HW -HStem: -409 15 -94 15 221 15 536 15 -LayerCount: 2 -Fore -SplineSet --2 64 m 25 - 0 96 l 29 - 1 96 l 29 - 1 64 l 25 - -2 64 l 25 -EndSplineSet -EndChar - StartChar: hepisemusright -Encoding: 83 -1 82 +Encoding: 83 -1 81 Width: 2 VWidth: 2048 Flags: HW @@ -1953,7 +1936,7 @@ EndSplineSet EndChar StartChar: mpdeminutus -Encoding: 84 -1 83 +Encoding: 84 -1 82 Width: 161 Flags: HW HStem: 536.497 15 221.497 15 -93.503 15 -408.503 15 @@ -1973,7 +1956,7 @@ EndSplineSet EndChar StartChar: PunctumDescendens -Encoding: 85 -1 84 +Encoding: 85 -1 83 Width: 161 Flags: HW HStem: -409 15 -94 15 221 15 536 15 @@ -1995,7 +1978,7 @@ EndSplineSet EndChar StartChar: PunctumAscendens -Encoding: 86 -1 85 +Encoding: 86 -1 84 Width: 161 Flags: HW HStem: -409 15 -94 15 221 15 536 15 @@ -2017,7 +2000,7 @@ EndSplineSet EndChar StartChar: mnbdeminutus -Encoding: 87 -1 86 +Encoding: 87 -1 85 Width: 161 Flags: HW HStem: -409 15 -94 15 221 15 536 15 @@ -2037,7 +2020,7 @@ EndSplineSet EndChar StartChar: mnbpdeminutus -Encoding: 88 -1 87 +Encoding: 88 -1 86 Width: 161 Flags: HW HStem: 536.058 15 221.058 15 -93.9416 15 -408.942 15 @@ -2057,7 +2040,7 @@ EndSplineSet EndChar StartChar: porrectusflexusnb1 -Encoding: 89 -1 88 +Encoding: 89 -1 87 Width: 340 VWidth: 2048 Flags: HW @@ -2077,7 +2060,7 @@ EndSplineSet EndChar StartChar: porrectusflexusnb2 -Encoding: 90 -1 89 +Encoding: 90 -1 88 Width: 428 VWidth: 2048 Flags: HW @@ -2097,7 +2080,7 @@ EndSplineSet EndChar StartChar: porrectusflexusnb3 -Encoding: 91 -1 90 +Encoding: 91 -1 89 Width: 586 VWidth: 2048 Flags: HW @@ -2117,7 +2100,7 @@ EndSplineSet EndChar StartChar: porrectusflexusnb4 -Encoding: 92 -1 91 +Encoding: 92 -1 90 Width: 670 VWidth: 2048 Flags: HW @@ -2137,7 +2120,7 @@ EndSplineSet EndChar StartChar: porrectusflexusnb5 -Encoding: 93 -1 92 +Encoding: 93 -1 91 Width: 931 VWidth: 2048 Flags: HW @@ -2157,7 +2140,7 @@ EndSplineSet EndChar StartChar: p2base -Encoding: 95 -1 94 +Encoding: 95 -1 92 Width: 161 Flags: W HStem: 536.228 15 221.228 15 -93.7716 15 -408.772 15 @@ -2177,7 +2160,7 @@ EndSplineSet EndChar StartChar: rvlbase -Encoding: 96 -1 95 +Encoding: 96 -1 93 Width: 161 Flags: HW HStem: -409 15 -94 15 221 15 536 15 @@ -2199,7 +2182,7 @@ EndSplineSet EndChar StartChar: msdeminutus -Encoding: 97 -1 96 +Encoding: 97 -1 94 Width: 161 Flags: HW HStem: 536.058 15 221.058 15 -93.9416 15 -408.942 15 @@ -2221,7 +2204,7 @@ EndSplineSet EndChar StartChar: mademinutus -Encoding: 98 -1 97 +Encoding: 98 -1 95 Width: 161 Flags: HW HStem: -409 15 -94 15 221 15 536 15 @@ -2243,7 +2226,7 @@ EndSplineSet EndChar StartChar: PunctumCavumHole -Encoding: 99 -1 98 +Encoding: 99 -1 96 Width: 161 VWidth: 1139 Flags: HW @@ -2262,7 +2245,7 @@ EndSplineSet EndChar StartChar: LineaPunctumCavumHole -Encoding: 100 -1 99 +Encoding: 100 -1 97 Width: 258 VWidth: 1139 Flags: HW @@ -2281,7 +2264,7 @@ EndSplineSet EndChar StartChar: NaturalHole -Encoding: 101 -1 100 +Encoding: 101 -1 98 Width: 141 VWidth: 1129 Flags: HW @@ -2298,7 +2281,7 @@ EndSplineSet EndChar StartChar: FlatHole -Encoding: 102 -1 101 +Encoding: 102 -1 99 Width: 159 VWidth: 1120 Flags: HW @@ -2317,7 +2300,7 @@ EndSplineSet EndChar StartChar: odbase -Encoding: 103 -1 102 +Encoding: 103 -1 100 Width: 192 Flags: HW HStem: -473.822 17.1 -114.722 17.1 244.378 17.1 603.478 17.1 @@ -2341,7 +2324,7 @@ EndSplineSet EndChar StartChar: DivisioDominican -Encoding: 104 -1 103 +Encoding: 104 -1 101 Width: 22 VWidth: 2048 Flags: W @@ -2358,7 +2341,7 @@ EndSplineSet EndChar StartChar: DivisioDominicanAlt -Encoding: 105 -1 104 +Encoding: 105 -1 102 Width: 22 VWidth: 2048 Flags: W @@ -2375,7 +2358,7 @@ EndSplineSet EndChar StartChar: Sharp -Encoding: 106 -1 105 +Encoding: 106 -1 103 Width: 258 VWidth: 2048 Flags: W @@ -2437,7 +2420,7 @@ EndSplineSet EndChar StartChar: SharpHole -Encoding: 107 -1 106 +Encoding: 107 -1 104 Width: 258 VWidth: 2048 Flags: W @@ -2454,7 +2437,7 @@ EndSplineSet EndChar StartChar: Linea -Encoding: 108 -1 107 +Encoding: 108 -1 105 Width: 431 VWidth: 2612 Flags: W @@ -2481,7 +2464,7 @@ EndSplineSet EndChar StartChar: RoundBrace -Encoding: 109 -1 108 +Encoding: 109 -1 106 Width: 937 VWidth: 2048 Flags: W @@ -2506,7 +2489,7 @@ EndSplineSet EndChar StartChar: CurlyBrace -Encoding: 110 -1 109 +Encoding: 110 -1 107 Width: 1006 VWidth: 2048 Flags: W @@ -2533,7 +2516,7 @@ EndSplineSet EndChar StartChar: BarBrace -Encoding: 111 -1 110 +Encoding: 111 -1 108 Width: 591 VWidth: 2048 Flags: W @@ -2558,7 +2541,7 @@ EndSplineSet EndChar StartChar: OriscusDeminutus -Encoding: 112 -1 111 +Encoding: 112 -1 109 Width: 192 Flags: HW HStem: -473.822 17.1 -114.722 17.1 244.378 17.1 603.478 17.1 @@ -2582,7 +2565,7 @@ EndSplineSet EndChar StartChar: obase4 -Encoding: 113 -1 112 +Encoding: 113 -1 110 Width: 192 Flags: HW HStem: -473.822 17.1 -114.722 17.1 244.378 17.1 603.478 17.1 @@ -2605,7 +2588,7 @@ EndSplineSet EndChar StartChar: obase8 -Encoding: 114 -1 113 +Encoding: 114 -1 111 Width: 192 Flags: HW HStem: -473.822 17.1 -114.722 17.1 244.378 17.1 603.478 17.1 @@ -2633,7 +2616,7 @@ EndSplineSet EndChar StartChar: VirgaReversaDescendens -Encoding: 115 -1 114 +Encoding: 115 -1 112 Width: 141 Flags: HW HStem: -409 15 -94 15 221 15 536 15 @@ -2657,7 +2640,7 @@ EndSplineSet EndChar StartChar: VirgaReversaLongqueueDescendens -Encoding: 116 -1 115 +Encoding: 116 -1 113 Width: 141 Flags: HW HStem: -409 15 -94 15 221 15 536 15 @@ -2681,7 +2664,7 @@ EndSplineSet EndChar StartChar: vbase2 -Encoding: 117 -1 116 +Encoding: 117 -1 114 Width: 161 Flags: HW HStem: -409 15 -94 15 221 15 536 15 @@ -2703,7 +2686,7 @@ EndSplineSet EndChar StartChar: vbase3 -Encoding: 118 -1 117 +Encoding: 118 -1 115 Width: 161 Flags: HW HStem: -409 15 -94 15 221 15 536 15 @@ -2725,7 +2708,7 @@ EndSplineSet EndChar StartChar: vbase4 -Encoding: 119 -1 118 +Encoding: 119 -1 116 Width: 161 Flags: HW HStem: -409 15 -94 15 221 15 536 15 @@ -2747,7 +2730,7 @@ EndSplineSet EndChar StartChar: vbase5 -Encoding: 120 -1 119 +Encoding: 120 -1 117 Width: 161 Flags: HW HStem: -409 15 -94 15 221 15 536 15 @@ -2769,7 +2752,7 @@ EndSplineSet EndChar StartChar: vbase1 -Encoding: 121 -1 120 +Encoding: 121 -1 118 Width: 161 Flags: HW HStem: -409 15 -94 15 221 15 536 15 @@ -2790,7 +2773,7 @@ EndSplineSet EndChar StartChar: OriscusScapusLongqueue -Encoding: 122 -1 121 +Encoding: 122 -1 119 Width: 192 Flags: HW HStem: -473.822 17.1 -114.722 17.1 244.378 17.1 603.478 17.1 @@ -2814,7 +2797,7 @@ EndSplineSet EndChar StartChar: OriscusScapus -Encoding: 123 -1 122 +Encoding: 123 -1 120 Width: 192 Flags: HW HStem: -473.822 17.1 -114.722 17.1 244.378 17.1 603.478 17.1 @@ -2838,7 +2821,7 @@ EndSplineSet EndChar StartChar: osbase1 -Encoding: 124 -1 123 +Encoding: 124 -1 121 Width: 192 Flags: HW HStem: -473.822 17.1 -114.722 17.1 244.378 17.1 603.478 17.1 @@ -2862,7 +2845,7 @@ EndSplineSet EndChar StartChar: osbase2 -Encoding: 125 -1 124 +Encoding: 125 -1 122 Width: 192 Flags: HW HStem: -473.822 17.1 -114.722 17.1 244.378 17.1 603.478 17.1 @@ -2888,7 +2871,7 @@ EndSplineSet EndChar StartChar: osbase3 -Encoding: 126 -1 125 +Encoding: 126 -1 123 Width: 192 Flags: HW HStem: -409 15 -94 15 221 15 536 15 @@ -2914,7 +2897,7 @@ EndSplineSet EndChar StartChar: osbase4 -Encoding: 127 -1 126 +Encoding: 127 -1 124 Width: 192 Flags: HW HStem: -409 15 -94 15 221 15 536 15 @@ -2940,7 +2923,7 @@ EndSplineSet EndChar StartChar: osbase5 -Encoding: 128 -1 127 +Encoding: 128 -1 125 Width: 192 Flags: HW HStem: -409 15 -94 15 221 15 536 15 @@ -2966,7 +2949,7 @@ EndSplineSet EndChar StartChar: oslbase -Encoding: 129 -1 128 +Encoding: 129 -1 126 Width: 192 Flags: HW HStem: -473.822 17.1 -114.722 17.1 244.378 17.1 603.478 17.1 @@ -2990,5 +2973,22 @@ SplineSet 22.1172 -359.873 l 5 EndSplineSet EndChar + +StartChar: hepisemusleft +Encoding: 82 -1 127 +Width: 1 +VWidth: 2048 +Flags: HW +HStem: -409 15 -94 15 221 15 536 15 +LayerCount: 2 +Fore +SplineSet +-2 64 m 25 + 0 96 l 29 + 1 96 l 29 + 1 64 l 25 + -2 64 l 25 +EndSplineSet +EndChar EndChars EndSplineFont diff --git a/fonts/squarize.py b/fonts/squarize.py index 514f5e84b..18ab8c0ef 100644 --- a/fonts/squarize.py +++ b/fonts/squarize.py @@ -85,6 +85,7 @@ BASE_HEIGHT = 157.5 HEPISEMUS_ADDITIONAL_WIDTH=5 +DEMINUTUS_VERTICAL_SHIFT=10 oldfont = None newfont = None font_name = None @@ -159,6 +160,7 @@ def main(): initialize_glyphs() font_width = {} hepisemus(font_width) + measures(font_width) pes(font_width) pes_quadratum(font_width) virga_strata(font_width) @@ -171,6 +173,7 @@ def main(): porrectus(font_width) porrectusflexus(font_width) torculusresupinus(font_width) + leading(font_width) # variants must be copied last! copy_variant_glyphs() newfont.generate(outfile) @@ -225,8 +228,11 @@ def precise_message(glyph_name): 'Virga', 'VirgaReversaLongqueue', 'VirgaReversa', + 'VirgaLineBR', 'Quilisma', + 'QuilismaLineTR', 'Oriscus', + 'OriscusLineTR', 'OriscusReversus', 'OriscusScapusLongqueue', 'OriscusScapus', @@ -274,15 +280,25 @@ def precise_message(glyph_name): 'PunctumAuctusLineBL', ] -def glyph_exists(glyphName, font): +def glyph_exists(glyph_name, font): "returns if glyph named glyphName exists in font (boolean)" result = True try: - font.selection.select(glyphName) + font.selection.select(glyph_name) except: result = False return result +def copy_existing_glyph(glyph_name): + "copies the named glyph, if it exists, and returns whether it was copied" + global oldfont + if glyph_exists(glyph_name, oldfont): + complete_paste(glyph_name) + set_glyph_name(glyph_name) + return True + else: + return False + # This will be populated by initialize_glyphs COMMON_DIRECT_VARIANTS = {} @@ -358,6 +374,11 @@ def get_width(widths, glyphName): S_TORCULUS_LIQUESCENS_QUILISMA = 'TorculusLiquescensQuilisma' S_FLEXUS_ORISCUS_SCAPUS = 'FlexusOriscusScapus' S_FLEXUS_ORISCUS_SCAPUS_LONGQUEUE = 'FlexusOriscusScapusLongqueue' +S_LEADING_ZERO_SPACER = 'LeadingZeroSpacer' +S_LEADING_LINE_SPACER = 'LeadingLineSpacer' +S_LEADING_PUNCTUM = 'LeadingPunctum' +S_LEADING_QUILISMA = 'LeadingQuilisma' +S_LEADING_ORISCUS = 'LeadingOriscus' # Liquescentiae L_NOTHING = 'Nothing' @@ -447,9 +468,12 @@ def write_deminutus(widths, i, j, length=0, tosimplify=0, firstbar=1): time. Sometimes we have to simplify before building the last glyph (tosimplify=1), and length is the offset. """ + global oldfont first_glyph = 'mademinutus' if firstbar == 1: first_glyph = 'mdeminutus' + if j == 1 and glyph_exists('mdeminutusam1', oldfont): + first_glyph = 'mdeminutusam1' elif firstbar == 0: first_glyph = 'mnbdeminutus' paste_and_move(first_glyph, length, i*BASE_HEIGHT) @@ -462,6 +486,25 @@ def write_deminutus(widths, i, j, length=0, tosimplify=0, firstbar=1): (i-j)*BASE_HEIGHT) return get_width(widths, first_glyph) +def measures(widths): + "Creates glyphs used only for measurement." + message("glyphs for measurement") + new_glyph() + first_glyph = 'PunctumLineBLBR' + second_glyph = 'PunctumLineTL' + simple_paste(first_glyph) + write_line(1, get_width(widths, first_glyph) - get_width(widths, 'line2'), -BASE_HEIGHT) + paste_and_move(second_glyph, get_width(widths, first_glyph) - get_width(widths, 'line2'), -BASE_HEIGHT) + set_width(get_width(widths, first_glyph)+get_width(widths, second_glyph)-get_width(widths, 'line2')) + end_glyph('FlexusLineBL') + new_glyph() + first_glyph = 'PunctumLineBL' + second_glyph = 'Punctum' + simple_paste(first_glyph) + paste_and_move(second_glyph, get_width(widths, first_glyph), -BASE_HEIGHT) + set_width(get_width(widths, first_glyph)+get_width(widths, second_glyph)) + end_glyph('FlexusAmOneLineBL') + def hepisemus(widths): "Creates horizontal episemae." global oldfont @@ -473,34 +516,45 @@ def hepisemus(widths): write_hepisemus(widths, get_width(widths, 'PunctumInclinatumDeminutus'), 'HEpisemusInclinatumDeminutus') write_hepisemus(widths, get_width(widths, 'Stropha'), 'HEpisemusStropha') write_hepisemus(widths, get_width(widths, 'Quilisma'), 'HEpisemusQuilisma') + write_hepisemus(widths, get_width(widths, 'QuilismaLineTR'), 'HEpisemusQuilismaLineTR') write_hepisemus(widths, get_width(widths, 'PunctumSmall'), 'HEpisemusHighPes') write_hepisemus(widths, get_width(widths, 'Oriscus'), 'HEpisemusOriscus') + write_hepisemus(widths, get_width(widths, 'VirgaLineBR'), 'HEpisemusVirgaLineBR') + write_hepisemus(widths, get_width(widths, 'OriscusLineTR'), 'HEpisemusOriscusLineTR') write_hepisemus(widths, get_width(widths, 'PunctumLineBR'), 'HEpisemusPunctumLineBR') write_hepisemus(widths, get_width(widths, 'PunctumLineBL'), 'HEpisemusPunctumLineBL') write_hepisemus(widths, get_width(widths, 'PunctumLineTL'), 'HEpisemusPunctumLineTL') write_hepisemus(widths, get_width(widths, 'PunctumLineTR'), 'HEpisemusPunctumLineTR') write_hepisemus(widths, get_width(widths, 'PunctumLineBLBR'), 'HEpisemusPunctumLineBLBR') write_hepisemus(widths, get_width(widths, 'PunctumAuctusLineBL'), 'HEpisemusPunctumAuctusLineBL') + reduction = get_width(widths, 'PunctumSmall') for i in range(1, MAX_INTERVAL+1): - write_hepisemus(widths, get_width(widths, "porrectus%d"%i), 'HEpisemusPorrectus%s' % AMBITUS[i]) + write_hepisemus(widths, get_width(widths, "porrectus%d"%i), + 'HEpisemusPorrectus%s' % AMBITUS[i], reduction) for i in range(1, MAX_INTERVAL+1): if glyph_exists("porrectusam1%d"%i, oldfont): - write_hepisemus(widths, get_width(widths, "porrectusam1%d"%i), 'HEpisemusPorrectusAmOne%s' % AMBITUS[i]) + write_hepisemus(widths, get_width(widths, "porrectusam1%d"%i), + 'HEpisemusPorrectusAmOne%s' % AMBITUS[i], reduction) else: - write_hepisemus(widths, get_width(widths, "porrectus%d"%i), 'HEpisemusPorrectusAmOne%s' % AMBITUS[i]) + write_hepisemus(widths, get_width(widths, "porrectus%d"%i), + 'HEpisemusPorrectusAmOne%s' % AMBITUS[i], reduction) + # porrectus flexus does not get reduced because the note after is to the right for i in range(1, MAX_INTERVAL+1): - write_hepisemus(widths, get_width(widths, "porrectusflexus%d"%i), 'HEpisemusPorrectusFlexus%s' % AMBITUS[i]) + write_hepisemus(widths, get_width(widths, "porrectusflexus%d"%i), + 'HEpisemusPorrectusFlexus%s' % AMBITUS[i]) -def write_hepisemus(widths, shape_width, glyphname): +def write_hepisemus(widths, shape_width, glyphname, reduction=0): "Writes the horizontal episemus glyphs." global HEPISEMUS_ADDITIONAL_WIDTH new_glyph() simple_paste("hepisemus_base") - scale(shape_width + 2*HEPISEMUS_ADDITIONAL_WIDTH, 1) + drawn_width = shape_width - reduction + scale(drawn_width + 2*HEPISEMUS_ADDITIONAL_WIDTH, 1) move(-HEPISEMUS_ADDITIONAL_WIDTH, 0) paste_and_move("hepisemusleft", -HEPISEMUS_ADDITIONAL_WIDTH, 0) paste_and_move("hepisemusright", - shape_width + HEPISEMUS_ADDITIONAL_WIDTH, 0) + drawn_width + HEPISEMUS_ADDITIONAL_WIDTH, 0) + # use the original width for the glyph for the sake of ledger lines set_width(shape_width) end_glyph(glyphname) @@ -512,7 +566,7 @@ def pes(widths): write_pes(widths, i, "p2base", S_PES) precise_message("pes quilisma") for i in range(1, MAX_INTERVAL+1): - write_pes(widths, i, "qbase", S_PES_QUILISMA) + write_pes(widths, i, "QuilismaLineTR", S_PES_QUILISMA) precise_message("pes deminutus") for i in range(1, MAX_INTERVAL+1): write_pes_deminutus(widths, i, "pesdeminutus", S_PES, L_DEMINUTUS) @@ -528,11 +582,9 @@ def write_pes(widths, i, first_glyph, shape, lique=L_NOTHING): global oldfont new_glyph() glyph_name = '%s%s%s' % (shape, AMBITUS[i], lique) - if glyph_exists(glyph_name, oldfont): - complete_paste(glyph_name) - set_glyph_name(glyph_name) + if copy_existing_glyph(glyph_name): return - get_width(widths, 'qbase') + get_width(widths, 'QuilismaLineTR') temp_width = 0 width_difference = get_width(widths, first_glyph)-get_width(widths, 'PunctumSmall') if width_difference < 0: @@ -557,8 +609,7 @@ def write_pes_debilis(widths, i, shape, lique=L_NOTHING): "Writes the pes debilis glyphs." new_glyph() glyph_name = '%s%s%s' % (shape, AMBITUS[i], lique) - if glyph_exists(glyph_name, oldfont): - complete_paste(glyph_name) + if copy_existing_glyph(glyph_name): return # with a deminutus it is much more beautiful than with a idebilis paste_and_move("deminutus", 0, 0) @@ -572,9 +623,7 @@ def write_pes_deminutus(widths, i, first_glyph, shape, lique=L_NOTHING): "Writes the pes deminutus glyphs." new_glyph() glyph_name = '%s%s%s' % (shape, AMBITUS[i], lique) - if glyph_exists(glyph_name, oldfont): - complete_paste(glyph_name) - set_glyph_name(glyph_name) + if copy_existing_glyph(glyph_name): return simple_paste(first_glyph) temp_width = get_width(widths, first_glyph)-get_width(widths, 'line2') @@ -589,9 +638,7 @@ def write_pes_debilis_deminutus(widths, i, shape, lique=L_NOTHING): "Writes the pes debilis deminutus glyphs." new_glyph() glyph_name = '%s%s%s' % (shape, AMBITUS[i], lique) - if glyph_exists(glyph_name, oldfont): - complete_paste(glyph_name) - set_glyph_name(glyph_name) + if copy_existing_glyph(glyph_name): return simple_paste("deminutus") write_line(i, get_width(widths, 'deminutus')-get_width(widths, 'line2'), BASE_HEIGHT) @@ -610,14 +657,14 @@ def pes_quadratum(widths): write_pes_quadratum(widths, i, "PunctumLineTR", "rvlbase", S_PES_QUADRATUM_LONGQUEUE) precise_message("pes quassus") for i in range(1, MAX_INTERVAL+1): - write_pes_quadratum(widths, i, "obase", "rvsbase", S_PES_QUASSUS) + write_pes_quadratum(widths, i, "OriscusLineTR", "rvsbase", S_PES_QUASSUS) for i in range(1, MAX_INTERVAL+1): - write_pes_quadratum(widths, i, "obase", "rvlbase", S_PES_QUASSUS_LONGQUEUE) + write_pes_quadratum(widths, i, "OriscusLineTR", "rvlbase", S_PES_QUASSUS_LONGQUEUE) precise_message("pes quilisma quadratum") for i in range(1, MAX_INTERVAL+1): - write_pes_quadratum(widths, i, "qbase", "rvsbase", S_PES_QUILISMA_QUADRATUM) + write_pes_quadratum(widths, i, "QuilismaLineTR", "rvsbase", S_PES_QUILISMA_QUADRATUM) for i in range(1, MAX_INTERVAL+1): - write_pes_quadratum(widths, i, "qbase", + write_pes_quadratum(widths, i, "QuilismaLineTR", "rvlbase", S_PES_QUILISMA_QUADRATUM_LONGQUEUE) precise_message("pes auctus ascendens") for i in range(1, MAX_INTERVAL+1): @@ -630,11 +677,11 @@ def pes_quadratum(widths): L_INITIO_DEBILIS_ASCENDENS) precise_message("pes quassus auctus ascendens") for i in range(1, MAX_INTERVAL+1): - write_pes_quadratum(widths, i, "obase", + write_pes_quadratum(widths, i, "OriscusLineTR", "auctusa2", S_PES_QUASSUS, L_ASCENDENS) precise_message("pes quilisma auctus ascendens") for i in range(1, MAX_INTERVAL+1): - write_pes_quadratum(widths, i, "qbase", + write_pes_quadratum(widths, i, "QuilismaLineTR", "auctusa2", S_PES_QUILISMA_QUADRATUM, L_ASCENDENS) precise_message("pes auctus descendens") @@ -648,20 +695,18 @@ def pes_quadratum(widths): L_INITIO_DEBILIS_DESCENDENS) precise_message("pes quassus auctus descendens") for i in range(1, MAX_INTERVAL+1): - write_pes_quadratum(widths, i, "obase", + write_pes_quadratum(widths, i, "OriscusLineTR", "PunctumAuctusLineBL", S_PES_QUASSUS, L_DESCENDENS) precise_message("pes quilisma auctus descendens") for i in range(1, MAX_INTERVAL+1): - write_pes_quadratum(widths, i, "qbase", "PunctumAuctusLineBL", S_PES_QUILISMA_QUADRATUM, + write_pes_quadratum(widths, i, "QuilismaLineTR", "PunctumAuctusLineBL", S_PES_QUILISMA_QUADRATUM, L_DESCENDENS) def write_pes_quadratum(widths, i, first_glyph, last_glyph, shape, lique=L_NOTHING): "Writes the pes quadratum glyphs." new_glyph() glyph_name = '%s%s%s' % (shape, AMBITUS[i], lique) - if glyph_exists(glyph_name, oldfont): - complete_paste(glyph_name) - set_glyph_name(glyph_name) + if copy_existing_glyph(glyph_name): return if first_glyph == "idebilis": first_width = get_width(widths, 'idebilis')-get_width(widths, 'line2') @@ -701,9 +746,7 @@ def write_virga_strata(widths, i, first_glyph, last_glyph, shape, lique=L_NOTHIN "Writes the virga strata glyphs." new_glyph() glyph_name = '%s%s%s' % (shape, AMBITUS[i], lique) - if glyph_exists(glyph_name, oldfont): - complete_paste(glyph_name) - set_glyph_name(glyph_name) + if copy_existing_glyph(glyph_name): return if i == 1: first_glyph = 'Punctum' @@ -733,9 +776,7 @@ def write_salicus(widths, i, j, last_glyph, shape, lique=L_NOTHING): "Writes the salicus glyphs." new_glyph() glyph_name = '%s%s%s%s' % (shape, AMBITUS[i], AMBITUS[j], lique) - if glyph_exists(glyph_name, oldfont): - complete_paste(glyph_name) - set_glyph_name(glyph_name) + if copy_existing_glyph(glyph_name): return if j == 1: if last_glyph == 'rvsbase': @@ -750,7 +791,7 @@ def write_salicus(widths, i, j, last_glyph, shape, lique=L_NOTHING): elif i == 1: first_glyph = 'Punctum' first_width = get_width(widths, first_glyph) - middle_glyph = 'obase' + middle_glyph = 'OriscusLineTR' middle_width = get_width(widths, middle_glyph)-get_width(widths, 'line2') elif j == 1: first_glyph = 'PunctumLineTR' @@ -866,9 +907,7 @@ def write_flexus(widths, i, first_glyph, last_glyph, shape, lique=L_NOTHING): "Writes the flexus glyphs." new_glyph() glyph_name = '%s%s%s' % (shape, AMBITUS[i], lique) - if glyph_exists(glyph_name, oldfont): - complete_paste(glyph_name) - set_glyph_name(glyph_name) + if copy_existing_glyph(glyph_name): return # we add a queue if it is a deminutus if first_glyph == "mdeminutus": @@ -906,7 +945,7 @@ def write_flexus(widths, i, first_glyph, last_glyph, shape, lique=L_NOTHING): first_glyph = 'OriscusScapus' elif first_glyph == 'oslbase': first_glyph = 'OriscusScapusLongqueue' - elif first_glyph == 'vsbase': + elif first_glyph == 'VirgaLineBR': first_glyph = 'VirgaReversa' elif first_glyph == 'vlbase': first_glyph = 'VirgaReversaLongqueue' @@ -964,27 +1003,21 @@ def write_porrectus(widths, i, j, last_glyph, with_bar, shape, lique=L_NOTHING): global oldfont new_glyph() glyph_name = '%s%s%s%s' % (shape, AMBITUS[i], AMBITUS[j], lique) - if glyph_exists(glyph_name, oldfont): - complete_paste(glyph_name) - set_glyph_name(glyph_name) + if copy_existing_glyph(glyph_name): return first_glyph = "porrectus%d" % i if j == 1 and glyph_exists("porrectusam1%d" % i, oldfont): first_glyph = "porrectusam1%d" % i if last_glyph == 'auctusa2' or last_glyph == 'PunctumAuctusLineBL': - if j == 1: - first_glyph = "porrectusflexusnb%d" % i - else: - first_glyph = "porrectusflexus%d" % i + first_glyph = "porrectusflexus%d" % i if not glyph_exists(first_glyph, oldfont): return if with_bar: write_first_bar(i) length = get_width(widths, first_glyph) simple_paste(first_glyph) - if j != 1 or (last_glyph != 'auctusa2' and last_glyph != 'PunctumAuctusLineBL'): - write_line(j, length-get_width(widths, 'line2'), (-i+1)*BASE_HEIGHT) - length = length-get_width(widths, 'line2') + write_line(j, length-get_width(widths, 'line2'), (-i+1)*BASE_HEIGHT) + length = length-get_width(widths, 'line2') if with_bar: simplify() if last_glyph == "rdeminutus": @@ -992,10 +1025,6 @@ def write_porrectus(widths, i, j, last_glyph, with_bar, shape, lique=L_NOTHING): paste_and_move(last_glyph, (length-get_width(widths, last_glyph)), (j-i)*BASE_HEIGHT) elif last_glyph == 'auctusa2' or last_glyph == 'PunctumAuctusLineBL': - if last_glyph == 'auctusa2' and j == 1: - last_glyph = 'PunctumAscendens' - elif last_glyph == 'PunctumAuctusLineBL' and j == 1: - last_glyph = 'PunctumDescendens' paste_and_move(last_glyph, (length), (j-i)*BASE_HEIGHT) length = length + get_width(widths, last_glyph) else: @@ -1010,9 +1039,7 @@ def write_alt_porrectus_deminutus(widths, i, j): "Writes the alternate porrectur deminutus glyphs." new_glyph() glyph_name = 'Porrectus%s%sDeminutus.alt' % (AMBITUS[i], AMBITUS[j]) - if glyph_exists(glyph_name, oldfont): - complete_paste(glyph_name) - set_glyph_name(glyph_name) + if copy_existing_glyph(glyph_name): return write_first_bar(i) if i == 1: @@ -1101,9 +1128,7 @@ def write_porrectusflexus(widths, i, j, k, last_glyph, with_bar, global oldfont new_glyph() glyph_name = '%s%s%s%s%s' % (shape, AMBITUS[i], AMBITUS[j], AMBITUS[k], lique) - if glyph_exists(glyph_name, oldfont): - complete_paste(glyph_name) - set_glyph_name(glyph_name) + if copy_existing_glyph(glyph_name): return if j == 1: first_glyph = "porrectusflexusnb%d" % i @@ -1117,13 +1142,9 @@ def write_porrectusflexus(widths, i, j, k, last_glyph, with_bar, simple_paste(first_glyph) write_line(j, length-get_width(widths, 'line2'), (-i+1)*BASE_HEIGHT) if last_glyph == "deminutus": - if j == 1: - width_dem = write_deminutus(widths, j-i, k, length, with_bar, firstbar=0) - length = length+width_dem - else: - width_dem = write_deminutus(widths, j-i, k, length-get_width(widths, 'line2'), - with_bar, firstbar=1) - length = length+width_dem-get_width(widths, 'line2') + width_dem = write_deminutus(widths, j-i, k, length-get_width(widths, 'line2'), + with_bar, firstbar=1) + length = length+width_dem-get_width(widths, 'line2') else: simplify() middle_glyph = 'PunctumLineBLBR' @@ -1163,7 +1184,7 @@ def torculus(widths): write_torculus(widths, i, j, "PunctumLineTR", "PunctumLineTL", S_TORCULUS) for i in range(1, MAX_INTERVAL+1): for j in range(1, MAX_INTERVAL+1): - write_torculus(widths, i, j, "qbase", "PunctumLineTL", S_TORCULUS_QUILISMA) + write_torculus(widths, i, j, "QuilismaLineTR", "PunctumLineTL", S_TORCULUS_QUILISMA) precise_message("torculus initio debilis") for i in range(1, MAX_INTERVAL+1): for j in range(1, MAX_INTERVAL+1): @@ -1176,7 +1197,7 @@ def torculus(widths): L_DESCENDENS) for i in range(1, MAX_INTERVAL+1): for j in range(1, MAX_INTERVAL+1): - write_torculus(widths, i, j, "qbase", "auctusd1", S_TORCULUS_QUILISMA, + write_torculus(widths, i, j, "QuilismaLineTR", "auctusd1", S_TORCULUS_QUILISMA, L_DESCENDENS) precise_message("torculus initio debilis auctus descendens") for i in range(1, MAX_INTERVAL+1): @@ -1190,7 +1211,7 @@ def torculus(widths): S_TORCULUS, L_ASCENDENS) for i in range(1, MAX_INTERVAL+1): for j in range(1, MAX_INTERVAL+1): - write_torculus(widths, i, j, "qbase", "auctusa1", S_TORCULUS_QUILISMA, + write_torculus(widths, i, j, "QuilismaLineTR", "auctusa1", S_TORCULUS_QUILISMA, L_ASCENDENS) precise_message("torculus initio debilis auctus ascendens") for i in range(1, MAX_INTERVAL+1): @@ -1204,7 +1225,7 @@ def torculus(widths): L_DEMINUTUS) for i in range(1, MAX_INTERVAL+1): for j in range(1, MAX_INTERVAL+1): - write_torculus(widths, i, j, "qbase", "deminutus", S_TORCULUS_QUILISMA, + write_torculus(widths, i, j, "QuilismaLineTR", "deminutus", S_TORCULUS_QUILISMA, L_DEMINUTUS) precise_message("torculus initio debilis deminutus") for i in range(1, MAX_INTERVAL+1): @@ -1216,12 +1237,10 @@ def write_torculus(widths, i, j, first_glyph, last_glyph, shape, lique=L_NOTHING "Writes the torculus glyphs." new_glyph() glyph_name = '%s%s%s%s' % (shape, AMBITUS[i], AMBITUS[j], lique) - if glyph_exists(glyph_name, oldfont): - complete_paste(glyph_name) - set_glyph_name(glyph_name) + if copy_existing_glyph(glyph_name): return length = get_width(widths, first_glyph)-get_width(widths, 'line2') - if first_glyph == "qbase": + if first_glyph == "QuilismaLineTR": if i == 1: first_glyph = 'Quilisma' length = get_width(widths, first_glyph) @@ -1276,7 +1295,7 @@ def torculus_liquescens(widths): for i in range(1, MAX_INTERVAL+1): for j in range(1, MAX_INTERVAL+1): for k in range(1, MAX_INTERVAL+1): - write_torculus_liquescens(widths, i, j, k, 'qbase', + write_torculus_liquescens(widths, i, j, k, 'QuilismaLineTR', S_TORCULUS_LIQUESCENS_QUILISMA, L_DEMINUTUS) def write_torculus_liquescens(widths, i, j, k, first_glyph, shape, @@ -1284,12 +1303,10 @@ def write_torculus_liquescens(widths, i, j, k, first_glyph, shape, "Writes the torculus liquescens glyphs." new_glyph() glyph_name = '%s%s%s%s%s' % (shape, AMBITUS[i], AMBITUS[j], AMBITUS[k], lique) - if glyph_exists(glyph_name, oldfont): - complete_paste(glyph_name) - set_glyph_name(glyph_name) + if copy_existing_glyph(glyph_name): return length = get_width(widths, first_glyph)-get_width(widths, 'line2') - if first_glyph == "qbase": + if first_glyph == "QuilismaLineTR": if i == 1: first_glyph = 'Quilisma' length = get_width(widths, first_glyph) @@ -1338,7 +1355,7 @@ def torculusresupinus(widths): for i in range(1, MAX_INTERVAL+1): for j in range(1, MAX_INTERVAL+1): for k in range(1, MAX_INTERVAL+1): - write_torculusresupinus(widths, i, j, k, 'qbase', 'PunctumSmall', + write_torculusresupinus(widths, i, j, k, 'QuilismaLineTR', 'PunctumSmall', S_TORCULUS_RESUPINUS_QUILISMA) precise_message("torculus resupinus deminutus") for i in range(1, MAX_INTERVAL+1): @@ -1355,7 +1372,7 @@ def torculusresupinus(widths): for i in range(1, MAX_INTERVAL+1): for j in range(1, MAX_INTERVAL+1): for k in range(1, MAX_INTERVAL+1): - write_torculusresupinus(widths, i, j, k, 'qbase', 'rdeminutus', + write_torculusresupinus(widths, i, j, k, 'QuilismaLineTR', 'rdeminutus', S_TORCULUS_RESUPINUS_QUILISMA, L_DEMINUTUS) precise_message("torculus resupinus deminutus alt") @@ -1374,7 +1391,7 @@ def torculusresupinus(widths): for i in range(1, MAX_INTERVAL+1): for j in range(1, MAX_INTERVAL+1): for k in range(1, MAX_INTERVAL+1): - write_alt_torculusresupinusdeminutus(widths, i, j, k, 'qbase', + write_alt_torculusresupinusdeminutus(widths, i, j, k, 'QuilismaLineTR', S_TORCULUS_RESUPINUS_QUILISMA, L_DEMINUTUS) precise_message("torculus resupinus auctus ascendens") @@ -1392,7 +1409,7 @@ def torculusresupinus(widths): for i in range(1, MAX_INTERVAL+1): for j in range(1, MAX_INTERVAL+1): for k in range(1, MAX_INTERVAL+1): - write_torculusresupinus(widths, i, j, k, 'qbase', "auctusa2", + write_torculusresupinus(widths, i, j, k, 'QuilismaLineTR', "auctusa2", S_TORCULUS_RESUPINUS_QUILISMA, L_ASCENDENS) precise_message("torculus resupinus auctus descendens") @@ -1411,7 +1428,7 @@ def torculusresupinus(widths): for i in range(1, MAX_INTERVAL+1): for j in range(1, MAX_INTERVAL+1): for k in range(1, MAX_INTERVAL+1): - write_torculusresupinus(widths, i, j, k, 'qbase', "PunctumAuctusLineBL", + write_torculusresupinus(widths, i, j, k, 'QuilismaLineTR', "PunctumAuctusLineBL", S_TORCULUS_RESUPINUS_QUILISMA, L_DESCENDENS) @@ -1421,24 +1438,19 @@ def write_torculusresupinus(widths, i, j, k, first_glyph, last_glyph, shape, global oldfont new_glyph() glyph_name = '%s%s%s%s%s' % (shape, AMBITUS[i], AMBITUS[j], AMBITUS[k], lique) - if glyph_exists(glyph_name, oldfont): - complete_paste(glyph_name) - set_glyph_name(glyph_name) + if copy_existing_glyph(glyph_name): return middle_glyph = "porrectus%d" % j if k == 1 and glyph_exists("porrectusam1%d" % j, oldfont): middle_glyph = "porrectusam1%d" % j if last_glyph == 'auctusa2' or last_glyph == 'PunctumAuctusLineBL': - if k == 1: - middle_glyph = "porrectusflexusnb%d" % j - else: - middle_glyph = "porrectusflexus%d" % j + middle_glyph = "porrectusflexus%d" % j if not glyph_exists(middle_glyph, oldfont): return if i == 1 and first_glyph != 'idebilis': if first_glyph == 'PunctumLineTR': first_glyph = 'Punctum' - elif first_glyph == 'qbase': + elif first_glyph == 'QuilismaLineTR': first_glyph = 'Quilisma' length = get_width(widths, first_glyph)+0.1 else: @@ -1448,7 +1460,7 @@ def write_torculusresupinus(widths, i, j, k, first_glyph, last_glyph, shape, write_line(i, length, BASE_HEIGHT) paste_and_move(middle_glyph, length, i*BASE_HEIGHT) length = length + get_width(widths, middle_glyph) - if (last_glyph != 'auctusa2' and last_glyph != 'PunctumAuctusLineBL') or k != 1: + if k != 1: write_line(k, length-get_width(widths, 'line2'), (i-j+1)*BASE_HEIGHT) simplify() if last_glyph == "rdeminutus": @@ -1456,12 +1468,6 @@ def write_torculusresupinus(widths, i, j, k, first_glyph, last_glyph, shape, (length-get_width(widths, 'rdeminutus')), (i-j+k)*BASE_HEIGHT) elif last_glyph == 'auctusa2' or last_glyph == 'PunctumAuctusLineBL': - if last_glyph == 'auctusa2' and k == 1: - last_glyph = 'PunctumAscendens' - elif last_glyph == 'PunctumAuctusLineBL' and k == 1: - last_glyph = 'PunctumDescendens' - if k == 1: - length = length+get_width(widths, 'line2') paste_and_move(last_glyph, (length-get_width(widths, 'line2')), (i-j+k)*BASE_HEIGHT) length = length - get_width(widths, 'line2') + get_width(widths, last_glyph) else: @@ -1476,16 +1482,14 @@ def write_alt_torculusresupinusdeminutus(widths, i, j, k, first_glyph, "Writes the torculusresupinusdeminutus glyphs." new_glyph() glyph_name = '%s%s%s%s%s.alt' % (shape, AMBITUS[i], AMBITUS[j], AMBITUS[k], lique) - if glyph_exists(glyph_name, oldfont): - complete_paste(glyph_name) - set_glyph_name(glyph_name) + if copy_existing_glyph(glyph_name): return length = get_width(widths, first_glyph)-get_width(widths, 'line2') if i == 1: if first_glyph == 'PunctumLineTR': first_glyph = 'Punctum' length = get_width(widths, first_glyph)+0.1 - elif first_glyph == 'qbase': + elif first_glyph == 'QuilismaLineTR': first_glyph = 'Quilisma' length = get_width(widths, first_glyph)+0.1 simple_paste(first_glyph) @@ -1537,11 +1541,11 @@ def scandicus(widths): def write_scandicus(widths, i, j, last_glyph, lique=L_NOTHING): "Writes the scandicus glyphs." + global oldfont new_glyph() + final_vertical_shift = 0 glyph_name = '%s%s%s%s' % (S_SCANDICUS, AMBITUS[i], AMBITUS[j], lique) - if glyph_exists(glyph_name, oldfont): - complete_paste(glyph_name) - set_glyph_name(glyph_name) + if copy_existing_glyph(glyph_name): return # special case of i=j=1, we use glyph 1025 directly if i == 1 and j == 1 and lique == L_NOTHING: @@ -1557,24 +1561,30 @@ def write_scandicus(widths, i, j, last_glyph, lique=L_NOTHING): second_glyph = 'p2base' if lique == L_DEMINUTUS: second_glyph = 'mnbpdeminutus' + if j == 1: + final_vertical_shift = DEMINUTUS_VERTICAL_SHIFT else: simple_paste('PunctumLineTR') length = get_width(widths, 'PunctumLineTR') - get_width(widths, 'line2') write_line(i, length, BASE_HEIGHT) second_glyph = 'msdeminutus' + if j == 1 and glyph_exists('msdeminutusam1', oldfont): + second_glyph = 'msdeminutusam1' + if j == 1: + final_vertical_shift = DEMINUTUS_VERTICAL_SHIFT paste_and_move(second_glyph, length, i*BASE_HEIGHT) if (i == 1) and lique == L_NOTHING: length = length + get_width(widths, 'Punctum') else: - length = length + get_width(widths, 'msdeminutus') + length = length + get_width(widths, second_glyph) if j != 1: write_line(j, length - get_width(widths, 'line2'), (i+1) * BASE_HEIGHT) if last_glyph == 'rdeminutus': paste_and_move('rdeminutus', length - - get_width(widths, 'rdeminutus'), (i+j)*BASE_HEIGHT) + get_width(widths, 'rdeminutus'), (i+j)*BASE_HEIGHT+final_vertical_shift) else: paste_and_move(last_glyph, length - get_width(widths, last_glyph), - (i+j)*BASE_HEIGHT) + (i+j)*BASE_HEIGHT+final_vertical_shift) set_width(length) end_glyph(glyph_name) @@ -1583,7 +1593,7 @@ def ancus(widths): message("ancus") for i in range(1, MAX_INTERVAL+1): for j in range(1, MAX_INTERVAL+1): - write_ancus(widths, i, j, 'vsbase', S_ANCUS) + write_ancus(widths, i, j, 'VirgaLineBR', S_ANCUS) for i in range(1, MAX_INTERVAL+1): for j in range(1, MAX_INTERVAL+1): write_ancus(widths, i, j, 'vlbase', S_ANCUS_LONGQUEUE) @@ -1592,13 +1602,11 @@ def write_ancus(widths, i, j, first_glyph, glyph_type): "Writes the ancus glyphs." new_glyph() glyph_name = '%s%s%s%s' % (glyph_type, AMBITUS[i], AMBITUS[j], L_DEMINUTUS) - if glyph_exists(glyph_name, oldfont): - complete_paste(glyph_name) - set_glyph_name(glyph_name) + if copy_existing_glyph(glyph_name): return if i == 1: second_glyph = 'mnbdeminutus' - if first_glyph == 'vsbase': + if first_glyph == 'VirgaLineBR': first_glyph = 'VirgaReversa' else: first_glyph = 'VirgaReversaLongqueue' @@ -1618,5 +1626,51 @@ def write_ancus(widths, i, j, first_glyph, glyph_type): set_width(length) end_glyph(glyph_name) +def leading(widths): + "Creates the leading fusion glyphs." + message("leading fusion glyphs") + for i in range(1, MAX_INTERVAL+1): + write_leading(widths, i, 'PunctumLineTR', S_LEADING_PUNCTUM) + for i in range(1, MAX_INTERVAL+1): + write_leading(widths, i, 'idebilis', S_LEADING_PUNCTUM, L_INITIO_DEBILIS) + for i in range(1, MAX_INTERVAL+1): + write_leading(widths, i, 'QuilismaLineTR', S_LEADING_QUILISMA) + for i in range(1, MAX_INTERVAL+1): + write_leading(widths, i, 'OriscusLineTR', S_LEADING_ORISCUS) + +def write_leading_spacer(widths, glyph_name, width): + "Writes the leading fusion spacer glyph." + new_glyph() + if copy_existing_glyph(glyph_name): + return + length = 0 + write_line(2, length, 0) + set_width(width) + end_glyph(glyph_name) + +# lique has a slightly different meaning here +def write_leading(widths, i, first_glyph, glyph_type, lique=''): + "Writes the leading fusion glyphs." + new_glyph() + glyph_name = '%s%s%s' % (glyph_type, AMBITUS[i], lique) + if copy_existing_glyph(glyph_name): + return + length = -get_width(widths, 'line2') + if i == 1 and first_glyph != 'idebilis': + length = 0.1 + if first_glyph == 'PunctumLineTR': + first_glyph = 'Punctum' + elif first_glyph == 'QuilismaLineTR': + first_glyph = 'Quilisma' + elif first_glyph == 'OriscusLineTR': + first_glyph = 'Oriscus' + length = get_width(widths,first_glyph) + length + paste_and_move(first_glyph, 0, -i * BASE_HEIGHT) + if i != 1: + write_line(i, length, -(i-1) * BASE_HEIGHT) + simplify() + set_width(length) + end_glyph(glyph_name) + if __name__ == "__main__": main() diff --git a/src/gregoriotex/gregoriotex-write.c b/src/gregoriotex/gregoriotex-write.c index c1b1581d6..f9bbf75a5 100644 --- a/src/gregoriotex/gregoriotex-write.c +++ b/src/gregoriotex/gregoriotex-write.c @@ -148,8 +148,8 @@ static gregoriotex_status *status = NULL; static grestyle_style gregoriotex_ignore_style = ST_NO_STYLE; static char *gregoriotex_determine_note_number_and_type(gregorio_note *note, - gregorio_glyph *glyph, gregorio_element *element, - gtex_alignment *type) { + gregorio_glyph *glyph, gregorio_element *element, gtex_alignment * type) +{ if (!note) { gregorio_message(_ ("called with NULL pointer"), @@ -323,7 +323,8 @@ static char *gregoriotex_determine_liquescentia(gtex_glyph_liquescentia type, return "Nothing"; } -static inline int compute_ambitus(gregorio_note *current_note) { +static inline int compute_ambitus(gregorio_note *current_note) +{ int first = current_note->u.note.pitch; int second = current_note->next->u.note.pitch; int ambitus; @@ -365,7 +366,8 @@ static char *gregoriotex_determine_glyph_name(gregorio_glyph *glyph, current_note = glyph->u.notes.first_note; if (!current_note->next) { gregorio_message(_("called with a multi-note glyph that has only " - "one note"), "gregoriotex_determine_interval", ERROR, 0); + "one note"), "gregoriotex_determine_interval", ERROR, + 0); return ""; } if (!(ambitus1 = compute_ambitus(current_note))) { @@ -399,8 +401,7 @@ static char *gregoriotex_determine_glyph_name(gregorio_glyph *glyph, // very basic, it is only the global dimensions : torculus, one_note, etc. static char *gregoriotex_determine_number_and_type(gregorio_glyph *glyph, - gregorio_element *element, gtex_alignment * type, - gtex_type * gtype) + gregorio_element *element, gtex_alignment * type, gtex_type * gtype) { char *shape = NULL; gtex_glyph_liquescentia ltype; @@ -555,34 +556,31 @@ static char *gregoriotex_determine_number_and_type(gregorio_glyph *glyph, } break; case G_TORCULUS: + *gtype = T_TORCULUS; if (glyph->u.notes.first_note->u.note.shape == S_QUILISMA) { *type = AT_QUILISMA; - *gtype = T_TORCULUS_QUILISMA; shape = "TorculusQuilisma"; ltype = LG_NO_INITIO; } else { *type = AT_ONE_NOTE; - *gtype = T_TORCULUS; shape = "Torculus"; ltype = LG_ALL; } break; case G_TORCULUS_LIQUESCENS: + *gtype = T_TORCULUS_LIQUESCENS; if (glyph->u.notes.first_note->u.note.shape == S_QUILISMA) { *type = AT_QUILISMA; - *gtype = T_TORCULUS_LIQUESCENS_QUILISMA; shape = "TorculusLiquescensQuilisma"; } else { *type = AT_ONE_NOTE; - *gtype = T_TORCULUS_LIQUESCENS; shape = "TorculusLiquescens"; } ltype = LG_ONLY_DEMINUTUS; break; case G_TORCULUS_RESUPINUS_FLEXUS: - // not sure about that... TODO: check *type = AT_ONE_NOTE; - *gtype = T_TORCULUS_RESUPINUS; + *gtype = T_TORCULUS_RESUPINUS_FLEXUS; break; case G_PORRECTUS: *type = AT_PORRECTUS; @@ -591,32 +589,31 @@ static char *gregoriotex_determine_number_and_type(gregorio_glyph *glyph, ltype = LG_NO_INITIO; break; case G_TORCULUS_RESUPINUS: + *gtype = T_TORCULUS_RESUPINUS; if (glyph->u.notes.first_note->u.note.shape == S_QUILISMA) { *type = AT_QUILISMA; - *gtype = T_TORCULUS_RESUPINUS_QUILISMA; shape = "TorculusResupinusQuilisma"; } else { *type = AT_ONE_NOTE; - *gtype = T_TORCULUS_RESUPINUS; shape = "TorculusResupinus"; } ltype = LG_ALL; break; case G_PORRECTUS_FLEXUS: *type = AT_PORRECTUS; - *gtype = T_PORRECTUSFLEXUS; + *gtype = T_PORRECTUS_FLEXUS; shape = "PorrectusFlexus"; ltype = LG_NO_INITIO; break; case G_PORRECTUS_NO_BAR: *type = AT_PORRECTUS; - *gtype = T_PORRECTUS_NOBAR; + *gtype = T_TORCULUS_RESUPINUS; shape = "PorrectusNobar"; ltype = LG_NO_INITIO; break; case G_PORRECTUS_FLEXUS_NO_BAR: *type = AT_PORRECTUS; - *gtype = T_PORRECTUSFLEXUS_NOBAR; + *gtype = T_TORCULUS_RESUPINUS_FLEXUS; shape = "PorrectusFlexusNobar"; ltype = LG_NO_INITIO; break; @@ -692,7 +689,6 @@ static char *gregoriotex_determine_number_and_type(gregorio_glyph *glyph, if (shape) { shape = gregoriotex_determine_glyph_name(glyph, shape, ltype); } - // we change to the original liquescentia glyph->u.notes.liquescentia = liquescentia; // we fix *type with initio_debilis @@ -761,8 +757,8 @@ static inline bool is_clef(gregorio_type x) * (c4), (::c4), (z0c4) or (z0::c4). It returns the gregorio_element of the * clef change. */ -static gregorio_element *gregoriotex_syllable_is_clef_change( - gregorio_syllable *syllable) +static gregorio_element *gregoriotex_syllable_is_clef_change(gregorio_syllable + *syllable) { gregorio_element *element; if (!syllable || !syllable->elements || !syllable->elements[0]) { @@ -1117,8 +1113,8 @@ static void gtex_print_char(FILE *f, grewchar to_print) // a function to map the internal ST_* styles to gregoriotex styles as defined // in gregoriotex-syllables.tex -static unsigned char gregoriotex_internal_style_to_gregoriotex( - grestyle_style style) +static unsigned char gregoriotex_internal_style_to_gregoriotex(grestyle_style + style) { switch (style) { case ST_ITALIC: @@ -1452,13 +1448,14 @@ static void gregoriotex_write_punctum_mora(FILE *f, gregorio_glyph *glyph, unsigned char punctum_inclinatum = 0; // a temp variable gregorio_note *tmpnote; + // TODO: ensure the first note of a T_ONE_NOTE_TRF is handled correctly // first: the very special case where type == T_ONE_NOTE_TRF, the punctum // is // at a strange place: - if (type == T_ONE_NOTE_TRF) { - fprintf(f, "\\grepunctummora{%c}{1}{0}{0}%%\n", - current_note->u.note.pitch); - } + //if (type == T_ONE_NOTE_TRF) { + // fprintf(f, "\\grepunctummora{%c}{1}{0}{0}%%\n", + // current_note->u.note.pitch); + //} // we go into this switch only if it is the note before the last note if (current_note->next) { switch (glyph->u.notes.glyph_type) { @@ -1619,9 +1616,19 @@ static inline void number_note_before_last_note(gregorio_glyph *current_glyph, if ((current_note->u.note.pitch - current_note->next->u.note.pitch) == 1 || (current_note->u.note.pitch - current_note->next->u.note.pitch) == -1) { - *number = 17; + if (!current_note->previous || current_note->u.note.pitch - + current_note->previous->u.note.pitch > 1) { + *number = 47; + } else { + *number = 17; + } } else { - *number = 2; + if (!current_note->previous || current_note->u.note.pitch - + current_note->previous->u.note.pitch > 1) { + *number = 46; + } else { + *number = 2; + } } } } @@ -1629,17 +1636,63 @@ static inline void number_note_before_last_note(gregorio_glyph *current_glyph, // num can be 0 or 18 according if the last note is a standard punctum or a // smaller punctum (for pes, porrectus and torculus resupinus static inline void number_last_note(gregorio_glyph *current_glyph, char *number, - char num) + char num, gregorio_note *current_note, bool no_ambitus_one) { - if (current_glyph->u.notes.liquescentia == L_DEMINUTUS_INITIO_DEBILIS - || current_glyph->u.notes.liquescentia == L_DEMINUTUS) { + if (current_glyph->u.notes.liquescentia & L_DEMINUTUS) { /* * may seem strange, but it is unlogical to typeset a small horizontal * episemus at the end of a flexus deminutus */ *number = 1; - } else { + return; + } + if (!current_note->previous || (!no_ambitus_one && (num == 18 || current_note->previous->u.note.pitch - + current_note->u.note.pitch == 1 || + current_note->u.note.pitch - current_note->previous->u.note.pitch == 1))) { *number = num; + return; + } + if (current_note->previous->u.note.pitch < current_note->u.note.pitch) { + if (current_glyph->u.notes.liquescentia & + (L_AUCTUS_ASCENDENS | L_AUCTUS_DESCENDENS | L_AUCTA)) { + *number = 53; + } else { + *number = 55; + } + } else { + *number = 52; + } +} + +static inline void number_first_note(char *number, + gregorio_note *current_note, gregorio_glyph *current_glyph) +{ + bool ambitus_one = true; + if (current_glyph->u.notes.liquescentia >= L_INITIO_DEBILIS) { + *number = 7; + } else { + if (current_note->next && current_note->next->u.note.pitch - + current_note->u.note.pitch != 1 && + current_note->u.note.pitch - current_note->next->u.note.pitch != 1) { + ambitus_one = false; + } + if (current_note->u.note.shape == S_ORISCUS) { + *number = ambitus_one ? 19 : 51; + return; + } + if (current_note->u.note.shape == S_QUILISMA) { + *number = ambitus_one ? 20 : 50; + return; + } + if (ambitus_one) { + *number = 6; + return; + } + if (current_note->u.note.shape > current_note->next->u.note.shape) { + *number = 49; + } else { + *number = 48; + } } } @@ -1695,6 +1748,23 @@ static inline void normal_height_top(gtex_sign_type sign_type, } } +// for the last note in a porrectus or torculus resupinus +static inline void normal_height_ending_porrectus(gtex_sign_type sign_type, + gregorio_note *current_note, char *height) +{ + if (sign_type == ST_H_EPISEMUS) { + if (current_note->previous && current_note->previous->h_episemus_type + && current_note->previous->previous + && current_note->previous->previous->h_episemus_type) { + *height = current_note->h_episemus_top_note + 1; + } else { + *height = current_note->u.note.pitch + 1; + } + } else { + *height = current_note->u.note.pitch + 2; + } +} + // case of one note and then one lower, when the sign is on the first static inline void height_layered_notes(gtex_sign_type sign_type, gregorio_note *current_note, char *height) @@ -1702,12 +1772,12 @@ static inline void height_layered_notes(gtex_sign_type sign_type, if (sign_type == ST_H_EPISEMUS) { *height = current_note->h_episemus_top_note + 1; } else { - if ((current_note->u.note.pitch - current_note->next->u.note.pitch) == 1 + if ((current_note->u.note.pitch - current_note->next->u.note.pitch) > 2 || (current_note->u.note.pitch - - current_note->next->u.note.pitch) == -1) { - *height = current_note->u.note.pitch + 2; - } else { + current_note->next->u.note.pitch) < -2) { *height = current_note->u.note.pitch - 1; + } else { + *height = current_note->u.note.pitch + 2; } } } @@ -1724,8 +1794,8 @@ static inline void normal_height_bottom(gtex_sign_type sign_type, * under the note */ if ((!current_note->previous - || simple_htype(current_note-> - previous->h_episemus_type) == H_NO_EPISEMUS) + || simple_htype(current_note->previous-> + h_episemus_type) == H_NO_EPISEMUS) && (!current_note->next || simple_htype(current_note->next->h_episemus_type) == H_NO_EPISEMUS)) { @@ -1741,6 +1811,26 @@ static inline void normal_height_bottom(gtex_sign_type sign_type, } } +// for the bottom note of a porrectus or the "porrectus part" of a torculus resupinus +static inline void normal_height_bottom_porrectus(gtex_sign_type sign_type, + gregorio_note *current_note, char *height, bool * bottom) +{ + if (sign_type == ST_H_EPISEMUS) { + if ((!current_note->previous + || simple_htype(current_note->previous-> + h_episemus_type) == H_NO_EPISEMUS)) { + *height = current_note->u.note.pitch - 1; + if (bottom) { + *bottom = true; + } + } else { + *height = current_note->h_episemus_top_note + 1; + } + } else { + *height = current_note->u.note.pitch - 1; + } +} + // case of one note and then one higher, on the same vertical axis, // when the sign is on the first, special case of the pes static inline void normal_height_bottom_pes(gtex_sign_type sign_type, @@ -1760,10 +1850,42 @@ static inline void normal_height_bottom_pes(gtex_sign_type sign_type, // hepisemus) number, according to the gregoriotex convention (described in // gregoriotex.tex) // this function is REALLY a pain in the ass, but it is sadly necessary +/* + * + * For the first note of a porrectus (flexus), this table summarizes the sign + * number (amb2 is the ambitus after the diagonal stroke): + * + * Porrectus | Porrectus | Porrectus | Porrectus + * non-auctus | non-auctus | auctus | Flexus + * amb2=1 | amb2>1 | | + * ------------+------------+-----------+----------- + * 9 | 8 | 10 | 10 + * + * For the second note of a torculus resupinus (flexus), this table summarizes + * the number (amb1 is the ambitus before the diagonal stroke and amb2 is the + * ambitus after the diagonal stroke): + * + * | Torculus | Torculus | Torculus | Torculus + * | Resupinus | Resupinus | Resupinus | Resupinus + * | non-auctus | non-auctus | auctus | Flexus + * | amb2=1 | amb2>1 | | + * --------+------------+------------+------------+-----------+----------- + * amb1=1 | Punctum | 36 | 22 | 43 | 43 + * amb1=1 | I. Debilis | 33 | 23 | 40 | 40 + * amb1=1 | Quilisma | 37 | 30 | 44 | 44 + * amb1=1 | Oriscus | 38 | 31 | 45 | 45 + * --------+------------+------------+------------+-----------+----------- + * amb1>1 | Punctum | 32 | 21 | 39 | 39 + * amb1>1 | I. Debilis | 33 | 23 | 40 | 40 + * amb1>1 | Quilisma | 34 | 28 | 41 | 41 + * amb1>1 | Oriscus | 35 | 29 | 42 | 42 + * + */ static void gregoriotex_find_sign_number(gregorio_glyph *current_glyph, int i, gtex_type type, gtex_sign_type sign_type, gregorio_note *current_note, char *number, char *height, bool * bottom) { + bool done; switch (type) { case T_PES: case T_PESQUILISMA: @@ -1799,18 +1921,7 @@ static void gregoriotex_find_sign_number(gregorio_glyph *current_glyph, case T_PESQUASSUS: case T_PESQUILISMAQUADRATUM: if (i == 1) { - if (current_glyph->u.notes.liquescentia >= L_INITIO_DEBILIS) { - *number = 7; - } else { - if (current_note->u.note.shape == S_ORISCUS) { - *number = 19; - } - if (current_note->u.note.shape == S_QUILISMA) { - *number = 20; - } else { - *number = 6; - } - } + number_first_note(number, current_note, current_glyph); normal_height_bottom(sign_type, current_note, height, bottom); } else { /* @@ -1821,7 +1932,7 @@ static void gregoriotex_find_sign_number(gregorio_glyph *current_glyph, || current_glyph->u.notes.liquescentia == L_DEMINUTUS) { *number = 7; } else { - *number = 0; + number_last_note(current_glyph, number, 0, current_note, true); } normal_height(sign_type, current_note, height); } @@ -1831,7 +1942,16 @@ static void gregoriotex_find_sign_number(gregorio_glyph *current_glyph, case T_FLEXUS_ORISCUS: switch (i) { case 1: - number_note_before_last_note(current_glyph, current_note, number); + if (type == T_FLEXUS_ORISCUS) { + *number = 51; + } else { + if (current_note->next && current_note->u.note.pitch - + current_note->next->u.note.pitch == 1) { + *number = 56; + } else { + *number = 49; + } + } if (current_glyph->u.notes.liquescentia == L_DEMINUTUS_INITIO_DEBILIS || current_glyph->u.notes.liquescentia == L_DEMINUTUS) { @@ -1841,27 +1961,108 @@ static void gregoriotex_find_sign_number(gregorio_glyph *current_glyph, } break; default: /* i>=2 */ - number_last_note(current_glyph, number, 0); + number_last_note(current_glyph, number, 0, current_note, false); normal_height_bottom(sign_type, current_note, height, bottom); break; } break; - case T_PORRECTUSFLEXUS: - case T_PORRECTUSFLEXUS_NOBAR: + case T_TORCULUS_RESUPINUS_FLEXUS: + done = true; + switch (i) { + case 1: + number_first_note(number, current_note, current_glyph); + normal_height_bottom(sign_type, current_note, height, bottom); + break; + case HEPISEMUS_FIRST_TWO: + // special case, called when the horizontal episemus is on the + // second and third notes of the torculus resupinus flexus. + // We consider current_note to be the second note. Warning, this + // MUST NOT be called if the porrectus is deminutus. + if (!current_note->next) { + return; + } + // fall through + case 2: + if (current_glyph->u.notes.liquescentia >= L_INITIO_DEBILIS) { + *number = 40; + } else { + if (current_note->u.note.pitch - + current_note->previous->u.note.pitch == 1) { + switch (current_note->previous->u.note.shape) { + case S_QUILISMA: + *number = 44; + break; + case S_ORISCUS: + *number = 45; + break; + default: + *number = 43; + break; + } + } else { + switch (current_note->previous->u.note.shape) { + case S_QUILISMA: + *number = 41; + break; + case S_ORISCUS: + *number = 42; + break; + default: + *number = 39; + break; + } + } + } + if (i == HEPISEMUS_FIRST_TWO) { + normal_height(sign_type, current_note, height); + } else { + normal_height_long_first(sign_type, current_note, height); + } + break; + case 4: + if ((current_glyph->u.notes.liquescentia == + L_DEMINUTUS_INITIO_DEBILIS + || current_glyph->u.notes.liquescentia == + L_DEMINUTUS) + && current_note->next) { + height_layered_notes(sign_type, current_note, height); + *number = 3; + } else { + normal_height(sign_type, current_note, height); + number_note_before_last_note(current_glyph, current_note, number); + } + break; + case 5: + number_last_note(current_glyph, number, 0, current_note, false); + normal_height_bottom(sign_type, current_note, height, bottom); + break; + default: + --i; + done = false; + break; + } + + if (done) { + break; + } + // else fallthrough to the next case! + case T_PORRECTUS_FLEXUS: switch (i) { case HEPISEMUS_FIRST_TWO: // special case, called when the horizontal episemus is on the fist // two notes of a glyph. We consider current_note to be the first // note. if (!current_note->next) { - *number = 0; + return; } - *number = 10; - normal_height(sign_type, current_note, height); - break; + // fall through case 1: - *number = 6; - normal_height_long_first(sign_type, current_note, height); + *number = 10; + if (i == HEPISEMUS_FIRST_TWO) { + normal_height(sign_type, current_note, height); + } else { + normal_height_long_first(sign_type, current_note, height); + } break; case 2: if (current_glyph->u.notes.liquescentia == @@ -1874,134 +2075,204 @@ static void gregoriotex_find_sign_number(gregorio_glyph *current_glyph, normal_height_bottom(sign_type, current_note, height, bottom); break; case 3: - if (current_note->u.note.pitch - current_note->next->u.note.pitch != - 1) { - number_note_before_last_note(current_glyph, current_note, - number); - } if ((current_glyph->u.notes.liquescentia == L_DEMINUTUS_INITIO_DEBILIS || current_glyph->u.notes.liquescentia == L_DEMINUTUS) && current_note->next) { - *number = 3; - } else { - *number = 2; - } - if (current_glyph->u.notes.liquescentia == - L_DEMINUTUS_INITIO_DEBILIS - || current_glyph->u.notes.liquescentia == L_DEMINUTUS) { height_layered_notes(sign_type, current_note, height); + *number = 3; } else { normal_height(sign_type, current_note, height); + number_note_before_last_note(current_glyph, current_note, number); } break; default: - number_last_note(current_glyph, number, 0); + number_last_note(current_glyph, number, 0, current_note, false); normal_height_bottom(sign_type, current_note, height, bottom); break; } break; case T_TORCULUS_RESUPINUS: - case T_TORCULUS_RESUPINUS_QUILISMA: + done = true; switch (i) { - case HEPISEMUS_FIRST_TWO: - // special case, called when the horizontal episemus is on the - // first two notes of a glyph. We consider current_note to be the - // second note. in the case of the toruculus resupinus, it are the - // notes two and three. Warning, this MUST NOT be called if the - // porrectus is deminutus. - if (!current_note->next) { - return; - } - *number = 11; - normal_height(sign_type, current_note, height); - break; case 1: - if (current_glyph->u.notes.liquescentia >= L_INITIO_DEBILIS) { - *number = 7; - } else { - *number = 6; - } + number_first_note(number, current_note, current_glyph); normal_height_bottom(sign_type, current_note, height, bottom); break; + case HEPISEMUS_FIRST_TWO: + // fall through case 2: - if (current_glyph->u.notes.liquescentia >= L_INITIO_DEBILIS) { - *number = 23; + if (!current_note->next) { + return; + } + if (current_glyph->u.notes.liquescentia & + (L_AUCTUS_ASCENDENS | L_AUCTUS_DESCENDENS | L_AUCTA)) { + // auctus + if (current_glyph->u.notes.liquescentia >= L_INITIO_DEBILIS) { + *number = 40; + } else { + if (current_note->u.note.pitch - + current_note->previous->u.note.pitch == 1) { + switch (current_note->previous->u.note.shape) { + case S_QUILISMA: + *number = 44; + break; + case S_ORISCUS: + *number = 45; + break; + default: + *number = 43; + break; + } + } else { + switch (current_note->previous->u.note.shape) { + case S_QUILISMA: + *number = 41; + break; + case S_ORISCUS: + *number = 42; + break; + default: + *number = 39; + break; + } + } + } + } else if (current_note->next->next->u.note.pitch - + current_note->next->u.note.pitch == 1) { + // non-auctus with a second ambitus of 1 + if (current_glyph->u.notes.liquescentia >= L_INITIO_DEBILIS) { + *number = 33; + } else { + if (current_note->u.note.pitch - + current_note->previous->u.note.pitch == 1) { + switch (current_note->previous->u.note.shape) { + case S_QUILISMA: + *number = 34; + break; + case S_ORISCUS: + *number = 35; + break; + default: + *number = 32; + break; + } + } else { + switch (current_note->previous->u.note.shape) { + case S_QUILISMA: + *number = 37; + break; + case S_ORISCUS: + *number = 38; + break; + default: + *number = 36; + break; + } + } + } } else { - if (current_note->u.note.pitch - - current_note->previous->u.note.pitch == 1) { - *number = 22; + // non-auctus with a second ambitus of at least 2 + if (current_glyph->u.notes.liquescentia >= L_INITIO_DEBILIS) { + *number = 23; } else { - *number = 21; + if (current_note->u.note.pitch - + current_note->previous->u.note.pitch == 1) { + switch (current_note->previous->u.note.shape) { + case S_QUILISMA: + *number = 28; + break; + case S_ORISCUS: + *number = 29; + break; + default: + *number = 21; + break; + } + } else { + switch (current_note->previous->u.note.shape) { + case S_QUILISMA: + *number = 30; + break; + case S_ORISCUS: + *number = 31; + break; + default: + *number = 22; + break; + } + } } } - normal_height_long_first(sign_type, current_note, height); - break; - case 3: - // you might think number_note_before_last_note more appropriate, - // but - // in the current fonts the third note of the torculus resupinus - // is v aligned with the last note - number_last_note(current_glyph, number, 18); - if (current_glyph->u.notes.liquescentia == - L_DEMINUTUS_INITIO_DEBILIS - || current_glyph->u.notes.liquescentia == L_DEMINUTUS) { - height_layered_notes(sign_type, current_note, height); + if (i == HEPISEMUS_FIRST_TWO) { + normal_height(sign_type, current_note, height); } else { - normal_height_bottom(sign_type, current_note, height, bottom); + normal_height_long_first(sign_type, current_note, height); } break; default: - number_last_note(current_glyph, number, 18); - normal_height_top(sign_type, current_note, height); + --i; + done = false; break; } - break; + + if (done) { + break; + } + // else fallthrough to the next case! case T_PORRECTUS: - case T_PORRECTUS_NOBAR: switch (i) { case HEPISEMUS_FIRST_TWO: // special case, called when the horizontal episemus is on the fist // two notes of a glyph. We consider current_note to be the first // note. Warning, this MUST NOT be called if the porrectus is // deminutus. + + // fall through + case 1: if (!current_note->next) { - *number = 0; + return; + } + if (current_glyph->u.notes.liquescentia & + (L_AUCTUS_ASCENDENS | L_AUCTUS_DESCENDENS | L_AUCTA)) { + // auctus + *number = 10; + } else if (current_note->next->next->u.note.pitch - + current_note->next->u.note.pitch == 1) { + // non-auctus with a second ambitus of 1 + *number = 9; + } else { + // non-auctus with a second ambitus of at least 2 + *number = 8; + } + if (i == HEPISEMUS_FIRST_TWO) { + normal_height(sign_type, current_note, height); + } else { + normal_height_long_first(sign_type, current_note, height); } - *number = 9; - normal_height(sign_type, current_note, height); - break; - case 1: - *number = 6; - normal_height_long_first(sign_type, current_note, height); break; case 2: - if ((current_glyph->u.notes.liquescentia == - L_DEMINUTUS_INITIO_DEBILIS - || current_glyph->u.notes.liquescentia == - L_DEMINUTUS) - && current_note->next) { + if (current_glyph->u.notes.liquescentia & L_DEMINUTUS) { *number = 3; + } else if (current_glyph->u.notes.liquescentia + & (L_AUCTUS_ASCENDENS|L_AUCTUS_DESCENDENS|L_AUCTA)) { + *number = 2; } else { *number = 0; } - normal_height_bottom(sign_type, current_note, height, bottom); + normal_height_bottom_porrectus(sign_type, current_note, height, bottom); break; default: // case 3 - number_last_note(current_glyph, number, 18); - normal_height_top(sign_type, current_note, height); + number_last_note(current_glyph, number, 18, current_note, true); + normal_height_ending_porrectus(sign_type, current_note, height); break; } break; case T_SCANDICUS: switch (i) { case 1: - if (current_glyph->u.notes.liquescentia >= L_INITIO_DEBILIS) { - *number = 7; - } else { - *number = 6; - } + number_first_note(number, current_note, current_glyph); normal_height(sign_type, current_note, height); break; case 2: @@ -2009,7 +2280,7 @@ static void gregoriotex_find_sign_number(gregorio_glyph *current_glyph, normal_height(sign_type, current_note, height); break; default: - number_last_note(current_glyph, number, 0); + number_last_note(current_glyph, number, 0, current_note, true); normal_height_top(sign_type, current_note, height); break; } @@ -2018,7 +2289,7 @@ static void gregoriotex_find_sign_number(gregorio_glyph *current_glyph, case T_ANCUS_LONGQUEUE: switch (i) { case 1: - *number = 6; + number_first_note(number, current_note, current_glyph); normal_height(sign_type, current_note, height); break; case 2: @@ -2026,24 +2297,15 @@ static void gregoriotex_find_sign_number(gregorio_glyph *current_glyph, height_layered_notes(sign_type, current_note, height); break; default: - number_last_note(current_glyph, number, 0); + number_last_note(current_glyph, number, 0, current_note, false); normal_height(sign_type, current_note, height); break; } break; case T_TORCULUS: - case T_TORCULUS_QUILISMA: switch (i) { case 1: - if (current_glyph->u.notes.liquescentia >= L_INITIO_DEBILIS) { - *number = 7; - } else { - if (type == T_TORCULUS_QUILISMA) { - *number = 20; - } else { - *number = 6; - } - } + number_first_note(number, current_note, current_glyph); normal_height_bottom(sign_type, current_note, height, bottom); break; case 2: @@ -2057,7 +2319,7 @@ static void gregoriotex_find_sign_number(gregorio_glyph *current_glyph, } break; default: - number_last_note(current_glyph, number, 0); + number_last_note(current_glyph, number, 0, current_note, false); normal_height_bottom(sign_type, current_note, height, bottom); break; } @@ -2083,6 +2345,13 @@ static void gregoriotex_find_sign_number(gregorio_glyph *current_glyph, case S_ORISCUS_DEMINUTUS: *number = 16; break; + case S_VIRGA_REVERSA: + if (current_glyph->u.notes.liquescentia == L_AUCTUS_DESCENDENS) { + *number = 54; + } else { + *number = 0; + } + break; case S_LINEA_PUNCTUM: case S_LINEA_PUNCTUM_CAVUM: *number = 24; @@ -2091,12 +2360,11 @@ static void gregoriotex_find_sign_number(gregorio_glyph *current_glyph, *number = 0; break; default: - number_last_note(current_glyph, number, 0); + number_last_note(current_glyph, number, 0, current_note, true); break; } break; } - } // a function to find the next horizontal episemus height (returns -1 if none @@ -2176,8 +2444,7 @@ static char gregoriotex_find_next_hepisemus_height(gregorio_glyph *glyph, i = 2; gtype = T_PES; } else { - gregoriotex_determine_number_and_type(glyph, element, &type, - >ype); + gregoriotex_determine_number_and_type(glyph, element, &type, >ype); } if (simple_htype(note->h_episemus_type) != H_NO_EPISEMUS) { gregoriotex_find_sign_number(glyph, i, @@ -2266,7 +2533,7 @@ static void gregoriotex_write_hepisemus(FILE *f, gregorio_glyph *current_glyph, next_height = height; } - if (current_note->next) { + if (i == HEPISEMUS_FIRST_TWO && current_note->next) { ambitus = current_note->u.note.pitch - current_note->next->u.note.pitch; } if (has_bottom(current_note->h_episemus_type)) { @@ -2308,10 +2575,8 @@ static void gregoriotex_write_additional_line(FILE *f, // patch to get a line under the full glyph in the case of dbc (for // example) switch (type) { - case T_PORRECTUSFLEXUS: - case T_PORRECTUSFLEXUS_NOBAR: case T_PORRECTUS: - case T_PORRECTUS_NOBAR: + case T_PORRECTUS_FLEXUS: if (i == 1) { i = HEPISEMUS_FIRST_TWO; } @@ -2319,6 +2584,8 @@ static void gregoriotex_write_additional_line(FILE *f, if (current_note->previous->u.note.pitch > 'b' && current_note->previous->u.note.pitch < 'l') { i = HEPISEMUS_FIRST_TWO; + // HEPISEMUS_FIRST_TWO works only for first note + current_note = current_note->previous; } else { return; } @@ -2331,13 +2598,16 @@ static void gregoriotex_write_additional_line(FILE *f, } break; case T_TORCULUS_RESUPINUS: - case T_TORCULUS_RESUPINUS_QUILISMA: + case T_TORCULUS_RESUPINUS_FLEXUS: if (i == 2) { i = HEPISEMUS_FIRST_TWO; } if (i == 3) { - if (current_note->previous->u.note.pitch > 'b') { + if (current_note->previous->u.note.pitch > 'b' + && current_note->previous->u.note.pitch < 'l') { i = HEPISEMUS_FIRST_TWO; + // HEPISEMUS_FIRST_TWO works only for first note + current_note = current_note->previous; } else { return; } @@ -2441,97 +2711,7 @@ static void gregoriotex_write_rare(FILE *f, gregorio_glyph *current_glyph, } /* - * function used when the glyph is only one note long, the glyph number are - * simply the following: - * 01: c clef - * 02: f clef - * 03: c clef for key changes - * 04: f clef for key changes - * 05: flat (oriented to the top) - * 06: flat (oriented to the bottom) - * 07: natural - * 08: virgula - * 09: divisio minima - * 10: divisio minor - * 11: divisio maior - * 12: divisio finalis - * 13: punctum deminutum - * 14: punctum mora - * 15: auctum duplex - * 16: circumflexus - * 17: punctum - * 18: punctum quadratum - * 19: punctum inclinatum - * 20: stropha - * 21: stropha aucta - * 22: virga - * 23: virga_short_bar - * 24: left virga - * 25: left virga_short_bar - * 26: quilisma - * 27: oriscus - * 28: oriscus auctus - * 29: oriscus with stem - * 30: oriscus with stem, short bar - * 31: punctum inclinatum auctum - * 32: punctum inclinatum deminutus - * 33: vertical episemus - * 34: punctum cavum - * 35: linea punctum - * 36: linea puctum cavum - * 37: circulus - * 38: semi-curculus - * 39: accentus - * 40: horizontal episemus, width of a punctum - * 41: horizontal episemus, width of a flexus debilis - * 42: horizontal episemus, width of an initio debilis - * 43: horizontal episemus, width of a punctum inclinatum - * 44: horizontal episemus, width of a punctum inclinatum deminutus - * 45: horizontal episemus, width of a stropha - * 46: horizontal episemus, width of a porrectus with ambitus of 1 - * 47: horizontal episemus, width of a porrectus with ambitus of 2 - * 48: horizontal episemus, width of a porrectus with ambitus of 3 - * 49: horizontal episemus, width of a porrectus with ambitus of 4 - * 50: horizontal episemus, width of a porrectus with ambitus of 5 - * 51: horizontal episemus, width of a porrectus flexus with ambitus of 1 - * 52: horizontal episemus, width of a porrectus flexus with ambitus of 2 - * 53: horizontal episemus, width of a porrectus flexus with ambitus of 3 - * 54: horizontal episemus, width of a porrectus flexus with ambitus of 4 - * 55: horizontal episemus, width of a porrectus flexus with ambitus of 5 - * 56: horizontal episemus, width of a quilisma - * 57: horizontal episemus, width of an oriscus - * 58: horizontal episemus width of a small punctum for pes, porrectus and - * torculus resupinus - * 60: custo for bass notes (oriented to the top) - * 61: custo for bass notes (oriented to the top) with short bar - * 62: custo for bass notes (oriented to the top) with middle bar - * (for the lowest note) - * 63: custo for high notes (oriented to the bottom) - * 64: custo for high notes (oriented to the bottom) with short bar - * 65: custo for high notes (oriented to the bottom) with middle bar (for the - * highest note) - * 69: reversed accentus - * 70: reversed semi-circulus - * 72: punctum auctus ascendens - * 73: punctum auctus descendens - * 74: smaller punctum for pes, porrectus and torculus resupinus (theorically - * never used alone, but necessary for some measures - * 75: punctum cavum alt - * 76: linea punctum cavum alt - * 77: punctum cavum hole - * 78: punctum cavum alt hole - * 79: linea punctum cavum hole - * 80: linea punctum cavum alt hole - * 81: flat hole - * 82: natural hole - * 83: virgula minor oriented to the top - * 84: virgula minor oriented to the bottom - * 85: sharp - * 86: sharp hole - * 87: linea - * 91: oriscus deminutus - * 92: virga aucta short bar - * 93: virga aucta + * function used when the glyph is only one note long */ static void gregoriotex_write_note(FILE *f, gregorio_note *note, @@ -2887,7 +3067,7 @@ static void gregoriotex_write_choral_sign(FILE *f, gregorio_glyph *glyph, } #define _end_loop()\ - if (type == T_ONE_NOTE || type == T_ONE_NOTE_TRF)\ + if (type == T_ONE_NOTE)\ {\ break;\ }\ @@ -2963,20 +3143,37 @@ static void gregoriotex_write_signs(FILE *f, gtex_type type, // if it is a porrectus or a porrectus flexus, we check if the // episemus is on the two first notes: _found(); - if ((type == T_PORRECTUS || type == T_PORRECTUSFLEXUS - || type == T_PORRECTUSFLEXUS_NOBAR - || type == T_PORRECTUS_NOBAR) && current_note->next + if ((type == T_PORRECTUS || type == T_PORRECTUS_FLEXUS) + && current_note->next && simple_htype(current_note->next->h_episemus_type) != H_NO_EPISEMUS && i == 1) { + // adjustment of h_episemus_top_note for g_f_i + if (current_note->next->next + && current_note->next->next->u.note.pitch > + current_note->u.note.pitch) { + current_note->h_episemus_top_note = + current_note->next->next->u.note.pitch; + current_note->next->h_episemus_top_note = + current_note->next->next->u.note.pitch; + } gregoriotex_write_hepisemus(f, glyph, element, HEPISEMUS_FIRST_TWO, type, current_note); block_hepisemus = 1; } else { if ((type == T_TORCULUS_RESUPINUS - || type == T_TORCULUS_RESUPINUS_QUILISMA) + || type == T_TORCULUS_RESUPINUS_FLEXUS) && current_note->next && simple_htype(current_note->next->h_episemus_type) != H_NO_EPISEMUS && i == 2) { + // adjustment of h_episemus_top_note for fg_f_i + if (current_note->next->next + && current_note->next->next->u.note.pitch > + current_note->u.note.pitch) { + current_note->h_episemus_top_note = + current_note->next->next->u.note.pitch; + current_note->next->h_episemus_top_note = + current_note->next->next->u.note.pitch; + } gregoriotex_write_hepisemus(f, glyph, element, HEPISEMUS_FIRST_TWO, type, current_note); block_hepisemus = 1; @@ -3038,6 +3235,43 @@ static void gregoriotex_write_signs(FILE *f, gtex_type type, fprintf(f, "}%%\n"); } +static char *determine_leading_shape(gregorio_glyph *glyph) +{ + static char buf[BUFSIZE]; + int ambitus = compute_ambitus(glyph->u.notes.first_note); + char *head, *head_liquescence; + + switch (glyph->u.notes.first_note->u.note.shape) { + case S_QUILISMA: + head = "Quilisma"; + break; + case S_ORISCUS: + case S_ORISCUS_SCAPUS: + head = "Oriscus"; + break; + default: + head = "Punctum"; + break; + } + + switch (glyph->u.notes.liquescentia) { + case L_INITIO_DEBILIS: + case L_DEMINUTUS_INITIO_DEBILIS: + case L_AUCTUS_ASCENDENS_INITIO_DEBILIS: + case L_AUCTUS_DESCENDENS_INITIO_DEBILIS: + case L_AUCTA_INITIO_DEBILIS: + head_liquescence = "InitioDebilis"; + break; + default: + head_liquescence = ""; + break; + } + + snprintf(buf, BUFSIZE, "Leading%s%s%s", head, tex_ambitus[ambitus], + head_liquescence); + return buf; +} + static void gregoriotex_write_glyph(FILE *f, gregorio_syllable *syllable, gregorio_element *element, gregorio_glyph *glyph) { @@ -3051,7 +3285,7 @@ static void gregoriotex_write_glyph(FILE *f, gregorio_syllable *syllable, gtex_type gtype = 0; char next_note_pitch = 0; gregorio_note *current_note; - char *shape; + char *leading_shape, *shape; if (!glyph) { gregorio_message(_("called with NULL pointer"), "gregoriotex_write_glyph", ERROR, 0); @@ -3129,22 +3363,19 @@ static void gregoriotex_write_glyph(FILE *f, gregorio_syllable *syllable, } break; case G_TORCULUS_RESUPINUS_FLEXUS: - gregoriotex_write_note(f, current_note, glyph, element, - next_note_pitch); - gregoriotex_write_signs(f, T_ONE_NOTE_TRF, glyph, element, - glyph->u.notes.first_note); + leading_shape = determine_leading_shape(glyph); + // trick to have the good position for these glyphs glyph->u.notes.glyph_type = G_PORRECTUS_FLEXUS_NO_BAR; - // tricky to have the good position for these glyphs glyph->u.notes.first_note = current_note->next; shape = gregoriotex_determine_number_and_type(glyph, element, &type, >ype); - // TODO : fusion functions - fprintf(f, "\\greglyph{\\grecp%s}{%c}{%c}{%d}", shape, + fprintf(f, "\\greglyph{\\grefusetwo{\\grecp%s}{\\grecp%s}}{%c}{%c}{%d}", + leading_shape, shape, glyph->u.notes.first_note->u.note.pitch, next_note_pitch, type); - gregoriotex_write_signs(f, gtype, glyph, element, - glyph->u.notes.first_note); glyph->u.notes.first_note = current_note; glyph->u.notes.glyph_type = G_TORCULUS_RESUPINUS_FLEXUS; + gregoriotex_write_signs(f, gtype, glyph, element, + glyph->u.notes.first_note); break; case G_BIVIRGA: case G_TRIVIRGA: @@ -3214,23 +3445,22 @@ static void gregoriotex_write_glyph(FILE *f, gregorio_syllable *syllable, if (glyph->u.notes.glyph_type == G_TORCULUS_RESUPINUS && current_note->u.note.shape != S_PUNCTUM && current_note->u.note.shape != S_QUILISMA) { - gregoriotex_write_note(f, current_note, glyph, element, - next_note_pitch); - gregoriotex_write_signs(f, T_ONE_NOTE, glyph, element, - glyph->u.notes.first_note); - // tricky to have the good position for these glyphs - glyph->u.notes.first_note = current_note->next; + leading_shape = determine_leading_shape(glyph); + // trick to have the good position for these glyphs glyph->u.notes.glyph_type = G_PORRECTUS_NO_BAR; + glyph->u.notes.first_note = current_note->next; shape = gregoriotex_determine_number_and_type(glyph, element, &type, >ype); - // TODO : fusion functions - fprintf(f, "\\greglyph{\\grecp%s}{%c}{%c}{%d}", shape, + fprintf(f, + "\\greglyph{\\grefusetwo{\\grecp%s}{\\grecp%s}}{%c}{%c}{%d}", + leading_shape, shape, glyph->u.notes.first_note->u.note.pitch, next_note_pitch, type); + glyph->u.notes.first_note = current_note; + glyph->u.notes.glyph_type = G_TORCULUS_RESUPINUS; gregoriotex_write_signs(f, gtype, glyph, element, glyph->u.notes.first_note); - glyph->u.notes.glyph_type = G_TORCULUS_RESUPINUS; - glyph->u.notes.first_note = current_note; + break; } else { shape = gregoriotex_determine_number_and_type(glyph, element, &type, >ype); @@ -3252,7 +3482,7 @@ static void gregoriotex_write_element(FILE *f, gregorio_syllable *syllable, { if (element->type == GRE_ELEMENT) { for (gregorio_glyph *glyph = element->u.glyphs.first_glyph; glyph; - glyph = glyph->next) { + glyph = glyph->next) { switch (glyph->type) { case GRE_SPACE: // we assume here that it is a SP_ZERO_WIDTH, the only one a @@ -3268,8 +3498,7 @@ static void gregoriotex_write_element(FILE *f, gregorio_syllable *syllable, break; case GRE_FLAT: - fprintf(f, "\\greflat{%c}{0}%%\n", - glyph->u.misc.pitched.pitch); + fprintf(f, "\\greflat{%c}{0}%%\n", glyph->u.misc.pitched.pitch); break; case GRE_NATURAL: @@ -3307,7 +3536,7 @@ static void gregoriotex_write_element(FILE *f, gregorio_syllable *syllable, } static void gregoriotex_write_text(FILE *f, gregorio_character *text, - bool *first_syllable, int next_syl) + bool * first_syllable, int next_syl) { if (text == NULL) { fprintf(f, "{}{}{}"); @@ -3371,7 +3600,8 @@ static void gregoriotex_print_change_line_clef(FILE *f, } } -static void handle_final_bar(FILE *f, char *type, gregorio_syllable *syllable) { +static void handle_final_bar(FILE *f, char *type, gregorio_syllable *syllable) +{ fprintf(f, "\\grefinal%s{%%\n", type); // first element will be the bar, which we just handled, so skip it for (gregorio_element *element = (*syllable->elements)->next; element; @@ -3400,10 +3630,11 @@ static void handle_final_bar(FILE *f, char *type, gregorio_syllable *syllable) { fprintf(f, "}%%\n"); } -static inline bool is_manual_custos(gregorio_element *element) { +static inline bool is_manual_custos(gregorio_element *element) +{ return element->type == GRE_ELEMENT - && element->u.glyphs.first_glyph - && element->u.glyphs.first_glyph->type == GRE_MANUAL_CUSTOS; + && element->u.glyphs.first_glyph + && element->u.glyphs.first_glyph->type == GRE_MANUAL_CUSTOS; } /* @@ -3420,7 +3651,7 @@ static inline bool is_manual_custos(gregorio_element *element) { * 2 if we are in the second argument (necessary in order to avoid infinite loops) */ static void gregoriotex_write_syllable(FILE *f, gregorio_syllable *syllable, - bool *first_syllable, unsigned char *line_number, + bool * first_syllable, unsigned char *line_number, unsigned char first_of_disc) { gregorio_line *line; @@ -3434,7 +3665,7 @@ static void gregoriotex_write_syllable(FILE *f, gregorio_syllable *syllable, fprintf(f, "\\grebeginnlbarea{1}{0}%%\n"); } if (syllable->euouae == EUOUAE_BEGINNING) { - fprintf (f, "\\grebegineuouae{}%%\n"); + fprintf(f, "\\grebegineuouae{}%%\n"); } /* * first we check if the syllable is only a end of line. If it is the case, @@ -3744,10 +3975,11 @@ static void gregoriotex_write_syllable(FILE *f, gregorio_syllable *syllable, // there current_element->type is GRE_ELEMENT assert(element->type == GRE_ELEMENT); gregoriotex_write_element(f, syllable, element); - if (element->next && (element->next->type == GRE_ELEMENT || ( - element->next->next - && element->next->type == GRE_ALT - && element->next->next->type == GRE_ELEMENT))) { + if (element->next && (element->next->type == GRE_ELEMENT + || (element->next->next + && element->next->type == GRE_ALT + && element->next->next->type == + GRE_ELEMENT))) { fprintf(f, "\\greendofelement{0}{0}%%\n"); } break; @@ -3763,7 +3995,7 @@ static void gregoriotex_write_syllable(FILE *f, gregorio_syllable *syllable, fprintf(f, "\\greendnlbarea{1}{0}%%\n"); } if (syllable->euouae == EUOUAE_END) { - fprintf (f, "\\greendeuouae{}%%\n"); + fprintf(f, "\\greendeuouae{}%%\n"); } } @@ -3870,8 +4102,8 @@ void gregoriotex_write_score(FILE *f, gregorio_score *score) } fprintf(f, "\\grebeginnotes %%\n"); if (score->first_voice_info) { - gregorio_det_step_and_line_from_key(score->first_voice_info-> - initial_key, &clef_letter, &clef_line); + gregorio_det_step_and_line_from_key(score-> + first_voice_info->initial_key, &clef_letter, &clef_line); if (score->first_voice_info->flatted_key) { clef_flat = gregoriotex_clef_flat_height(clef_letter, clef_line); } else { diff --git a/src/gregoriotex/gregoriotex.h b/src/gregoriotex/gregoriotex.h index 58903a75f..50522d48f 100644 --- a/src/gregoriotex/gregoriotex.h +++ b/src/gregoriotex/gregoriotex.h @@ -41,7 +41,6 @@ typedef enum gtex_type { T_PESQUILISMAQUADRATUM, T_PESQUILISMAQUADRATUM_LONGQUEUE, T_FLEXUS, - T_FLEXUS_NOBAR, T_FLEXUS_LONGQUEUE, T_FLEXUS_ORISCUS, T_FLEXUS_ORISCUS_SCAPUS, @@ -49,7 +48,6 @@ typedef enum gtex_type { T_VIRGA_STRATA, // three note neumes T_PORRECTUS, - T_PORRECTUS_NOBAR, T_TORCULUS, T_TORCULUS_QUILISMA, T_SCANDICUS, // only deminutus @@ -58,14 +56,10 @@ typedef enum gtex_type { T_SALICUS, T_SALICUS_LONGQUEUE, // four note neumes - T_PORRECTUSFLEXUS, - T_PORRECTUSFLEXUS_NOBAR, + T_PORRECTUS_FLEXUS, T_TORCULUS_RESUPINUS, - T_TORCULUS_RESUPINUS_QUILISMA, T_TORCULUS_LIQUESCENS, - T_TORCULUS_LIQUESCENS_QUILISMA, - // this is a special type for the first note of a torculus resupinus flexus - T_ONE_NOTE_TRF, + T_TORCULUS_RESUPINUS_FLEXUS, } gtex_type; // the different types for the alignment of the notes in GregorioTeX diff --git a/src/struct.h b/src/struct.h index 69587c72d..a0c702b33 100644 --- a/src/struct.h +++ b/src/struct.h @@ -171,15 +171,15 @@ typedef enum gregorio_space { typedef enum gregorio_liquescentia { L_NO_LIQUESCENTIA = 0, - L_DEMINUTUS = 1, - L_AUCTUS_ASCENDENS = 2, - L_AUCTUS_DESCENDENS = 3, - L_AUCTA = 4, - L_INITIO_DEBILIS = 5, - L_DEMINUTUS_INITIO_DEBILIS = 6, - L_AUCTUS_ASCENDENS_INITIO_DEBILIS = 7, - L_AUCTUS_DESCENDENS_INITIO_DEBILIS = 8, - L_AUCTA_INITIO_DEBILIS = 9, + L_DEMINUTUS = 0x01, + L_AUCTUS_ASCENDENS = 0x02, + L_AUCTUS_DESCENDENS = 0x04, + L_AUCTA = 0x08, + L_INITIO_DEBILIS = 0x10, + L_DEMINUTUS_INITIO_DEBILIS = 0x11, + L_AUCTUS_ASCENDENS_INITIO_DEBILIS = 0x12, + L_AUCTUS_DESCENDENS_INITIO_DEBILIS = 0x14, + L_AUCTA_INITIO_DEBILIS = 0x18, } gregorio_liquescentia; typedef enum gregorio_h_episemus { diff --git a/tex/gregoriotex-chars.tex b/tex/gregoriotex-chars.tex index fee3230ce..9ef1bca9e 100644 --- a/tex/gregoriotex-chars.tex +++ b/tex/gregoriotex-chars.tex @@ -39,11 +39,14 @@ \def\gre@char@stropha{\grecpStropha}% \def\gre@char@strophaaucta{\grecpStrophaAucta}% \def\gre@char@quilisma{\grecpQuilisma}% +\def\gre@char@quilisma@line@tr{\grecpQuilismaLineTR}% \def\gre@char@oriscus{\grecpOriscus}% +\def\gre@char@oriscus@line@tr{\grecpOriscusLineTR}% \def\gre@char@oriscusauctus{\grecpOriscusReversus}% \def\gre@char@punctuminclinatumdem{\grecpPunctumInclinatumAuctus}% \def\gre@char@lineapunctum{\grecpLineaPunctum}% \def\gre@char@peshigh{\grecpPunctumSmall}% +\def\gre@char@virgaaucta{\grecpVirgaReversaDescendens}% \def\gre@char@punctum@line@br{\grecpPunctumLineBR}% \def\gre@char@punctum@line@tr{\grecpPunctumLineTR}% \def\gre@char@punctum@line@tl{\grecpPunctumLineTL}% @@ -57,6 +60,9 @@ \def\gre@char@flexusdeminutus{\grecpFlexusTwoDeminutus}% \def\gre@char@flexusaltone{\grecpFlexusNobarOneNothing}% \def\gre@char@flexusalt{\grecpFlexusNobarTwoNothing}% +\def\gre@char@flexusaltone@line@bl{\grecpFlexusAmOneLineBL}% +\def\gre@char@flexusalt@line@bl{\grecpFlexusLineBL}% +\def\gre@char@virga@line@br{\grecpVirgaLineBR}% \def\gre@char@torculus{\grecpTorculusOneTwoNothing}% \def\gre@char@torculusdeminutus{\grecpTorculusTwoTwoDeminutus}% \def\gre@char@porrectus@one{\grecpPorrectusOneTwoNothing}% @@ -69,6 +75,20 @@ \def\gre@char@porrectus@amone@three{\grecpPorrectusThreeOneNothing}% \def\gre@char@porrectus@amone@four{\grecpPorrectusFourOneNothing}% \def\gre@char@porrectus@amone@five{\grecpPorrectusFiveOneNothing}% +\def\gre@char@leading@debilis{\grecpLeadingPunctumOneInitioDebilis}% +\def\gre@char@leading@punctum@one{\grecpLeadingPunctumOne}% +\def\gre@char@leading@quilisma@one{\grecpLeadingQuilismaOne}% +\def\gre@char@leading@oriscus@one{\grecpLeadingOriscusOne}% +\def\gre@char@leading@punctum@two{\grecpLeadingPunctumTwo}% +\def\gre@char@leading@quilisma@two{\grecpLeadingQuilismaTwo}% +\def\gre@char@leading@oriscus@two{\grecpLeadingOriscusTwo}% +\def\gre@char@fuse@punctum@one{\grefusetwo{\grecpLeadingPunctumOne}{\grecpPunctum}}% +\def\gre@char@fuse@quilisma@one{\grefusetwo{\grecpLeadingQuilismaOne}{\grecpPunctum}}% +\def\gre@char@fuse@oriscus@one{\grefusetwo{\grecpLeadingOriscusOne}{\grecpPunctum}}% +\def\gre@char@fuse@punctum@two{\grefusetwo{\grecpLeadingPunctumTwo}{\grecpPunctum}}% +\def\gre@char@fuse@quilisma@two{\grefusetwo{\grecpLeadingQuilismaTwo}{\grecpPunctum}}% +\def\gre@char@fuse@oriscus@two{\grefusetwo{\grecpLeadingOriscusTwo}{\grecpPunctum}}% +\def\gre@char@fuse@debilis{\grefusetwo{\grecpLeadingPunctumOneInitioDebilis}{\grecpPunctum}}% % signs \def\gre@char@curlybrace{\grecpCurlyBrace}% @@ -84,28 +104,49 @@ % horizontal episemus \def\gre@char@he@punctum{\grecpHEpisemusPunctum}% +\def\gre@char@he@punctum@line@br{\grecpHEpisemusPunctumLineBR}% +\def\gre@char@he@punctum@line@tr{\grecpHEpisemusPunctumLineTR}% +\def\gre@char@he@punctum@line@tl{\grecpHEpisemusPunctumLineTL}% +\def\gre@char@he@punctum@line@bl{\grecpHEpisemusPunctumLineBL}% +\def\gre@char@he@punctum@line@blbr{\grecpHEpisemusPunctumLineBLBR}% +\def\gre@char@he@punctumauctus@line@bl{\grecpHEpisemusPunctumAuctusLineBL}% \def\gre@char@he@flexus{\grecpHEpisemusFlexusDeminutus}% \def\gre@char@he@initio{\grecpHEpisemusDebilis}% +\def\gre@char@he@virga@line@br{\grecpHEpisemusVirgaLineBR}% \def\gre@char@he@inclinatum{\grecpHEpisemusInclinatum}% \def\gre@char@he@inclinatumdem{\grecpHEpisemusInclinatumDeminutus}% \def\gre@char@he@stropha{\grecpHEpisemusStropha}% -\def\gre@char@he@porrectus@one{\grecpHEpisemusPorrectusOne}% -\def\gre@char@he@porrectus@two{\grecpHEpisemusPorrectusTwo}% -\def\gre@char@he@porrectus@three{\grecpHEpisemusPorrectusThree}% -\def\gre@char@he@porrectus@four{\grecpHEpisemusPorrectusFour}% -\def\gre@char@he@porrectus@five{\grecpHEpisemusPorrectusFive}% -\def\gre@char@he@porrectus@amone@one{\grecpHEpisemusPorrectusAmOneOne}% -\def\gre@char@he@porrectus@amone@two{\grecpHEpisemusPorrectusAmOneTwo}% -\def\gre@char@he@porrectus@amone@three{\grecpHEpisemusPorrectusAmOneThree}% -\def\gre@char@he@porrectus@amone@four{\grecpHEpisemusPorrectusAmOneFour}% -\def\gre@char@he@porrectus@amone@five{\grecpHEpisemusPorrectusAmOneFive}% -\def\gre@char@he@porrectusfl@one{\grecpHEpisemusPorrectusFlexusOne}% -\def\gre@char@he@porrectusfl@two{\grecpHEpisemusPorrectusFlexusTwo}% -\def\gre@char@he@porrectusfl@three{\grecpHEpisemusPorrectusFlexusThree}% -\def\gre@char@he@porrectusfl@four{\grecpHEpisemusPorrectusFlexusFour}% -\def\gre@char@he@porrectusfl@five{\grecpHEpisemusPorrectusFlexusFive}% +\def\gre@char@he@porrectus#1{% + \ifcase#1\grecpHEpisemusPunctum% + \or\grecpHEpisemusPorrectusOne% + \or\grecpHEpisemusPorrectusTwo% + \or\grecpHEpisemusPorrectusThree% + \or\grecpHEpisemusPorrectusFour% + \or\grecpHEpisemusPorrectusFive + \fi% +}% +\def\gre@char@he@porrectus@amone#1{% + \ifcase#1\grecpHEpisemusPunctum% + \or\grecpHEpisemusPorrectusAmOneOne% + \or\grecpHEpisemusPorrectusAmOneTwo% + \or\grecpHEpisemusPorrectusAmOneThree% + \or\grecpHEpisemusPorrectusAmOneFour% + \or\grecpHEpisemusPorrectusAmOneFive% + \fi% +}% +\def\gre@char@he@porrectusfl#1{% + \ifcase#1\grecpHEpisemusPunctum% + \or\grecpHEpisemusPorrectusFlexusOne% + \or\grecpHEpisemusPorrectusFlexusTwo% + \or\grecpHEpisemusPorrectusFlexusThree% + \or\grecpHEpisemusPorrectusFlexusFour% + \or\grecpHEpisemusPorrectusFlexusFive% + \fi% +}% \def\gre@char@he@quilisma{\grecpHEpisemusQuilisma}% +\def\gre@char@he@quilisma@line@tr{\grecpHEpisemusQuilismaLineTR}% \def\gre@char@he@oriscus{\grecpHEpisemusOriscus}% +\def\gre@char@he@oriscus@line@tr{\grecpHEpisemusOriscusLineTR}% \def\gre@char@he@smallpunctum{\grecpHEpisemusHighPes}% "smallpunctum" is the top punctum in a pes \def\greflatchar{\gregoriofont\grecpFlat}% diff --git a/tex/gregoriotex-main.tex b/tex/gregoriotex-main.tex index 2cb80a9e3..acf461070 100644 --- a/tex/gregoriotex-main.tex +++ b/tex/gregoriotex-main.tex @@ -47,6 +47,8 @@ }% }% }% + +\def\gre@nothing{} \AtBeginDocument{\IfStrEq{\gre@debug}{}{}{\typeout{GregorioTeX is in debug mode}\typeout{\gre@debug\space messages will be printed to the log.}}}% @@ -663,6 +665,11 @@ \relax % }% +% Macro for fustion of larger neumes +\def\grefusetwo#1#2{% + #1\grenobreak #2\relax % +}% + % Macros for using variant glyphs % Changes a gregorio code point to a variant glyph diff --git a/tex/gregoriotex-signs.tex b/tex/gregoriotex-signs.tex index 8b3469c54..de1c643a3 100644 --- a/tex/gregoriotex-signs.tex +++ b/tex/gregoriotex-signs.tex @@ -663,7 +663,21 @@ \newbox\GreTempsign% -% a macro to help typesetting vertical episemus. The third argument is 0 when we go back to the beginning of the glyph. If it is 2, it means that we must go back first of width #1, and then forward of #2. If it is 1, it means that we only need to go back of #2. if it is 3, we go to the beginning of the glyph, then forward of #1 then back of #2 +% a macro to help typesetting vertical episemus. +% #1 is an offset glyph (see #3 below) +% #2 represents the glyph upon which the sign is to be centered +% #3 is a case number +% 0 : go back to the beginning of the previous glyph and then forward half +% the width of #2; this puts the sign at the beginning of the previous +% glyph, whose first note is the size of #2 +% 1 : go back half the width of #2; this puts the sign at the end of the +% previous glyph, whose last note is the size of #2 +% 2 : go back the width of #1 and then foward half the width of #2; this +% puts the sign at the glyph from the end that starts at #1's width from +% the end +% 3 : go back to the beginning of the previous glyph and then forward the +% width of #1 and then back half the width of #2; this puts the sign at +% the glyph from the start that ends at #1's width from the start % #4 is a shift that we want to get applied, useful for punctum inclinatum for example % #5 is the glyph number. % #6 is the type of sign (1: vertical episemus, 2: rare sign, 3: choral sign) @@ -715,40 +729,76 @@ \relax% }% +% Note position cases: % here are the common values for both hepisemus (and consequently also for additional lines) and vepisemus % this indicates the note %% 0: last note, which is a standard punctum (works with pes) %% 1: same, but the last note is a deminutus -%% 2: the note before the last note, which is a standard punctum +%% 2: the note before the last note, which is a standard punctum (like the second note of hig) %% 3: idem, but the note is the note preceding a deminutus %% 4: the note before the note before the last note (for porrectus flexus) %% 5: idem, but when the two last notes are a deminutus %% 6: the first note, if it is a standard punctum %% 7: the first note, if it is an initio debilis -%% 8: the first note, if it is a porrectus -%%%%%% the three next arguments make no sense for a vepisemus -%% 9: the two first notes, if it is a porrectus -%% 10: the two first notes, if it is a porrectus flexus -%% 11: the notes two and three of a torculus resupinus +%% 8: the first note, if it is a non-auctus porrectus with a second ambitus of at least two +%% 9: idem, for a second ambitus of one +%% 10: idem, for an auctus porrectus, regardless of second ambitus %% 12: the last note, if it is a punctum inclinatum %% 13: idem, if it is a punctum inclinatum deminutus %% 14: idem, if it is a stropha %% 15: idem, with a quilisma %% 16: idem, with an oriscus -%% 17: same of 2 but for ambitus of one +%% 17: same of 2 but for ambitus of one (like the second note of ghg) %% 18: same of 0, but the last note is a smaller punctum (concerning simple podatus, podatus, and torculus resupinus) %% 19: the first note, if it is an oriscus %% 20: the first note, if it is a quilisma -%% 21: the second note of a torculus resupinus with first ambitus of at least two -%% 22: idem with ambitus of one -%% 23: idem with initio debilis +%% 21: the second note of a non-auctus torculus resupinus with a first and +%% second ambitus of at least two +%% 22: idem with first ambitus of one +%% 23: idem with initio debilis (regardless of first ambitus) %% 24: the last note, if it is a linea punctum (or linea punctum cavum) %% 25: the last note, if it is a bar %% 26: the last note, if it is a virgula %% 27: the last note, if it is a divisio finalis - -% a function to typeset a vertical episemus or a rare accent (like accentus, circulus, etc.). The firts argument is the letter of the height of the episemus (not the height of the note it corresponds to. This function must be called after a call to \greglyph. The second argument is the type of glyph it was, more precisely the kind of space there is between the end (or in special cases the beginning) of the glyph and the place where we will typeset the episemus. The values are described in the commentary just above. -% the third argument is the glyph number in the font +%% 28: same as 21, with a quilisma +%% 29: idem, with an oriscus +%% 30: same as 22, with a quilisma +%% 31: idem, with an oriscus +%% 32: same as 21, for a non-auctus torculus resupinus +%% auctus liquescence +%% 33: idem with initio debilis (regardless of first ambitus) +%% 34: same as 32, with a quilisma +%% 35: idem, with an oriscus +%% 36: same as 22, for a non-auctus torculus resupinus +%% 37: idem, with a quilisma +%% 38: idem, with an oriscus +%% 39: same as 32, for an auctus torculus resupinus or any torculus resupinus +%% flexus, regardless of second ambitus +%% 40: idem with initio debilis (regardless of first ambitus) +%% 41: same as 39, with a quilisma +%% 42: idem, with an oriscus +%% 43: same as 36, for a torculus resupinus with second ambitus of one and not +%% auctus liquescence +%% 37: idem, with a quilisma +%% 38: idem, with an oriscus +%% 46: idem 17, with the note having two line on the bottom corners (like second note of gig) +%% 47: idem 46, with the note having a line on the bottom left (like second note of gih) +%% 48: the first note, if it's a punctum with a bar on the top-right corner (~6) +%% 49: the first note, if it's a "virga" with a bar on the bottom-right corner (~6) +%% 50: the first note, if it's a quilisma with a bar on the top-right corner (~20) +%% 51: the first note, if it's an oriscus with a bar on the top-right corner (~19) +%% 52: the last note, if it's a punctum with a bar on the top-left corner (~0) +%% 53: the last note, if it's an auctus with a bar on the bottom-left corner (~0) +%% 54: the last note, if it's a virga aucta +%% 55: the last note, if it's a "virga" with a bar on the bottom-left corner (~0) +%% 56: the first note, if it's a virga + +% a function to typeset a vertical episemus or a rare accent (like accentus, +% circulus, etc.). This function must be called after a call to \greglyph. +% #1 is the letter of the height of the episemus (not the height of the note +% it corresponds to. +% #2 is note position case as in the table above +% #3 is the sign glyph % #4 is type (1: vertical episemus, 2: rare sign, 3: choral sign, 4: brace above the bar) % #5 is the choral sign if relevant \def\grevepisemusorrare#1#2#3#4#5{% @@ -816,8 +866,11 @@ \or% %case 8, in which we do (for now) the same as case 6 \grevepisemusorrareaux{0}{\gre@char@punctum}{0}{0}{#3}{#4}{#5}% - \or% case 9, 10 and 11 - \or\or\or % + \or% + %case 9 + \grevepisemusorrareaux{0}{\gre@char@punctum}{0}{0}{#3}{#4}{#5}% + \or\or% case 10 and 11 + \or% %case 12 \grevepisemusorrareaux{0}{\gre@char@punctuminclinatum}{0}{30\the\grefactor }{#3}{#4}{#5}% \or% @@ -846,15 +899,13 @@ \grevepisemusorrareaux{0}{\gre@char@quilisma}{0}{0}{#3}{#4}{#5}% \or% %case 21 - % 5634 is a flexus without bar with ambitus of 2 - \grevepisemusorrareaux{\gre@char@flexusalt}{\gre@char@punctum}{3}{0}{#3}{#4}{#5}% + \grevepisemusorrareaux{\gre@char@fuse@punctum@two}{\gre@char@punctum}{3}{0}{#3}{#4}{#5}% \or% %case 22 - % 5633 is a flexus without bar with ambitus of 1 - \grevepisemusorrareaux{\gre@char@flexusaltone}{\gre@char@punctum}{3}{0}{#3}{#4}{#5}% + \grevepisemusorrareaux{\gre@char@fuse@punctum@one}{\gre@char@punctum}{3}{0}{#3}{#4}{#5}% \or% %case 23 - \grevepisemusorrareaux{\gre@char@pesinitauctus}{\gre@char@punctum}{3}{0}{#3}{#4}{#5}% + \grevepisemusorrareaux{\gre@char@fuse@debilis}{\gre@char@punctum}{3}{0}{#3}{#4}{#5}% \or% %case 24 \grevepisemusorrareaux{0}{\gre@char@lineapunctum}{1}{0}{#3}{#4}{#5}% @@ -867,6 +918,93 @@ \or% %case 27 \grevepisemusorrareaux{0}{\gredivisiofinalissymbol}{1}{0}{#3}{#4}{#5}% + \or% + %case 28 + \grevepisemusorrareaux{\gre@char@fuse@quilisma@two}{\gre@char@punctum}{3}{0}{#3}{#4}{#5}% + \or% + %case 29 + \grevepisemusorrareaux{\gre@char@fuse@oriscus@two}{\gre@char@punctum}{3}{0}{#3}{#4}{#5}% + \or% + %case 30 + \grevepisemusorrareaux{\gre@char@fuse@quilisma@one}{\gre@char@punctum}{3}{0}{#3}{#4}{#5}% + \or% + %case 31 + \grevepisemusorrareaux{\gre@char@fuse@oriscus@one}{\gre@char@punctum}{3}{0}{#3}{#4}{#5}% + \or% + %case 32 + \grevepisemusorrareaux{\gre@char@fuse@punctum@two}{\gre@char@punctum}{3}{0}{#3}{#4}{#5}% + \or% + %case 33 + \grevepisemusorrareaux{\gre@char@fuse@debilis}{\gre@char@punctum}{3}{0}{#3}{#4}{#5}% + \or% + %case 34 + \grevepisemusorrareaux{\gre@char@fuse@quilisma@two}{\gre@char@punctum}{3}{0}{#3}{#4}{#5}% + \or% + %case 35 + \grevepisemusorrareaux{\gre@char@fuse@oriscus@two}{\gre@char@punctum}{3}{0}{#3}{#4}{#5}% + \or% + %case 36 + \grevepisemusorrareaux{\gre@char@fuse@punctum@one}{\gre@char@punctum}{3}{0}{#3}{#4}{#5}% + \or% + %case 37 + \grevepisemusorrareaux{\gre@char@fuse@quilisma@one}{\gre@char@punctum}{3}{0}{#3}{#4}{#5}% + \or% + %case 38 + \grevepisemusorrareaux{\gre@char@fuse@oriscus@one}{\gre@char@punctum}{3}{0}{#3}{#4}{#5}% + \or% + %case 39 + \grevepisemusorrareaux{\gre@char@fuse@punctum@two}{\gre@char@punctum}{3}{0}{#3}{#4}{#5}% + \or% + %case 40 + \grevepisemusorrareaux{\gre@char@fuse@debilis}{\gre@char@punctum}{3}{0}{#3}{#4}{#5}% + \or% + %case 41 + \grevepisemusorrareaux{\gre@char@fuse@quilisma@two}{\gre@char@punctum}{3}{0}{#3}{#4}{#5}% + \or% + %case 42 + \grevepisemusorrareaux{\gre@char@fuse@oriscus@two}{\gre@char@punctum}{3}{0}{#3}{#4}{#5}% + \or% + %case 43 + \grevepisemusorrareaux{\gre@char@fuse@punctum@one}{\gre@char@punctum}{3}{0}{#3}{#4}{#5}% + \or% + %case 44 + \grevepisemusorrareaux{\gre@char@fuse@quilisma@one}{\gre@char@punctum}{3}{0}{#3}{#4}{#5}% + \or% + %case 45 + \grevepisemusorrareaux{\gre@char@fuse@oriscus@one}{\gre@char@punctum}{3}{0}{#3}{#4}{#5}% + \or% + %case 46 + \grevepisemusorrareaux{\gre@char@flexusalt@line@bl}{\gre@char@punctum@line@blbr}{2}{0}{#3}{#4}{#5}% + \or% + %case 47 + \grevepisemusorrareaux{\gre@char@flexusaltone@line@bl}{\gre@char@punctum@line@bl}{2}{0}{#3}{#4}{#5}% + \or% + %case 48 + \grevepisemusorrareaux{0}{\gre@char@punctum@line@tr}{0}{0}{#3}{#4}{#5}% + \or% + %case 49 + \grevepisemusorrareaux{0}{\gre@char@virga@line@br}{0}{0}{#3}{#4}{#5}% + \or% + %case 50 + \grevepisemusorrareaux{0}{\gre@char@quilisma@line@tr}{0}{0}{#3}{#4}{#5}% + \or% + %case 51 + \grevepisemusorrareaux{0}{\gre@char@oriscus@line@tr}{0}{0}{#3}{#4}{#5}% + \or% + %case 52 + \grevepisemusorrareaux{0}{\gre@char@punctum}{1}{0}{#3}{#4}{#5}% + \or% + %case 53 + \grevepisemusorrareaux{0}{\gre@char@punctumauctus@line@bl}{1}{0}{#3}{#4}{#5}% + \or% + %case 54 + \grevepisemusorrareaux{0}{\gre@char@virgaaucta}{1}{0}{#3}{#4}{#5}% + \or% + %case 55 + \grevepisemusorrareaux{0}{\gre@char@virga@line@br}{1}{0}{#3}{#4}{#5}% + \or% + %case 56 + \grevepisemusorrareaux{0}{\gre@char@virga}{0}{0}{#3}{#4}{#5}% \fi% \relax% }% @@ -916,16 +1054,36 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% a macro that will help in the typesetting of a horizontal episemus and additional lines, the first argument is a glyph that have the same width as the width between the end of the glyph and the beginning of the episemus, and the second argument is the character of the episemus. If the third argument is 0, we go directly to the beginning of the glyph, else we don't change anything -% 4th argument is the same as in hepisorline -% #5 is the choral sign if relevant +% a macro that will help in the typesetting of a horizontal episemus and additional lines, +% #1 is an offset glyph (see #3, below) +% #2 is the episemus glyph +% #3 is a case number, similar in nature to #3 in grevepisemusorrareaux +% 0 : go back to the beginning of the previous glyph; this starts the +% episemus at the beginning of the previous glyph +% 1 : stay at the end of the glyph; doesn't make much sense to use this +% 2 : go back the width of #1; this starts the episemus at the glyph from +% the end that starts at #1's width from the end +% 3 : go back to the beginning of the previous glyph and then forward the +% width of #1; this starts the episemus at the glyph from the start that +% starts just after #1's width from the start +% #4 argument is the same as in hepisorline \def\grehepisorlineaux#1#2#3#4{% - \ifnum#3=0% + \ifcase#3% + % case 0 % first we set \gre@dimen@temp@three to the width of the last glyph \gre@dimen@temp@three=\gre@dimen@lastglyphwidth % - \else% + \or + % case 1 + \gre@dimen@temp@three=0 pt\relax % + \or + % case 2 \setbox\GreTempsign=\hbox{\gregoriofont #1}% \gre@dimen@temp@three=\wd\GreTempsign% + \or + % case 3 + \gre@dimen@temp@three=\gre@dimen@lastglyphwidth % + \setbox\GreTempsign=\hbox{\gregoriofont #1}% + \advance\gre@dimen@temp@three by -\wd\GreTempsign % \fi% \kern-\gre@dimen@temp@three % % then we draw the sign, and go back to the beginning of the sign @@ -973,11 +1131,17 @@ \relax% }% -% a function to typeset a horizontal line (additional line or episemus). The firts argument is the letter of the height of the episemus (not the height of the note it corresponds to. This function must be called after a call to \greglyph. -%The second argument is the type of glyph it was, more precisely the kind of space there is between the end (or in special cases the beginning) of the glyph and the place where we will typeset the episemus. The possible values are the common ones -% the third argument is a bit particular, it is the ambitus of the porrectus or porrectus flexus if the second argument is 8 or 9, otherwise -% #4 is 0 for an horizontal episemus, 1 for an horizontal episemus under a note, 3 for a line at the bottom, 2 for a line at the top -\def\grehepisorline#1#2#3#4{% +% a function to typeset a horizontal line (additional line or episemus). +% This function must be called after a call to \greglyph. +% #1 is the letter of the height of the episemus (not the height of the note +% it corresponds to. +% #2 is note position case as in the table above +% #3 is the ambitus for a two note episemus at the diagonal stroke of a +% porrectus, porrectus flexus, orculus resupinus, or torculus resupinus +% flexus +% #4 is 0 for an horizontal episemus, 1 for an horizontal episemus under a +% note, 3 for a line at the bottom, 2 for a line at the top +\def\grehepisorline#1#2#3#4{{% \ifcase#4 % \gre@calculate@glyphraisevalue{#1}{9}% \or % @@ -992,26 +1156,26 @@ \fi % \ifcase#2 % %case 0 - \grehepisorlineaux{\gre@char@punctum}{\gre@char@he@punctum}{1}{#4}% + \grehepisorlineaux{\gre@char@punctum}{\gre@char@he@punctum}{2}{#4}% \or% %case 1 - \grehepisorlineaux{\gre@char@smallpunctum}{\gre@char@he@initio}{1}{#4}% + \grehepisorlineaux{\gre@char@smallpunctum}{\gre@char@he@initio}{2}{#4}% \or% %case 2 % a kind of flexus, it has the good width - \grehepisorlineaux{\gre@char@flexusalt}{\gre@char@he@punctum}{1}{#4}% + \grehepisorlineaux{\gre@char@flexusalt}{\gre@char@he@punctum}{2}{#4}% \or% %case 3 % in order to go to the good place, we first make a kern of - the glyph before deminutus, which has the same width as a standard flexus deminutus - \grehepisorlineaux{\gre@char@flexusdeminutus}{\gre@char@he@punctum}{1}{#4}% + \grehepisorlineaux{\gre@char@flexusdeminutus}{\gre@char@he@punctum}{2}{#4}% \or% %case 4 % a torculus, it has the good width - \grehepisorlineaux{\gre@char@torculus}{\gre@char@he@punctum}{1}{#4}% + \grehepisorlineaux{\gre@char@torculus}{\gre@char@he@punctum}{2}{#4}% \or% %case 5 % torculus deminutus has the good width - \grehepisorlineaux{\gre@char@torculusdeminutus}{\gre@char@he@punctum}{1}{#4}% + \grehepisorlineaux{\gre@char@torculusdeminutus}{\gre@char@he@punctum}{2}{#4}% \or% %case 6 \grehepisorlineaux{0}{\gre@char@he@punctum}{0}{#4}% @@ -1021,70 +1185,35 @@ \grehepisorlineaux{0}{\gre@char@he@flexus}{0}{#4}% \or% %case 8 - \grehepisorlineaux{0}{\gre@char@he@punctum}{0}{#4}% + \grehepisorlineaux{0}{\gre@char@he@porrectus{#3}}{0}{#4}% \or% %case 9 - \ifcase#3% - \or% - \grehepisorlineaux{0}{\gre@char@he@porrectus@one}{0}{#4}% - \or% - \grehepisorlineaux{0}{\gre@char@he@porrectus@two}{0}{#4}% - \or% - \grehepisorlineaux{0}{\gre@char@he@porrectus@three}{0}{#4}% - \or% - \grehepisorlineaux{0}{\gre@char@he@porrectus@four}{0}{#4}% - \or% - \grehepisorlineaux{0}{\gre@char@he@porrectus@five}{0}{#4}% - \fi% + \grehepisorlineaux{0}{\gre@char@he@porrectus@amone{#3}}{0}{#4}% \or% %case 10 - \ifcase#3% - \or% - \grehepisorlineaux{0}{\gre@char@he@porrectusfl@one}{0}{#4}% - \or% - \grehepisorlineaux{0}{\gre@char@he@porrectusfl@two}{0}{#4}% - \or% - \grehepisorlineaux{0}{\gre@char@he@porrectusfl@three}{0}{#4}% - \or% - \grehepisorlineaux{0}{\gre@char@he@porrectusfl@four}{0}{#4}% - \or% - \grehepisorlineaux{0}{\gre@char@he@porrectusfl@five}{0}{#4}% - \fi% - \or % - %case 11 - \ifcase#3% - \or% - \grehepisorlineaux{\gre@char@porrectus@one}{\gre@char@he@porrectusfl@one}{1}{#4}% - \or% - \grehepisorlineaux{\gre@char@porrectus@two}{\gre@char@he@porrectusfl@two}{1}{#4}% - \or% - \grehepisorlineaux{\gre@char@porrectus@three}{\gre@char@he@porrectusfl@three}{1}{#4}% - \or% - \grehepisorlineaux{\gre@char@porrectus@four}{\gre@char@he@porrectusfl@four}{1}{#4}% - \or% - \grehepisorlineaux{\gre@char@porrectus@five}{\gre@char@he@porrectusfl@five}{1}{#4}% - \fi% + \grehepisorlineaux{0}{\gre@char@he@porrectusfl{#3}}{0}{#4}% + \or% case 11 is gone \or% %case 12 - \grehepisorlineaux{\gre@char@punctuminclinatum}{\gre@char@he@inclinatum}{1}{#4}% + \grehepisorlineaux{\gre@char@punctuminclinatum}{\gre@char@he@inclinatum}{2}{#4}% \or% %case 13 - \grehepisorlineaux{\gre@char@punctuminclinatumdem}{\gre@char@he@inclinatumdem}{1}{#4}% + \grehepisorlineaux{\gre@char@punctuminclinatumdem}{\gre@char@he@inclinatumdem}{2}{#4}% \or% %case 14 - \grehepisorlineaux{\gre@char@stropha}{\gre@char@he@stropha}{1}{#4}% + \grehepisorlineaux{\gre@char@stropha}{\gre@char@he@stropha}{2}{#4}% \or% %case 15 - \grehepisorlineaux{\gre@char@quilisma}{\gre@char@he@quilisma}{1}{#4}% + \grehepisorlineaux{\gre@char@quilisma}{\gre@char@he@quilisma}{2}{#4}% \or% %case 16 - \grehepisorlineaux{\gre@char@oriscus}{\gre@char@he@oriscus}{1}{#4}% + \grehepisorlineaux{\gre@char@oriscus}{\gre@char@he@oriscus}{2}{#4}% \or% %case 17 - \grehepisorlineaux{\gre@char@flexusaltone}{\gre@char@he@punctum}{1}{#4}% + \grehepisorlineaux{\gre@char@flexusaltone}{\gre@char@he@punctum}{2}{#4}% \or % %case 18 - \grehepisorlineaux{\gre@char@peshigh}{\gre@char@he@smallpunctum}{1}{#4}% + \grehepisorlineaux{\gre@char@peshigh}{\gre@char@he@smallpunctum}{2}{#4}% \or % %case 19 \grehepisorlineaux{0}{\gre@char@he@oriscus}{0}{#4}% @@ -1093,52 +1222,107 @@ \grehepisorlineaux{0}{\gre@char@he@quilisma}{0}{#4}% \or % %case 21 - \ifcase#3% - \or% - \grehepisorlineaux{\gre@char@porrectus@one}{\gre@char@he@punctum}{1}{#4}% - \or% - \grehepisorlineaux{\gre@char@porrectus@two}{\gre@char@he@punctum}{1}{#4}% - \or% - \grehepisorlineaux{\gre@char@porrectus@three}{\gre@char@he@punctum}{1}{#4}% - \or% - \grehepisorlineaux{\gre@char@porrectus@four}{\gre@char@he@punctum}{1}{#4}% - \or% - \grehepisorlineaux{\gre@char@porrectus@five}{\gre@char@he@punctum}{1}{#4}% - \fi% + \grehepisorlineaux{\gre@char@leading@punctum@two}{\gre@char@he@porrectus{#3}}{3}{#4}% \or % %case 22 - \ifcase#3% - \or% - \grehepisorlineaux{\gre@char@porrectus@one}{\gre@char@he@punctum}{1}{#4}% - \or% - \grehepisorlineaux{\gre@char@porrectus@two}{\gre@char@he@punctum}{1}{#4}% - \or% - \grehepisorlineaux{\gre@char@porrectus@three}{\gre@char@he@punctum}{1}{#4}% - \or% - \grehepisorlineaux{\gre@char@porrectus@four}{\gre@char@he@punctum}{1}{#4}% - \or% - \grehepisorlineaux{\gre@char@porrectus@five}{\gre@char@he@punctum}{1}{#4}% - \fi% + \grehepisorlineaux{\gre@char@leading@punctum@one}{\gre@char@he@porrectus{#3}}{3}{#4}% \or % %case 23 - \ifcase#3% - \or% - \grehepisorlineaux{\gre@char@porrectus@one}{\gre@char@he@punctum}{1}{#4}% - \or% - \grehepisorlineaux{\gre@char@porrectus@two}{\gre@char@he@punctum}{1}{#4}% - \or% - \grehepisorlineaux{\gre@char@porrectus@three}{\gre@char@he@punctum}{1}{#4}% - \or% - \grehepisorlineaux{\gre@char@porrectus@four}{\gre@char@he@punctum}{1}{#4}% - \or% - \grehepisorlineaux{\gre@char@porrectus@five}{\gre@char@he@punctum}{1}{#4}% - \fi% + \grehepisorlineaux{\gre@char@leading@debilis}{\gre@char@he@porrectus{#3}}{3}{#4}% \or% %case 24 - \grehepisorlineaux{\gre@char@pesinitauctusone}{\gre@char@he@punctum}{1}{#4}%the episemus is not quite long enough so I assumed a different width for now... + \grehepisorlineaux{\gre@char@pesinitauctusone}{\gre@char@he@punctum}{2}{#4}%the episemus is not quite long enough so I assumed a different width for now... + \or\or\or% case 25, 26, 27 + \or% + %case 28 + \grehepisorlineaux{\gre@char@leading@quilisma@two}{\gre@char@he@porrectus{#3}}{3}{#4}% + \or% + %case 29 + \grehepisorlineaux{\gre@char@leading@oriscus@two}{\gre@char@he@porrectus{#3}}{3}{#4}% + \or% + %case 30 + \grehepisorlineaux{\gre@char@leading@quilisma@one}{\gre@char@he@porrectus{#3}}{3}{#4}% + \or% + %case 31 + \grehepisorlineaux{\gre@char@leading@oriscus@one}{\gre@char@he@porrectus{#3}}{3}{#4}% + \or% + %case 32 + \grehepisorlineaux{\gre@char@leading@punctum@two}{\gre@char@he@porrectus@amone{#3}}{3}{#4}% + \or% + %case 33 + \grehepisorlineaux{\gre@char@leading@debilis}{\gre@char@he@porrectus@amone{#3}}{3}{#4}% + \or% + %case 34 + \grehepisorlineaux{\gre@char@leading@quilisma@two}{\gre@char@he@porrectus@amone{#3}}{3}{#4}% + \or% + %case 35 + \grehepisorlineaux{\gre@char@leading@oriscus@two}{\gre@char@he@porrectus@amone{#3}}{3}{#4}% + \or% + %case 36 + \grehepisorlineaux{\gre@char@leading@punctum@one}{\gre@char@he@porrectus@amone{#3}}{3}{#4}% + \or% + %case 37 + \grehepisorlineaux{\gre@char@leading@quilisma@one}{\gre@char@he@porrectus@amone{#3}}{3}{#4}% + \or% + %case 38 + \grehepisorlineaux{\gre@char@leading@oriscus@one}{\gre@char@he@porrectus@amone{#3}}{3}{#4}% + \or% + %case 39 + \grehepisorlineaux{\gre@char@leading@punctum@two}{\gre@char@he@porrectusfl{#3}}{3}{#4}% + \or% + %case 40 + \grehepisorlineaux{\gre@char@leading@debilis}{\gre@char@he@porrectusfl{#3}}{3}{#4}% + \or% + %case 41 + \grehepisorlineaux{\gre@char@leading@quilisma@two}{\gre@char@he@porrectusfl{#3}}{3}{#4}% + \or% + %case 42 + \grehepisorlineaux{\gre@char@leading@oriscus@two}{\gre@char@he@porrectusfl{#3}}{3}{#4}% + \or% + %case 43 + \grehepisorlineaux{\gre@char@leading@punctum@one}{\gre@char@he@porrectusfl{#3}}{3}{#4}% + \or% + %case 44 + \grehepisorlineaux{\gre@char@leading@quilisma@one}{\gre@char@he@porrectusfl{#3}}{3}{#4}% + \or% + %case 45 + \grehepisorlineaux{\gre@char@leading@oriscus@one}{\gre@char@he@porrectusfl{#3}}{3}{#4}% + \or% + %case 46 + \grehepisorlineaux{\gre@char@flexusalt@line@bl}{\gre@char@he@punctum@line@blbr}{2}{#4}% + \or% + %case 47 + \grehepisorlineaux{\gre@char@flexusaltone@line@bl}{\gre@char@he@punctum@line@bl}{2}{#4}% + \or% + %case 48 + \grehepisorlineaux{0}{\gre@char@he@punctum@line@tr}{0}{#4}% + \or% + %case 49 + \grehepisorlineaux{0}{\gre@char@he@virga@line@br}{0}{#4}% + \or % + %case 50 + \grehepisorlineaux{0}{\gre@char@he@quilisma@line@tr}{0}{#4}% + \or % + %case 51 + \grehepisorlineaux{0}{\gre@char@he@oriscus@line@tr}{0}{#4}% + \or % + %case 52 + \grehepisorlineaux{\gre@char@punctum@line@tl}{\gre@char@he@punctum@line@tl}{2}{#4}% + \or % + %case 53 + \grehepisorlineaux{\gre@char@punctumauctus@line@bl}{\gre@char@he@punctumauctus@line@bl}{2}{#4}% + \or % + %case 54 + \grehepisorlineaux{\gre@char@virgaaucta}{\gre@char@he@punctumauctus@line@bl}{2}{#4}% + \or % + %case 55 + \grehepisorlineaux{\gre@char@virga@line@br}{\gre@char@he@virga@line@br}{2}{#4}% + \or% + %case 56 + \grehepisorlineaux{0}{\gre@char@he@virga}{0}{#4}% \fi% \relax% -}% +}}% % dumb top function % #4 is a trick for bridges: if we must use a different height because of a bridge, it's #4, otherwise #4=#1