2 tex-beam.cc -- implement Lookup::beam
4 source file of the GNU LilyPond music typesetter
6 (c) 1996, 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
10 Code to generate beams for TeX
15 #include "molecule.hh"
17 #include "symtable.hh"
18 #include "dimension.hh"
22 #include "paper-def.hh"
23 #include "string-convert.hh"
28 Lookup::rule_symbol (Real height, Real width) const
30 Atom bs=(*symtables_p_)("param")->lookup ("rule");
32 args.push (print_dimen (height));
33 args.push (print_dimen (width));
34 bs.tex_ = substitute_args (bs.tex_,args);
35 bs.dim_.x() = Interval (0,width);
36 bs.dim_.y() = Interval (0,height);
41 Lookup::beam(Real slope, Real width, Real thick) const
44 Atom a (ps_beam (slope, width, thick));
45 Real height = slope * width;
46 Real min_y = (0 <? height) - thick/2;
47 Real max_y = (0 >? height) + thick/2;
49 a.dim_[X_AXIS] = Interval(0, width);
50 a.dim_[Y_AXIS] = Interval(min_y, max_y);
55 Lookup::ps_beam (Real slope, Real width, Real thick) const
57 String ps = "\\embeddedps{\n";
58 ps += to_str (width) + " "+ to_str (slope) + " " + to_str (thick)