]> git.donarmstrong.com Git - lilypond.git/blob - lily/open-type-font.cc
* mf/merge.pe: new file.
[lilypond.git] / lily / open-type-font.cc
1 /*
2   open-type-font.cc --  implement Open_type_font
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 2004 Han-Wen Nienhuys <hanwen@xs4all.nl>
7
8 */
9 #include "warn.hh"
10 #include "open-type-font.hh"
11
12 SCM
13 Open_type_font::make_otf (String str)
14 {
15   Open_type_font * otf = new Open_type_font;
16   int error_code = FT_New_Face( freetype2_library, str.to_str0(),
17                        0, &(otf->face_));
18   
19   if (error_code == FT_Err_Unknown_File_Format)
20     {
21       error("Unsupported font format");
22     }
23   else if (error_code)
24     {
25       error ("Unknown error reading font file.");
26     }
27
28   return otf->self_scm ();
29 }
30
31 Open_type_font::~Open_type_font()
32 {
33   FT_Done_Face (face_);
34 }