From: fred Date: Sun, 24 Mar 2002 19:58:45 +0000 (+0000) Subject: lilypond-0.1.18 X-Git-Tag: release/1.5.59~3827 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=9be46814da63218b6c193ee67520fcf44b2ee3b7;p=lilypond.git lilypond-0.1.18 --- diff --git a/bin/mf-to-table.in b/bin/mf-to-table.in index 17a7c2f7a8..c7e5a25b94 100644 --- a/bin/mf-to-table.in +++ b/bin/mf-to-table.in @@ -9,7 +9,7 @@ Ugh . Perl sux. Anybody for Python? =cut -$mf_to_table_version = 0.1; +$mf_to_table_version = 0.2; use Getopt::Long; @@ -30,43 +30,58 @@ sub usage . "Generate mozarella metrics table from preparated metafont log\n\n" . "Options:\n" . " -h, --help print this help\n" - . " -o, --output=FILE name output file\n" + . " -l, --ly=FILE name output table\n" + . " -t, --tex=FILE name output tex chardefs\n" } sub make_table { my $line; my $indent = 0; + my $lineno=0; while ($line = ) { + $lineno++; if ($line =~ /^@@/) { $line =~ s/^@@(.*)@@/$1/; chop ($line); my @fields = split (/:/,$line); my $label = $fields [0]; my $name = $fields [1]; - print OUT "\t" x $indent; + print OUTLY "\t" x $indent; if ($label eq "font") { - print OUT "% $name=\\symboltables {\n"; + print OUTLY "% $name=\\symboltables {\n"; + print OUTTEX "% $name\n"; $indent++; } elsif ($label eq "group") { - print OUT "\"$name\" = \\table {\n"; + print OUTLY "\"$name\" = \\table {\n"; + print OUTTEX "% $name\n"; $indent++; } elsif ($label eq "puorg") { - print OUT "}\n"; + print OUTLY "}\n"; + print OUTTEX "\n"; $indent--; } elsif ($label eq "tnof") { - print OUT "% } % $name\n"; + print OUTLY "% } % $name\n"; $indent--; } elsif ($label eq "char") { my $c = $fields [2]; my $w = $fields [3]; my $h = $fields [4]; my $d = $fields [5]; - my $id = $fields [6]; - my $texstr = $fields [7]; - print OUT sprintf( "\"%s\"\t\"\\%s\"\t%.2f\\pt\t%.2f\\pt\t%.2f\\pt\t%.2f\\pt\n", $id, $texstr, 0, $w, $h, $d ); + my $b = $fields [6]; + my $id = $fields [7]; + my $texstr = $fields [8]; + print OUTLY sprintf( "\"%s\"\t\"\\%s\"\t%.2f\\pt\t%.2f\\pt\t%.2f\\pt\t%.2f\\pt\n", $id, $texstr, -$b, $w, $h, -$d ); + # remove % from generic chars, and save start charcode + my $defstr = "\\fetdef"; + if ($texstr =~ /{%/) { + $texstr =~ s/{%.*//; + $texstr .= "start"; + $defstr = "\\def" + } + print OUTTEX sprintf( "%s\\%s{%d}\n", $defstr, $texstr, $c); } else { - print STDERR "mf-to-table: unknown label: \`$label\'\n"; + print STDERR "mf-to-table: $lineno: unknown label: \`$label\'\n"; } } } @@ -74,16 +89,28 @@ sub make_table sub set_files { - $infile = "-"; - $outfile = "-"; - $outfile = $opt_output if (defined($opt_output)); - if ($ARGV [0]) { $infile = $ARGV[0]; } - if (( ! -f $infile) && (! $infile =~ /\\.log$/s ) ){ + if (!(-f $infile) && !($infile =~ /\.log$/s )) { $infile .= ".log"; } + + if (defined($opt_ly)) { + $lyfile = $opt_ly; + } + else { + $lyfile = $infile; + $lyfile =~ s/\.log$/.ly/; + } + if (defined($opt_tex)) { + $texfile = $opt_tex; + } + else { + $texfile = $infile; + $texfile =~ s/\.log$/.tex/; + } + print STDERR "Input ", (($infile eq "-") ?"STDIN" : $infile), " .. \n"; } @@ -92,14 +119,20 @@ sub do_one_arg set_files; die "can't open \`$infile\'" unless open IN,$infile ; - die "can't open \`$outfile\'" unless open OUT, ">$outfile"; - print OUT "% generated at " . localtime() . " from $infile\n"; - print OUT "% changes will be lost\n"; + + die "can't open \`$lyfile\'" unless open OUTLY, ">$lyfile"; + print OUTLY "% generated at " . localtime() . " from $infile\n"; + print OUTLY "% changes will be lost\n\n"; + + die "can't open \`$texfile\'" unless open OUTTEX, ">$texfile"; + print OUTTEX "% generated at " . localtime() . " from $infile\n"; + print OUTTEX "% changes will be lost\n\n"; make_table; close IN; - close OUT; + close OUTLY; + close OUTTEX; } ## "main" @@ -107,7 +140,7 @@ sub do_one_arg identify; #GetOptions ("help", "output=s", "from=i", "to=i", "minor=i", "edit", "show-rules"); -GetOptions ("help", "output=s"); +GetOptions ("help", "ly=s", "tex=s"); if ($opt_help) { usage(); @@ -115,7 +148,7 @@ if ($opt_help) { exit 0; } -local ($infile,$outfile); +local ($infile,$lyfile,$texfile); my $processed_one=0; while (defined($ARGV[0])) { diff --git a/lily/clef-grav.cc b/lily/clef-grav.cc index 670e5d9cd0..fc70af6a0e 100644 --- a/lily/clef-grav.cc +++ b/lily/clef-grav.cc @@ -75,7 +75,7 @@ void Clef_engraver::do_creation_processing() { Scalar def = get_property ("defaultclef"); - if (def) + if (def.operator bool ()) // egcs: Scalar to bool is ambiguous set_type (def); if (clef_type_str_.length_i ()) create_clef(); diff --git a/lily/include/translator-group.hh b/lily/include/translator-group.hh index dc2e8365eb..1cc3a0b3c3 100644 --- a/lily/include/translator-group.hh +++ b/lily/include/translator-group.hh @@ -17,7 +17,9 @@ #include "plist.hh" #include "parray.hh" +// egcs typedef void (Translator::*Method_pointer)(void); +typedef void (Translator::*Const_method_pointer)(void) const; /** Make some kind of #Element#s from Requests. Elements are made by hierarchically grouped #Translator#s @@ -68,7 +70,8 @@ protected: virtual void do_post_move_processing(); virtual void do_creation_processing(); virtual void do_removal_processing(); - void each (Method_pointer) const; + void each (Method_pointer); + void each (Const_method_pointer) const; }; #endif // TRANSLATOR_GROUP_HH diff --git a/lily/performer.cc b/lily/performer.cc index 5775f157eb..ed171b5a70 100644 --- a/lily/performer.cc +++ b/lily/performer.cc @@ -14,10 +14,6 @@ IMPLEMENT_IS_TYPE_B1(Performer, Translator); -Performer::Performer() -{ -} - void Performer::play (Audio_element* p) { diff --git a/lily/rhythmic-column-grav.cc b/lily/rhythmic-column-grav.cc index af3238c0f9..7cba706c24 100644 --- a/lily/rhythmic-column-grav.cc +++ b/lily/rhythmic-column-grav.cc @@ -76,7 +76,8 @@ Rhythmic_column_engraver::do_pre_move_processing() if (ncol_p_) { if (! ncol_p_->h_shift_b_) - ncol_p_->h_shift_b_ = (bool) get_property ("hshift"); + // egcs + ncol_p_->h_shift_b_ = get_property ("hshift").operator bool (); if (! ncol_p_->dir_) ncol_p_->dir_ =(Direction) int(get_property ("ydirection")); diff --git a/lily/translator-group.cc b/lily/translator-group.cc index 1521ede70d..5725a028c3 100644 --- a/lily/translator-group.cc +++ b/lily/translator-group.cc @@ -267,7 +267,14 @@ Translator_group::get_default_interpreter() } void -Translator_group::each (Method_pointer method) const +Translator_group::each (Method_pointer method) +{ + for (PCursor i (trans_p_list_.top ()); i.ok (); i++) + (i.ptr()->*method) (); +} + +void +Translator_group::each (Const_method_pointer method) const { for (PCursor i (trans_p_list_.top ()); i.ok (); i++) (i.ptr()->*method) (); diff --git a/tex/taupindefs.tex b/tex/taupindefs.tex index 290e711cb9..12080f171a 100644 --- a/tex/taupindefs.tex +++ b/tex/taupindefs.tex @@ -1,4 +1,3 @@ -\input fetdefs \def\musixtwentyfonts{ \font\normaltextfont=cmr10 %\textfont is a primitive \font\smalltextfont=cmr8 @@ -38,8 +37,11 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % provide interface to musixtex fonts %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\musicdef\breveball{'040} -\musicdef\longaball{'047} +% \musicdef\breveball{'040} +% \musicdef\longaball{'047} +% \musicdef\quartball{'007} +% \musicdef\halfball{'010} +% \musicdef\wholeball{'011} \musicdef\halfrest{'074} \musicdef\wholerest{'075} \musicdef\breverest{'072} @@ -48,12 +50,12 @@ %% hmm \musicdef\outsidehalfrest{10} \musicdef\outsidewholerest{11} -\musicdef\quartrest{62} -\musicdef\eighthrest{63} -\musicdef\sixteenthrest{64} -\musicdef\thirtysecondrest{65} -\musicdef\sixtyfourthrest{66} -\musicdef\hundredtwentyeighthrest{67} +% \musicdef\quartrest{62} +% \musicdef\eighthrest{63} +% \musicdef\sixteenthrest{64} +% \musicdef\thirtysecondrest{65} +% \musicdef\sixtyfourthrest{66} +% \musicdef\hundredtwentyeighthrest{67} \musicdef\sharp{52} \musicdef\flat{50} \musicdef\natural{54} @@ -125,10 +127,12 @@ \def\tr{{\it tr}} -\def\beamuslope#1#2{{\count0=#2\advance\count0 by#1 - \advance\count0 by 122 - \musicfnt\char\count0}} -\def\beamdslope#1#2{{\count0=#2\advance\count0 by#1 - \advance\count0 by 186 - \musicfnt\char\count0}} +% \def\beamuslope#1#2{{\count0=#2\advance\count0 by#1 +% \advance\count0 by 122 +% \musicfnt\char\count0}} +% \def\beamdslope#1#2{{\count0=#2\advance\count0 by#1 +% \advance\count0 by 186 +% \musicfnt\char\count0}} + +\input fetdefs