lilypond-0.0.9
[lilypond.git] / tex.cc
blobae9dc1b5f3064bb2e9d7d6fc239a046394b4030c
1 #include "dimen.hh"
2 #include "tex.hh"
3 #include "symbol.hh"
4 #include "const.hh"
6 String
7 vstrut(Real h)
9 return String("\\vrule height ") + print_dimen(h) + "depth 0pt width 0pt";
13 static void
14 substitute_arg(String& r, String arg)
16 int p = r.pos('%');
17 if (!p ) return ;
18 else p--;
19 r = r.left(p) + arg + r.right(r.len() - p -1);
23 String
24 substitute_args(String source, svec<String> args)
26 String retval (source);
27 for (int i = 0 ; i < args.sz(); i++)
28 substitute_arg(retval, args[i]);
29 while (retval.pos('%'))
30 substitute_arg(retval, "");
31 return retval;