10 texsetting
= "\\unknowntexsetting";
11 symtables_
= new Symtables
;
14 Lookup::Lookup(Lookup
const &s
)
16 texsetting
= s
.texsetting
;
17 symtables_
= new Symtables(*s
.symtables_
);
25 Lookup::add(String s
, Symtable
*p
)
27 symtables_
->add(s
, p
);
31 Lookup::text(String style
, String text
, int dir
)
36 Symbol tsym
= (*symtables_
)("style")->lookup(style
);
37 a
[0] = substitute_args(tsym
.tex
,a
);
39 Symbol s
= (*symtables_
)("align")->lookup(dir
);
40 s
.tex
= substitute_args(s
.tex
,a
);
50 return ball(4).dim
.y
.length()/2;
59 Symtable
* st
= (*symtables_
)("balls");
60 return st
->lookup(String(j
));
66 return (*symtables_
)("rests")->lookup(String(j
));
72 Symbol
s( (*symtables_
)("param")->lookup("fill"));
78 Lookup::accidental(int j
)
80 return (*symtables_
)("accidentals")->lookup(String(j
));
87 return (*symtables_
)("bars")->lookup(s
);
91 Lookup::script(String s
)
93 return (*symtables_
)("scripts")->lookup(s
);
97 Lookup::clef(String s
)
99 return (*symtables_
)("clefs")->lookup(s
);
106 error("max 3 dots"); // todo
107 return (*symtables_
)("dots")->lookup(j
);
113 return (*symtables_
)("flags")->lookup(j
);
117 Lookup::streepjes(int i
)
131 Symbol ret
= (*symtables_
)("streepjes")->lookup(idx
);
135 ret
.tex
= substitute_args(ret
.tex
, a
);
141 Lookup::hairpin(Real
&wid
, bool decresc
)
143 int idx
= int(rint(wid
/ 6 PT
));
146 String idxstr
= (decresc
)? "decrescendosym" : "crescendosym";
147 Symbol ret
=(*symtables_
)("param")->lookup(idxstr
);
151 ret
.tex
= substitute_args(ret
.tex
, a
);
152 ret
.dim
.x
= Interval(0,wid
);
157 Lookup::linestaff(int lines
, Real wid
)
160 s
.dim
.x
= Interval(0,wid
);
161 Real dy
= (lines
>0) ? (lines
-1)*internote()*2 : 0;
162 s
.dim
.y
= Interval(0,dy
);
166 a
.push(print_dimen(wid
));
168 s
.tex
= (*symtables_
)("param")->lookup("linestaf").tex
;
169 s
.tex
= substitute_args(s
.tex
, a
);
176 Lookup::meter(Array
<Scalar
> a
)
179 s
.dim
.x
= Interval( 0 PT
, 10 PT
);
180 s
.dim
.y
= Interval(0, 20 PT
); // todo
181 String src
= (*symtables_
)("param")->lookup("meter").tex
;
182 s
.tex
= substitute_args(src
,a
);
188 Lookup::stem(Real y1
,Real y2
)
197 s
.dim
.x
= Interval(0,0);
198 s
.dim
.y
= Interval(y1
,y2
);
201 a
.push(print_dimen(y1
));
202 a
.push(print_dimen(y2
));
204 String src
= (*symtables_
)("param")->lookup("stem").tex
;
205 s
.tex
= substitute_args(src
,a
);