2 This file is part of LilyPond, the GNU music typesetter.
4 Copyright (C) 1997--2015 Han-Wen Nienhuys <hanwen@xs4all.nl>
6 LilyPond is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
11 LilyPond is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
20 #include "lily-guile.hh"
21 #include "dimensions.hh"
24 LY_DEFINE (ly_pt, "ly:pt",
26 "@var{num} printer points.")
28 LY_ASSERT_TYPE (scm_is_number, num, 1);
29 return scm_from_double (point_constant
30 * scm_to_double (num));
33 LY_DEFINE (ly_cm, "ly:cm",
37 LY_ASSERT_TYPE (scm_is_number, num, 1);
38 return scm_from_double (cm_constant
39 * scm_to_double (num));
42 LY_DEFINE (ly_inch, "ly:inch",
46 LY_ASSERT_TYPE (scm_is_number, num, 1);
47 return scm_from_double (inch_constant
48 * scm_to_double (num));
51 LY_DEFINE (ly_mm, "ly:mm",
55 LY_ASSERT_TYPE (scm_is_number, num, 1);
56 return scm_from_double (mm_constant
57 * scm_to_double (num));
60 LY_DEFINE (ly_bp, "ly:bp",
62 "@var{num} bigpoints (1/72th inch).")
64 LY_ASSERT_TYPE (scm_is_number, num, 1);
65 return scm_from_double (bigpoint_constant
66 * scm_to_double (num));