]> git.donarmstrong.com Git - lilypond.git/commitdiff
(find_scaled_font): divide lookup
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 9 May 2004 17:56:54 +0000 (17:56 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 9 May 2004 17:56:54 +0000 (17:56 +0000)
magnification by outpuscale for non-virtual fontmetrics. This
fixes ludicrously long font definitions for text
fonts. (backportme)

ChangeLog
buildscripts/lilypond-profile.sh
input/test/title-markup.ly
lily/book.cc
lily/paper-def.cc

index c45953b5badfe746ebc454c78e4eefbb1208c95a..4020592ac7566d845751fd0c22bd1b329d3cb346 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2004-05-09  Han-Wen Nienhuys   <hanwen@xs4all.nl>
 
+       * lily/paper-def.cc (find_scaled_font): divide lookup
+       magnification by outpuscale for non-virtual fontmetrics. This
+       fixes ludicrously long font definitions for text
+       fonts. (backportme)
+
        * lily/score-engraver.cc: remove
        {Engraver,Score_engraver}::typeset_grob(), remove all calls.
 
@@ -10,6 +15,8 @@
        * lily/parser.yy (book_body): Grok Composite_music and \header.
        (markup): Push NOTES mode before score_block.
 
+       * VERSION: release 2.3.1
+       
        * mf/feta-klef.mf: 
        * mf/feta-bolletjes.mf: Oops.  Comment-out canvast test code.
 
index 43c535882be78888fc8f727b301cc711703f9ff6..16afdaba978ef86cbe19c9dedee0b80e26bd18fc 100644 (file)
@@ -80,8 +80,8 @@ else
 
 
        # For direct ps output: ps/lilyponddefs.ps
-       ## GS_LIB="$datadir/ps:"${GS_LIB:=""}
-       ## export GS_LIB
+       GS_LIB="$datadir/ps:"${GS_LIB:=""}
+       export GS_LIB
 
        # For direct ps output fonts. Add all available TeX Type1 fonts
        tmppfadir=`kpsewhich ecrm10.pfa`
index 24fd359cba67f9a0c49e21d108461820c18335b8..e4b38623d4b9e1d39205db3bf6319e94bfd27045 100644 (file)
@@ -95,7 +95,7 @@ spaceTest = \markup { "two space chars" }
            c2-\sizeTest c2-\spaceTest
        }
        \paper {
-           %% #(paper-set-staff-size (* 11.0 pt)) 
+           #(paper-set-staff-size (* 11.0 pt)) 
        }
     }
     
index 93c2cf84eb993211bcbd32b60e0d4ba4981937ea..0861d4f6a8daf01d5b1af3518d5abb4a604ec607 100644 (file)
@@ -69,6 +69,7 @@ Book::process (String outname, Music_output_def *default_def, SCM header)
        {
          if (paper)
            paper_book->papers_.push (paper);
+         
          paper_book->scores_.push (systems);
 
          // fixme.
index acf580772b9f03972d3d40ef89ca22169df557e9..b1b3a6d6e599106c843f0498a406fb5186fdcc91 100644 (file)
@@ -84,10 +84,18 @@ Paper_def::get_paper_outputter (String outname) const
 Font_metric*
 Paper_def::find_scaled_font (Font_metric *f, Real m, SCM input_enc_name)
 {
+  SCM scale_var = SCM_EOL;
+  Real lookup_mag = m;
+  if (!dynamic_cast<Virtual_font_metric*> (f))
+    {
+      scale_var = ly_module_lookup (scope_, ly_symbol2scm ("outputscale"));
+      lookup_mag /= ly_scm2double (scm_variable_ref (scale_var));
+    }
+  
   SCM sizes = scm_hashq_ref (scaled_fonts_, f->self_scm (), SCM_BOOL_F);
   if (sizes != SCM_BOOL_F)
     {
-      SCM met = scm_assoc (scm_make_real (m), sizes);
+      SCM met = scm_assoc (scm_make_real (lookup_mag), sizes);
       if (ly_c_pair_p (met))
        return unsmob_metrics (ly_cdr (met));
     }
@@ -99,14 +107,18 @@ Paper_def::find_scaled_font (Font_metric *f, Real m, SCM input_enc_name)
   SCM val = SCM_EOL;
   if (Virtual_font_metric * vf = dynamic_cast<Virtual_font_metric*> (f))
     {
-      /* For fontify_atom (), the magnification and name must be known
-        at the same time. That's impossible for
+      /*
+       For fontify_atom (), the magnification and name must be known
+       at the same time. That's impossible for
 
          Scaled (Virtual_font (Font1,Font2))
 
        so we replace by
 
-         Virtual_font (Scaled (Font1), Scaled (Font2))  */
+         Virtual_font (Scaled (Font1), Scaled (Font2))
+
+      */
+      
       SCM lst = SCM_EOL;
       SCM *t = &lst;
       for (SCM s = vf->get_font_list (); ly_c_pair_p (s); s = ly_cdr (s))
@@ -122,19 +134,17 @@ Paper_def::find_scaled_font (Font_metric *f, Real m, SCM input_enc_name)
     }
   else
     {
-      SCM scale_var = ly_module_lookup (scope_, ly_symbol2scm ("outputscale"));
 
       if (!ly_c_symbol_p (input_enc_name))
        {
          SCM var = ly_module_lookup (scope_, ly_symbol2scm ("inputencoding"));
          input_enc_name = scm_variable_ref (var);
        }
-      m /= ly_scm2double (scm_variable_ref (scale_var));
       val = Modified_font_metric::make_scaled_font_metric (input_enc_name,
-                                                          f, m);
+                                                          f, lookup_mag);
     }
 
-  sizes = scm_acons (scm_make_real (m), val, sizes);
+  sizes = scm_acons (scm_make_real (lookup_mag), val, sizes);
   scm_gc_unprotect_object (val);
   scm_hashq_set_x (scaled_fonts_, f->self_scm (), sizes);
   return unsmob_metrics (val);