]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/font-metric.hh
e14ebb4e147d0b45197b12608fef1b2863988f8a
[lilypond.git] / lily / include / font-metric.hh
1 /*   
2   font-metric.hh -- declare Font_metric
3   
4   source file of the GNU LilyPond music typesetter
5   
6   (c) 1999--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7   
8  */
9
10 #ifndef FONT_METRIC_HH
11 #define FONT_METRIC_HH
12
13 #include "box.hh"
14 #include "lily-guile.hh"
15 #include "smobs.hh"
16 #include "lily-proto.hh"
17
18 struct Font_metric
19 {
20 public:
21   SCM name_;
22   virtual SCM description () const;
23   virtual Box get_char (int ascii, Real mag) const;
24   virtual Box text_dimension (String, Real mag = 1.0)  const;
25   virtual Molecule find_by_name (String, Real mag = 1.0) const;
26
27   DECLARE_SMOBS(Font_metric,);
28 private:
29   Font_metric (Font_metric const&); // no copy.
30 protected:
31   Font_metric ();
32 };
33
34
35 struct Scaled_font_metric : public Font_metric
36 {
37   virtual SCM description () const;
38   virtual Box text_dimension (String, Real) const;
39   virtual Molecule find_by_name (String, Real) const;
40   static SCM make_scaled_font_metric (Font_metric*, Real);
41 protected:
42   Font_metric *orig_l_;
43   Real magnification_f_;
44   
45   Scaled_font_metric (Font_metric*,Real);
46 };
47
48 Font_metric * unsmob_metrics (SCM s);
49
50 #endif /* FONT_METRIC_HH */
51