]> git.donarmstrong.com Git - lilypond.git/blob - paper.cc
a0e533f62636a47dc84caec9623cdc6a650d443e
[lilypond.git] / paper.cc
1 #include "paper.hh"
2 #include "debug.hh"
3 #include "lookupsyms.hh"
4 #include "dimen.hh"
5 #include "textdb.hh"
6
7 Paperdef::Paperdef()
8 {
9     linewidth = convert_dimen(15,"cm");         // in cm for now
10     whole_width= convert_dimen(2,"cm");
11     lookup_ = new Lookup();
12     parse();
13     
14 }
15
16 void 
17 Paperdef::parse()
18 {
19     Text_db symini("symbol.ini");
20
21     
22     while (!symini.eof()) {
23         
24          Text_record  r(  symini++);
25         
26          if  (r[0] == "symboltables")
27              lookup_->parse(symini);     
28     }
29 }
30
31 Paperdef::~Paperdef()
32 {
33     delete lookup_;
34 }
35
36 Real
37 Paperdef::interline() const
38 {
39     return lookup_->ball(4).dim.y.length();
40 }
41 Real
42 Paperdef::note_width()const
43 {
44     return lookup_->ball(4).dim.x.length( );
45 }
46 Real
47 Paperdef::standard_height() const
48 {
49     return convert_dimen(20,"pt");
50 }
51
52 void
53 Paperdef::print() const
54 {
55 #ifndef NPRINT
56     mtor << "Paper {width: " << print_dimen(linewidth);
57     mtor << "whole: " << print_dimen(whole_width);
58     mtor << "out: " <<outfile;
59     mtor << "}\n";
60 #endif
61 }