From 842b0a4136eaaeb797eb1df512357702817ab320 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Janek=20Warcho=C5=82?= Date: Wed, 6 Apr 2011 10:20:44 +0200 Subject: [PATCH] trying to implement "normal" flag-style as default unfortunately my try doesn't work.... --- lily/stem.cc | 15 ++++----- mf/feta-flags.mf | 60 ++++++++++++++++++++-------------------- scm/define-grob-properties.scm | 2 +- scm/define-markup-commands.scm | 2 +- scm/flag-styles.scm | 4 +- 5 files changed, 41 insertions(+), 42 deletions(-) diff --git a/lily/stem.cc b/lily/stem.cc index 2afff44..6095d96 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -674,7 +674,7 @@ Stem::calc_flag (SCM smob) are two completely different things. Here we deal only with the latter, don't let naming confuse you. */ - if (flag_style == "") + if (flag_style == "normal") { /* Janek: TODO: make this apply to stems with lengths overriden by user. @@ -712,21 +712,21 @@ Stem::calc_flag (SCM smob) for (SCM l = foo; scm_is_pair (l); l = scm_cdr (l)) { string glyph_name = ly_scm2string (scm_car (l)); - if (glyph_name.find ("flags.standard") == 0) + if (glyph_name.find ("flags.normal") == 0) /* examine available standard flags glyphs */ { /* extract glyph direction from its name (0=up, 1=down). - "flags.standard" accounts for first 14 characters - of flag glyph name, do 15th char is its direction: */ - int glyph_dir = (glyph_name.substr(14,1) == "d") ? 1 : 0; + "flags.normal" accounts for first 12 characters + of flag glyph name, do 13th char is its direction: */ + int glyph_dir = (glyph_name.substr(12,1) == "d") ? 1 : 0; /* extract duration log and convert it to int: */ - int glyph_durlog = ::atoi(glyph_name.substr(15,1).c_str()); + int glyph_durlog = ::atoi(glyph_name.substr(13,1).c_str()); /* for what stem length is this glyph designed? (extract a string and convert it into a float): */ Real length - = ::atof(glyph_name.substr(17,string::npos).c_str()); + = ::atof(glyph_name.substr(15,string::npos).c_str()); // add this info to flag_lengths flag_lengths[glyph_dir][glyph_durlog - 3].push_back (length); @@ -765,7 +765,6 @@ Stem::calc_flag (SCM smob) flag_lengths [(dir=='d')?1:0][log-3][flag_variant_number]); // TODO: how should we name "standard" flag style? // encode it properly. - flag_style = "standard"; } else sprintf (length_variant, ""); diff --git a/mf/feta-flags.mf b/mf/feta-flags.mf index 78c56bc..a745bfd 100644 --- a/mf/feta-flags.mf +++ b/mf/feta-flags.mf @@ -500,86 +500,86 @@ enddef; % (not required by default engine, but they may become useful for someone) -fet_beginchar ("8th Flag (up) 3.50", "standardu3_3.50"); +fet_beginchar ("8th Flag (up) 3.50", "normalu3_3.50"); upstemsingleflag (0.0); fet_endchar; -fet_beginchar ("8th Flag (up) 3.00", "standardu3_3.00"); - upstemsingleflag (0.5); +fet_beginchar ("8th Flag (up) 3.00", "normalu3_3.00"); + upstemsingleflag (0.3); fet_endchar; -fet_beginchar ("16th Flag (up) 3.50", "standardu4_3.50"); +fet_beginchar ("16th Flag (up) 3.50", "normalu4_3.50"); upstemdoubleflag (0); fet_endchar; -fet_beginchar ("16th Flag (up) 3.00", "standardu4_3.00"); - upstemdoubleflag (0.5); +fet_beginchar ("16th Flag (up) 3.00", "normalu4_3.00"); + upstemdoubleflag (0.3); fet_endchar; -fet_beginchar ("32nd Flag (up) 4.25", "standardu5_4.25"); +fet_beginchar ("32nd Flag (up) 4.25", "normalu5_4.25"); upstemtripleflag (0); fet_endchar; -fet_beginchar ("32nd Flag (up) 3.75", "standardu5_3.75"); - upstemtripleflag (0.5); +fet_beginchar ("32nd Flag (up) 3.75", "normalu5_3.75"); + upstemtripleflag (0.3); fet_endchar; -fet_beginchar ("64th Flag (up) 5.00", "standardu6_5.00"); +fet_beginchar ("64th Flag (up) 5.00", "normalu6_5.00"); upstemquadrupleflag (0); fet_endchar; -fet_beginchar ("64th Flag (up) 4.50", "standardu6_4.50"); - upstemquadrupleflag (0.5); +fet_beginchar ("64th Flag (up) 4.50", "normalu6_4.50"); + upstemquadrupleflag (0.3); fet_endchar; -fet_beginchar ("128th Flag (up) 6.00", "standardu7_6.00"); +fet_beginchar ("128th Flag (up) 6.00", "normalu7_6.00"); upstemquintupleflag (0); fet_endchar; -fet_beginchar ("128th Flag (up) 5.50", "standardu7_5.50"); - upstemquintupleflag (0.5); +fet_beginchar ("128th Flag (up) 5.50", "normalu7_5.50"); + upstemquintupleflag (0.3); fet_endchar; -fet_beginchar ("8th Flag (down) 3.50", "standardd3_3.50"); +fet_beginchar ("8th Flag (down) 3.50", "normald3_3.50"); downstemsingleflag (0.0); fet_endchar; -fet_beginchar ("8th Flag (down) 3.00", "standardd3_3.00"); - downstemsingleflag (0.5); +fet_beginchar ("8th Flag (down) 3.00", "normald3_3.00"); + downstemsingleflag (0.3); fet_endchar; -fet_beginchar ("16th Flag (down) 3.50", "standardd4_3.50"); +fet_beginchar ("16th Flag (down) 3.50", "normald4_3.50"); downstemdoubleflag (0); fet_endchar; -fet_beginchar ("16th Flag (down) 3.00", "standardd4_3.00"); - downstemdoubleflag (0.5); +fet_beginchar ("16th Flag (down) 3.00", "normald4_3.00"); + downstemdoubleflag (0.3); fet_endchar; -fet_beginchar ("32nd Flag (down) 4.25", "standardd5_4.25"); +fet_beginchar ("32nd Flag (down) 4.25", "normald5_4.25"); downstemtripleflag (0); fet_endchar; -fet_beginchar ("32nd Flag (down) 3.75", "standardd5_3.75"); - downstemtripleflag (0.5); +fet_beginchar ("32nd Flag (down) 3.75", "normald5_3.75"); + downstemtripleflag (0.3); fet_endchar; -fet_beginchar ("64th Flag (down) 5.00", "standardd6_5.00"); +fet_beginchar ("64th Flag (down) 5.00", "normald6_5.00"); downstemquadrupleflag (0); fet_endchar; -fet_beginchar ("64th Flag (down) 4.50", "standardd6_4.50"); - downstemquadrupleflag (0.5); +fet_beginchar ("64th Flag (down) 4.50", "normald6_4.50"); + downstemquadrupleflag (0.3); fet_endchar; -fet_beginchar ("128th Flag (down) 6.00", "standardd7_6.00"); +fet_beginchar ("128th Flag (down) 6.00", "normald7_6.00"); downstemquintupleflag (0); fet_endchar; -fet_beginchar ("128th Flag (down) 5.50", "standardd7_5.50"); - downstemquintupleflag (0.5); +fet_beginchar ("128th Flag (down) 5.50", "normald7_5.50"); + downstemquintupleflag (0.3); fet_endchar; diff --git a/scm/define-grob-properties.scm b/scm/define-grob-properties.scm index 62d7cf0..1806fa2 100644 --- a/scm/define-grob-properties.scm +++ b/scm/define-grob-properties.scm @@ -274,7 +274,7 @@ flag. By providing your own function, you can create arbitrary flags.") (flag-count ,number? "The number of tremolo beams.") (flag-style ,symbol? "A symbol determining what style of flag -glyph is typeset on a @code{Stem}. Valid options include @code{'()} +glyph is typeset on a @code{Stem}. Valid options include @code{'normal} for standard flags, @code{'mensural} and @code{'no-flag}, which switches off the flag.") (font-encoding ,symbol? "The font encoding is the broadest diff --git a/scm/define-markup-commands.scm b/scm/define-markup-commands.scm index 5de7fdc..5459343 100644 --- a/scm/define-markup-commands.scm +++ b/scm/define-markup-commands.scm @@ -2976,7 +2976,7 @@ Construct a note symbol, with stem. By using fractional values for (flaggl (and (> log 2) (ly:stencil-translate (ly:font-get-glyph font - (string-append "flags." + (string-append "flags.normal" (if (> dir 0) "u" "d") (number->string log))) (cons (+ (car attach-off) (if (< dir 0) diff --git a/scm/flag-styles.scm b/scm/flag-styles.scm index 9e1a268..f643648 100644 --- a/scm/flag-styles.scm +++ b/scm/flag-styles.scm @@ -200,7 +200,7 @@ stencil." (define-public (normal-flag stem-grob) "Create a default flag." - (create-glyph-flag "" "" stem-grob)) + (create-glyph-flag "normal" "" stem-grob)) @@ -222,7 +222,7 @@ at will. The correct way to do this is: (symbol->string flag-style-symbol) ""))) (cond - ((equal? flag-style "") (normal-flag stem-grob)) + ((equal? flag-style "normal") (normal-flag stem-grob)) ((equal? flag-style "mensural") (mensural-flag stem-grob)) ((equal? flag-style "no-flag") (no-flag stem-grob)) (else ((glyph-flag flag-style) stem-grob))))) -- 1.7.0.4