From 97ebd8b72cdd2db28ad8eb38629d51f285afff22 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Sun, 12 Dec 2004 19:49:20 +0000 Subject: [PATCH] (get_indexed_char): scale metrics by design-size and units_per_EM. --- ChangeLog | 3 +++ lily/open-type-font.cc | 13 +++++++++---- lily/tfm.cc | 2 -- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2348febb65..6adda6f98f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2004-12-12 Han-Wen Nienhuys + * lily/open-type-font.cc (get_indexed_char): scale metrics by + design-size and units_per_EM. + * mf/bigcheese.pe.in: set PUA codepoints before loading din & nummer. 2004-12-12 Jan Nieuwenhuizen diff --git a/lily/open-type-font.cc b/lily/open-type-font.cc index b870342cba..ab666a43fa 100644 --- a/lily/open-type-font.cc +++ b/lily/open-type-font.cc @@ -7,10 +7,11 @@ */ +#include + #include "warn.hh" #include "open-type-font.hh" - -#include +#include "dimensions.hh" SCM Open_type_font::make_otf (String str) @@ -42,15 +43,19 @@ Open_type_font::get_indexed_char (int signed_idx) const { FT_UInt idx = signed_idx; FT_Load_Glyph (face_, - idx, - FT_LOAD_NO_SCALE); + idx, + FT_LOAD_NO_SCALE); FT_Glyph_Metrics m = face_->glyph->metrics; int hb = m.horiBearingX; int vb = m.horiBearingY; Box b (Interval (-hb, m.width - hb), Interval (-vb, m.height - vb)); + + Real point_constant = 1 PT; + + b.scale (design_size() * Real (point_constant) / face_->units_per_EM); return b; } diff --git a/lily/tfm.cc b/lily/tfm.cc index 571df4319c..bad631cdc8 100644 --- a/lily/tfm.cc +++ b/lily/tfm.cc @@ -55,8 +55,6 @@ Tex_font_metric::Tex_font_metric () encoding_table_ = SCM_EOL; } - - void Tex_font_metric::derived_mark () const { -- 2.39.2