flower-1.0.27
[lilypond.git] / src / tex.cc
blob1a5c4a08c57d7b815e327edc08216129834e7942
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.pos('%');
18 if (!p ) return ;
19 else p--;
20 r = r.left(p) + arg + r.right(r.len() - p -1);
24 String
25 substitute_args(String source, Array<String> args)
27 String retval (source);
28 for (int i = 0 ; i < args.size(); i++)
29 substitute_arg(retval, args[i]);
30 while (retval.pos('%'))
31 substitute_arg(retval, "");
32 return retval;
34 String
35 substitute_args(String source, Array<Scalar> args)
37 Array<String> sv;
38 for (int i = 0 ; i < args.size(); i++)
39 sv.push(args[i]);
41 return substitute_args(source, sv);