]> git.donarmstrong.com Git - lilypond.git/blob - tex.cc
release: 0.0.6
[lilypond.git] / tex.cc
1 #include "dimen.hh"
2 #include "tex.hh"
3 #include "symbol.hh"
4 #include "const.hh"
5
6 String
7 vstrut(Real h)
8 {
9     return String("\\vrule height ") + print_dimen(h) + "depth 0pt width 0pt";
10 }
11
12
13 static void
14 substitute_arg(String& r, String arg)
15 {
16     int p = r.pos('%');
17     if (!p ) return ;
18     else p--;
19     r = r.left(p) + arg + r.right(r.len() - p -1);
20 }
21
22
23 String
24 substitute_args(String source, svec<String> args)    
25 {
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;
32 }