From: Jan Nieuwenhuizen Date: Tue, 24 Oct 2000 22:02:06 +0000 (+0200) Subject: patch::: 1.3.98.jcn2 X-Git-Tag: release/1.3.99~1 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=5cbe821608ec464ea8f418cba15f012b9b1cad80;p=lilypond.git patch::: 1.3.98.jcn2 1.3.98.jcn2 =========== * Renamed all occurrences of font-size to font-relative-size * Renamed all occurrences of font-point to font-point-size * Fixed interface.scm descriptions to use symbols iso strings * Fixes for chord names, and added jazz style (James Hammons) --- diff --git a/CHANGES b/CHANGES index a070cb2554..19e9c79e20 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,14 @@ +1.3.98.jcn2 +=========== + +* Renamed all occurrences of font-size to font-relative-size + +* Renamed all occurrences of font-point to font-point-size + +* Fixed interface.scm descriptions to use symbols iso strings + +* Fixes for chord names, and added jazz style (James Hammons) + 1.3.98.jcn1 =========== @@ -7,6 +18,25 @@ * Quick fix for regtest. +1.3.98.hwn2 +=========== + +* Rewrote Scheme side of font-selection. + +* Bugfix: deprecate group-center-element thoroughly. + +* Bugfix: LeftEdge must also have Break_align_item::alignment_callback +X-offset-callback. + +* Add use music property "direction" for storing direction in +Script_req, use music property "text-type" for storing 'dynamic, +'finger, etc. Remove Dynamic_script_req. Resurrect fingerings. + +1.3.98.lec1 +=========== + +* fixed scale-definition.ly for greek mode names. + 1.3.98 ====== diff --git a/Documentation/mail.texi b/Documentation/mail.texi index bd39936d83..e69de29bb2 100644 --- a/Documentation/mail.texi +++ b/Documentation/mail.texi @@ -1,11 +0,0 @@ -\input texinfo @c -*-texinfo-*- -@setfilename mail.info -@settitle mail - -@node Top, , , (dir) -@top - - -The following mailing list have been setup for LilyPond. - -@bye diff --git a/Documentation/topdocs/README.texi b/Documentation/topdocs/README.texi index dc612fb7ee..f1b3d8ded8 100644 --- a/Documentation/topdocs/README.texi +++ b/Documentation/topdocs/README.texi @@ -15,9 +15,13 @@ the GNU Project. LilyPond uses a versioning scheme similar to the Linux kernel. In a version "x.y.z", an even second number 'y' denotes a stable version. -For development versions 'y' is odd. For using straightforward score -production, please use the latest stable version. Development versions -may not produce good or nice scores. +For development versions 'y' is odd. Sh, in theory, version 1.2 is stable, +which means that there are no glaring errors in it. In practice 1.2.x is also +unmaintained. + +1.3.x is in healthy development: lots of problems turn up, but they're +fixed quickly. Therefore we recommend you try 1.2.x, if you have any +problem with it, upgrade to the latest 1.3.x release. @section Requirements @@ -50,8 +54,7 @@ on how to make the HTML documentation. make -C Documentation/user/ dvi @end example -You need a working LilyPond binary to create the DVI sources . - +You need a working LilyPond binary to create the DVI and HTML sources. @item use ASCII. Do using @example @@ -71,8 +74,20 @@ criticism, comments, bugreports, patches, etc., but please, @end example -and @emph{not} to us personally. See @file{Documentation/mail.texi} for -more info. +and @emph{not} to us personally. We have the following mailing lists: + +@itemize @bullet +@item @uref{http://mail.gnu.org/mailman/listinfo/info-gnu-music,info-gnu-music@@gnu.org} +is a low-volume list for information on the GNU Music project. + This list is moderated; ask + @email{drl@@gnu.org, David R. Linn} or + @email{hanwen@@cs.uu.nl, Han-Wen} to send announcements for this list. +@item @uref{http://mail.gnu.org/mailman/listinfo/help-gnu-music,help-gnu-music@@gnu.org} + For help with using LilyPond. +@item @uref{http://mail.gnu.org/mailman/listinfo/bug-gnu-music,bug-gnu-music@@gnu.org} +If you have bugreports, you should send them to this list. +@end itemize + @section Windows 32 diff --git a/VERSION b/VERSION index 6c508bc402..700d0aba6e 100644 --- a/VERSION +++ b/VERSION @@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=3 PATCH_LEVEL=98 -MY_PATCH_LEVEL=jcn1 +MY_PATCH_LEVEL=jcn2 # use the above to send patches: MY_PATCH_LEVEL is always empty for a # released version. diff --git a/buildscripts/tfmtoafm.sh b/buildscripts/tfmtoafm.sh index 42c0bf6ee2..3b4f224822 100755 --- a/buildscripts/tfmtoafm.sh +++ b/buildscripts/tfmtoafm.sh @@ -1,17 +1,19 @@ #!@SHELL@ # tfmtoafm.sh --urg -if [ $# -ne 1 ]; then - echo "Usage: tfmtoafm FONT" +tfm=$1 +font=`basename $1 .tfm` + +if [ $# -ne 1 -o "$tfm" = "$font" ]; then + echo "Usage: tfmtoafm TFM-FILE" echo - echo "example: tfmtoafm cmr10" + echo "example: tfmtoafm cmr10.tfm" exit 2 fi -font=$1 size=`echo $font | sed "s/[^0-9]*//"` -afm=$1.afm -fontfile=`kpsewhich $1.tfm` +afm=$font.afm +fontfile=`kpsewhich $font.tfm` t1=/tmp/tfmtoafm1-$$ t2=/tmp/tfmtoafm2-$$ rm -f $t1 $t2 $font $afm @@ -23,19 +25,22 @@ scaling=`awk -v OFMT='%.5f' '/designsize/ {print $2/'$size/1000} $font` tail -127 $font | cut -f 1-2 > $t1 cat $t1 | cut -d, -f 1-2 > $t2 rm $t1 -nl -ba $t2 | awk -F '[ \t,]+' '{print "C "$2";\t"$3";\tB 0.00 0.00 "$4/'"$scaling"'" "$5/'"$scaling"'";"}' > $t1 +#nl -ba $t2 | awk -F '[ \t,]+' '{print "C "$2";\t"$3";\tB 0.00 0.00 "$4/'"$scaling"'" "$5/'"$scaling"'";"}' > $t1 +nl -ba $t2 | awk -F '[ \t,]+' '{print "C "$2" ; WX 0 ; N "$3" ; B 0.00 0.00 "$4/'"$scaling"'" "$5/'"$scaling"'" ;"}' > $t1 +count=`cat $t1 | wc -l` +count=$((count + 1)) cat > $afm <> $afm +head -1 $t1 | sed -e "s/C 1 ;/C 0 ;/" -e "s/-1 ;/-0 ;/" >> $afm cat $t1 >> $afm cat >> $afm < - \property Voice.NoteHead \pop #'font-size - \property Voice.Stem \pop #'font-size + \property Voice.NoteHead \pop #'font-relative-size + \property Voice.Stem \pop #'font-relative-size \property Voice.Stem \pop #'length - \property Voice.Slur \pop #'font-size + \property Voice.Slur \pop #'font-relative-size \property Score.PaperColumn \pop #'space-factor \property Score.PaperColumn \pop #'to-musical-spacing-factor <)gis'2 e> @@ -440,7 +440,7 @@ lowerDynamics = \context Dynamics=lower \notes{ \consists "Text_engraver"; %GURGURGU, text is initialised using TextScript TextScript \push #'style = #"italic" - %%% TextScript \push #'font-size = #2 + %%% TextScript \push #'font-relative-size = #2 \consists "Skip_req_swallow_translator"; diff --git a/input/scarlatti-properties.ly b/input/scarlatti-properties.ly index 52e9c4fb8a..5584a54521 100644 --- a/input/scarlatti-properties.ly +++ b/input/scarlatti-properties.ly @@ -6,8 +6,8 @@ rh=\property Thread.NoteHead \push #'style = #'default lh=\property Thread.NoteHead \push #'style = #'diamond -n = \property Thread.NoteHead \pop #'font-size % = #'diamond %\property Thread.fontSize=#0 -sm=\property Thread.NoteHead \push #'font-size = #-1 +n = \property Thread.NoteHead \pop #'font-relative-size % = #'diamond %\property Thread.fontSize=#0 +sm=\property Thread.NoteHead \push #'font-relative-size = #-1 % su=\property Voice.verticalDirection=#1 % sd=\property Voice.verticalDirection=#-1 diff --git a/input/test/american-chords.ly b/input/test/american-chords.ly index bc20a85f4c..760ab2ab7d 100644 --- a/input/test/american-chords.ly +++ b/input/test/american-chords.ly @@ -1,4 +1,4 @@ -\version "1.3.96" +\version "1.3.98" %{ See scm/chord-names.scm: chord::names-alist-american James Hammons @@ -15,29 +15,30 @@ chord = \notes\transpose c''\chords{ \property ChordNames.ChordNames \push #'style = #"american" -c -cs:m -df:m5- -c:5^3 -c:4^3 -c:5+ -c:2^3 -c:m5-.7- -c:7+ -c:7.4^3 -c:5+.7 -c:m5-.7 -c:5-.7+ -c:m7+ -c:m7 -c:7 -c:6 -c:m6 -c:9^7 -c:6.9^7 -c:9 -c:7+.9 -c:m7.9 +c % Major triad +cs:m % Minor triad +df:m5- % Diminished triad +c:5^3 % Root-fifth chord +c:4^3 % Suspended fourth triad +c:5+ % Augmented triad +c:2^3 % "2" chord +c:m5-.7- % Diminished seventh +c:7+ % Major seventh +c:7.4^3 % Dominant seventh suspended fourth +c:5+.7 % Augmented dominant seventh +c:m5-.7 % "Half" diminished seventh +c:5-.7 % Dominant seventh flat fifth +c:5-.7+ % Major seventh flat fifth +c:m7+ % Minor-major seventh +c:m7 % Minor seventh +c:7 % Dominant seventh +c:6 % Major sixth +c:m6 % Minor sixth +c:9^7 % Major triad w/added ninth +c:6.9^7 % Six/Nine chord +c:9 % Dominant ninth +c:7+.9 % Major ninth +c:m7.9 % Minor ninth } \score{ @@ -53,5 +54,3 @@ c:m7.9 } } } - -% (((0 . 0) (2 . -1) (4 . 0)) . ("Bar" . ("script" . "Baz"))) diff --git a/input/test/bagpipe.ly b/input/test/bagpipe.ly index e9be547c7a..04a13098be 100644 --- a/input/test/bagpipe.ly +++ b/input/test/bagpipe.ly @@ -12,13 +12,13 @@ \translator { \GraceContext - NoteHead \push #'font-size = #-2 - NoteHead \push #'font-size = #-2 + NoteHead \push #'font-relative-size = #-2 + NoteHead \push #'font-relative-size = #-2 Stem \push #'flag-style = ##f % The following determines the length of stems without beams % default is between 2.8 and 4.0 depending on the number of flags Stem \push #'length = #6 - Stem \push #'font-size = #-2 + Stem \push #'font-relative-size = #-2 GraceAlignItem \push #'horizontal-space = #1 Stem \push #'flag-style = #"" diff --git a/input/test/coriolan-margin.ly b/input/test/coriolan-margin.ly index 865543e8f1..30bb13b080 100644 --- a/input/test/coriolan-margin.ly +++ b/input/test/coriolan-margin.ly @@ -124,13 +124,6 @@ violoncello = \notes \relative c' { \translator { \OrchestralScoreContext timeSignatureStyle = #"C" - % 16 pt - instrumentScriptPadding = #55 %% urg, this is in pt - instrScriptPadding = #35 - % 20pt - %instrumentScriptPadding = #60 %% urg, this is in pt - %instrScriptPadding = #40 - marginScriptHorizontalAlignment = #1 } } } diff --git a/input/test/cue-notes.ly b/input/test/cue-notes.ly index 7dba0a417e..876c5b9307 100644 --- a/input/test/cue-notes.ly +++ b/input/test/cue-notes.ly @@ -4,12 +4,12 @@ CueVoiceContext = \translator { \VoiceContext \name CueVoice; - basicNoteHeadProperties \push #'font-size = #-1 - basicStemProperties \push #'font-size = #-1 - basicBeamProperties \push #'font-size = #-1 - basicTextScriptProperties \push #'font-size = #-1 - basicSlurProperties \push #'font-size = #-1 - basicLocalKeyProperties \push #'font-size = #-1 + basicNoteHeadProperties \push #'font-relative-size = #-1 + basicStemProperties \push #'font-relative-size = #-1 + basicBeamProperties \push #'font-relative-size = #-1 + basicTextScriptProperties \push #'font-relative-size = #-1 + basicSlurProperties \push #'font-relative-size = #-1 + basicLocalKeyProperties \push #'font-relative-size = #-1 }; \translator{ \CueVoiceContext } StaffContext = \translator{\StaffContext diff --git a/input/test/equaliser.ly b/input/test/equaliser.ly index 384ad6606b..2a449f8561 100644 --- a/input/test/equaliser.ly +++ b/input/test/equaliser.ly @@ -135,14 +135,6 @@ violoncello = \notes \relative c' { \translator { \HaraKiriStaffContext } - \translator { - \ScoreContext - %instrumentScriptPadding = #55 %% urg, this is in pt - %instrScriptPadding = #35 - marginScriptHorizontalAlignment = #1 - %marginScriptPadding = #15 - %marginScriptHorizontalAlignment = #0 - } } \midi { \tempo 1 = 60; diff --git a/input/test/fingering.ly b/input/test/fingering.ly new file mode 100644 index 0000000000..8b2bb446c4 --- /dev/null +++ b/input/test/fingering.ly @@ -0,0 +1,7 @@ + + +\score { +\notes \context Voice = VA \relative c'' { + \grace {[b8^1 c^2]} d4^3 +} +\paper {linewidth = -1. ; }} diff --git a/input/test/instrument-name-mmrest.ly b/input/test/instrument-name-mmrest.ly new file mode 100644 index 0000000000..9393f346eb --- /dev/null +++ b/input/test/instrument-name-mmrest.ly @@ -0,0 +1,23 @@ + +%{ + +this combines instrument names and multimeasure rests (there was an +interesting bug in 1.3.98) + +%} + +\version "1.3.97"; +\score{ + \context Staff < + \property Staff.instrument = "instrument" + \property Staff.instr = "instr" + \notes{c''1 \break R1 } + > + \paper { + \translator { \StaffContext + \consists Instrument_name_engraver; + + } + } + } + diff --git a/input/test/jazz-chords.ly b/input/test/jazz-chords.ly index 8bcafc2aea..5c79a485d5 100644 --- a/input/test/jazz-chords.ly +++ b/input/test/jazz-chords.ly @@ -16,8 +16,8 @@ ;(((0 . 0) (2 . -1) (4 . -1) (6 . -2)) . (super "o7")) ;jazz: the delta, see jazz-chords.ly - (((0 . 0) (2 . -1) (4 . -1) (6 . -2)) . (super ((font-family . "math") "N"))) - (((0 . 0) (2 . -1) (4 . -1) (6 . -1)) . (rows ((raise . 1) "o") ((raise . 0.5) ((kern . -0.5) ((font-size . "-3") "/"))) "7")) ; slashed o + (((0 . 0) (2 . -1) (4 . -1) (6 . -2)) . (super ((font-family . math) "N"))) + (((0 . 0) (2 . -1) (4 . -1) (6 . -1)) . (rows ((raise . 1) "o") ((raise . 0.5) ((kern . -0.5) ((font-relative-size . -3) "/"))) "7")) ; slashed o ;(((0 . 0) (2 . -1) (4 . -1) (6 . -1)) . (super "x7")) ; slashed o diff --git a/input/test/markup.ly b/input/test/markup.ly index 9d7703fdf0..6ca28e3d5d 100644 --- a/input/test/markup.ly +++ b/input/test/markup.ly @@ -11,16 +11,16 @@ d-\textscript #'(lines "one" "two" "three") e-\textscript #'(lines (bold "one") - (rows "and" "there" "is" ((font-family . "number") "2")) + (rows "and" "there" "is" ((font-family . number) "2")) (italic "three")) f-\textscript #'(finger "3") - g-\textscript #'(music (named "noteheads-2")) + g-\textscript #'(music (named "noteheads-2" "flags-u3")) } \paper{ linewidth = -1.\mm; \translator{ \ScoreContext - TextScript \push #'font-family = #"roman" + TextScript \push #'font-family = #'roman TextScript \pop #'no-spacing-rods TextScript \push #'direction = #1 } diff --git a/input/test/part-combine-moments.ly b/input/test/part-combine-moments.ly index 79c8ff46d9..8953992bac 100644 --- a/input/test/part-combine-moments.ly +++ b/input/test/part-combine-moments.ly @@ -90,9 +90,6 @@ %% URG: this changes dynamics too %%textStyle = #"italic" timeSignatureStyle = #"C" - instrumentScriptPadding = #60 %% urg, this is in pt - instrScriptPadding = #40 %% urg, this is in pt - marginScriptHorizontalAlignment = #1 maximumRestCount = #1 } } diff --git a/input/test/part-combine-score.ly b/input/test/part-combine-score.ly index 59f4bf94eb..ba9999d04a 100644 --- a/input/test/part-combine-score.ly +++ b/input/test/part-combine-score.ly @@ -169,9 +169,6 @@ %% URG: this changes dynamics too %%textStyle = #"italic" timeSignatureStyle = #"C" - instrumentScriptPadding = #60 %% urg, this is in pt - instrScriptPadding = #40 %% urg, this is in pt - marginScriptHorizontalAlignment = #1 maximumRestCount = #1 } } diff --git a/input/test/part-combine-staff.ly b/input/test/part-combine-staff.ly index 7590a333e0..0e69ad05b4 100644 --- a/input/test/part-combine-staff.ly +++ b/input/test/part-combine-staff.ly @@ -100,9 +100,6 @@ %% URG: this changes dynamics too %%textStyle = #"italic" timeSignatureStyle = #"C" - instrumentScriptPadding = #60 %% urg, this is in pt - instrScriptPadding = #40 %% urg, this is in pt - marginScriptHorizontalAlignment = #1 maximumRestCount = #1 } } diff --git a/input/test/pushproperty.ly b/input/test/pushproperty.ly index c91a964ede..2fb31b21ce 100644 --- a/input/test/pushproperty.ly +++ b/input/test/pushproperty.ly @@ -77,7 +77,7 @@ You can use identifiers, eg. \paper { \translator { \VoiceContext - NoteHead \push #'font-size = #-2 + NoteHead \push #'font-relative-size = #-2 } } } diff --git a/input/test/scales-greek.ly b/input/test/scales-greek.ly new file mode 100644 index 0000000000..37f77a94ce --- /dev/null +++ b/input/test/scales-greek.ly @@ -0,0 +1,42 @@ +\header { + crossRefNumber = "1"; + tagline = "Lily was here 1.3.98 -- automatically converted from ABC"; + title = "Scales"; +} +voicedefault = \notes { +\property Score.defaultBarType="empty" + +\key c \major; c'8 -"major" d'8 e'8 f'8 g'8 a'8 b'8 +c''8 \key c \ionian; c'8 -"ionian" d'8 e'8 f'8 g'8 a'8 +b'8 c''8 \key d \dorian; c'8 -"dorian" d'8 e'8 f'8 g'8 +a'8 b'8 c''8 \key e \phrygian; c'8 -"phrygian" d'8 e'8 f'8 + g'8 a'8 b'8 c''8 \key f \lydian; c'8 -"lydian" d'8 e'8 + f'8 g'8 a'8 b'8 c''8 \key g \mixolydian; c'8 -"mixolydian" + d'8 e'8 f'8 g'8 a'8 b'8 c''8 \key a \minor; c'8 +-"minor" d'8 e'8 f'8 g'8 a'8 b'8 c''8 \key a \aeolian; + c'8 -"aeolian" d'8 e'8 f'8 g'8 a'8 b'8 c''8 +\key b \locrian; c'8 -"locrian" d'8 e'8 f'8 g'8 a'8 b'8 +c''8 \key f \major; c'8 -"major" d'8 e'8 f'8 g'8 a'8 +bes'8 c''8 \key f \ionian; c'8 -"ionian" d'8 e'8 f'8 g'8 + a'8 bes'8 c''8 \key g \dorian; c'8 -"dorian" d'8 e'8 f'8 + g'8 a'8 bes'8 c''8 \key a \phrygian; c'8 -"phrygian" d'8 +e'8 f'8 g'8 a'8 bes'8 c''8 \key bes \lydian; c'8 +-"lydian" d'8 e'8 f'8 g'8 a'8 bes'8 c''8 +\key c \mixolydian; c'8 -"mixolydian" d'8 e'8 f'8 g'8 a'8 +bes'8 c''8 \key d \aeolian; c'8 -"aeolian" d'8 e'8 f'8 g'8 + a'8 bes'8 c''8 \key d \minor; c'8 -"minor" d'8 e'8 f'8 + g'8 a'8 bes'8 c''8 \key e \locrian; c'8 -"locrian" d'8 +e'8 f'8 g'8 a'8 bes'8 c''8 +}\score{ + \notes < + + \context Staff="default" + { + \$voicedefault + } + + > + \paper { + } + \midi {} +} diff --git a/input/test/scales.ly b/input/test/scales.ly index f3f8df7c05..9399edf7b5 100644 --- a/input/test/scales.ly +++ b/input/test/scales.ly @@ -100,10 +100,8 @@ es,, f ges as bes ces d es \key as\minor; - as, bes ces des es fes g as - - - } + as, bes ces des es fes g as} + \paper { } \midi { } } diff --git a/input/trip.ly b/input/trip.ly index f943744f35..a8062f7e62 100644 --- a/input/trip.ly +++ b/input/trip.ly @@ -100,22 +100,22 @@ fugaIIRight = \notes \relative c'' { \context Voice=one { \shiftOff \stemUp - e4 + e4 -5 } \context Voice=two { \shiftOn \stemUp - cis + cis-4 } \context Voice=three { \shiftOnn \stemUp - ais + ais-3 } \context Voice=four { \shiftOnnn \stemUp - fis + fis-2 } > diff --git a/lily/GNUmakefile b/lily/GNUmakefile index e40277fe3c..7f88845376 100644 --- a/lily/GNUmakefile +++ b/lily/GNUmakefile @@ -22,6 +22,6 @@ default: $(outdir)/my-lily-parser.o: $(outdir)/parser.hh $(outdir)/my-lily-lexer.o: $(outdir)/parser.hh $(outdir)/lexer.o: $(outdir)/parser.hh -$(outdir)/lily-version.o: $(outdir)/version.hh -$(outdir)/lily-guile.o: $(outdir)/version.hh +$(outdir)/lily-guile.o: $(outdir)/version.hh +$(outdir)/lily-version.o: $(outdir)/version.hh diff --git a/lily/align-interface.cc b/lily/align-interface.cc index ef4fc214bd..c05787c168 100644 --- a/lily/align-interface.cc +++ b/lily/align-interface.cc @@ -65,8 +65,8 @@ Align_interface::do_side_processing (Score_element * me, Axis a) gh_number_p (gh_car (min_dims)) && gh_number_p (gh_cdr (min_dims))) { - y.unite (Interval (gh_scm2double (gh_car (min_dims)), - gh_scm2double (gh_cdr (min_dims)))); + y.unite (ly_scm2interval (min_dims)); + } SCM extra_dims = e->remove_elt_property ("extra-space"); @@ -94,20 +94,20 @@ Align_interface::do_side_processing (Score_element * me, Axis a) } Real where_f=0; - for (int i=0 ; i < elems.size(); i++) + for (int j=0 ; j < elems.size(); j++) { - Real dy = - stacking_dir * dims[i][-stacking_dir]; - if (i) - dy += stacking_dir * dims[i-1][stacking_dir]; + Real dy = - stacking_dir * dims[j][-stacking_dir]; + if (j) + dy += stacking_dir * dims[j-1][stacking_dir]; - if (i) + if (j) { dy = (dy >? threshold[SMALLER] ) translate_axis (where_f, a); + elems[j]->translate_axis (where_f, a); } } diff --git a/lily/break-align-engraver.cc b/lily/break-align-engraver.cc index b96a117f95..cbc7db0b0d 100644 --- a/lily/break-align-engraver.cc +++ b/lily/break-align-engraver.cc @@ -125,7 +125,7 @@ Break_align_engraver::acknowledge_element (Score_element_info inf) */ edge->set_extent_callback (Score_element::point_dimension_callback_proc, X_AXIS); - align_l_->set_elt_property ("group-center-element", edge->self_scm ()); + align_l_->set_elt_property ("self-alignment-X", edge->self_scm ()); announce_element (edge, 0); column_alist_ = scm_assoc_set_x (column_alist_, edge_sym, edge->self_scm ()); diff --git a/lily/dynamic-engraver.cc b/lily/dynamic-engraver.cc index 0da8f321c6..9befc70458 100644 --- a/lily/dynamic-engraver.cc +++ b/lily/dynamic-engraver.cc @@ -36,7 +36,7 @@ class Dynamic_engraver : public Engraver Spanner * finished_cresc_p_; Spanner * cresc_p_; - Dynamic_script_req* script_req_l_; + Text_script_req* script_req_l_; Span_req * current_cresc_req_; Drul_array accepted_spanreqs_drul_; @@ -90,9 +90,10 @@ Dynamic_engraver::do_post_move_processing () bool Dynamic_engraver::do_try_music (Music * m) { - if (Dynamic_script_req* d = dynamic_cast (m)) + if (dynamic_cast (m) + && m->get_mus_property ("text-type") == ly_symbol2scm ("dynamic")) { - script_req_l_ = d; + script_req_l_ = dynamic_cast (m); return true; } else if (Span_req* s = dynamic_cast (m)) @@ -132,8 +133,9 @@ Dynamic_engraver::do_process_music () Axis_group_interface::set_interface (line_spanner_); Axis_group_interface::set_axes (line_spanner_, Y_AXIS, Y_AXIS); - Request * rq = accepted_spanreqs_drul_[START]; - if (script_req_l_) rq = script_req_l_ ; + Music * rq = accepted_spanreqs_drul_[START]; + if (script_req_l_) + rq = script_req_l_ ; announce_element (line_spanner_, rq); diff --git a/lily/dynamic-performer.cc b/lily/dynamic-performer.cc index 92e53acd49..7818776d04 100644 --- a/lily/dynamic-performer.cc +++ b/lily/dynamic-performer.cc @@ -33,7 +33,7 @@ protected: virtual void do_pre_move_processing (); private: - Dynamic_script_req* script_req_l_; + Music* script_req_l_; Audio_dynamic* audio_p_; }; @@ -133,9 +133,10 @@ Dynamic_performer::do_try_music (Music* r) { if (!script_req_l_) { - if(Dynamic_script_req* d = dynamic_cast (r)) + if( dynamic_cast (r) + && r->get_mus_property ("text-type") == ly_symbol2scm ("dynamic")) { - script_req_l_ = d; + script_req_l_ = r; return true; } } diff --git a/lily/include/musical-request.hh b/lily/include/musical-request.hh index 5fb7299a69..8ecb9a55a2 100644 --- a/lily/include/musical-request.hh +++ b/lily/include/musical-request.hh @@ -72,11 +72,6 @@ protected: virtual bool do_equal_b (Request const*) const; }; -class Dynamic_script_req : public Script_req -{ -protected: - VIRTUAL_COPY_CONS (Music); -}; /// request which has some kind of pitch struct Melodic_req :virtual Request diff --git a/lily/include/request.hh b/lily/include/request.hh index 3792ee507b..31cf4f8cb0 100644 --- a/lily/include/request.hh +++ b/lily/include/request.hh @@ -39,9 +39,8 @@ protected: class Script_req : public virtual Request { public: - Direction dir_; - void set_direction (Direction d ) { dir_ = d; } - Direction get_direction () const { return dir_; } + void set_direction (Direction d); + Direction get_direction () const; VIRTUAL_COPY_CONS(Music); Script_req (); diff --git a/lily/parser.yy b/lily/parser.yy index a0fab22726..fabbc95e57 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -1052,7 +1052,7 @@ request_that_take_dir: request_with_dir: script_dir request_that_take_dir { if (Script_req * gs = dynamic_cast ($2)) - gs->dir_ = Direction ($1); + gs->set_direction (Direction ($1)); else if ($1) $2->origin ()->warning (_ ("Can't specify direction for this request")); $$ = $2; @@ -1065,7 +1065,11 @@ verbose_request: $$->set_spot (THIS->here_input ()); } | DYNAMICSCRIPT embedded_scm { - Dynamic_script_req *d = new Dynamic_script_req; + /* + TODO: junkme, use text-type == dynamic + */ + Text_script_req *d = new Text_script_req; + d->set_mus_property ("text-type" , ly_symbol2scm ("dynamic")); d->set_mus_property ("text", $2); d->set_spot (THIS->here_input ()); $$ = d; @@ -1250,13 +1254,11 @@ gen_text_def: $$ = t; } | DIGIT { - /* - Maybe use Finger_script_request? - */ + String ds = to_str ($1); Text_script_req* t = new Text_script_req; - t->set_mus_property ("text", - gh_cons (ly_symbol2scm ("finger"), - ly_str02scm (to_str ($1).ch_C ()))); + + t->set_mus_property ("text", ly_str02scm (ds.ch_C())); + t->set_mus_property ("text-type" , ly_symbol2scm ("finger")); t->set_spot (THIS->here_input ()); $$ = t; } diff --git a/lily/request.cc b/lily/request.cc index 3b39385c4b..a8db23eec9 100644 --- a/lily/request.cc +++ b/lily/request.cc @@ -28,3 +28,19 @@ Request::Request () { set_mus_property ("type", ly_symbol2scm ("request")); } + +void +Script_req::set_direction (Direction d) +{ + set_mus_property ("direction", gh_int2scm (d)); +} + +Direction +Script_req::get_direction () const +{ + SCM d = get_mus_property ("direction"); + + return (isdir_b (d)) ? to_dir (d) : CENTER; +} + + diff --git a/lily/score-element.cc b/lily/score-element.cc index 6f5f97bd65..b489d29989 100644 --- a/lily/score-element.cc +++ b/lily/score-element.cc @@ -230,7 +230,7 @@ Score_element::lookup_l () const if (!lookup_l_) { Score_element * urg = (Score_element*)this; - SCM sz = urg->remove_elt_property ("font-size"); + SCM sz = urg->remove_elt_property ("font-relative-size"); int i = (gh_number_p (sz)) ? gh_scm2int (sz) : 0; diff --git a/lily/text-engraver.cc b/lily/text-engraver.cc index 2322691825..c18a61f614 100644 --- a/lily/text-engraver.cc +++ b/lily/text-engraver.cc @@ -36,9 +36,10 @@ protected: bool Text_engraver::do_try_music (Music *m) { - if (Text_script_req *r = dynamic_cast (m)) + if (dynamic_cast (m) + && m->get_mus_property ("text-type") != ly_symbol2scm ("dynamic")) { - reqs_.push (r); + reqs_.push (dynamic_cast (m)); return true; } return false; @@ -85,15 +86,11 @@ Text_engraver::do_process_music () // URG: Text vs TextScript String basic = "TextScript"; -#if 0 - // maybe use some sort of TYPE for script/dynamic/finger? - - // separate engraver? - if (r->style_str_== "finger") + if (r->get_mus_property ("text-type") == ly_symbol2scm ("finger")) { basic = "Fingering"; } -#endif + Item *text = new Item (get_property (basic.ch_C ())); /* diff --git a/lily/text-item.cc b/lily/text-item.cc index 160de83d53..b6fa571c60 100644 --- a/lily/text-item.cc +++ b/lily/text-item.cc @@ -58,22 +58,21 @@ Text_item::string2molecule (Score_element *me, SCM text, SCM properties) if (paper == SCM_EOL) paper = scm_string_to_symbol (me->paper_l ()->get_scmvar ("style_sheet")); - SCM font_name; + // should move fallback to scm + SCM font_name = ly_str02scm ("cmr10"); if (gh_pair_p (style)) { SCM f = get_elt_property (me, "style-to-font-name"); - font_name = gh_call2 (f, paper, gh_cdr (style)); + if (gh_procedure_p (f)) + font_name = gh_call2 (f, paper, gh_cdr (style)); } else { SCM f = get_elt_property (me, "properties-to-font-name"); - font_name = gh_call2 (f, paper, properties); + if (gh_procedure_p (f)) + font_name = gh_call2 (f, paper, properties); } - // should move fallback to scm - if (!gh_string_p (font_name)) - font_name = ly_str02scm ("cmr10"); - SCM lookup = scm_assoc (ly_symbol2scm ("lookup"), properties); Molecule mol; diff --git a/ly/engraver.ly b/ly/engraver.ly index 60c71da796..acfd960192 100644 --- a/ly/engraver.ly +++ b/ly/engraver.ly @@ -158,13 +158,13 @@ GraceContext=\translator { Stem \push #'stem-length = #6.0 Stem \push #'direction = #1 - NoteHead \push #'font-size = #-1 - Stem \push #'font-size = #-1 + NoteHead \push #'font-relative-size = #-1 + Stem \push #'font-relative-size = #-1 Stem \push #'stem-shorten = #'(0) - Beam \push #'font-size = #-1 - TextScript \push #'font-size = #-1 - Slur \push #'font-size = #-1 - Accidentals \push #'font-size = #-1 + Beam \push #'font-relative-size = #-1 + TextScript \push #'font-relative-size = #-1 + Slur \push #'font-relative-size = #-1 + Accidentals \push #'font-relative-size = #-1 Beam \push #'thickness = #0.3 Beam \push #'space-function = #(lambda (x) 0.5) diff --git a/ly/italiano.ly b/ly/italiano.ly index 28bbc05995..4df74b22cc 100644 --- a/ly/italiano.ly +++ b/ly/italiano.ly @@ -10,7 +10,7 @@ % contributed by Paolo Zuliani -\notenames #' +\notenames #'( (dobb . ( -1 0 -2 )) (dob . ( -1 0 -1 )) (do . ( -1 0 0 )) diff --git a/ly/scale-definitions.ly b/ly/scale-definitions.ly index 873f58313b..0b48ce633a 100644 --- a/ly/scale-definitions.ly +++ b/ly/scale-definitions.ly @@ -8,8 +8,8 @@ major = #'( (4 . 0) (5 . 0) (6 . 0) - ) + minor = #'( (0 . 0) (1 . 0) @@ -19,14 +19,81 @@ minor = #'( (5 . -1) (6 . -1) ) - - -%{ OUTDATED: someone please fix these -ionian = 0 -locrian = 1 -aeolian = 3 -mixolydian = 5 -lydian = 7 -phrygian = 8 -dorian = 10 -%} + + +ionian = #'( + (0 . 0) + (1 . 0) + (2 . 0) + (3 . 0) + (4 . 0) + (5 . 0) + (6 . 0) + ) + + +locrian = #'( + (0 . 0) + (1 . -1) + (2 . -1) + (3 . 0) + (4 . -1) + (5 . -1) + (6 . -1) + ) + + +aeolian = #'( + (0 . 0) + (1 . 0) + (2 . -1) + (3 . 0) + (4 . 0) + (5 . -1) + (6 . -1) + ) + + +mixolydian = #'( + (0 . 0) + (1 . 0) + (2 . 0) + (3 . 0) + (4 . 0) + (5 . 0) + (6 . -1) + ) + + +lydian = #'( + (0 . 0) + (1 . 0) + (2 . 0) + (3 . 1) + (4 . 0) + (5 . 0) + (6 . 0) + ) + + +phrygian = #'( + (0 . 0) + (1 . -1) + (2 . -1) + (3 . 0) + (4 . 0) + (5 . -1) + (6 . -1) +) + + +dorian = #'( + (0 . 0) + (1 . 0) + (2 . -1) + (3 . 0) + (4 . 0) + (5 . 0) + (6 . -1) + ) + diff --git a/mf/GNUmakefile b/mf/GNUmakefile index 027f47c883..220f84ef34 100644 --- a/mf/GNUmakefile +++ b/mf/GNUmakefile @@ -15,10 +15,15 @@ FET_FILES = $(filter-out $(TEST_FILES),$(wildcard feta[0-9]*.mf)) FONT_FILES = $(filter-out $(TEST_FILES),$(wildcard feta*[0-9].mf)) XPM_FONTS = feta20 feta-nummer10 feta-braces20 +#CM_AFM_FILES = cmr10 + +$(outdir)/cmr10.afm: + -$(BASH) $(buildscripts)/tfmtoafm.sh `kpsewhich cmr10.tfm` + -mv $(@F) $@ LOG_FILES = $(addprefix $(outdir)/, $(FET_FILES:.mf=.log)) TEXTABLES = $(addprefix $(outdir)/, $(FET_FILES:.mf=.tex)) -AFM_FILES = $(addprefix $(outdir)/, $(FET_FILES:.mf=.afm) $(AF_FILES:.af=.afm)) +AFM_FILES = $(addprefix $(outdir)/, $(FET_FILES:.mf=.afm) $(AF_FILES:.af=.afm) $(addsuffix .afm, $(CM_AFM_FILES))) TFM_FILES = $(addprefix $(outdir)/, $(FONT_FILES:.mf=.tfm)) PFA_FILES = $(addprefix $(outdir)/, $(FONT_FILES:.mf=.pfa)) diff --git a/mutopia/Coriolan/coriolan-paper.ly b/mutopia/Coriolan/coriolan-paper.ly index 05808d950c..aec442fd6a 100644 --- a/mutopia/Coriolan/coriolan-paper.ly +++ b/mutopia/Coriolan/coriolan-paper.ly @@ -76,10 +76,6 @@ %% urg: in pt? barNumberScriptPadding = #15 - %% URG: this changes dynamics too - %%textStyle = #"italic" - timeSignatureStyle = #"C" - marginScriptHorizontalAlignment = #1 maximumRestCount = #1 } } diff --git a/scm/chord-names.scm b/scm/chord-names.scm index a0cd520bf9..14b8de6192 100644 --- a/scm/chord-names.scm +++ b/scm/chord-names.scm @@ -89,13 +89,14 @@ ;jazz: the delta, see jazz-chords.ly ;;(((0 . 0) (2 . -1) (4 . -1) (6 . -2)) . (super ((font-family . "math") "N")) ;; slashed o - (((0 . 0) (2 . -1) (4 . -1) (6 . -1)) . (rows ((raise . 1) "o") ((raise . 0.5) ((kern . -0.5) ((font-size . "-3") "/"))) "7")) ; slashed o + (((0 . 0) (2 . -1) (4 . -1) (6 . -1)) . (rows ((raise . 1) "o") ((raise . 0.5) ((kern . -0.5) ((font-relative-size . -3) "/"))) "7")) ; slashed o (((0 . 0) (2 . 0) (4 . 1) (6 . -1)) . ("aug7")) - (((0 . 0) (2 . 0) (4 . -1) (6 . 0)) . (rows "maj7" (music (named ("accidentals--1"))) "5")) + (((0 . 0) (2 . 0) (4 . -1) (6 . 0)) . (rows "maj7" ((font-relative-size . -2) ((raise . 0.2) (music (named "accidentals--1")))) "5")) + (((0 . 0) (2 . 0) (4 . -1) (6 . -1)) . (rows "7" ((font-relative-size . -2) ((raise . 0.2) (music (named "accidentals--1")))) "5")) (((0 . 0) (3 . 0) (4 . 0) (6 . -1)) . ("7sus4")) ;; Common ninth chords (((0 . 0) (2 . 0) (4 . 0) (5 . 0) (1 . 0)) . ("6/9")) ;; we don't want the '/no7' - (((0 . 0) (2 . 0) (4 . 0) (5 . 0)) . ("maj6")) + (((0 . 0) (2 . 0) (4 . 0) (5 . 0)) . ("6")) (((0 . 0) (2 . -1) (4 . 0) (5 . 0)) . ("m6")) (((0 . 0) (2 . 0) (4 . 0) (1 . 0)) . ("add9")) (((0 . 0) (2 . 0) (4 . 0) (6 . 0) (1 . 0)) . ("maj9")) @@ -105,6 +106,29 @@ ) chord::names-alist-american)) +;; Jazz chords, by Atte André Jensen +;; Note: This uses the american list as a base + +(define chord::names-alist-jazz '()) +(set! chord::names-alist-jazz + (append + '( + ; half diminished seventh chord = slashed o + (((0 . 0) (2 . -1) (4 . -1) (6 . -1)) . (("o" (type . "super")) ("/" (size . -2) (offset . (-0.58 . 0.5))) )) + ; diminished seventh chord = o + (((0 . 0) (2 . -1) (4 . -1) (6 . -2)) . (("o" (type . "super")))) + ; major seventh chord = triangle + (((0 . 0) (2 . 0) (4 . 0) (6 . 0)) . ((super ((font-family . "math") "N")) (size . -3))) + ; minor major seventh chord = m triangle + (((0 . 0) (2 . -1) (4 . 0) (6 . 0)) . (("m") ((super ((font-family . math) "N")) (size . -3)))) + ; augmented dominant = +7 + (((0 . 0) (2 . 0) (4 . +1) (6 . -1)) . (super "+7")) + +;; Missing jazz chord definitions go here (note new syntax: see american for hints) + + ) + chord::names-alist-american)) + ;;;;;;;;;; @@ -121,11 +145,11 @@ (list (append '(named) (list - (append '((font-size . "-2")) + (append '((font-relative-size . -2)) + (list (append '((raise . 0.6)) (list (string-append "accidentals-" - (number->string (caddr pitch))))))))))))) - + (number->string (caddr pitch))))))))))))))) (define (step->text pitch) (string-append @@ -320,6 +344,12 @@ (subtractions #f)) (chord::inner-name-banter tonic user-name additions subtractions base-and-inversion))) +;; Jazz style--basically similar to american with minor changes +(define (chord::name-jazz tonic user-name pitches base-and-inversion) + (let ((additions (chord::additions pitches)) + (subtractions #f)) + (chord::inner-name-banter tonic user-name additions subtractions base-and-inversion))) + ;; C++ entry point ;; ;; Check for each subset of chord, full chord first, if there's a diff --git a/scm/element-descriptions.scm b/scm/element-descriptions.scm index 5914a5a9a1..0f4ddf4e38 100644 --- a/scm/element-descriptions.scm +++ b/scm/element-descriptions.scm @@ -42,7 +42,7 @@ (style-to-font-name . ,style-to-font-name) (markup-to-properties . ,markup-to-properties) (font-family . roman) - (font-size . "-1") + (font-relative-size . -1) (meta . ,(element-description "BarNumber" text-interface break-aligned-interface)) )) @@ -94,8 +94,9 @@ (properties-to-font-name . ,properties-to-font-name) (style-to-font-name . ,style-to-font-name) (markup-to-properties . ,markup-to-properties) - (font-size . "0") ;; Hmm, 0 should be the default, maybe?? - (font-family . "roman") + (font-relative-size . 0) + (font-family . roman) + (font-shape . upright) (meta . ,(element-description "ChordNames" chord-name-interface)) )) @@ -153,19 +154,20 @@ (LeftEdge . ( (break-align-symbol . Left_edge_item) + (X-offset-callbacks . (,Break_align_interface::alignment_callback)) (breakable . #t) - (meta . ,(element-description "LeftEdge" break-aligned-interface)) +m (meta . ,(element-description "LeftEdge" break-aligned-interface)) )) (Fingering . ( (molecule-callback . ,Text_item::brew_molecule) + (X-offset-callbacks . (,Side_position::centered_on_parent ,Side_position::aligned_on_self)) (padding . 3.0) (self-alignment-X . 0) - (font-style . dynamic) + (font-style . finger) (properties-to-font-name . ,properties-to-font-name) (style-to-font-name . ,style-to-font-name) (markup-to-properties . ,markup-to-properties) - (meta . ,(element-description "Fingering" finger-interface text-script-interface text-interface side-position-interface)) )) @@ -204,7 +206,7 @@ (properties-to-font-name . ,properties-to-font-name) (style-to-font-name . ,style-to-font-name) (markup-to-properties . ,markup-to-properties) - (font-family . "roman") + (font-family . roman) (meta . ,(element-description "InstrumentName" text-interface break-aligned-interface)) )) @@ -248,7 +250,7 @@ (properties-to-font-name . ,properties-to-font-name) (style-to-font-name . ,style-to-font-name) (markup-to-properties . ,markup-to-properties) - (font-family . "roman") + (font-family . roman) (meta . ,(element-description "LyricText" lyric-syllable-interface text-interface)) )) @@ -299,8 +301,8 @@ (properties-to-font-name . ,properties-to-font-name) (style-to-font-name . ,style-to-font-name) (markup-to-properties . ,markup-to-properties) - (font-family . "roman") - (font-size . "0") + (font-family . roman) + (font-relative-size . 0) (meta . ,(element-description "NoteName" note-name-interface general-element-interface)) @@ -313,7 +315,7 @@ (X-offset-callbacks . (,Side_position::centered_on_parent ,Side_position::aligned_on_self)) (Y-offset-callbacks . (,Side_position::aligned_side)) (molecule-callback . ,Text_item::brew_molecule) - (font-shape . "italic") + (font-shape . italic) (properties-to-font-name . ,properties-to-font-name) (style-to-font-name . ,style-to-font-name) (markup-to-properties . ,markup-to-properties) @@ -396,7 +398,7 @@ (properties-to-font-name . ,properties-to-font-name) (style-to-font-name . ,style-to-font-name) (markup-to-properties . ,markup-to-properties) - (font-family . "roman") + (font-family . roman) (meta . ,(element-description "StanzaNumber" break-aligned-interface text-interface)) )) @@ -413,7 +415,7 @@ (,Side_position::aligned_side ,Side_position::centered_on_parent)) (no-spacing-rods . #t) - (font-shape . "italic") + (font-shape . italic) (properties-to-font-name . ,properties-to-font-name) (style-to-font-name . ,style-to-font-name) (markup-to-properties . ,markup-to-properties) @@ -492,12 +494,12 @@ (properties-to-font-name . ,properties-to-font-name) (style-to-font-name . ,style-to-font-name) (markup-to-properties . ,markup-to-properties) - (font-family . "roman") + (font-family . roman) (meta . ,(element-description "TextScript" text-script-interface text-interface side-position-interface )) )) (TextSpanner . ( (molecule-callback . ,Text_spanner::brew_molecule) - (font-shape . "italic") + (font-shape . italic) (properties-to-font-name . ,properties-to-font-name) (style-to-font-name . ,style-to-font-name) (markup-to-properties . ,markup-to-properties) @@ -543,14 +545,14 @@ (properties-to-font-name . ,properties-to-font-name) (style-to-font-name . ,style-to-font-name) (markup-to-properties . ,markup-to-properties) - (font-shape . "italic") - (meta . ,(element-description "TupletBracket" + (font-shape . italic) + (meta . ,(element-description "TupletBracket" text-interface tuplet-bracket-interface)) )) (UnaChordaPdeal . ( (molecule-callback . ,Text_item::brew_molecule) - (font-shape . "italic") + (font-shape . italic) (properties-to-font-name . ,properties-to-font-name) (style-to-font-name . ,style-to-font-name) (markup-to-properties . ,markup-to-properties) diff --git a/scm/font.scm b/scm/font.scm index 717bddc358..8552faf065 100644 --- a/scm/font.scm +++ b/scm/font.scm @@ -7,91 +7,158 @@ ;;; -;; Corresponding properties: -;; -;; font-series font-shape font-family font-name font-point font-size -;; + (define style-to-font-alist - '( - (finger . "* * number * * -3") - (volta . "* * number * * -2") - (timesig . "* * number * * 0") - (mmrest . "* * number * * 0") - (mark . "* * number * * 1") - (script . "* * roman * * -1") - (large . "* * roman * * 1") - (Large . "bold * roman * * 2") - (dynamic . "bold * dynamic * * 0") - )) + `( + (finger . ((font-family . number) (font-relative-size . -3))) + (volta . ((font-family . number) (font-relative-size . -2))) + (timesig . ((font-family . number) (font-relative-size . 0))) + (mmrest . ((font-family . number) (font-relative-size . -1))) + (mark . ((font-family . number) (font-relative-size . 1))) + (script . ((font-family . roman) (font-relative-size . -1))) + (large . ((font-family . roman) (font-relative-size . 1))) + (Large . ((font-series . bold) (font-family . roman) (font-relative-size . 2))) + (dynamic . ((font-series . bold) (font-family . dynamic) (font-relative-size . 0))) + +)) + +(define (font-field name font-descr) + (list-ref + font-descr + (cond + ((eq? name 'font-relative-size) 0) + ((eq? name 'font-series) 1) + ((eq? name 'font-shape) 2) + ((eq? name 'font-family) 3) + ((eq? name 'font-name) 4) + ((eq? name 'font-point-size-size) 5) + ) + )) + + +;; return that part of LIST for which PRED is true. +(define (filter-list pred? list) + (if (null? list) '() + (let* ( + (rest (filter-list pred? (cdr list))) + ) + (if (pred? (car list)) + (cons (car list) rest) + rest + ) + ) + ) + ) + +;; return those descriptions from FONT-DESCR-LIST whose FIELD-NAME matches VALUE + +;;;;;;;;; TODO TODO . (should not use filtering?) +;; this is bad, since we generate garbage every font-lookup. +;; otoh, if the qualifiers is narrow enough , we don't generate much garbage. +;;o -(define paper20-style-sheet-alist-template + +;;; kut kut, het lukt gewoon niet, vandaag: + +;;;couldn't find font satisfying ((font-family . roman) (font-shape . upright) (font-relative-size . -3)) + + +(define (filter-field field-name value font-descr-alist) + (if (string? value) + (let ((err (current-error-port))) + (display "\nignoring string qualifier: " err) + (display value err) + (display "\n" err) + font-descr-alist) + (filter-list + (lambda (x) (eq? value (font-field field-name (car x)))) + font-descr-alist) + )) + +(define paper20-style-sheet-alist '( - (("medium upright music feta 20" . 0) . "feta20") - (("medium upright music feta 16" . -1) . "feta16") - (("medium upright music feta 13" . -2) . "feta13") - (("medium upright music feta 13" . -3) . "feta11") - (("medium upright music feta 13" . -4) . "feta11") - (("medium upright music feta 23" . 1) . "feta23") - (("medium upright music feta 26" . 2) . "feta26") - (("medium upright braces feta-braces 20" . 0) . "feta-braces20") - (("bold italic dynamic feta-din 14" . 2) . "feta-din14") - (("bold italic dynamic feta-din 13" . 1) . "feta-din13") - (("bold italic dynamic feta-din 12" . 0) . "feta-din12") - (("bold italic dynamic feta-din 10" . -1) . "feta-din10") - (("bold italic dynamic feta-din 8" . -2) . "feta-din8") - (("bold italic dynamic feta-din 7" . -3) . "feta-din7") - (("bold italic dynamic feta-din 6" . -4) . "feta-din6") - (("bold italic dynamic feta-din 5" . -5) . "feta-din5") - (("bold italic dynamic feta-din 4" . -6) . "feta-din4") - ;; Hmm - (("medium upright number feta-nummer 13" . 3) . "feta-nummer14") - (("medium upright number feta-nummer 13" . 2) . "feta-nummer13") - (("medium upright number feta-nummer 12" . 1) . "feta-nummer12") - (("medium upright number feta-nummer 10" . 0) . "feta-nummer10") - (("medium upright number feta-nummer 8" . -1) . "feta-nummer8") - (("medium upright number feta-nummer 7" . -2) . "feta-nummer7") - (("medium upright number feta-nummer 6" . -3) . "feta-nummer6") - (("medium upright number feta-nummer 5" . -4) . "feta-nummer5") - (("medium upright number feta-nummer 4" . -5) . "feta-nummer4") - (("medium upright roman cmr 8" . -3) . "cmr8" ) - (("medium upright roman cmr 8" . -2) . "cmr8" ) - (("medium upright roman cmr 8" . -1) . "cmr8" ) - (("medium upright roman cmr 10" . 0) . "cmr10") - (("medium upright roman cmr 12" . 1) . "cmr12") - (("bold upright roman cmbx 10" . 0) . "cmbx10") - (("bold upright roman cmbx 12" . 1) . "cmbx12") - (("medium italic roman cmbx 10" . 0) . "cmbx10") - (("medium italic roman cmbx 12" . 1) . "cmbx12") - (("medium upright math msam 10" . -3) . "msam10") - (("medium upright math msam 10" . -2) . "msam10") - (("medium upright math msam 10" . -1) . "msam10") - (("medium upright math msam 10" . 0) . "msam10") + ((0 medium upright music feta 20) . "feta20") + ((-1 medium upright music feta 16) . "feta16") + ((-2 medium upright music feta 13) . "feta13") + ((-3 medium upright music feta 13) . "feta11") + ((-4 medium upright music feta 13) . "feta11") + ((1 medium upright music feta 23) . "feta23") + ((2 medium upright music feta 26) . "feta26") + ((0 medium upright braces feta-braces 20) . "feta-braces20") + ((0 medium italic roman cmti 10) . "cmti10") + ((1 medium italic roman cmti 12) . "cmti12") + ((3 bold italic dynamic feta 10) . "feta-din13") + ((2 bold italic dynamic feta 10) . "feta-din13") + ((1 bold italic dynamic feta 10) . "feta-din12") + ((0 bold italic dynamic feta 10) . "feta-din10") + ((-1 bold italic dynamic feta 10) . "feta-din8") + ((-2 bold italic dynamic feta 10) . "feta-din7") + ((-3 bold italic dynamic feta 10) . "feta-din6") + ((-4 bold italic dynamic feta 10) . "feta-din5") + ((-5 bold italic dynamic feta 10) . "feta-din4") + ((3 medium upright number feta-nummer 13) . "feta-nummer13") + ((2 medium upright number feta-nummer 13) . "feta-nummer13") + ((1 medium upright number feta-nummer 12) . "feta-nummer12") + ((0 medium upright number feta-nummer 10) . "feta-nummer10") + ((-1 medium upright number feta-nummer 8) . "feta-nummer8") + ((-2 medium upright number feta-nummer 6) . "feta-nummer6") + ((-3 medium upright number feta-nummer 5) . "feta-nummer5") + ((-4 medium upright number feta-nummer 4) . "feta-nummer4") + ((0 medium upright roman cmr 10) . "cmr10") + ((1 medium upright roman cmr 12) . "cmr12") + ((-1 medium upright roman cmr 8) . "cmr8" ) + ((-2 medium upright roman cmr 7) . "cmr7" ) + ((-3 medium upright roman cmr 6) . "cmr6" ) + ((-4 medium upright roman cmr 5) . "cmr5" ) + ((-5 medium upright roman cmr 4) . "cmr4" ) + ((2 bold upright roman cmbx 10) . "cmbx10") + ((1 bold upright roman cmbx 12) . "cmbx12") + ((-3 medium upright math msam 10) . "msam10") + ((-2 medium upright math msam 10) . "msam10") + ((-1 medium upright math msam 10) . "msam10") + ((0 medium upright math msam 10) . "msam10") )) -(define (style-sheet-template-entry-compile entry size) - (cons - (string-append (caar entry) - " " - (number->string (- (cdar entry) size)) - " ") - (cdr entry))) - + +;; return a FONT-DESCR with relative size incremented by INCREMENT +(define (change-relative-size font-desc increment) + (cons (+ increment (car font-desc)) (cdr font-desc)) + ) + +;; map a function FUNC over the keys of an alist LIST, leaving the vals. +(define (map-alist-keys func list) + (if (null? list) + '() + (cons (cons (func (caar list)) (cdar list)) + (map-alist-keys func (cdr list))) + )) + +;; map a function FUNC over the vals of LIST, leaving the keys. +(define (map-alist-vals func list) + (if (null? list) + '() + (cons (cons (caar list) (func (cdar list))) + (map-alist-vals func (cdr list))) + )) + +(define (change-style-sheet-relative-size sheet x) + (map-alist-keys (lambda (descr) (change-relative-size descr x)) sheet)) + + +;; make style sheet for each paper version. (define style-sheet-alist - `( - (paper11 . ,(map (lambda (x) (style-sheet-template-entry-compile x -3)) - paper20-style-sheet-alist-template)) - (paper13 . ,(map (lambda (x) (style-sheet-template-entry-compile x -2)) - paper20-style-sheet-alist-template)) - (paper16 . ,(map (lambda (x) (style-sheet-template-entry-compile x -1)) - paper20-style-sheet-alist-template)) - (paper20 . ,(map (lambda (x) (style-sheet-template-entry-compile x 0)) - paper20-style-sheet-alist-template)) - (paper23 . ,(map (lambda (x) (style-sheet-template-entry-compile x 1)) - paper20-style-sheet-alist-template)) - (paper26 . ,(map (lambda (x) (style-sheet-template-entry-compile x 2)) - paper20-style-sheet-alist-template)) - )) + (map-alist-vals (lambda (x) (change-style-sheet-relative-size + paper20-style-sheet-alist x)) + '((paper11 . -3) + (paper13 . -2) + (paper16 . -1) + (paper20 . 0) + (paper23 . 1) + (paper26 . 2) + )) + ) + (define (font-regexp-to-font-name paper regexp) (let ((style-sheet (cdr (assoc paper style-sheet-alist)))) @@ -102,31 +169,59 @@ (loop (cdr fonts)) '()))))) +;; reduce the font list by successively applying a font-qualifier. +(define (qualifiers-to-fontname qualifiers font-descr-alist) + (if (null? qualifiers) + (if (null? font-descr-alist) + "" + (cdar font-descr-alist)) ; return the topmost. + + (qualifiers-to-fontname + (cdr qualifiers) + (filter-field (caar qualifiers) (cdar qualifiers) font-descr-alist) + ) + )) + (define (properties-to-font-name paper properties-alist) - (let ((font-regexp (apply string-append - (map (lambda (key) - (string-append - (let ((entry (assoc key properties-alist))) - (if entry (cdr entry) "[^ ]+")) - " ")) - '(font-series font-shape font-family font-name font-point font-size))))) - ;;(display "font-regexp: `") - ;;(display font-regexp) - ;;(display "'\n") - (font-regexp-to-font-name paper font-regexp))) + (let* ( + (fonts (cdr (assoc paper style-sheet-alist))) + + ;; change order to change priorities of qualifiers. + (q-order '(font-name font-family font-series font-shape font-point-size font-relative-size)) + (rawqualifiers (map (lambda (x) (assoc x properties-alist)) + q-order)) + + (qualifiers (filter-list pair? rawqualifiers)) + (fontnm (qualifiers-to-fontname qualifiers fonts)) + (err (current-error-port)) + ) + + (if (eq? fontnm "") + (begin + (display "\ncouldn't find font satisfying " err) + (display qualifiers err) + (display "\n" err) + "cmr10" + ) + fontnm) + + + )) + (define markup-abbrev-to-properties-alist (append '( (rows . ((align . 0))) (lines . ((align . 1))) - (roman . ((font-family . "roman"))) - (music . ((font-family . "music"))) - (bold . ((font-series . "bold"))) - (italic . ((font-shape . "italic"))) + (roman . ((font-family . roman))) + (music . ((font-family . music))) + (finger . ((font-style . finger))) + (bold . ((font-series . bold))) + (italic . ((font-shape . italic))) (named . ((lookup . name))) - (super . ((raise . 1) (font-size . "-1"))) - (sub . ((raise . -1) (font-size . "-1"))) + (super . ((raise . 1) (font-relative-size . -1))) + (sub . ((raise . -1) (font-relative-size . -1))) (text . ((lookup . value))) ) (map (lambda (x) (cons (car x) (cons 'font-style (car x)))) @@ -141,11 +236,32 @@ (let ((entry (assoc markup markup-abbrev-to-properties-alist))) (if entry (cdr entry) (list (cons markup #t)))))) - + +; fixme, how's this supposed to work? +; and why don't we import font-setting from elt? (define (style-to-font-name paper style) (let* ((entry (assoc style style-to-font-alist)) - (font (if entry (cdr entry) "* * * * * *")) - (font-regexp - (regexp-substitute/global #f "\\*" font 'pre "[^ ]+" 'post))) - (font-regexp-to-font-name paper font-regexp))) + (qs (if entry (cdr entry) '())) + (sheet (cdr (assoc paper style-sheet-alist))) + (fontnm (qualifiers-to-fontname qs sheet)) + (err (current-error-port))) + (if (eq? fontnm "") + (begin + (display "\ncouldn't find font satisfying " err) + (display qs err) + (display "\n" err) + "cmr10") + fontnm))) + + + + +; (define (test-module) +; (display (filter-list 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)) +; ) + diff --git a/scm/generic-property.scm b/scm/generic-property.scm index 2903c24d0c..882f083290 100644 --- a/scm/generic-property.scm +++ b/scm/generic-property.scm @@ -155,7 +155,7 @@ (define generic-All-properties (cons 'all - (list (list 'fontSize number? 'font-size)))) + (list (list 'fontSize number? 'font-relative-size)))) (define generic-notehead-properties diff --git a/scm/interface.scm b/scm/interface.scm index 148048df1c..3075f9a626 100644 --- a/scm/interface.scm +++ b/scm/interface.scm @@ -52,7 +52,7 @@ (property-description 'Y-offset-callbacks list? "see X-offset-callbacks") (property-description 'X-extent-callback procedure? "procedure taking an element and axis argument, returning a number-pair. The return value is the extent of the element.") (property-description 'Y-extent-callback procedure? "see X-extent-callback ") - (property-description 'font-size integer? "") + (property-description 'font-relative-size integer? "") (property-description 'extra-offset number-pair? "pair of reals (a cons) forcing an extra offset before outputting") (property-description 'interfaces list? "list of symbols indicating the interfaces supported by this object. Is initialized from the meta field.") (property-description 'dependencies list? "list of score-element pointers that indicate who to compute first for certain global passes") @@ -189,7 +189,12 @@ one end of the stem") (property-description 'side-relative-direction dir? "if set: get the direction from a different object, and multiply by this.") (property-description 'minimum-space number? "minimum distance that the victim should move (after padding)") (property-description 'padding number? "add this much extra space between victim and support") - (property-description 'self-alignment-X number? "real number: -1 = left aligned, 0 = center, 1 right-aligned in X direction. Set to an element pointer, if you want that element to be the center. ") + (property-description 'self-alignment-X number? "real number: -1 = +left aligned, 0 = center, 1 right-aligned in X direction.

Set to +an element pointer, if you want that element to be the center. In +this case, the center element should have this object as a reference +point. +") (property-description 'self-alignment-Y number? "like self-alignment-X but for Y axis") ) @@ -286,13 +291,12 @@ This procedure is called (using dependency resolution) after line breaking. Retu " Order elements top to bottom/left to right/right to left etc." (list (property-description 'stacking-dir dir? "stack contents of elements in which direction ?") - (property-description 'align-dir dir? "Which side to align? -1: left side, 0: centered around center-element if not nil, or around center of width), 1: right side") + (property-description 'align-dir dir? "Which side to align? -1: left side, 0: around center of width, 1: right side") (property-description 'threshold number-pair? "(cons MIN MAX), where MIN and MAX are dimensions in staffspace") (property-description 'alignment-done boolean? "boolean to administrate whether we've done the alignment already (to ensure that the process is done only once)") (property-description 'center-element ly-element? "element which will be at the center of the group after aligning (when using -Align_interface::center_on_element). The center element should have -this object as a reference point.") +Align_interface::center_on_element). ") (property-description 'elements list? "to be aligned elements ") (property-description 'axes list? "list of axis numbers. Should contain only one number.") ))) @@ -425,13 +429,13 @@ The following abbreviations are currently defined:

