dashed-line.
* lily/bar-line.cc (dashed_bar_line): new function.
(compound_barline): support \bar "dashed".
* lily/lily-parser-scheme.cc (LY_DEFINE): only write
--output=DIR to DIR/BASE if it is a dir.
* flower/file-name.cc (file_part): new function
(dir_part): new function
* lily/lily-parser-scheme.cc (LY_DEFINE):
* DEDICATION: update
+2006-07-26 Han-Wen Nienhuys <hanwen@lilypond.org>
+
+ * scm/output-ps.scm (dashed-line): add phase argument to
+ dashed-line.
+
+ * lily/bar-line.cc (dashed_bar_line): new function.
+ (compound_barline): support \bar "dashed".
+
+ * lily/lily-parser-scheme.cc (LY_DEFINE): only write
+ --output=DIR to DIR/BASE if it is a dir.
+
+ * flower/file-name.cc (file_part): new function
+ (dir_part): new function
+
+ * lily/lily-parser-scheme.cc (LY_DEFINE):
+
+ * DEDICATION: update
+
+2006-07-25 Han-Wen Nienhuys <hanwen@lilypond.org>
+
+ * lily/instrument-name-engraver.cc: formatting.
+
+ * python/convertrules.py (conv): bugfix for \epsfile.
+
2006-07-25 Joe Neeman <joeneeman@gmail.com>
* lily/grob.cc:
- * lily/gourlay-breaking.cc: Oops, these should have been included in my last
- commit
+
+ * lily/gourlay-breaking.cc: Oops, these should have been included
+ in my last commit
2006-07-24 Han-Wen Nienhuys <hanwen@lilypond.org>
Those deserving special mentioning (in no particular order):
Esther, Marijke, Heike, Inge, Judith, Hannah, Auke, Ilse, Evelyn,
Maartje, Suzanne, Ilse (gee, again?), Marieke, Irene, Martine, Idwine,
-Hanna, Lonneke, Elisha, Anna and last (but certainly not least)
-Janneke!
+Hanna, Lonneke, Elisha, Anna, Janneke and last (but certainly not
+least) Janneke!
HWN
@end ignore
+@item
+Barlines can be dashed now,
+
+@lilypond[relative,ragged-right,fragment]
+c4 \bar "dashed" c4
+@end lilypond
+
+This feature was sponsored by Kieren MacMillan.
+
@item
Grace notes maybe forced to use floating spacing,
ssize n = s.length ();
if (n && s[n - 1] == '/')
s[n - 1] = 0;
- s = s.substr (0, s.rfind ('/'));
+ if (s.rfind ('/') != NPOS)
+ {
+ s = s.substr (0, s.rfind ('/'));
+ }
+ else
+ s = "";
+
return s;
}
/* Join components to full file_name. */
string
-File_name::to_string () const
+File_name::dir_part () const
{
string s;
if (!root_.empty ())
s = root_ + ::to_string (ROOTSEP);
+
if (!dir_.empty ())
{
s += dir_;
- if (!base_.empty () || !ext_.empty ())
- s += ::to_string (DIRSEP);
}
- s += base_;
+
+ return s;
+}
+
+
+string
+File_name::file_part () const
+{
+ string s;
+ s = base_;
if (!ext_.empty ())
s += ::to_string (EXTSEP) + ext_;
return s;
}
+string
+File_name::to_string () const
+{
+ string d = dir_part ();
+ string f = file_part ();
+
+ if (!f.empty ()
+ && !dir_.empty())
+ {
+ d += ::to_string (DIRSEP);
+ }
+
+ return d + f;
+}
+
File_name::File_name (string file_name)
{
#ifdef __CYGWIN__
bool is_absolute () const;
string to_string () const;
+
+ string dir_part () const;
+ string file_part () const;
};
#endif /* FILE_NAME */
--- /dev/null
+
+\header { texidoc = "The dashes in a dashed bar line covers staff
+ lines exactly. Dashed barlines between staves start and end on a
+ half dash precisely." }
+
+\version "2.9.13"
+
+\paper { ragged-right = ##t }
+
+\relative \new StaffGroup <<
+ \new Staff {
+ c4 \bar "dashed" c }
+ \new Staff {
+ c c
+ }
+>>
+
#include "output-def.hh"
#include "paper-column.hh"
#include "staff-symbol-referencer.hh"
+#include "line-interface.hh"
MAKE_SCHEME_CALLBACK (Bar_line, print, 1);
SCM
m.add_stencil (d);
}
}
+ else if (str == "dashed")
+ {
+ m = dashed_bar_line (me, h, hair);
+ }
else if (str == ".")
{
m = dot;
}
+Stencil
+Bar_line::dashed_bar_line (Grob *me, Real h, Real thick)
+{
+ Real dash_size
+ = 1.0 - robust_scm2double (me->get_property ("gap"), 0.3);
+ /*
+ this is a tad complex for what we want to achieve, but with a
+ simple line, the round blotting interferes with staff line
+ connections.
+ */
+ Real ss = Staff_symbol_referencer::staff_space (me);
+ int count = Staff_symbol_referencer::line_count (me);
+ Real line_thick = Staff_symbol_referencer::line_thickness (me);
+
+ if (fabs (line_thick + (count -1) * ss - h) < 0.1) // ugh.
+ {
+ Real blot =
+ me->layout ()->get_dimension (ly_symbol2scm ("blot-diameter"));
+
+ Real half_space = ss/2;
+ Stencil bar;
+
+ for (int i = (count-1); i >= -(count-1); i -= 2)
+ {
+ Real top_y = min ((i + dash_size) * half_space,
+ (count-1) * half_space + line_thick / 2);
+ Real bot_y = max ((i - dash_size) * half_space,
+ -(count-1) * half_space - line_thick/2);
+
+ bar.add_stencil (Lookup::round_filled_box (Box (Interval (0,thick),
+ Interval (bot_y, top_y)),
+ blot));
+ }
+ return bar;
+ }
+ else
+ {
+ /*
+ We have to scale the dashing so it starts and ends with half a
+ dash exactly.
+ */
+ int dashes = int (rint (h / ss));
+ Real total_dash_size = h / dashes;
+ Real factor = (dash_size - thick) / ss;
+
+ SCM at = scm_list_n (ly_symbol2scm ("dashed-line"),
+ scm_from_double (thick),
+ scm_from_double (factor * total_dash_size),
+ scm_from_double ((1-factor) * total_dash_size),
+ scm_from_double (0),
+ scm_from_double (h),
+ scm_from_double (factor * total_dash_size * 0.5),
+ SCM_UNDEFINED);
+
+ Box box;
+ box.add_point (Offset (0, 0));
+ box.add_point (Offset (0, h));
+
+ Stencil s (box, at);
+ s.translate (Offset (thick/2, -h/2));
+ return s;
+ }
+ return Stencil();
+}
+
+
ADD_INTERFACE (Bar_line,
"bar-line-interface",
"These produce, respectively, a right repeat, a left repeat, a double\n"
"repeat, a double bar, a start bar, an end bar, and a thick double bar.\n"
"If @var{bartype} is set to @code{empty} then nothing is printed,\n"
- "but a line break is allowed at that spot.\n",
+ "but a line break is allowed at that spot.\n"
+ "\n\n"
+ "@code{gap} is used for the gaps in dashed barlines."
+ ,
- /* properties */
+
+ /* properties */
+ "gap "
"kern "
"thin-kern "
"hair-thickness "
"glyph-name "
"bar-size "
);
+
+
public:
static bool has_interface (Grob *);
+ static Stencil dashed_bar_line (Grob *me, Real h, Real thick);
static Stencil compound_barline (Grob *, string, Real height, bool rounded);
static Stencil simple_barline (Grob *, Real wid, Real height, bool rounded);
DECLARE_SCHEME_CALLBACK (calc_bar_size, (SCM));
"",
/* read */
- "vocNam vocalName instrument instr "
- "currentCommandColumn",
+ "currentCommandColumn "
+ "instr "
+ "instrument "
+ "vocNam "
+ "vocalName "
+ ,
/* write */ "");
if (!output_name_global.empty ())
{
+
/* Interpret --output=DIR to mean --output=DIR/BASE. */
string dir;
if (is_dir (output_name_global))
output_name_global = "";
}
else
- dir = dir_name (output_name_global);
+ {
+ File_name out (output_name_global);
+ if (is_dir (out.dir_part ()))
+ {
+ dir = out.dir_part ();
+ out_file_name = out.file_part ();
+ }
+ }
+
if (dir != "" && dir != "." && dir != get_working_directory ())
{
global_path.prepend (get_working_directory ());
scm_from_double (off),
scm_from_double (to[X_AXIS] - from[X_AXIS]),
scm_from_double (to[Y_AXIS] - from[Y_AXIS]),
+ scm_from_double (0.0),
SCM_UNDEFINED);
Box box;
"""override Stem #'beamed-* -> #'details #'beamed-*"""))
def conv (str):
- str = re.sub (r'\epsfile *#"', r'\epsfile #X #10 #"', str)
+ str = re.sub (r'\\epsfile *#"', r'\\epsfile #X #10 #"', str)
return str
conversions.append (((2, 7, 30), conv,
. (
(break-align-symbol . staff-bar)
(glyph . "|")
+ (gap . 0.4)
(layer . 0)
(break-visibility . ,all-visible)
(non-musical . #t)
"false")
(round4 radius) (round4 thick)))
-(define (dashed-line thick on off dx dy)
- (format #f "~a ~a ~a [ ~a ~a ] 0 draw_dashed_line"
+(define (dashed-line thick on off dx dy phase)
+ (format #f "~a ~a ~a [ ~a ~a ] ~a draw_dashed_line"
(str4 dx)
(str4 dy)
(str4 thick)
(str4 on)
- (str4 off)))
+ (str4 off)
+ (str4 phase)
+
+ ))
;; what the heck is this interface ?
(define (dashed-slur thick on off l)
(y2 . ,(- y2)))
alist)))
-(define (dashed-line thick on off dx dy)
+(define (dashed-line thick on off dx dy phase)
(draw-line thick 0 0 dx dy `(style . ,(format "stroke-dasharray:~a,~a;" on off))))
(define (named-glyph font name)
(ly:warning (_ "can't find ~a in ~a" name font))
""))))
-(define (dashed-line thick on off dx dy)
- (embedded-ps (list 'dashed-line thick on off dx dy)))
+(define (dashed-line thick on off dx dy phase)
+ (embedded-ps (list 'dashed-line thick on off dx dy phase)))
(define (zigzag-line centre? zzw zzh thick dx dy)
(embedded-ps (list 'zigzag-line centre? zzw zzh thick dx dy)))
'@lilypond_libdir@']:
sys.path.insert (0, os.path.join (d, 'python'))
-sys.path.insert (0, os.path.join (datadir, 'python'))
-
# dynamic relocation, for GUB binaries.
bindir = os.path.abspath (os.path.split (sys.argv[0])[0])
for p in ['share', 'lib']: