]> git.donarmstrong.com Git - lilypond.git/blob - lily/pango-font-scheme.cc
Merge branch 'master' of ssh+git://git.sv.gnu.org/srv/git/lilypond
[lilypond.git] / lily / pango-font-scheme.cc
1 /*
2   pango-font-scheme.cc -- implement Pango_font
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 2004--2008 Han-Wen Nienhuys <hanwen@xs4all.nl>
7 */
8
9 #define PANGO_ENABLE_BACKEND // ugh, why necessary?
10
11 #include <pango/pangoft2.h>
12
13 #include "main.hh"
14 #include "lookup.hh"
15 #include "dimensions.hh"
16 #include "pango-font.hh"
17 #include "warn.hh"
18
19 #if HAVE_PANGO_FT2
20 #include "stencil.hh"
21
22 LY_DEFINE (ly_pango_font_p, "ly:pango-font?",
23            1, 0, 0,
24            (SCM f),
25            "Is @var{f} a pango font?")
26 {
27   return scm_from_bool (dynamic_cast<Pango_font *> (unsmob_metrics (f)));
28 }
29
30 LY_DEFINE (ly_pango_font_physical_fonts, "ly:pango-font-physical-fonts",
31            1, 0, 0,
32            (SCM f),
33            "Return alist of @code{(ps-name file-name font-index)} lists"
34            " for Pango font@tie{}@var{f}.")
35 {
36   Pango_font *pf = dynamic_cast<Pango_font *> (unsmob_metrics (f));
37
38   SCM alist = SCM_EOL;
39   if (pf)
40     alist = ly_hash2alist (pf->physical_font_tab ());
41
42   return alist;
43 }
44 #endif