]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/all-font-metrics.hh
Merge branch 'lilypond/translation' of ssh://jomand@git.sv.gnu.org/srv/git/lilypond...
[lilypond.git] / lily / include / all-font-metrics.hh
1 /*
2   all-fonts.hh -- declare All_font_metrics
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 1998--2008 Han-Wen Nienhuys <hanwen@xs4all.nl>
7 */
8
9 #ifndef ALL_FONTS_HH
10 #define ALL_FONTS_HH
11
12 #include "file-path.hh"
13 #include "font-metric.hh"
14 #include "config.hh"
15
16 #if HAVE_PANGO_FT2
17 #include <pango/pango.h>
18 #include <pango/pangoft2.h>
19 #endif
20
21
22 /*
23    Interface to all fonts (both system fonts and fonts loaded
24    via Pango).
25 */
26 class All_font_metrics
27 {
28   Scheme_hash_table *otf_dict_;
29   File_path search_path_;
30
31 #if HAVE_PANGO_FT2
32   PangoFT2FontMap *pango_ft2_fontmap_;
33   Scheme_hash_table *pango_dict_;
34   int pango_dpi_;
35 #endif
36
37   map<string, Index_to_charcode_map > filename_charcode_maps_map_;
38   
39   All_font_metrics (All_font_metrics const &);
40 public:
41
42   Index_to_charcode_map const *get_index_to_charcode_map (string filename,
43                                                           int face_index,
44                                                           FT_Face face);
45
46   All_font_metrics (string search_path);
47   ~All_font_metrics ();
48
49   Pango_font *find_pango_font (PangoFontDescription const *description,
50                                Real scale);
51
52   Font_metric *find_font (string name);
53   Open_type_font *find_otf (string name);
54   SCM font_descriptions () const;
55 };
56
57 extern All_font_metrics *all_fonts_global;
58 SCM ly_reset_all_fonts ();
59
60 #endif /* ALL_FONTS_HH */