any font-style
finger volta timesig mmrest mark script large Large dynamic " ) - (property-description 'font-style string? "font definition for a special purpose, one of: finger volta timesig mark script large Large dynamic") - (property-description 'font-series string? "partial font definition: medium, bold") - (property-description 'font-shape string? "partial font definition: upright or italic") - (property-description 'font-family string? "partial font definition: music roman braces dynamic math ...") - (property-description 'font-name string? "partial font definition: base name of font file FIXME: should override other partials") - (property-description 'font-point string? "partial font definition: exact font size in points FIXME: should override font-size") - (property-description 'font-size string? "partial font definition: the relative size, 0 is style-sheet's normal size, -1 is smaller, +1 is bigger") + (property-description 'font-style symbol? "font definition for a special purpose, one of: finger volta timesig mark script large Large dynamic") + (property-description 'font-series symbol? "partial font definition: medium, bold") + (property-description 'font-shape symbol? "partial font definition: upright or italic") + (property-description 'font-family symbol? "partial font definition: music roman braces dynamic math ...") + (property-description 'font-name symbol? "partial font definition: base name of font file FIXME: should override other partials") + (property-description 'font-point-size number? "partial font definition: exact font size in points FIXME: should override font-relative-size") + (property-description 'font-relative-size number? "partial font definition: the relative size, 0 is style-sheet's normal size, -1 is smaller, +1 is bigger") (property-description 'align number? "the alignment of the text, 0 is horizontal, 1 is vertical") (property-description 'lookup symbol? "lookup method: 'value for plain text, 'name for character-name") (property-description 'raise number? "height for text to be raised (a negative value lowers the text") diff --git a/scm/lily.scm b/scm/lily.scm index fd0b407b71..4e34b96bd5 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -14,7 +14,7 @@ ; We should repartition the entire scm side of lily in a ; more sane way, using namesspaces/modules? -;(debug-enable 'backtrace) +(debug-enable 'backtrace) ;;; library funtions diff --git a/scripts/convert-mudela.py b/scripts/convert-mudela.py index 3dfc56f3b5..c6d70e2e4c 100644 --- a/scripts/convert-mudela.py +++ b/scripts/convert-mudela.py @@ -117,7 +117,7 @@ if 1: # need new a namespace sys.stderr.write ('\nNot smart enough to convert \\octave') raise FatalConversionError() - return lines + return str conversions.append ( ((0,1,19), conv, 'deprecated \\octave; can\'t convert automatically')) @@ -148,7 +148,7 @@ if 1: if 1: def conv (str): - return lines + return str conversions.append ( ((1,0,0), conv, '0.1.21 -> 1.0.0 ')) @@ -168,9 +168,9 @@ if 1: if 1: def conv(str): - if re.search ('\\\\header', lines): + if re.search ('\\\\header', str): sys.stderr.write ('\nNot smart enough to convert to new \\header format') - return lines + return str conversions.append ((1,0,2), conv, '\\header { key = concat + with + operator }') @@ -233,7 +233,7 @@ if 1: if 1: def conv(str): - return lines + return str conversions.append ((1,0,12), conv, 'Chord syntax stuff') @@ -541,6 +541,10 @@ if 1: if 1: def conv (str): str = re.sub ('ChordNames*', 'ChordNames', str) + if re.search ('\\\\textscript "[^"]* *"[^"]*"', str): + sys.stderr.write ('\nNot smart enough to convert to new \\textscript markup text') + + str = re.sub ('\\textscript +\("[^"]*"\)', '\\textscript #\1', str) return str