From a25bb511f6f0c37d2dcff87c683f9e482fca0701 Mon Sep 17 00:00:00 2001 From: fred Date: Sat, 21 Dec 1996 16:02:43 +0000 Subject: [PATCH] lilypond-0.0.20 --- src/textspanner.cc | 57 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 src/textspanner.cc diff --git a/src/textspanner.cc b/src/textspanner.cc new file mode 100644 index 0000000000..e33efbb9b3 --- /dev/null +++ b/src/textspanner.cc @@ -0,0 +1,57 @@ +#include "paper.hh" +#include "molecule.hh" +#include "lookup.hh" +#include "boxes.hh" +#include "textspanner.hh" + +Text_spanner::Text_spanner(Directional_spanner*d) +{ + support = d; + align = 0; + style = "roman"; +} + +void +Text_spanner::process() +{ + Offset tpos; + + switch(align) { + case 0: + tpos = support->center(); + break; + default: + assert(false); + break; + } + + Paperdef *pap_p = paper(); + + Atom tsym (pap_p->lookup_->text(style, text, -align)); + tsym.translate(tpos); + output = new Molecule; + output->add( tsym ); +} + +void +Text_spanner::preprocess() +{ + right = support->right; + left = support->left; + assert(left && right); +} + +Interval +Text_spanner::height()const +{ + return output->extent().y; +} + +Spanner* +Text_spanner::broken_at(PCol*c1, PCol*c2)const +{ + Text_spanner *n=new Text_spanner(*this); + n->left = c1; + n->right = c2; + return n; +} -- 2.39.5