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>
11 #include "open-type-font.hh"
14 Open_type_font::make_otf (String str)
16 Open_type_font * otf = new Open_type_font;
17 int error_code = FT_New_Face( freetype2_library, str.to_str0(),
20 // int code = FT_Set_Charmap (otf->face_, );
23 if (error_code == FT_Err_Unknown_File_Format)
25 error("Unsupported font format");
29 error ("Unknown error reading font file.");
32 return otf->self_scm ();
35 Open_type_font::~Open_type_font()
42 Open_type_font::get_indexed_char (int signed_idx)
44 FT_UInt idx = signed_idx;
50 FT_Glyph_Metrics m = face->glyph->metrics;
51 Box b (Interval (0, m->width) - m->horiBearingX,
52 Interval (0, m->height) - m->horiBearingY);
58 Open_type_font::name_to_index (String nm)
65 Open_type_font::get_design_size () const