]> git.donarmstrong.com Git - lilypond.git/commitdiff
(get_indexed_char): scale metrics by
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 12 Dec 2004 19:49:20 +0000 (19:49 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 12 Dec 2004 19:49:20 +0000 (19:49 +0000)
design-size and units_per_EM.

ChangeLog
lily/open-type-font.cc
lily/tfm.cc

index 2348febb65ac09906d49ed9a159ba8d1f4cb42c8..6adda6f98f487da9321052c61c4db1e35fec309b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2004-12-12  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
+       * 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  <janneke@gnu.org>
index b870342cba633cec288a1a1379733dc7d113c2ff..ab666a43fa24fa34dffa0a133568f44bfdc97f17 100644 (file)
@@ -7,10 +7,11 @@
 
 */
 
+#include <stdio.h>
+
 #include "warn.hh"
 #include "open-type-font.hh"
-
-#include <stdio.h>
+#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;
 }
 
index 571df4319c76f66dc077daa4695647c5f20c3cfb..bad631cdc82cca53564ca72c48d7e21b40bd2798 100644 (file)
@@ -55,8 +55,6 @@ Tex_font_metric::Tex_font_metric ()
   encoding_table_ = SCM_EOL;
 }
 
-
-
 void
 Tex_font_metric::derived_mark () const
 {