]> git.donarmstrong.com Git - lilypond.git/blob - lily/pango-select-scheme.cc
734fa7a88526f9b460f2f5f347e6d08158cb5397
[lilypond.git] / lily / pango-select-scheme.cc
1 /*
2   pango-select-scheme.cc -- implement Pango descr <-> string bindings
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
7
8 */
9
10 #include "config.hh"
11
12 #if HAVE_PANGO_FT2
13 #include "pango-font.hh"
14
15 LY_DEFINE(ly_make_pango_description_string, "ly:make-pango-description-string",
16           2, 0, 0, (SCM chain, SCM size),
17           "Make a PangoFontDescription string for the property alist @var{chain} at size @var{size}.")
18 {
19   SCM_ASSERT_TYPE(scm_is_number (size), size, SCM_ARG1, __FUNCTION__, "number");
20   PangoFontDescription *pfd = properties_to_pango_description (chain, scm_to_double (size));
21   char *str = pango_font_description_to_string (pfd);
22
23   SCM scm_str = scm_makfrom0str (str);
24   g_free (str);
25   pango_font_description_free (pfd);
26   return scm_str;
27 }
28           
29 #endif