]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/open-type-font.hh
* scm/framework-ps.scm (write-preamble): embed CFFs if file name
[lilypond.git] / lily / include / open-type-font.hh
1 /*
2   open-type-font.hh -- declare Open_type_font
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
7 */
8
9 #ifndef OPEN_TYPE_FONT_HH
10 #define OPEN_TYPE_FONT_HH
11
12 #include <map>
13 #include "freetype.hh"
14 #include "font-metric.hh"
15
16 typedef std::map<FT_UInt, FT_ULong> Index_to_charcode_map;
17 Index_to_charcode_map make_index_to_charcode_map (FT_Face face);
18
19 class Open_type_font : public Font_metric
20 {
21   /* handle to face object */
22   FT_Face face_;
23
24   SCM lily_subfonts_;
25   SCM lily_character_table_;
26   SCM lily_global_table_;
27   Index_to_charcode_map index_to_charcode_map_;
28   Open_type_font (FT_Face);
29
30 public:
31   SCM get_subfonts () const;
32   SCM get_global_table () const;
33   SCM get_char_table () const;
34
35   String get_otf_table (String tag) const;
36   static SCM make_otf (String);
37   virtual String font_name () const;
38   virtual ~Open_type_font ();
39   virtual Offset attachment_point (String) const;
40   virtual int count () const;
41   virtual Box get_indexed_char (int) const;
42   virtual int name_to_index (String) const;
43   //virtual unsigned glyph_name_to_charcode (String) const;
44   virtual unsigned index_to_charcode (int) const;
45   virtual void derived_mark () const;
46   virtual SCM sub_fonts () const;
47   virtual Real design_size () const;
48 };
49
50 String get_otf_table (FT_Face face, String tag);
51 FT_Face open_ft_face (String str);
52
53 #endif /* OPEN_TYPE_FONT_HH */