]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/all-font-metrics.hh
Run grand-replace (issue 3765)
[lilypond.git] / lily / include / all-font-metrics.hh
1 /*
2   This file is part of LilyPond, the GNU music typesetter.
3
4   Copyright (C) 1998--2014 Han-Wen Nienhuys <hanwen@xs4all.nl>
5
6   LilyPond is free software: you can redistribute it and/or modify
7   it under the terms of the GNU General Public License as published by
8   the Free Software Foundation, either version 3 of the License, or
9   (at your option) any later version.
10
11   LilyPond is distributed in the hope that it will be useful,
12   but WITHOUT ANY WARRANTY; without even the implied warranty of
13   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14   GNU General Public License for more details.
15
16   You should have received a copy of the GNU General Public License
17   along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
18 */
19
20 #ifndef ALL_FONTS_HH
21 #define ALL_FONTS_HH
22
23 #include "file-path.hh"
24 #include "font-metric.hh"
25 #include "config.hh"
26
27 #if HAVE_PANGO_FT2
28 #include <pango/pango.h>
29 #include <pango/pangoft2.h>
30 #endif
31
32 /*
33    Interface to all fonts (both system fonts and fonts loaded
34    via Pango).
35 */
36 class All_font_metrics
37 {
38   Scheme_hash_table *otf_dict_;
39   File_path search_path_;
40
41 #if HAVE_PANGO_FT2
42   PangoFT2FontMap *pango_ft2_fontmap_;
43   Scheme_hash_table *pango_dict_;
44   int pango_dpi_;
45 #endif
46
47   map<string, Index_to_charcode_map > filename_charcode_maps_map_;
48
49   All_font_metrics (All_font_metrics const &);
50 public:
51
52   Index_to_charcode_map const *get_index_to_charcode_map (const string &filename,
53                                                           int face_index,
54                                                           FT_Face face);
55
56   All_font_metrics (const string &search_path);
57   ~All_font_metrics ();
58
59   Pango_font *find_pango_font (PangoFontDescription const *description,
60                                Real scale);
61
62   Font_metric *find_font (const string &name);
63   Open_type_font *find_otf (const string &name);
64   SCM font_descriptions () const;
65 };
66
67 extern All_font_metrics *all_fonts_global;
68 SCM ly_reset_all_fonts ();
69
70 #endif /* ALL_FONTS_HH */