]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/pango-font.hh
*** empty log message ***
[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--2006 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 #include "font-metric.hh"
19
20 #include "open-type-font.hh"
21
22 class Pango_font : public Font_metric
23 {
24   PangoContext *context_;
25   PangoFontDescription *pango_description_;
26   PangoAttrList *attribute_list_;
27   Real scale_;
28   Real output_scale_;
29   SCM physical_font_tab_;
30   Direction text_direction_;
31
32   map<string, Index_to_charcode_map > charcode_maps_;
33
34   Index_to_charcode_map const *get_index_to_charcode_map (string postscript_name, FT_Face face);
35 public:
36   SCM physical_font_tab () const;
37   Pango_font (PangoFT2FontMap *,
38               PangoFontDescription *,
39               Real);
40   ~Pango_font ();
41
42   string description_string () const; 
43   SCM font_file_name () const;
44   void register_font_file (string, string);
45   Stencil text_stencil (string) const;
46   Stencil pango_item_string_stencil (PangoItem const *, string) const;
47
48   virtual void derived_mark () const;
49 };
50
51 PangoFontDescription *
52 symbols_to_pango_font_description (SCM family,
53                                    SCM style,
54                                    SCM variant,
55                                    SCM weight,
56                                    SCM stretch);
57
58 Font_metric *
59 select_pango_font (Output_def *layout, SCM chain);
60
61 const int PANGO_RESOLUTION = 1200;
62 PangoFontDescription *properties_to_pango_description (SCM chain, Real text_size);
63
64 #endif /* HAVE_PANGO16 */
65 #endif /* PANGO_FONT_HH */
66