]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/dimensions.hh
13eab8db9fa13db7ff881889a2d1ff3160f626b9
[lilypond.git] / lily / include / dimensions.hh
1 #ifndef DIMENSIONS_HH
2 #define DIMENSIONS_HH
3
4 #include "real.hh"
5 class String;
6
7
8 const Real INCH_TO_PT = 72.270;
9 const Real CM_TO_PT = (INCH_TO_PT / 2.54);
10 const Real MM_TO_PT = (CM_TO_PT / 10);
11 const Real PT_TO_PT = 1.0;
12 const Real INCH_TO_BP = 72;
13 const Real BIGPOINT_TO_POINT = (INCH_TO_PT / INCH_TO_BP);
14 const Real CHAR_TO_PT = 1.0;
15 const Real PT_TO_MM = (1.0 / MM_TO_PT);
16
17 #ifdef POINTS
18
19 #define INTERNAL_UNIT "pt"
20
21 #define PT * (PT_TO_PT)
22 #define MM * (MM_TO_PT)
23 #define CM  * (CM_TO_PT)
24 #define INCH * (INCH_TO_PT)
25 #define BIGPOINT * (BIGPOINT_TO_POINT)
26 #define CHAR * (CHAR_TO_PT)
27
28 #else   // mm
29
30 #define INTERNAL_UNIT "mm"
31
32 #define PT * (PT_TO_PT * PT_TO_MM)
33 #define MM * (MM_TO_PT * PT_TO_MM)
34 #define CM * (CM_TO_PT *PT_TO_MM)
35 #define INCH * (INCH_TO_PT * PT_TO_MM)
36 #define BIGPOINT * (BIGPOINT_TO_POINT * PT_TO_MM)
37 #define CHAR * (CHAR_TO_PT * PT_TO_MM)
38
39 #endif
40
41 String print_dimen (Real);
42
43 #endif /* DIMENSIONS_HH */
44