% Feta (not the Font-En-Tja) music font -- draw flags
% This file is part of LilyPond, the GNU music typesetter.
%
-% Copyright (C) 1997--2011 Han-Wen Nienhuys <hanwen@xs4all.nl>
+% Copyright (C) 1997--2014 Han-Wen Nienhuys <hanwen@xs4all.nl>
%
-% LilyPond is free software: you can redistribute it and/or modify
+% The LilyPond font is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
-% (at your option) any later version.
+% (at your option) any later version, or under the SIL Open Font License.
%
% LilyPond is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
enddef;
-fet_beginchar ("8th Flag (up)", "u3");
+
+
+def upstemsingleflag (expr shortening) =
save flare, hip_depth_ratio, hip_width, foot_depth, foot_width_ratio;
+ save flagspace, total_depth, flag_count;
+ flag_count = 1;
+ total_depth# = (3 - shortening) * staff_space# - blot_diameter# / 2;
flare = staff_space;
+ flagspace# = staff_space#;
hip_depth_ratio = .72;
- foot_width_ratio = .8;
hip_width# = upflag_width# - hip_thickness# / 2;
- foot_depth# = 3 staff_space# - blot_diameter# / 2;
+ foot_width_ratio = .8;
+
+ (flag_count - 1) * flagspace# + foot_depth# = total_depth#;
+
define_pixels (hip_width, foot_depth);
+ define_whole_vertical_pixels (flagspace);
- set_char_box (0,
- hip_width# + stemthickness# / 2 + right_upflag_space#,
+ set_char_box (0, hip_width# + stemthickness# / 2 + right_upflag_space#,
foot_depth# + foot_thickness# / 2, stemthickness# / 2);
- draw_flag ((0,0), flare, (hip_width, foot_depth),
+ draw_flag ((0, -(flag_count - 1) * flagspace),
+ flare, (hip_width, foot_depth),
hip_depth_ratio, foot_width_ratio,
hip_thickness, foot_thickness, 1);
- draw_square_block ((-0.5 stemthickness_rounded, -staff_space_rounded),
- (0, 0));
-fet_endchar;
+ draw_square_block ((-0.5 stemthickness_rounded, 0),
+ (0, (-flag_count * staff_space_rounded)));
+enddef;
-fet_beginchar ("16th Flag (up)", "u4");
+def upstemdoubleflag (expr shortening) =
save flare, hip_depth_ratio, hip_width, foot_depth, foot_width_ratio;
save flagspace, total_depth, flag_count;
- total_depth# = 3.5 staff_space# - blot_diameter# / 2;
flag_count = 2;
+ total_depth# = (3.5 - shortening) * staff_space# - blot_diameter# / 2;
flare = .85 staff_space;
flagspace# = .85 staff_space#;
hip_depth_ratio = .72;
hip_width# = upflag_width# - hip_thickness# / 2;
- flagspace# + foot_depth# = total_depth#;
foot_width_ratio = .8;
+
+ (flag_count - 1) * flagspace# + foot_depth# = total_depth#;
+
define_pixels (hip_width, foot_depth);
define_whole_vertical_pixels (flagspace);
- set_char_box (0,
- hip_width# + stemthickness# / 2 + right_upflag_space#,
+ set_char_box (0, hip_width# + stemthickness# / 2 + right_upflag_space#,
total_depth# + foot_thickness# / 2, stemthickness# / 2);
- draw_flag ((0, -flagspace), flare, (hip_width, foot_depth),
+ draw_flag ((0, -(flag_count - 1) * flagspace),
+ flare, (hip_width, foot_depth),
hip_depth_ratio, foot_width_ratio,
hip_thickness, foot_thickness, 1);
hip_thickness, foot_thickness);
draw_square_block ((-0.5 stemthickness_rounded, 0),
- (0, -2 staff_space_rounded));
-fet_endchar;
+ (0, (-flag_count * staff_space_rounded)));
+enddef;
-fet_beginchar ("32nd Flag (up)", "u5");
+def upstemtripleflag (expr shortening) =
save flare, hip_depth_ratio, hip_width, foot_depth, foot_width_ratio;
save flagspace, total_depth, flag_count;
flag_count = 3;
- total_depth# = 4.25 staff_space#;
+ total_depth# = (4.25 - shortening) * staff_space# - blot_diameter# / 2;
flare = .85 staff_space;
flagspace# = .87 staff_space#;
hip_depth_ratio = .72;
set_char_box (0, hip_width# + right_upflag_space#,
total_depth# + foot_thickness# / 2, stemthickness# / 2);
- draw_flag ((0, -2 flagspace), flare, (hip_width, foot_depth),
+ draw_flag ((0, -(flag_count - 1) * flagspace),
+ flare, (hip_width, foot_depth),
hip_depth_ratio, foot_width_ratio,
hip_thickness, foot_thickness, 1);
hip_thickness, foot_thickness);
draw_square_block ((-0.5 stemthickness_rounded, 0),
- (0, -3 staff_space_rounded));
-fet_endchar;
+ (0, (-flag_count * staff_space_rounded)));
+enddef;
-fet_beginchar ("64th Flag (up)", "u6");
+def upstemquadrupleflag (expr shortening) =
save flare, hip_depth_ratio, hip_width, foot_depth, foot_width_ratio;
save flagspace, total_depth, flag_count;
flag_count = 4;
+ total_depth# = (5.25 - shortening) * staff_space# - blot_diameter# / 2;
flare = .85 staff_space;
flagspace# = .9 staff_space#;
hip_depth_ratio = .72;
hip_width# = upflag_width# - hip_thickness# / 2;
- total_depth# = 5.25 staff_space#;
foot_width_ratio = .8;
(flag_count - 1) * flagspace# + foot_depth# = total_depth#;
set_char_box (0, hip_width# + right_upflag_space#,
total_depth# + foot_thickness# / 2, stemthickness# / 2);
- draw_flag ((0, -(flag_count - 1) * flagspace), flare,
- (hip_width, foot_depth),
+ draw_flag ((0, -(flag_count - 1) * flagspace),
+ flare, (hip_width, foot_depth),
hip_depth_ratio, foot_width_ratio,
hip_thickness, foot_thickness, 1);
hip_thickness, foot_thickness);
draw_square_block ((-0.5 stemthickness_rounded, 0),
- (0, -4 staff_space_rounded));
-fet_endchar;
+ (0, (-flag_count * staff_space_rounded)));
+enddef;
-fet_beginchar ("128th Flag (up)", "u7");
+def upstemquintupleflag (expr shortening) =
save flare, hip_depth_ratio, hip_width, foot_depth, foot_width_ratio;
save flagspace, total_depth, flag_count;
flag_count = 5;
+ total_depth# = (6.25 - shortening) * staff_space# - blot_diameter# / 2;
flare = .85 staff_space;
flagspace# = .93 staff_space#;
hip_depth_ratio = .72;
hip_width# = upflag_width# - hip_thickness# / 2;
- total_depth# = 6.25 staff_space#;
foot_width_ratio = .8;
(flag_count - 1) * flagspace# + foot_depth# = total_depth#;
set_char_box (0, hip_width# + right_upflag_space#,
total_depth# + foot_thickness# / 2, stemthickness# / 2);
- draw_flag ((0, -(flag_count - 1) * flagspace), flare,
- (hip_width, foot_depth),
+ draw_flag ((0, -(flag_count - 1) * flagspace),
+ flare, (hip_width, foot_depth),
hip_depth_ratio, foot_width_ratio,
hip_thickness, foot_thickness, 1);
hip_thickness, foot_thickness);
draw_square_block ((-0.5 stemthickness_rounded, 0),
- (0, -5 staff_space_rounded));
-fet_endchar;
+ (0, (-flag_count * staff_space_rounded)));
+enddef;
-fet_beginchar ("8th (down)", "d3");
+
+
+def downstemsingleflag (expr shortening) =
save flare, hip_depth_ratio, hip_width, foot_depth, foot_width_ratio;
save flagspace, total_depth, flag_count;
flag_count = 1;
+ total_depth# = (2.75 - shortening) * staff_space#;
flare = staff_space;
flagspace# = .9 staff_space#;
- hip_depth_ratio = .72;
+ hip_depth_ratio = .74;
hip_width# = downflag_width# - hip_thickness# / 2;
- total_depth# = 2.85 staff_space#;
- foot_width_ratio = .8;
+ foot_width_ratio = .85;
(flag_count - 1) * flagspace# + foot_depth# = total_depth#;
- define_pixels (hip_width, flagspace, foot_depth);
+ define_pixels (hip_width, foot_depth);
+ define_whole_vertical_pixels (flagspace);
set_char_box (0, hip_width# + right_downflag_space#,
total_depth# + foot_thickness# / 2, stemthickness# / 2)
- draw_flag ((0, -(flag_count - 1) * flagspace), flare,
- (hip_width, foot_depth),
+ draw_flag ((0, -(flag_count - 1) * flagspace),
+ flare, (hip_width, foot_depth),
hip_depth_ratio, foot_width_ratio,
hip_thickness, foot_thickness, 0);
draw_square_block ((-0.5 stemthickness_rounded, 0),
- (0, -staff_space_rounded));
-
- y_mirror_char;
-fet_endchar;
-
-
-%%%%%%%%
-%
-% Single Stroke for Short Appogiatura
-%
-
-fet_beginchar ("grace dash (up)", "ugrace");
- save flare, hip_depth_ratio, hip_width, foot_depth;
-
- hip_depth_ratio = .72;
- flare# = staff_space#;
- hip_width# = upflag_width# - hip_thickness# / 2;
- foot_depth# = 3 staff_space#;
-
- define_pixels (hip_width, foot_depth);
-
- set_char_box (hip_width# * hip_depth_ratio,
- hip_width# + right_upflag_space#,
- foot_depth# * hip_depth_ratio, -flare#)
-
- pickup pencircle scaled 1.5 stemthickness;
-
- z1 = (-b, -d);
- z2 = (w, h);
-
- penpos1 (1.5 stemthickness, angle (z2 - z1) - 90);
- penpos2 (1.5 stemthickness, angle (z2 - z1) - 90);
-
- fill z1l
- -- z2l
- .. top z2
- .. rt z2
- .. z2r
- -- z1r
- .. bot z1
- .. lft z1
- .. cycle;
-
- penlabels (1, 2);
-fet_endchar;
-
-
-fet_beginchar ("grace dash (down)", "dgrace");
- save flare, hip_depth_ratio, hip_width, foot_depth;
- save total_depth;
-
- hip_depth_ratio = .72 ;
- flare# = .99 staff_space#;
- hip_width# = downflag_width# - hip_thickness# / 2;
- total_depth# = 2.85 staff_space#;
- foot_depth# = total_depth#;
- foot_width_ratio = .8;
-
- define_pixels (hip_width, foot_depth);
-
- set_char_box (hip_width# * hip_depth_ratio,
- hip_width# + right_downflag_space#,
- foot_depth# * hip_depth_ratio, -flare#)
-
- pickup pencircle scaled 1.5 stemthickness;
-
- z1 = (-b, -d);
- z2 = (w, h);
-
- penpos1 (1.5 stemthickness, angle (z2 - z1) - 90);
- penpos2 (1.5 stemthickness, angle (z2 - z1) - 90);
-
- fill z1l
- -- z2l
- .. top z2
- .. rt z2
- .. z2r
- -- z1r
- .. bot z1
- .. lft z1
- .. cycle;
+ (0, (-flag_count * staff_space_rounded)));
y_mirror_char;
-fet_endchar;
+enddef;
-fet_beginchar ("16th (down)", "d4");
+def downstemdoubleflag (expr shortening) =
save flare, hip_depth_ratio, hip_width, foot_depth, foot_width_ratio;
save flagspace, total_depth, flag_count;
flag_count = 2;
- flare = .8 staff_space;
+ total_depth# = (3.0 - shortening) * staff_space# - blot_diameter# / 2;
+ flare = .82 staff_space;
flagspace# = .9 staff_space#;
hip_depth_ratio = .85;
hip_width# = downflag_width# - hip_thickness# / 2;
- total_depth# = 3.0 staff_space# - blot_diameter# / 2;
foot_width_ratio = .95;
(flag_count - 1) * flagspace# + foot_depth# = total_depth#;
- set_char_box (0, hip_width# + right_downflag_space#,
- total_depth# + foot_thickness# / 2, stemthickness# / 2);
-
define_pixels (hip_width, foot_depth);
define_whole_vertical_pixels (flagspace);
- draw_flag ((0, -(flag_count - 1) * flagspace), flare,
- (hip_width, foot_depth),
+ set_char_box (0, hip_width# + right_downflag_space#,
+ total_depth# + foot_thickness# / 2, stemthickness# / 2);
+
+ draw_flag ((0, -(flag_count - 1) * flagspace),
+ flare, (hip_width, foot_depth),
hip_depth_ratio, foot_width_ratio,
hip_thickness, foot_thickness, 0);
hip_thickness, foot_thickness);
draw_square_block ((-0.5 stemthickness_rounded, 0),
- (0, -2 staff_space_rounded));
+ (0, (-flag_count * staff_space_rounded)));
y_mirror_char;
-fet_endchar;
+enddef;
-fet_beginchar ("32nd (down)", "d5");
+def downstemtripleflag (expr shortening) =
save flare, hip_depth_ratio, hip_width, foot_depth, foot_width_ratio;
save flagspace, total_depth, flag_count;
flag_count = 3;
- flare = .84 staff_space;
- flagspace# = .9 staff_space#;
- hip_depth_ratio = .85;
+ total_depth# = (3.75 - shortening) * staff_space# - blot_diameter# / 2;
+ flare = .82 staff_space;
+ flagspace# = .88 staff_space#;
+ hip_depth_ratio = .87;
hip_width# = downflag_width# - hip_thickness# / 2;
- total_depth# = 3.85 staff_space#;
- foot_width_ratio = .95;
+ foot_width_ratio = .965;
(flag_count - 1) * flagspace# + foot_depth# = total_depth#;
set_char_box (0, hip_width# + right_downflag_space#,
total_depth# + foot_thickness# / 2, stemthickness# / 2);
- draw_flag ((0, -(flag_count - 1) * flagspace), flare,
- (hip_width, foot_depth),
+ draw_flag ((0, -(flag_count - 1) * flagspace),
+ flare, (hip_width, foot_depth),
hip_depth_ratio, foot_width_ratio,
hip_thickness, foot_thickness, 0);
- add_flag (flagspace, flare, .97, 1.00, 1.25,
+ add_flag (flagspace, flare, .98, 1.00, 1.22,
hip_thickness, foot_thickness);
- add_flag (flagspace, flare, .95, 1.05, 1.25,
+ add_flag (flagspace, flare, .95, 1.02, 1.22,
hip_thickness, foot_thickness);
draw_square_block ((-0.5 stemthickness_rounded, 0),
- (0, -3 staff_space_rounded));
+ (0, (-flag_count * staff_space_rounded)));
y_mirror_char;
-fet_endchar;
+enddef;
-fet_beginchar ("64th (down)", "d6");
+def downstemquadrupleflag (expr shortening) =
save flare, hip_depth_ratio, hip_width, foot_depth, foot_width_ratio;
save flagspace, total_depth, flag_count;
flag_count = 4;
+ total_depth# = (4.5 - shortening) * staff_space# - blot_diameter# / 2;
flare = .8 staff_space;
flagspace# = .9 staff_space#;
- hip_depth_ratio = .85;
+ hip_depth_ratio = .83;
hip_width# = downflag_width# - hip_thickness# / 2;
- total_depth# = 4.35 staff_space#;
- foot_width_ratio = .98;
+ foot_width_ratio = .975;
(flag_count - 1) * flagspace# + foot_depth# = total_depth#;
set_char_box (0, hip_width# + right_downflag_space#,
total_depth# + foot_thickness# / 2, stemthickness# / 2);
- draw_flag ((0, -(flag_count - 1) * flagspace), flare,
- (hip_width, foot_depth),
+ draw_flag ((0, -(flag_count - 1) * flagspace),
+ flare, (hip_width, foot_depth),
hip_depth_ratio, foot_width_ratio,
hip_thickness, foot_thickness, 0);
- add_flag (flagspace, flare, .97, 1.20, 1.175,
+ add_flag (flagspace, flare, .98, 1.10, 1.19,
hip_thickness, foot_thickness);
- add_flag (flagspace, flare, .97, 1.10, 1.175,
+ add_flag (flagspace, flare, .98, 1.08, 1.19,
hip_thickness, foot_thickness);
- add_flag (.98 flagspace, flare, .91, 1.05, 1.2,
+ add_flag (.98 flagspace, flare, .94, 1.04, 1.21,
hip_thickness, foot_thickness);
draw_square_block ((-0.5 stemthickness_rounded, 0),
- (0, -4 staff_space_rounded));
+ (0, (-flag_count * staff_space_rounded)));
y_mirror_char;
-fet_endchar;
+enddef;
-fet_beginchar ("128th (down)", "d7");
+def downstemquintupleflag (expr shortening) =
save flare, hip_depth_ratio, hip_width, foot_depth, foot_width_ratio;
save flagspace, total_depth, flag_count;
flag_count = 5;
+ total_depth# = (5.5 - shortening) * staff_space# - blot_diameter# / 2;
flare = .8 staff_space;
- flagspace# = .9 staff_space#;
+ flagspace# = .92 staff_space#;
hip_depth_ratio = .85;
hip_width# = downflag_width# - hip_thickness# / 2;
- total_depth# = 5.25 staff_space#;
foot_width_ratio = .98;
(flag_count - 1) * flagspace# + foot_depth# = total_depth#;
+
define_pixels (hip_width, foot_depth);
define_whole_vertical_pixels (flagspace);
set_char_box (0, hip_width# + right_downflag_space#,
total_depth# + foot_thickness# / 2, stemthickness# / 2);
- draw_flag ((0, -(flag_count - 1) * flagspace), flare,
- (hip_width, foot_depth),
+ draw_flag ((0, -(flag_count - 1) * flagspace),
+ flare, (hip_width, foot_depth),
hip_depth_ratio, foot_width_ratio,
hip_thickness, foot_thickness, 0);
- add_flag (flagspace, flare, .97, 1.20, 1.175,
+ add_flag (flagspace, flare, .98, 1.10, 1.185,
hip_thickness, foot_thickness);
- add_flag (flagspace, flare, .97, 1.10, 1.175,
+ add_flag (flagspace, flare, .98, 1.08, 1.185,
hip_thickness, foot_thickness);
- add_flag (.98 flagspace, flare, .91, 1.05, 1.2,
+ add_flag (.98 flagspace, flare, .97, 1.06, 1.2,
hip_thickness, foot_thickness);
- add_flag (.98 flagspace, flare, .91, 1.05, 1.2,
+ add_flag (.98 flagspace, flare, .93, 1.04, 1.22,
hip_thickness, foot_thickness);
draw_square_block ((-0.5 stemthickness_rounded, 0),
- (0, -5 staff_space_rounded));
+ (0, (-flag_count * staff_space_rounded)));
y_mirror_char;
+enddef;
+
+
+
+
+fet_beginchar ("8th Flag (up)", "u3");
+ upstemsingleflag (0.0);
+fet_endchar;
+
+
+fet_beginchar ("16th Flag (up)", "u4");
+ upstemdoubleflag (0);
+fet_endchar;
+
+
+fet_beginchar ("32nd Flag (up)", "u5");
+ upstemtripleflag (0);
+fet_endchar;
+
+
+fet_beginchar ("64th Flag (up)", "u6");
+ upstemquadrupleflag (0);
+fet_endchar;
+
+
+fet_beginchar ("128th Flag (up)", "u7");
+ upstemquintupleflag (0);
+fet_endchar;
+
+
+
+
+
+fet_beginchar ("8th Flag (down)", "d3");
+ downstemsingleflag (0.0);
+fet_endchar;
+
+
+fet_beginchar ("16th Flag (down) 3", "d4");
+ downstemdoubleflag (0);
+fet_endchar;
+
+
+fet_beginchar ("32nd Flag (down)", "d5");
+ downstemtripleflag (0);
fet_endchar;
+
+fet_beginchar ("64th Flag (down)", "d6");
+ downstemquadrupleflag (0);
+fet_endchar;
+
+
+fet_beginchar ("128th Flag (down)", "d7");
+ downstemquintupleflag (0);
+fet_endchar;
+
+
+
+
+%%%%%%%%
+%
+% Single Stroke for Short Appogiatura
+%
+
+fet_beginchar ("grace dash (up)", "ugrace");
+ save flare, hip_depth_ratio, hip_width, foot_depth;
+
+ hip_depth_ratio = .72;
+ flare# = staff_space#;
+ hip_width# = upflag_width# - hip_thickness# / 2;
+ foot_depth# = 3 staff_space#;
+
+ define_pixels (hip_width, foot_depth);
+
+ set_char_box (hip_width# * hip_depth_ratio,
+ hip_width# + right_upflag_space#,
+ foot_depth# * hip_depth_ratio, -flare#)
+
+ pickup pencircle scaled 1.5 stemthickness;
+
+ z1 = (-b, -d);
+ z2 = (w, h);
+
+ penpos1 (1.5 stemthickness, angle (z2 - z1) - 90);
+ penpos2 (1.5 stemthickness, angle (z2 - z1) - 90);
+
+ fill z1l
+ -- z2l
+ .. top z2
+ .. rt z2
+ .. z2r
+ -- z1r
+ .. bot z1
+ .. lft z1
+ .. cycle;
+
+ penlabels (1, 2);
+fet_endchar;
+
+
+fet_beginchar ("grace dash (down)", "dgrace");
+ save flare, hip_depth_ratio, hip_width, foot_depth;
+ save total_depth;
+
+ hip_depth_ratio = .72 ;
+ flare# = .99 staff_space#;
+ hip_width# = downflag_width# - hip_thickness# / 2;
+ total_depth# = 2.85 staff_space#;
+ foot_depth# = total_depth#;
+ foot_width_ratio = .8;
+
+ define_pixels (hip_width, foot_depth);
+
+ set_char_box (hip_width# * hip_depth_ratio,
+ hip_width# + right_downflag_space#,
+ foot_depth# * hip_depth_ratio, -flare#)
+
+ pickup pencircle scaled 1.5 stemthickness;
+
+ z1 = (-b, -d);
+ z2 = (w, h);
+
+ penpos1 (1.5 stemthickness, angle (z2 - z1) - 90);
+ penpos2 (1.5 stemthickness, angle (z2 - z1) - 90);
+
+ fill z1l
+ -- z2l
+ .. top z2
+ .. rt z2
+ .. z2r
+ -- z1r
+ .. bot z1
+ .. lft z1
+ .. cycle;
+
+ y_mirror_char;
+fet_endchar;
+
+
fet_endgroup ("flags");