]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/pango-font.hh
Run `make grand-replace'.
[lilypond.git] / lily / include / pango-font.hh
1 /*
2   pango-font.hh -- declare 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 #ifndef PANGO_FONT_HH
10 #define PANGO_FONT_HH
11
12 #include "config.hh"
13
14 #if HAVE_PANGO_FT2
15
16 #include <pango/pango.h>
17 #include <pango/pangoft2.h>
18
19 #include "font-metric.hh"
20
21 class Pango_font : public Font_metric
22 {
23   PangoContext *context_;
24   PangoFontDescription *pango_description_;
25   PangoAttrList *attribute_list_;
26   Real scale_;
27   Real output_scale_;
28   SCM physical_font_tab_;
29   Direction text_direction_;
30
31 public:
32   SCM physical_font_tab () const;
33   Pango_font (PangoFT2FontMap *,
34               PangoFontDescription const *,
35               Real);
36   ~Pango_font ();
37
38   string description_string () const; 
39   SCM font_file_name () const;
40   void register_font_file (string, string);
41   Stencil text_stencil (string, bool tight) const;
42
43   Stencil pango_item_string_stencil (PangoItem const *, string, bool tight) const;
44
45   virtual Stencil word_stencil (string) const;
46   virtual Stencil text_stencil (string) const;
47   virtual void derived_mark () const;
48 };
49
50 PangoFontDescription *
51 symbols_to_pango_font_description (SCM family,
52                                    SCM style,
53                                    SCM variant,
54                                    SCM weight,
55                                    SCM stretch);
56
57 Font_metric *
58 select_pango_font (Output_def *layout, SCM chain);
59
60 const int PANGO_RESOLUTION = 1200;
61 PangoFontDescription *properties_to_pango_description (SCM chain, Real text_size);
62
63 #endif /* HAVE_PANGO16 */
64 #endif /* PANGO_FONT_HH */
65