From: Han-Wen Nienhuys Date: Sun, 9 May 2004 17:56:54 +0000 (+0000) Subject: (find_scaled_font): divide lookup X-Git-Tag: release/2.3.2~24 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=f517cd0deca8c936a6e6f56c2f79c7e31f3632a7;p=lilypond.git (find_scaled_font): divide lookup magnification by outpuscale for non-virtual fontmetrics. This fixes ludicrously long font definitions for text fonts. (backportme) --- diff --git a/ChangeLog b/ChangeLog index c45953b5ba..4020592ac7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2004-05-09 Han-Wen Nienhuys + * 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. diff --git a/buildscripts/lilypond-profile.sh b/buildscripts/lilypond-profile.sh index 43c535882b..16afdaba97 100644 --- a/buildscripts/lilypond-profile.sh +++ b/buildscripts/lilypond-profile.sh @@ -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` diff --git a/input/test/title-markup.ly b/input/test/title-markup.ly index 24fd359cba..e4b38623d4 100644 --- a/input/test/title-markup.ly +++ b/input/test/title-markup.ly @@ -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)) } } diff --git a/lily/book.cc b/lily/book.cc index 93c2cf84eb..0861d4f6a8 100644 --- a/lily/book.cc +++ b/lily/book.cc @@ -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. diff --git a/lily/paper-def.cc b/lily/paper-def.cc index acf580772b..b1b3a6d6e5 100644 --- a/lily/paper-def.cc +++ b/lily/paper-def.cc @@ -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 (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 (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);