Am Dienstag, 17. Juni 2008 schrieb madhg: > Valentin Villenave wrote: > > I'd be ready to add this as an Enhancement request; can you find a > > better picture please? > > > > Cheers, > > Valentin > > Good, thank you. These are all keyboard music, scanned from published > facsimiles (which are clearly produced and don't need transcribing). > > C. P. E. Bach Fortsetzung ... Sonaten 1761
Actually, adding different flags in lilypond is quite simple: Simply use \override Stem #'flag-style = #'flagstylename and lilypond will use the characters "flags.flagstylename[ud][3456]" as flags. Now, to implement straight flags, all one has to do is to create glyphs named flags.straightu3, flags.straightd3, etc.! Attached is a first attempt to do this, plus a sample file showing the new "straight", the "mensural" and the default flag styles. The PDF of the sample file can be found at: http://www.fam.tuwien.ac.at/~reinhold/temp/test_straight_flags.pdf I'm encountering two problems: 1) The glyph "flags.straightd3" is not found by lilypond (although it exists and appears in the PDF!), so it cannot be properly positioned... The error message is: test_straight_flags.ly:13:9: Warnung: Fähnchen »straightd3« nicht gefunden 2) I'm using y_mirror_char; to create the flags for downwards stems, but it seems that in this case the outlines are not properly merged (i.e. the stem and the flags are not AND'ed), but instead XOR'ed, as the attached screenshot of the glyph shows (I opened the otf file in fontforge). If I don't use y_mirror_char, all the outlines are properly merged... Cheers, Reinhold -- ------------------------------------------------------------------ Reinhold Kainhofer, Vienna University of Technology, Austria email: [EMAIL PROTECTED], http://reinhold.kainhofer.com/ * Financial and Actuarial Mathematics, TU Wien, http://www.fam.tuwien.ac.at/ * K Desktop Environment, http://www.kde.org, KOrganizer maintainer * Chorvereinigung "Jung-Wien", http://www.jung-wien.at/
<<attachment: Straight-Flag-Intersection_FontForge.jpg>>
diff --git a/mf/feta-banier.mf b/mf/feta-banier.mf index e3d5637..6e12b98 100644 --- a/mf/feta-banier.mf +++ b/mf/feta-banier.mf @@ -468,4 +468,115 @@ fet_beginchar ("64th (down)", "d6"); y_mirror_char; fet_endchar; + + + + + + +%%%%%%%% +% +% Straight flags (old, but not ancient, style) +% + +save straight_flag_angle, straight_upflag_length, straight_downflag_length, straight_flag_thickness; + +straight_flag_angle = -37; +straight_upflag_length# = .65 black_notehead_width# + stemthickness# / 2; +straight_downflag_length# = .833 black_notehead_width# + stemthickness# / 2; +straight_flag_thickness# = 0.5 staff_space#; + +define_pixels (straight_upflag_length, straight_downflag_length, straight_flag_thickness); + +save straight_flag_path; +path straight_flag_path; + +def draw_straight_flag (expr center, len, angle, thickness) = + clearxy; + pickup pencircle xscaled 7 yscaled thickness; + z1 = center; + z2 = z1 + len * dir(angle); + straight_flag_path := z1 -- z2; + draw straight_flag_path; +enddef; + +def add_straight_flag (expr yoff, len, angle, thickness) = +begingroup + save prev_center; + pair prev_center, center; + + prev_center = point 0 of straight_flag_path; + center = prev_center + (0, yoff); + draw_straight_flag (center, len, angle, thickness); +endgroup +enddef; + +def create_straight_flag_char (expr flag_count, len, lenhash) = +begingroup + save flagspace, depth, width; + flagspace# = 0.9 staff_space#; + define_pixels (flagspace); + (width#, depth#) = lenhash * dir (straight_flag_angle) + + (stemthickness# / 2, straight_flag_thickness#) + + (0, flagspace# * (flag_count-1)); + + set_char_box (0, width#, depth#, stemthickness# / 2); + draw_straight_flag ( + (0, -straight_flag_thickness / 2), + len, straight_flag_angle, straight_flag_thickness); + for n=2 upto flag_count: + add_straight_flag(-flagspace, len, + straight_flag_angle, straight_flag_thickness); + endfor + draw_square_block ((-0.5 stemthickness_rounded, -flag_count*staff_space_rounded), (0, 0)); +endgroup +enddef; + + +fet_beginchar ("straight 8th Flag (up)", "straightu3"); + create_straight_flag_char (1, straight_upflag_length, straight_upflag_length#); +fet_endchar; + + +fet_beginchar ("straight 16th Flag (up)", "straightu4"); + create_straight_flag_char (2, straight_upflag_length, straight_upflag_length#); +fet_endchar; + + +fet_beginchar ("straight 32nd Flag (up)", "straightu5"); + create_straight_flag_char (3, straight_upflag_length, straight_upflag_length#); +fet_endchar; + + +fet_beginchar ("straight 64th Flag (up)", "straightu6"); + create_straight_flag_char (4, straight_upflag_length, straight_upflag_length#); +fet_endchar; + + +fet_beginchar ("straight 8th (down)", "straightd3"); + create_straight_flag_char (1, straight_downflag_length, straight_downflag_length#); + y_mirror_char; +fet_endchar; + + +fet_beginchar ("straight 16th (down)", "straightd4"); + create_straight_flag_char (2, straight_downflag_length, straight_downflag_length#); + y_mirror_char; +fet_endchar; + + +fet_beginchar ("straight 32nd (down)", "straightd5"); + create_straight_flag_char (3, straight_downflag_length, straight_downflag_length#); + y_mirror_char; +fet_endchar; + + +fet_beginchar ("straight 64th (down)", "straightd6"); + create_straight_flag_char (4, straight_downflag_length, straight_downflag_length#); + y_mirror_char; +fet_endchar; + + + + fet_endgroup ("flags");
#(set-global-staff-size 18) { \autoBeamOff % Straight ("not-so-ancient") flags \override Stem #'flag-style = #'straight c'8 d'8 e'8 f'8 c'16 d'16 e'16 f'16 c'32 d'32 e'32 f'32 c'64 d'64 e'64 f'64 r16 | c''8 d''8 e''8 f''8 c''16 d''16 e''16 f''16 c''32 d''32 e''32 f''32 c''64 d''64 e''64 f''64 r16\bar"|." % ancient mensural flags \override Stem #'flag-style = #'mensural c'8 d'8 e'8 f'8 c'16 d'16 e'16 f'16 c'32 d'32 e'32 f'32 c'64 d'64 e'64 f'64 r16 | c''8 d''8 e''8 f''8 c''16 d''16 e''16 f''16 c''32 d''32 e''32 f''32 c''64 d''64 e''64 f''64 r16\bar"|." % Classical curved flags \revert Stem #'flag-style c'8 d'8 e'8 f'8 c'16 d'16 e'16 f'16 c'32 d'32 e'32 f'32 c'64 d'64 e'64 f'64 r16 | c''8 d''8 e''8 f''8 c''16 d''16 e''16 f''16 c''32 d''32 e''32 f''32 c''64 d''64 e''64 f''64 r16\bar"|." }
_______________________________________________ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user