lilypond-1.3.26
[lilypond.git] / src / tex.cc
blobe8349e63cc290de1f0cc4627c7fc6d20ccc5ee2e
1 #include "dimen.hh"
2 #include "tex.hh"
3 #include "symbol.hh"
4 #include "const.hh"
5 #include "varray.hh"
7 String
8 vstrut(Real h)
10 return String("\\vrule height ") + print_dimen(h) + "depth 0pt width 0pt";
14 static void
15 substitute_arg(String& r, String arg)
17 int p = r.index_i('%');
18 if (p < 0)
19 return ;
21 r = r.left_str(p) + arg + r.right_str(r.length_i() - p -1);
25 String
26 substitute_args(String source, Array<String> args)
28 String retval (source);
29 for (int i = 0 ; i < args.size(); i++)
30 substitute_arg(retval, args[i]);
31 while (retval.index_i('%') >= 0)
32 substitute_arg(retval, "");
33 return retval;
36 String
37 substitute_args(String source, Array<Scalar> args)
39 Array<String> sv;
40 for (int i = 0 ; i < args.size(); i++)
41 sv.push(args[i]);
43 return substitute_args(source, sv);