Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(368)

Delta Between Two Patch Sets: mf/feta-scripts.mf

Issue 340660043: Issue 3128: add Haydn-style turns to Feta
Left Patch Set: Created 5 years, 11 months ago
Right Patch Set: make slashturn 4% thinner at the center (instead of 10% thicker), haydnturn 0% thicker (instead of … Created 5 years, 11 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « ly/script-init.ly ('k') | ps/encodingdefs.ps » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 % Feta (not the Font-En-Tja) music font -- implement scripts 1 % Feta (not the Font-En-Tja) music font -- implement scripts
2 % This file is part of LilyPond, the GNU music typesetter. 2 % This file is part of LilyPond, the GNU music typesetter.
3 % 3 %
4 % Copyright (C) 1997--2015 Han-Wen Nienhuys <hanwen@xs4all.nl> 4 % Copyright (C) 1997--2015 Han-Wen Nienhuys <hanwen@xs4all.nl>
5 % Jan Nieuwenhuizen <janneke@gnu.org> 5 % Jan Nieuwenhuizen <janneke@gnu.org>
6 % 6 %
7 % 7 %
8 % The LilyPond font is free software: you can redistribute it and/or modify 8 % The LilyPond font is free software: you can redistribute it and/or modify
9 % it under the terms of the GNU General Public License as published by 9 % it under the terms of the GNU General Public License as published by
10 % the Free Software Foundation, either version 3 of the License, or 10 % the Free Software Foundation, either version 3 of the License, or
(...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 737
738 fill pat; 738 fill pat;
739 739
740 labels (1, 2, 3); 740 labels (1, 2, 3);
741 fet_endchar; 741 fet_endchar;
742 742
743 % 743 %
744 % Inspired by a computer-set version of Auf dem Strom by Baerenreiter. 744 % Inspired by a computer-set version of Auf dem Strom by Baerenreiter.
745 % 745 %
746 746
747 def draw_turn (expr height_factor) = 747 def draw_turn (expr height_factor, thicker_center) =
748 save thin, thick, ball_diam, darkness; 748 save thin, thick, ball_diam, darkness;
749 save wd, ht, thick_nibangle, ball_nib_thick; 749 save wd, ht, thick_nibangle, ball_nib_thick;
750 save turndir; 750 save turndir;
751 pair turndir; 751 pair turndir;
752 752
753 wd# = 35/16 staff_space#; 753 wd# = 35/16 staff_space#;
754 ht# = 18/17 staff_space#; 754 ht# = 18/17 staff_space#;
755 darkness = 0.3 linethickness + 0.09 staff_space; 755 darkness = 0.3 linethickness + 0.09 staff_space;
756 756
757 » set_char_box (wd# / 2, wd# / 2, ht# / 2 * height_factor, ht# / 2 * heigh t_factor); 757 » set_char_box (wd# / 2, wd# / 2,
lemzwerg 2018/04/08 14:17:20 Please avoid lines longer than 78 characters.
758 » » ht# / 2 * height_factor, ht# / 2 * height_factor);
758 759
759 thick_nibangle = 60; 760 thick_nibangle = 60;
760 thick = 3 darkness; 761 thick = 3 darkness;
761 thin = darkness; 762 thin = darkness;
762 ball_nib_thick = 2.7 darkness; 763 ball_nib_thick = 2.7 darkness;
763 ball_diam = ball_nib_thick + (h - ball_nib_thick) / 10; 764 ball_diam = ball_nib_thick + (h - ball_nib_thick) / 10;
764 765
765 x3l = w; 766 x3l = w;
766 y3 = 0; 767 y3 = 0;
767 y4l = h / height_factor; 768 y4l = h / height_factor;
768 x4 = x2; 769 x4 = x2;
769 x2l = w / 2; 770 x2l = w / 2;
770 y2l = -d / height_factor; 771 y2l = -d / height_factor;
771 z1 = (0,0); 772 z1 = (0,0);
772 773
773 » penpos1 (1.1 thick, thick_nibangle); 774 » penpos1 (thicker_center * thick, thick_nibangle);
774 penpos2 (thick, thick_nibangle); 775 penpos2 (thick, thick_nibangle);
775 penpos3 (thin, 180); 776 penpos3 (thin, 180);
776 penpos4 (ball_nib_thick, -90); 777 penpos4 (ball_nib_thick, -90);
777 778
778 path swoosh, ploop; 779 path swoosh, ploop;
779 swoosh := z1l{curl 0} 780 swoosh := z1l{curl 0}
780 .. z2l 781 .. z2l
781 .. z3l{up} 782 .. z3l{up}
782 .. {left}z4l 783 .. {left}z4l
783 -- z4r 784 -- z4r
(...skipping 13 matching lines...) Expand all
797 ploop := z4l{left} 798 ploop := z4l{left}
798 .. z5l 799 .. z5l
799 .. z6l 800 .. z6l
800 -- cycle; 801 -- cycle;
801 fill ploop; 802 fill ploop;
802 fill ploop scaled -1 shifted (-feta_eps, -feta_eps); 803 fill ploop scaled -1 shifted (-feta_eps, -feta_eps);
803 enddef; 804 enddef;
804 805
805 806
806 fet_beginchar ("Reverse turn", "reverseturn"); 807 fet_beginchar ("Reverse turn", "reverseturn");
807 » draw_turn (1); 808 » draw_turn (1, 1.1);
808 currentpicture := currentpicture yscaled -1; 809 currentpicture := currentpicture yscaled -1;
809 fet_endchar; 810 fet_endchar;
810 811
811 812
812 fet_beginchar ("Turn", "turn"); 813 fet_beginchar ("Turn", "turn");
813 » draw_turn (1); 814 » draw_turn (1, 1.1);
814 penlabels (1, 2, 3, 4, 5, 6, 7); 815 penlabels (1, 2, 3, 4, 5, 6, 7);
815 fet_endchar; 816 fet_endchar;
816 817
817 818
818 fet_beginchar ("Slashed turn", "slashturn"); 819 fet_beginchar ("Slashed turn", "slashturn");
819 » draw_turn (4 / 3); 820 » draw_turn (4 / 3, 0.96);
820 821
821 clearxy; 822 clearxy;
822 823
823 pickup pencircle scaled turn_stemwidth; 824 pickup pencircle scaled turn_stemwidth;
824 825
825 top y1 = h; 826 top y1 = h;
826 bot y2 = -d; 827 bot y2 = -d;
827 x1 = x2; 828 x1 = x2;
828 x2 = 0; 829 x2 = 0;
829 830
830 draw_gridline (z2, z1, turn_stemwidth); 831 draw_gridline (z2, z1, turn_stemwidth);
831 fet_endchar; 832 fet_endchar;
832 833
833 834
834 def draw_haydnturn (expr height_factor) = 835 def draw_haydnturn (expr height_factor) =
835 save thin, thick, darkness; 836 save thin, thick, darkness;
836 save wd, ht, thick_nibangle; 837 save wd, ht, thick_nibangle;
837 838
838 wd# = 2 staff_space#; 839 wd# = 2 staff_space#;
839 ht# = 3 / 5 staff_space#; 840 ht# = 3 / 5 staff_space#;
840 » set_char_box (wd# / 2, wd# / 2, ht# / 2 * height_factor, ht# / 2 * heigh t_factor); 841 » set_char_box (wd# / 2, wd# / 2,
lemzwerg 2018/04/08 14:17:20 Ditto.
842 » » ht# / 2 * height_factor, ht# / 2 * height_factor);
841 843
842 darkness = 0.3 linethickness + 0.09 staff_space; 844 darkness = 0.3 linethickness + 0.09 staff_space;
843 845
844 thick_nibangle = 60; 846 thick_nibangle = 60;
845 thick = 3 darkness; 847 thick = 3 darkness;
846 thin = darkness; 848 thin = darkness;
847 849
848 x3l = w; 850 x3l = w;
849 y3 = h / height_factor - thin / 2; 851 y3 = h / height_factor - thin / 2;
850 x2l = w / 3; 852 x2l = w / 3;
851 y2l = -d / height_factor; 853 y2l = -d / height_factor;
852 z1 = (0,0); 854 z1 = (0,0);
853 855
854 » penpos1 (1.1 thick, thick_nibangle); 856 » penpos1 (thick, thick_nibangle);
855 penpos2 (thick, thick_nibangle); 857 penpos2 (thick, thick_nibangle);
856 penpos3 (thin, 150); 858 penpos3 (thin, 150);
857 859
858 path swoosh; 860 path swoosh;
859 swoosh := z1l{curl 0} 861 swoosh := z1l{curl 0}
860 .. z2l 862 .. z2l
861 » » .. z3l{dir(60)} 863 » » .. z3l{dir (60)}
lemzwerg 2018/04/08 14:17:20 Please use a space after `dir' to be in sync with
862 » » .. z3r{dir(240)} 864 » » .. z3r{dir (240)}
863 .. z2r{left}; 865 .. z2r{left};
864 fill swoosh 866 fill swoosh
865 .. swoosh scaled -1 shifted (-feta_eps, -feta_eps) 867 .. swoosh scaled -1 shifted (-feta_eps, -feta_eps)
866 .. cycle; 868 .. cycle;
867 869
868 clearxy; 870 clearxy;
869 871
870 pickup pencircle scaled turn_stemwidth; 872 pickup pencircle scaled turn_stemwidth;
871 873
872 top y1 = h; 874 top y1 = h;
(...skipping 1032 matching lines...) Expand 10 before | Expand all | Expand 10 after
1905 1907
1906 z5 = (0, 0); 1908 z5 = (0, 0);
1907 z6 = (x5, 1.5 y1r); 1909 z6 = (x5, 1.5 y1r);
1908 1910
1909 draw_gridline (z5, z6, thickness); 1911 draw_gridline (z5, z6, thickness);
1910 1912
1911 labels (5, 6); 1913 labels (5, 6);
1912 fet_endchar; 1914 fet_endchar;
1913 1915
1914 fet_endgroup ("scripts"); 1916 fet_endgroup ("scripts");
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b