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