From e8936ee66fdd3e7ebe30556590e8dc913908a533 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Sat, 2 Aug 2003 19:29:55 +0000 Subject: [PATCH] *** empty log message *** --- ChangeLog | 10 +- input/trip.ly | 224 ----------------------------- lily/all-font-metrics.cc | 44 ++++-- lily/ambitus.cc | 4 +- lily/arpeggio.cc | 2 +- lily/bar-line.cc | 2 +- lily/beam-quanting.cc | 2 +- lily/beam.cc | 4 +- lily/break-algorithm.cc | 4 +- lily/breathing-sign.cc | 18 +-- lily/cluster.cc | 2 +- lily/hairpin.cc | 2 +- lily/horizontal-bracket.cc | 2 +- lily/hyphen-spanner.cc | 2 +- lily/include/kpath.hh | 6 +- lily/kpath.cc | 6 +- lily/line-spanner.cc | 2 +- lily/lyric-extender.cc | 2 +- lily/main.cc | 2 +- lily/measure-grouping-spanner.cc | 2 +- lily/mensural-ligature-engraver.cc | 2 +- lily/mensural-ligature.cc | 4 +- lily/multi-measure-rest.cc | 2 +- lily/note-head.cc | 4 +- lily/note-spacing.cc | 2 +- lily/paper-def.cc | 12 +- lily/slur.cc | 4 +- lily/staff-symbol.cc | 2 +- lily/stem.cc | 6 +- lily/system-start-delimiter.cc | 2 +- lily/text-spanner.cc | 2 +- lily/tie.cc | 2 +- lily/tuplet-bracket.cc | 2 +- lily/vaticana-ligature-engraver.cc | 2 +- lily/vaticana-ligature.cc | 4 +- lily/volta-bracket.cc | 28 ++-- scm/font.scm | 12 +- 37 files changed, 109 insertions(+), 325 deletions(-) delete mode 100644 input/trip.ly diff --git a/ChangeLog b/ChangeLog index 23b76fc9a4..a6216da95c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,7 +9,15 @@ 2003-08-02 Han-Wen Nienhuys - * input/trip.ly: remove + * lily/all-font-metrics.cc (find_font): load AFM files first only + for feta fonts. This fixes problems with TeXlive and other TeX + distros that include AFM files for the CM fonts. + + * scm/font.scm (qualifiers-to-font-name): remove. + + * lily/paper-def.cc: remove get_var. + + * input/trip.ly: remove file. * input/regression/spacing-note-flags.ly (raggedright): remove stafflinethickness diff --git a/input/trip.ly b/input/trip.ly deleted file mode 100644 index 4cb6535e2e..0000000000 --- a/input/trip.ly +++ /dev/null @@ -1,224 +0,0 @@ -\header { - title = "Trip test" - subtitle = "Make life very difficult for lilypond" - copyright = "public domain" - - footer ="This file tests as much features of lily as possible." -} - - -\version "1.7.18" - -%{ - -This file tests as much features of lily as possible. If there are any -basic faults in lily, this file will not run correctly. - -TODO: - -* autochange. - -* tremolo - -* lyrics. - -* drum, jazz, pop notation - -%} - - -praeludiumRight = \notes { - \key e \major - \clef violin - - % 13 -- how to type -- where to split -- this more neatly? - \context Staff < - \context Voice = I \relative c'' { \stemUp r4 dis4 e4. e8 ~ | - \shiftOn e4-.-^^\f [d8 fis8] \shiftOff gis4 ~ [gis8 fis16 e ] | - fis4 ~ [fis8 e16 dis] e4 r8 e8 } - \context Voice = III \relative c'' { \stemUp \shiftOn r4 bis cis \shiftOff cis | - a' ~ [a16 gis a b] \shiftOn dis,4 cis ~ | - [cis8 dis16 ais] bis4 cis r8 b } - \context Voice = IV \relative c'' { - \stemDown - \shiftOn s4 gis } - - \context Voice = II \relative c' { \stemDown -% \shiftOn % idem - - r4 fis \shiftOff gis gis | - a4. cis8 gis2 | - fis4 gis gis r8 e8 } - > | - % 16 -} - -praeludiumLeft = \notes \relative c { - \key e \major - \clef bass - - % 13 - \context Staff < - \context Voice = two { r4 } - \context Voice = one { \stemUp s4 dis' cis cis ~ | - \times 4/5 - { [cis8 ( cis - - a \translator Staff = treble \stemDown \shiftOn d - ) - - cis] } - \translator Staff = bass - \shiftOff \stemUp - [bis gis] cis4 | - dis2 cis4 r8 cis } - \context Voice = one { \stemUp bis2 } - \context Voice = three { - \property Voice.DynamicLineSpanner \override #'direction = #-1 - \stemUp \shiftOn r4 gis ~ [gis8 - \< - - gis] ~ \stemDown \shiftOff gis4 | - a4. fis8 - \! - gis4. a8 ~ | - a4 gis4 gis r8 gis } - \context Voice = four { \stemDown \shiftOn s4 fis4 e} - \context Voice = two { \stemDown s4 dis4 cis4 } - > | - %16 -} - - - - -fugaIIRight = \notes \relative c'' { - \key e \major % E-major - \clef violin - \time 3/4 - - %15 - \context Staff < - { [b8 fis8] b4 }\\ - { fis2 } - > - - \context Staff \notes\relative c''< - { - e4 -5 - }\\ - \\ - { - cis-4 - }\\ \\ - - { - ais-3 - }\\ \\ - { - fis-2 - } - > - - %16 - \context Staff < - { dis2 dis4 | - cis2 cis4 | - b4. [cis8 dis e] } \\ - { fis2. ~ | - fis ~ | - fis4 e2 } \\ - { [b8 fis] b2 ~ | - [b8 a!16 gis] a2 ~ | - a4 gis2 } - > | - %19 -} - -gracetest = \notes \grace { [c16 ( cis dis] } - -fugaIILeft = \notes { - \key e \major - \clef bass - - %15 - \context Staff < - { - \gracetest - \relative b, < )b2 dis-\arpeggio fis a b cis dis> \stemUp ais4 | - b2 b4 } \\ - { s2 e4 | fis2 fis4 } - > - \stemBoth - cis2 [e16( fis a \clef "treble" b] | - d'4 ) b8 b8 b4 | - %19 -} - -fugaIIPedal = \notes \relative c { - \key e \major - \clef bass - - \repeat "volta" 2 { dis4.-\ltoe } \alternative { e8-\rtoe cis4 } | - b4.-\lheel [cis8-\ltoe dis8-\rtoe e8-\rheel] | - fis4.-\rtoe [e8-\rheel dis8-\rtoe cis8-\ltoe] | - dis4-\rtoe e4-\rheel e,4-\ltoe | - %19 -} - -% these should be two separate scores... -\score{ - \context Score \notes < - \context PianoStaff < - \context Staff = treble { - \property Staff.instrument = #"right" - \property Staff.instr = #"rt" - \property PianoStaff.instrument = #"hands" - \property PianoStaff.instr = #"hs" - - - \property Score.midiInstrument = "church organ" - \praeludiumRight - \times 4/3 { c4 c4 c4 } \mark "B" - \fugaIIRight } - \context Staff = bass { - \property Staff.instrument = #"left" - \property Staff.instr = #"lt" - \praeludiumLeft r1 \fugaIILeft } - > - \context Staff = pedal \relative c < - { - \property Staff.instrument = #"bass" - \property Staff.instr = #"bs" - - \time 4/4 - \key e \major - \clef bass - - %13 - \property Staff.PhrasingSlur \override #'dashed = #5.0 - c4 \( ( d ) e\) f -% r4 fis,4-\ltoe e4.-\lheel e'8-\rheel | - -% tie accs: 2nd should get no acc -f4-\rtoe~ f8 -fis8-\rtoe fis4-\rtoe [e8-\ltoe a-\rtoe] | - dis,4-\ltoe gis-\rtoe [cis,8-\ltoe - ( - b!-\lheel ais-\rtoe g-\ltoe ~ ] | - -% tie should generate acc. -\break - g r4. - ) - c2^^^-^\f - \time 3/4 - - \fugaIIPedal \bar "|." } - - > - > -\paper {} - \midi { - \tempo 4 =96 } -} diff --git a/lily/all-font-metrics.cc b/lily/all-font-metrics.cc index 3d6ded75af..b7a70505c4 100644 --- a/lily/all-font-metrics.cc +++ b/lily/all-font-metrics.cc @@ -1,4 +1,5 @@ -/* +/* + all-font-metrics.cc -- implement All_font_metrics source file of the GNU LilyPond music typesetter @@ -34,6 +35,11 @@ All_font_metrics::~All_font_metrics () scm_gc_unprotect_object (tfm_p_dict_->self_scm ()); } +/* + TODO: our AFM handling is broken: the units in an AFM file are + relative to the design size (1000 units = 1 designsize). Hence we + should include design size when generating an AFM metric. + */ Adobe_font_metric * All_font_metrics::find_afm (String name) { @@ -52,7 +58,7 @@ All_font_metrics::find_afm (String name) if (path.empty_b ()) { - String p = ly_find_afm (name.to_str0 ()); + String p = kpathsea_find_afm (name.to_str0 ()); if (p.length ()) path = p; } @@ -84,7 +90,6 @@ All_font_metrics::find_afm (String name) */ if (afm->checksum_) { - Tex_font_metric * tfm = find_tfm (name); /* FIXME: better warning message @@ -124,7 +129,7 @@ All_font_metrics::find_tfm (String name) if (path.empty_b ()) { - String p = ly_find_tfm (name.to_str0 ()); + String p = kpathsea_find_tfm (name.to_str0 ()); if (p.length ()) path = p; } @@ -134,9 +139,9 @@ All_font_metrics::find_tfm (String name) if (path.empty_b ()) return 0; - if (verbose_global_b) progress_indication ("[" + path); + val = Tex_font_metric::make_tfm (path); if (verbose_global_b) @@ -158,13 +163,26 @@ All_font_metrics::find_tfm (String name) Font_metric * All_font_metrics::find_font (String name) { - Font_metric * f= find_afm (name); - if (f) - return f; - - f = find_tfm (name); - if (f) - return f; + if (name.left_string (4) == "feta") + { + Font_metric * f = find_afm (name); + if (f) + return f; + else + f =find_tfm (name); + if (f) + return f ; + } + else + { + Font_metric * f = find_tfm (name); + if (f) + return f; + else + f =find_afm (name); + if (f) + return f ; + } warning (_f ("can't find font: `%s'", name.to_str0 ())); warning (_ ("Loading default font")); @@ -174,7 +192,7 @@ All_font_metrics::find_font (String name) /* we're in emergency recovery mode here anyway, so don't try to do anything smart that runs the risk of failing. */ - f= find_afm (def_name); + Font_metric* f= find_afm (def_name); if (f) return f; diff --git a/lily/ambitus.cc b/lily/ambitus.cc index a4864d6b29..0421a1e113 100644 --- a/lily/ambitus.cc +++ b/lily/ambitus.cc @@ -198,8 +198,8 @@ Ambitus::brew_molecule (SCM smob) if (to_boolean (me->get_grob_property ("join-heads")) && ((p_max - p_min) >= 3)) { - Real linethickness = me->get_paper ()->get_var ("linethickness"); - Real blotdiameter = me->get_paper ()->get_var ("blotdiameter"); + Real linethickness = me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness")); + Real blotdiameter = me->get_paper ()->get_realvar (ly_symbol2scm ("blotdiameter")); Interval x_extent = 0.5 * Interval (-linethickness, +linethickness); Interval y_extent = 0.5 * Interval (p_min + 1.35, p_max - 1.35); Box line_box (x_extent, y_extent); diff --git a/lily/arpeggio.cc b/lily/arpeggio.cc index 70177a7584..bdeabba728 100644 --- a/lily/arpeggio.cc +++ b/lily/arpeggio.cc @@ -118,7 +118,7 @@ Arpeggio::brew_chord_bracket (SCM smob) heads.unite (iv + ss->relative_coordinate (common, Y_AXIS) - my_y); } - Real lt = me->get_paper ()->get_var ("linethickness"); + Real lt = me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness")); Real sp = 1.5 * Staff_symbol_referencer::staff_space (me); Real dy = heads.length() + sp; Real x = 0.7; diff --git a/lily/bar-line.cc b/lily/bar-line.cc index e0f0ca038d..38af64a6bb 100644 --- a/lily/bar-line.cc +++ b/lily/bar-line.cc @@ -53,7 +53,7 @@ Bar_line::compound_barline (Grob*me, String str, Real h) Real hair = gh_scm2double (me->get_grob_property ("hair-thickness")); Real fatline = gh_scm2double (me->get_grob_property ("thick-thickness")); - Real staffline = me->get_paper ()->get_var ("linethickness"); + Real staffline = me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness")); Real staff_space = Staff_symbol_referencer::staff_space (me); kern *= staffline; diff --git a/lily/beam-quanting.cc b/lily/beam-quanting.cc index 4d95ed4e65..238d040137 100644 --- a/lily/beam-quanting.cc +++ b/lily/beam-quanting.cc @@ -86,7 +86,7 @@ Beam::quanting (SCM smob) Real ss = Staff_symbol_referencer::staff_space (me); Real thickness = gh_scm2double (me->get_grob_property ("thickness")) / ss; - Real slt = me->get_paper ()->get_var ("linethickness") / ss; + Real slt = me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness")) / ss; SCM sdy = me->get_grob_property ("least-squares-dy"); diff --git a/lily/beam.cc b/lily/beam.cc index f949c8f230..ef9f56ec37 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -109,7 +109,7 @@ Beam::space_function (SCM smob, SCM beam_count) Grob *me = unsmob_grob (smob); Real staff_space = Staff_symbol_referencer::staff_space (me); - Real line = me->get_paper ()->get_var ("linethickness"); + Real line = me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness")); Real thickness = get_thickness (me); Real beam_translation = gh_scm2int (beam_count) < 4 @@ -338,7 +338,7 @@ Beam::brew_molecule (SCM grob) SCM gap = me->get_grob_property ("gap"); Molecule the_beam; - Real lt = me->get_paper ()->get_var ("linethickness"); + Real lt = me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness")); for (int i = 0; i<= stems.size(); i++) { diff --git a/lily/break-algorithm.cc b/lily/break-algorithm.cc index 407e93ca18..c9b74c3f47 100644 --- a/lily/break-algorithm.cc +++ b/lily/break-algorithm.cc @@ -62,7 +62,7 @@ Break_algorithm::generate_spacing_problem (Link_array const &curline, /* this is hardcoded, but this shouldn't happen anyway. - used to be get_var ("loose_column_distance"); + used to be get_realvar (ly_symbol2scm ("loose_column_distance")); */ sp->default_space_ = 1.0; @@ -95,7 +95,7 @@ void Break_algorithm::set_pscore (Paper_score*s) { pscore_ = s; - linewidth_ = s->paper_->get_var ("linewidth"); + linewidth_ = s->paper_->get_realvar (ly_symbol2scm ("linewidth")); } Array diff --git a/lily/breathing-sign.cc b/lily/breathing-sign.cc index 4f0b37190b..a1743c8c73 100644 --- a/lily/breathing-sign.cc +++ b/lily/breathing-sign.cc @@ -63,7 +63,7 @@ Breathing_sign::railtracks (SCM smob) { Grob * me = unsmob_grob (smob); Real space = Staff_symbol_referencer::staff_space (me); - Real th = me->get_paper ()->get_var ("linethickness"); + Real th = me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness")); SCM lt = me->get_grob_property ("thickness"); if (gh_number_p (lt)) th *= gh_scm2double (lt); @@ -88,7 +88,7 @@ Breathing_sign::divisio_minima (SCM smob) Grob *me = unsmob_grob (smob); Real staff_space = Staff_symbol_referencer::staff_space (me); Real staff_size; - Real thickness = me->get_paper ()->get_var ("linethickness"); + Real thickness = me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness")); SCM lt = me->get_grob_property ("thickness"); if (gh_number_p (lt)) thickness *= gh_scm2double (lt); @@ -99,7 +99,7 @@ Breathing_sign::divisio_minima (SCM smob) else staff_size = 0.0; - Real blotdiameter = me->get_paper ()->get_var ("blotdiameter"); + Real blotdiameter = me->get_paper ()->get_realvar (ly_symbol2scm ("blotdiameter")); /* * Draw a small vertical line through the uppermost (or, depending @@ -122,7 +122,7 @@ Breathing_sign::divisio_maior (SCM smob) Grob *me = unsmob_grob (smob); Real staff_space = Staff_symbol_referencer::staff_space (me); Real staff_size; - Real thickness = me->get_paper ()->get_var ("linethickness"); + Real thickness = me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness")); SCM lt = me->get_grob_property ("thickness"); if (gh_number_p (lt)) thickness *= gh_scm2double (lt); @@ -133,7 +133,7 @@ Breathing_sign::divisio_maior (SCM smob) else staff_size = 0.0; - Real blotdiameter = me->get_paper ()->get_var ("blotdiameter"); + Real blotdiameter = me->get_paper ()->get_realvar (ly_symbol2scm ("blotdiameter")); /* * Draw a vertical line that is vertically centered in the staff @@ -163,7 +163,7 @@ Breathing_sign::divisio_maxima (SCM smob) Grob *me = unsmob_grob (smob); Real staff_space = Staff_symbol_referencer::staff_space (me); Real staff_size; - Real thickness = me->get_paper ()->get_var ("linethickness"); + Real thickness = me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness")); SCM lt = me->get_grob_property ("thickness"); if (gh_number_p (lt)) thickness *= gh_scm2double (lt); @@ -174,7 +174,7 @@ Breathing_sign::divisio_maxima (SCM smob) else staff_size = 0.0; - Real blotdiameter = me->get_paper ()->get_var ("blotdiameter"); + Real blotdiameter = me->get_paper ()->get_realvar (ly_symbol2scm ("blotdiameter")); // like a "|" type bar Interval xdim (0, thickness); @@ -194,7 +194,7 @@ Breathing_sign::finalis (SCM smob) Grob *me = unsmob_grob (smob); Real staff_space = Staff_symbol_referencer::staff_space (me); Real staff_size; - Real thickness = me->get_paper ()->get_var ("linethickness"); + Real thickness = me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness")); SCM lt = me->get_grob_property ("thickness"); if (gh_number_p (lt)) thickness *= gh_scm2double (lt); @@ -205,7 +205,7 @@ Breathing_sign::finalis (SCM smob) else staff_size = 0.0; - Real blotdiameter = me->get_paper ()->get_var ("blotdiameter"); + Real blotdiameter = me->get_paper ()->get_realvar (ly_symbol2scm ("blotdiameter")); // like a "||" type bar Interval xdim (0, thickness); diff --git a/lily/cluster.cc b/lily/cluster.cc index 483c4363d4..af858ada86 100644 --- a/lily/cluster.cc +++ b/lily/cluster.cc @@ -31,7 +31,7 @@ Molecule brew_cluster_piece (Grob *me, Array bottom_points, Array top_points) { #if 0 - Real blotdiameter = me->get_paper ()->get_var ("blotdiameter"); + Real blotdiameter = me->get_paper ()->get_realvar (ly_symbol2scm ("blotdiameter")); #else Real blotdiameter = Staff_symbol_referencer::staff_space (me)/2; #endif diff --git a/lily/hairpin.cc b/lily/hairpin.cc index 503b575f6e..723244c025 100644 --- a/lily/hairpin.cc +++ b/lily/hairpin.cc @@ -24,7 +24,7 @@ Hairpin::brew_molecule (SCM smob) Grob *me= unsmob_grob (smob); Spanner *spanner = dynamic_cast (me); - Real line = me->get_paper ()->get_var ("linethickness"); + Real line = me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness")); SCM s = me->get_grob_property ("grow-direction"); if (!ly_dir_p (s)) diff --git a/lily/horizontal-bracket.cc b/lily/horizontal-bracket.cc index c7fd73e05f..d125911322 100644 --- a/lily/horizontal-bracket.cc +++ b/lily/horizontal-bracket.cc @@ -51,7 +51,7 @@ Horizontal_bracket::brew_molecule (SCM smob) ext.unite (gs[0]->extent (cx, X_AXIS)); Direction d = Directional_element_interface::get (me); - Real t = me->get_paper()->get_var ("linethickness"); + Real t = me->get_paper()->get_realvar (ly_symbol2scm ("linethickness")); SCM lthick = me->get_grob_property ("thickness"); if (gh_number_p (lthick)) diff --git a/lily/hyphen-spanner.cc b/lily/hyphen-spanner.cc index 2d582818fe..e8227bbf81 100644 --- a/lily/hyphen-spanner.cc +++ b/lily/hyphen-spanner.cc @@ -65,7 +65,7 @@ Hyphen_spanner::brew_molecule (SCM smob) } while (flip (&d) != LEFT); - Real lt = sp->get_paper ()->get_var ("linethickness"); + Real lt = sp->get_paper ()->get_realvar (ly_symbol2scm ("linethickness")); Real th = gh_scm2double (sp->get_grob_property ("thickness")) * lt ; Real h = gh_scm2double (sp->get_grob_property ("height")); diff --git a/lily/include/kpath.hh b/lily/include/kpath.hh index 5c8cc868fc..8b06b73268 100644 --- a/lily/include/kpath.hh +++ b/lily/include/kpath.hh @@ -12,9 +12,9 @@ source file of the GNU LilyPond music typesetter -String ly_find_afm (char const * name); -String ly_find_tfm (char const * name); -void ly_init_kpath (char *av0); +String kpathsea_find_afm (char const * name); +String kpathsea_find_tfm (char const * name); +void init_kpath (char *av0); diff --git a/lily/kpath.cc b/lily/kpath.cc index 3516e61318..07fcbc62b8 100644 --- a/lily/kpath.cc +++ b/lily/kpath.cc @@ -41,7 +41,7 @@ extern "C" { #include "warn.hh" String -ly_find_afm (char const * name) +kpathsea_find_afm (char const * name) { #if (KPATHSEA && HAVE_KPSE_FIND_FILE) char * name_ptr = kpse_find_file (name, kpse_afm_format, true); @@ -62,7 +62,7 @@ ly_find_afm (char const * name) } String -ly_find_tfm (char const * name) +kpathsea_find_tfm (char const * name) { String p = global_path.find (String (name) + ".tfm"); @@ -84,7 +84,7 @@ ly_find_tfm (char const * name) void -ly_init_kpath (char *av0) +init_kpath (char *av0) { #if KPATHSEA && HAVE_KPATHSEA_KPATHSEA_H /* diff --git a/lily/line-spanner.cc b/lily/line-spanner.cc index a1a58b5e7c..03a201fa37 100644 --- a/lily/line-spanner.cc +++ b/lily/line-spanner.cc @@ -238,7 +238,7 @@ Line_spanner::brew_molecule (SCM smob) Offset my_off; Offset his_off; - Real thick = me->get_paper ()->get_var ("linethickness"); + Real thick = me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness")); SCM s = me->get_grob_property ("thickness"); if (gh_number_p (s)) diff --git a/lily/lyric-extender.cc b/lily/lyric-extender.cc index 944a4f75b0..7d1166c063 100644 --- a/lily/lyric-extender.cc +++ b/lily/lyric-extender.cc @@ -26,7 +26,7 @@ Lyric_extender::brew_molecule (SCM smob) Real leftext = l->extent (l, X_AXIS).length (); - Real sl = sp->get_paper ()->get_var ("linethickness"); + Real sl = sp->get_paper ()->get_realvar (ly_symbol2scm ("linethickness")); Real righttrim = 0.5; // default to half a space gap on the right diff --git a/lily/main.cc b/lily/main.cc index 077b5aaa61..ca5bc6b240 100644 --- a/lily/main.cc +++ b/lily/main.cc @@ -424,7 +424,7 @@ main (int argc, char **argv) sane_putenv ("GUILE_INIT_SEGMENT_SIZE_1", "4194304", false); sane_putenv ("GUILE_MAX_SEGMENT_SIZE", "8388608", false); - ly_init_kpath (argv[0]); + init_kpath (argv[0]); bool help_b = false; oparser_p_static = new Getopt_long (argc, argv, options_static); diff --git a/lily/measure-grouping-spanner.cc b/lily/measure-grouping-spanner.cc index fb9da592c9..b29f91a1d9 100644 --- a/lily/measure-grouping-spanner.cc +++ b/lily/measure-grouping-spanner.cc @@ -25,7 +25,7 @@ Measure_grouping::brew_molecule (SCM grob) SCM thick = me->get_grob_property ("thickness"); SCM height = me->get_grob_property ("height"); - Real t = me->get_paper ()->get_var ("linethickness") * gh_scm2double (thick); + Real t = me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness")) * gh_scm2double (thick); Grob *common = me->get_bound(LEFT)->common_refpoint (me->get_bound (RIGHT), X_AXIS); diff --git a/lily/mensural-ligature-engraver.cc b/lily/mensural-ligature-engraver.cc index 8c73fb6cec..bf1c2cd0c5 100644 --- a/lily/mensural-ligature-engraver.cc +++ b/lily/mensural-ligature-engraver.cc @@ -354,7 +354,7 @@ Mensural_ligature_engraver::propagate_properties (Spanner *ligature, SCM thickness_scm = ligature->get_grob_property ("thickness"); Real thickness = (thickness_scm != SCM_EOL) ? gh_scm2double (thickness_scm) : 1.4; - thickness *= ligature->get_paper ()->get_var ("linethickness"); + thickness *= ligature->get_paper ()->get_realvar (ly_symbol2scm ("linethickness")); Real head_width = Font_interface::get_default_font (ligature)-> diff --git a/lily/mensural-ligature.cc b/lily/mensural-ligature.cc index 9b58b03b8c..a60e2fe5ed 100644 --- a/lily/mensural-ligature.cc +++ b/lily/mensural-ligature.cc @@ -153,7 +153,7 @@ internal_brew_primitive (Grob *me, bool ledger_take_space) programming_error (_f ("Mensural_ligature:" "thickness undefined on flexa %d; assuming 1.4", primitive)); - thickness = 1.4 * me->get_paper ()->get_var ("linethickness"); + thickness = 1.4 * me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness")); } } @@ -223,7 +223,7 @@ internal_brew_primitive (Grob *me, bool ledger_take_space) int join_left = gh_scm2int (join_left_scm); if (!join_left) programming_error (_f ("Mensural_ligature: (join_left == 0)")); - Real blotdiameter = (me->get_paper ()->get_var ("blotdiameter")); + Real blotdiameter = (me->get_paper ()->get_realvar (ly_symbol2scm ("blotdiameter"))); Interval x_extent = Interval (0, thickness); Interval y_extent = (join_left > 0) ? Interval (-join_left * 0.5 * staff_space, 0) : diff --git a/lily/multi-measure-rest.cc b/lily/multi-measure-rest.cc index 194a23780f..9d7d2c4285 100644 --- a/lily/multi-measure-rest.cc +++ b/lily/multi-measure-rest.cc @@ -181,7 +181,7 @@ Multi_measure_rest::big_rest (Grob *me, Real width) Real ss = Staff_symbol_referencer::staff_space (me); - Real slt = me->get_paper ()->get_var ("linethickness"); + Real slt = me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness")); Real y = slt * tthick/2 * ss; Real ythick = hair_thick * slt * ss; Box b(Interval (0, width - 2 * ythick), Interval (-y, y)); diff --git a/lily/note-head.cc b/lily/note-head.cc index 445abc8a63..b52a9a5ea1 100644 --- a/lily/note-head.cc +++ b/lily/note-head.cc @@ -77,9 +77,9 @@ Note_head::brew_ledger_lines (Grob *me, if (lines_i) { Real ledgerlinethickness = - (me->get_paper ()->get_var ("ledgerlinethickness")); + (me->get_paper ()->get_realvar (ly_symbol2scm ("ledgerlinethickness"))); Real blotdiameter = ledgerlinethickness; - // (me->get_paper ()->get_var ("blotdiameter")); + // (me->get_paper ()->get_realvar (ly_symbol2scm ("blotdiameter"))); Interval y_extent = Interval (-0.5*(ledgerlinethickness), +0.5*(ledgerlinethickness)); diff --git a/lily/note-spacing.cc b/lily/note-spacing.cc index 664588ebc7..80a789e418 100644 --- a/lily/note-spacing.cc +++ b/lily/note-spacing.cc @@ -356,7 +356,7 @@ Note_spacing::stem_dir_correction (Grob*me, Item * rcolumn, if (st) { Real thick = gh_scm2double (st->get_grob_property ("thickness")) - * st->get_paper ()->get_var ("linethickness"); + * st->get_paper ()->get_realvar (ly_symbol2scm ("linethickness")); note_head_width -= thick; } diff --git a/lily/paper-def.cc b/lily/paper-def.cc index af507637e7..b3568b2dd0 100644 --- a/lily/paper-def.cc +++ b/lily/paper-def.cc @@ -43,11 +43,6 @@ Paper_def::Paper_def (Paper_def const&src) } -Real -Paper_def::get_var (String s) const -{ - return get_realvar (ly_symbol2scm (s.to_str0 ())); -} Real Paper_def::get_realvar (SCM s) const @@ -66,14 +61,13 @@ Paper_def::get_realvar (SCM s) const Interval Paper_def::line_dimensions_int (int n) const { - Real lw = get_var ("linewidth"); - Real ind = n? 0.0:get_var ("indent"); + Real lw = get_realvar (ly_symbol2scm ("linewidth")); + Real ind = n? 0.0:get_realvar (ly_symbol2scm ("indent")); return Interval (ind, lw); } - int Paper_def::score_count_ = 0; int @@ -107,8 +101,6 @@ Paper_def::get_paper_outputter () /* todo: use symbols and hashtable idx? - - */ Font_metric * Paper_def::find_font (SCM fn, Real m) diff --git a/lily/slur.cc b/lily/slur.cc index 7473197e22..023c5a20dd 100644 --- a/lily/slur.cc +++ b/lily/slur.cc @@ -343,7 +343,7 @@ Slur::get_attachment (Grob *me, Direction dir, */ Real stem_thickness = gh_scm2double (stem->get_grob_property ("thickness")) - * stem->get_paper ()->get_var ("linethickness"); + * stem->get_paper ()->get_realvar (ly_symbol2scm ("linethickness")); o += Offset (0.5 * x_extent * (1 + Stem::get_direction (stem)) - ((dir + 1)/2) * stem_thickness @@ -541,7 +541,7 @@ Slur::brew_molecule (SCM smob) return SCM_EOL; } - Real thick = me->get_paper ()->get_var ("linethickness") * + Real thick = me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness")) * gh_scm2double (me->get_grob_property ("thickness")); Bezier one = get_curve (me); diff --git a/lily/staff-symbol.cc b/lily/staff-symbol.cc index 53beacabb0..c8db2f4812 100644 --- a/lily/staff-symbol.cc +++ b/lily/staff-symbol.cc @@ -62,7 +62,7 @@ Staff_symbol::brew_molecule (SCM smob) width = 0; } - Real t = me->get_paper ()->get_var ("linethickness"); + Real t = me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness")); SCM my_thick = me->get_grob_property("thickness"); if (gh_number_p (my_thick)) t *= gh_scm2double (my_thick); diff --git a/lily/stem.cc b/lily/stem.cc index efbdcd1b77..f0f30ea685 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -421,7 +421,7 @@ Stem::position_noteheads (Grob*me) Real thick = gh_scm2double (me->get_grob_property ("thickness")) - * me->get_paper ()->get_var ("linethickness"); + * me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness")); Grob *hed = support_head (me); Real w = Note_head::head_extent (hed,X_AXIS)[dir]; @@ -712,7 +712,7 @@ Stem::brew_molecule (SCM smob) { Real stem_width = gh_scm2double (me->get_grob_property ("thickness")) // URG - * me->get_paper ()->get_var ("linethickness"); + * me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness")); Molecule ss =Lookup::filledbox (Box (Interval (-stem_width/2, stem_width/2), Interval (stem_y[DOWN]*dy, stem_y[UP]*dy))); @@ -772,7 +772,7 @@ Stem::off_callback (SCM element_smob, SCM) { Real rule_thick = gh_scm2double (me->get_grob_property ("thickness")) - * me->get_paper ()->get_var ("linethickness"); + * me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness")); r += - d * rule_thick * 0.5; diff --git a/lily/system-start-delimiter.cc b/lily/system-start-delimiter.cc index 94aa817bb1..0292655e0f 100644 --- a/lily/system-start-delimiter.cc +++ b/lily/system-start-delimiter.cc @@ -62,7 +62,7 @@ Will not fix it since I'm not sure. Molecule System_start_delimiter::simple_bar (Grob*me,Real h) { - Real w = me->get_paper ()->get_var ("linethickness") * + Real w = me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness")) * gh_scm2double (me->get_grob_property ("thickness")); return Lookup::filledbox (Box (Interval (0,w), Interval (-h/2, h/2))); } diff --git a/lily/text-spanner.cc b/lily/text-spanner.cc index 913c53aab5..a7ad249ed6 100644 --- a/lily/text-spanner.cc +++ b/lily/text-spanner.cc @@ -115,7 +115,7 @@ Text_spanner::brew_molecule (SCM smob) span_points[RIGHT] -= gh_scm2double (ly_cdr (ew)); } - Real thick = me->get_paper ()->get_var ("linethickness"); + Real thick = me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness")); SCM st = me->get_grob_property ("thickness"); if (gh_number_p (st)) { diff --git a/lily/tie.cc b/lily/tie.cc index 21eaac68f6..f314d8bc17 100644 --- a/lily/tie.cc +++ b/lily/tie.cc @@ -317,7 +317,7 @@ Tie::brew_molecule (SCM smob) Real thick = gh_scm2double (me->get_grob_property ("thickness")) - * me->get_paper ()->get_var ("linethickness"); + * me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness")); Bezier b; int i = 0; diff --git a/lily/tuplet-bracket.cc b/lily/tuplet-bracket.cc index 56f9585c8f..82cca6b7ae 100644 --- a/lily/tuplet-bracket.cc +++ b/lily/tuplet-bracket.cc @@ -170,7 +170,7 @@ Tuplet_bracket::brew_molecule (SCM smob) if (bracket_visibility) { - Real lt = me->get_paper ()->get_var ("linethickness"); + Real lt = me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness")); SCM thick = me->get_grob_property ("thickness"); if (gh_number_p (thick)) diff --git a/lily/vaticana-ligature-engraver.cc b/lily/vaticana-ligature-engraver.cc index 8343f986c3..bd7bd8af85 100644 --- a/lily/vaticana-ligature-engraver.cc +++ b/lily/vaticana-ligature-engraver.cc @@ -346,7 +346,7 @@ Vaticana_ligature_engraver::transform_heads (Spanner *ligature, "assuming 1.4 linethickness"); join_thickness = 1.4; } - join_thickness *= ligature->get_paper ()->get_var ("linethickness"); + join_thickness *= ligature->get_paper ()->get_realvar (ly_symbol2scm ("linethickness")); Item *prev_primitive = 0; int prev_prefix_set = 0; diff --git a/lily/vaticana-ligature.cc b/lily/vaticana-ligature.cc index 9639cab8b4..9a99e09943 100644 --- a/lily/vaticana-ligature.cc +++ b/lily/vaticana-ligature.cc @@ -219,7 +219,7 @@ vaticana_brew_primitive (Grob *me, bool ledger_take_space) programming_error (_f ("Vaticana_ligature:" "thickness undefined; assuming 1.4", me)); - thickness = 1.4 * me->get_paper ()->get_var ("linethickness"); + thickness = 1.4 * me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness")); } Real x_offset = 0.0; @@ -256,7 +256,7 @@ vaticana_brew_primitive (Grob *me, bool ledger_take_space) int delta_pitch = gh_scm2int (delta_pitch_scm); if (!delta_pitch) programming_error (_f ("Vaticana_ligature: (delta_pitch == 0)")); - Real blotdiameter = (me->get_paper ()->get_var ("blotdiameter")); + Real blotdiameter = (me->get_paper ()->get_realvar (ly_symbol2scm ("blotdiameter"))); Interval x_extent = Interval (0, thickness); Interval y_extent = (delta_pitch > 0) ? Interval (-delta_pitch * 0.5 * staff_space, 0) : // ascending join diff --git a/lily/volta-bracket.cc b/lily/volta-bracket.cc index ed7f4193d9..e959395fb4 100644 --- a/lily/volta-bracket.cc +++ b/lily/volta-bracket.cc @@ -65,27 +65,27 @@ Volta_bracket_interface::brew_molecule (SCM smob) (strcmp(cs,":|")!=0 && strcmp(cs,"|:")!=0 && strcmp(cs,"|.")!=0 && strcmp(cs,":|:")!=0 && strcmp(cs,".|")!=0); - Real staff_thick = me->get_paper ()->get_var ("linethickness"); + Real staff_thick = me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness")); Real half_space = 0.5; Item * bound = dynamic_cast (me)->get_bound (LEFT); /* not a start, but really broken in two - */ + */ Real left =0.; if (bound->break_status_dir () == RIGHT) - { - Paper_column *pc = bound->get_column (); - left = pc->extent (pc, X_AXIS)[RIGHT] - bound->relative_coordinate (pc, X_AXIS); - } + { + Paper_column *pc = bound->get_column (); + left = pc->extent (pc, X_AXIS)[RIGHT] - bound->relative_coordinate (pc, X_AXIS); + } else - { - /* - the volta spanner is attached to the bar-line, which is moved - to the right. We don't need to compensate for the left edge. - */ - } + { + /* + the volta spanner is attached to the bar-line, which is moved + to the right. We don't need to compensate for the left edge. + */ + } Real w = dynamic_cast (me)->spanner_length () - left - half_space; Real h = gh_scm2double (me->get_grob_property ("height")); @@ -133,6 +133,6 @@ Volta_bracket_interface::add_column (Grob*me, Grob* c) } ADD_INTERFACE (Volta_bracket_interface,"volta-bracket-interface", - "Volta bracket with number", - "bars thickness height"); + "Volta bracket with number", + "bars thickness height"); diff --git a/scm/font.scm b/scm/font.scm index 02a408038b..2fdf3adb6e 100644 --- a/scm/font.scm +++ b/scm/font.scm @@ -230,16 +230,7 @@ (append size-independent-fonts (cdr (assoc sym font-list-alist)))) -(define (qualifiers-to-fontnames qualifiers font-descr-alist) - " reduce the font list by successively applying a font-qualifier." - (if (null? qualifiers) - font-descr-alist - - (qualifiers-to-fontnames - (cdr qualifiers) - (filter-field (caar qualifiers) (cdar qualifiers) font-descr-alist) - ) - )) + (define (wild-eq? x y) (or (eq? x y) @@ -349,7 +340,6 @@ and warn if the selected font is not unique. (display (filter pair? '(1 2 (1 2) (1 .2))) (display (filter-field 'font-name 'cmbx paper20-style-sheet-alist)) - (display (qualifiers-to-fontname '((font-name . cmbx)) paper20-style-sheet-alist)) (display (style-to-font-name 'paper20 'large))) ))) -- 2.39.2