using namespace std;
-#include <freetype/tttables.h>
+#include FT_TRUETYPE_TABLES_H
#include "dimensions.hh"
+#include "freetype.hh"
#include "international.hh"
#include "modified-font-metric.hh"
#include "warn.hh"
}
string
-Open_type_font::get_otf_table (string tag) const
+Open_type_font::get_otf_table (const string &tag) const
{
return ::get_otf_table (face_, tag);
}
UGH fix naming
*/
string
-get_otf_table (FT_Face face, string tag)
+get_otf_table (FT_Face face, const string &tag)
{
FT_ULong len;
FT_Byte *tab = load_table (tag.c_str (), face, &len);
}
FT_Face
-open_ft_face (string str, FT_Long idx)
+open_ft_face (const string &str, FT_Long idx)
{
FT_Face face;
FT_Error error_code = FT_New_Face (freetype2_library, str.c_str (), idx, &face);
}
SCM
-Open_type_font::make_otf (string str)
+Open_type_font::make_otf (const string &str)
{
FT_Face face = open_ft_face (str, 0 /* index */);
Open_type_font *otf = new Open_type_font (face);
}
Offset
-Open_type_font::attachment_point (string glyph_name) const
+Open_type_font::attachment_point (const string &glyph_name) const
{
SCM sym = ly_symbol2scm (glyph_name.c_str ());
SCM entry = scm_hashq_ref (lily_character_table_, sym, SCM_BOOL_F);
}
}
- FT_UInt idx = FT_UInt (signed_idx);
- FT_Load_Glyph (face_, idx, FT_LOAD_NO_SCALE);
-
- FT_Glyph_Metrics m = face_->glyph->metrics;
- FT_Pos hb = m.horiBearingX;
- FT_Pos vb = m.horiBearingY;
- Box b (Interval (Real (-hb), Real (m.width - hb)),
- Interval (Real (-vb), Real (m.height - vb)));
+ Box b = get_unscaled_indexed_char_dimensions (signed_idx);
b.scale (design_size () / Real (face_->units_per_EM));
return b;
}
+Real
+Open_type_font::get_units_per_EM () const
+{
+ return face_->units_per_EM;
+}
+
size_t
Open_type_font::name_to_index (string nm) const
{
return (size_t) - 1;
}
+Box
+Open_type_font::get_unscaled_indexed_char_dimensions (size_t signed_idx) const
+{
+ return ly_FT_get_unscaled_indexed_char_dimensions (face_, signed_idx);
+}
+
+Box
+Open_type_font::get_glyph_outline_bbox (size_t signed_idx) const
+{
+ return ly_FT_get_glyph_outline_bbox (face_, signed_idx);
+}
+
+SCM
+Open_type_font::get_glyph_outline (size_t signed_idx) const
+{
+ return ly_FT_get_glyph_outline (face_, signed_idx);
+}
+
size_t
Open_type_font::index_to_charcode (size_t i) const
{