return *this;
}
Interval_t<T> &operator *=(T r) {
- elem (LEFT) *= r;
- elem (RIGHT) *= r;
- if (r < T(0)) {
- T t = elem (LEFT);
- elem (LEFT) = elem (RIGHT);
- elem (RIGHT) = t;
- }
+ if (!empty_b ())
+ {
+ elem (LEFT) *= r;
+ elem (RIGHT) *= r;
+ if (r < T(0)) {
+ T t = elem (LEFT);
+ elem (LEFT) = elem (RIGHT);
+ elem (RIGHT) = t;
+ }
+ }
return *this;
}
}
-Box
-Scaled_font_metric::text_dimension (String t) const
-{
- Box b (orig_l_->text_dimension (t));
-
- b.scale (magnification_f_);
- return b;
-}
Font_metric::~Font_metric ()
{
Font_metric ();
};
-
-/*
- Perhaps junk this, and move iface to paper_def?
- */
-struct Scaled_font_metric : public Font_metric
-{
- virtual Box text_dimension (String) const;
- virtual Molecule find_by_name (String) const;
- static SCM make_scaled_font_metric (Font_metric*, Real);
-protected:
- Font_metric *orig_l_;
- Real magnification_f_;
-
- Scaled_font_metric (Font_metric*,Real);
-};
-
Font_metric * unsmob_metrics (SCM s);
#endif /* FONT_METRIC_HH */
--- /dev/null
+/*
+ scaled-font-metric.hh -- declare Font_metric
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1999--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+
+#ifndef SCALED_FONT_METRIC_HH
+#define SCALED_FONT_METRIC_HH
+
+#include "font-metric.hh"
+
+/*
+ Perhaps junk this, and move this to paper_def as interface?
+ */
+struct Scaled_font_metric : public Font_metric
+{
+ virtual Box text_dimension (String) const;
+ virtual Molecule find_by_name (String) const;
+ static SCM make_scaled_font_metric (Font_metric*, Real);
+
+protected:
+ virtual Box get_char (int)const;
+ Font_metric *orig_l_;
+ Real magnification_f_;
+
+ Scaled_font_metric (Font_metric*,Real);
+};
+#endif
#include "misc.hh"
#include "paper-def.hh"
#include "debug.hh"
-#include "font-metric.hh"
+#include "scaled-font-metric.hh"
#include "main.hh"
#include "scope.hh"
#include "file-results.hh" // urg? header_global_p
-#include "font-metric.hh"
+/*
+ scaled-font-metric.cc -- declare Scaled_font_metric
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1999--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+
+#include "scaled-font-metric.hh"
#include "string.hh"
#include "molecule.hh"
return q ;
}
+
+Box
+Scaled_font_metric::get_char (int i) const
+{
+ Box b = orig_l_->get_char (i);
+ b.scale (magnification_f_);
+ return b;
+}
+
+Box
+Scaled_font_metric::text_dimension (String t) const
+{
+ Box b (orig_l_->text_dimension (t));
+
+ b.scale (magnification_f_);
+ return b;
+}
void
-Volta_spanner::set_interface (Score_element*me)
+Volta_spanner::set_interface (Score_element*)
{
}
height# := height_sharp;
width# := width_sharp;
- beginchar(incr code, width#, height#/2, height#/2);
-
+ beginchar(code, width#, height#/2, height#/2);
+ code := incr code;
+
define_pixels (height, width);
thin = 2 stafflinethickness;
thick = .5 staff_space;