2 open-type-font.cc -- implement Open_type_font
4 source file of the GNU LilyPond music typesetter
6 (c) 2004 Han-Wen Nienhuys <hanwen@xs4all.nl>
12 #include "open-type-font.hh"
15 Open_type_font::make_otf (String str)
17 Open_type_font * otf = new Open_type_font;
18 int error_code = FT_New_Face( freetype2_library, str.to_str0(),
21 // int code = FT_Set_Charmap (otf->face_, );
24 if (error_code == FT_Err_Unknown_File_Format)
26 error("Unsupported font format");
30 error ("Unknown error reading font file.");
33 return otf->self_scm ();
36 Open_type_font::~Open_type_font()
43 Open_type_font::get_indexed_char (int signed_idx)
45 FT_UInt idx = signed_idx;
51 FT_Glyph_Metrics m = face->glyph->metrics;
52 Box b (Interval (0, m->width) - m->horiBearingX,
53 Interval (0, m->height) - m->horiBearingY);
59 Open_type_font::name_to_index (String nm)
66 Open_type_font::get_design_size () const