]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/paper-def.hh
release: 0.0.52
[lilypond.git] / lily / include / paper-def.hh
1 /*
2   paper-def.hh -- declare Paper_def
3
4   source file of the LilyPond music typesetter
5
6   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
8
9
10 #ifndef PAPER_DEF_HH
11 #define PAPER_DEF_HH
12 #include "proto.hh"
13 #include "real.hh"
14 #include "string.hh"
15 #include "moment.hh"
16
17
18 /** symbols, dimensions and constants
19
20   This struct takes care of all kinds of symbols, dimensions and
21  constants. Most of them are related to the point-size of the fonts,
22  so therefore, the lookup table for symbols is also in here.
23
24  */
25 class Paper_def {
26     Lookup *lookup_p_;
27 public:    
28     String outfile;
29
30     Real linewidth;
31
32     /// how much space does a whole note take (ideally?)
33     Real whole_width;
34
35     /// ideal = geometric_ ^ log2(duration)
36     Real geometric_;
37     
38     /* *************** */
39     void reinit();
40     Paper_def(Lookup*);
41     void set(Lookup*);
42     ~Paper_def();
43     Paper_def(Paper_def const&);
44     /**
45       The distance between lines
46      */
47     Real interline()const;
48     /// half the distance between lines
49     Real internote()const;
50
51     /// thickness of the standard line 
52     Real rule_thickness()const;
53
54     /// height of the staff
55     Real standard_height()const;
56
57     /// width of a quaver ball
58     Real note_width() const;
59     void print() const;
60     Lookup const * lookup_l();  // TODO naming
61
62     /** convert a duration to an idealspacing
63       influence using the geometric_ and whole_width parameters.
64       */
65     Real duration_to_dist(Moment);
66 };
67
68 #endif // Paper_def_HH
69