From 671020aabbf0d8d10e1fa5f7e20e33e92df085fc Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Fri, 30 Dec 2005 01:56:57 +0000 Subject: [PATCH] *** empty log message *** --- .cvsignore | 139 +++++++++++++++++++++++++++ ChangeLog | 11 +++ lily/font-config.cc | 27 +++++- lily/main.cc | 2 +- lily/relocate.cc | 4 +- ly/engraver-init.ly | 4 +- ly/property-init.ly | 2 +- scm/auto-beam.scm | 2 +- scm/define-grobs.scm | 60 ++++++------ scm/define-music-display-methods.scm | 18 ++-- scm/define-music-types.scm | 4 +- 11 files changed, 223 insertions(+), 50 deletions(-) diff --git a/.cvsignore b/.cvsignore index 363bf404ee..bb83430d3a 100644 --- a/.cvsignore +++ b/.cvsignore @@ -21,25 +21,164 @@ *~ .gdbinit .htaccess +.lineno +1000.scsm GNUmakefile +System +ab aclocal.m4 +add +aly +arial.pfa autom4te.cache +ay +ay.tar.gz +aybabtu.afm +b +bench.sh +bla +bla.lytex +builddir.make +c.afm +c.pfb +calls +cf2.zip +cffpats +conf32255.sh +config-g16.hh config-g16.make +config-g164.hh +config-g164.make +config-g16nothread.hh +config-g16nothread.make +config-g16opt.hh config-g16opt.make +config-opt.hh config-opt.make +config-optsize.hh +config-optsize.make +config-prof.hh config-prof.make +config-speed.hh +config-speed.make config.hh config.make config.status +configure +cont +cp.out +crashes custom.py +d +dif +example-1.texstr +exp.scm +f.texstr +f.textmetrics +fcc.c +fi.py +fingpats +firefox.icns +fondu3FB3-2 +fondu_src-050825.tgz +fontconfig +fontconfig.c +foo.c +foo.make +glob +grob-array-pats +gsbug-inv +gspatch +gstest +hello +hello.utf +htpasswd install-sh +invstrength +les-nereides.dsc +les-nereides.texstr +les-nereides.textmetrics +lib +lilymydear.zip +lilypond-2.6.0-2.7.0.diff +lilypond-internals.texi +lilypond-tools.zip +log +lppats +lute_archives +m +makefile.pango +makelily.py +mehl +mingw +morgenlied.lpm +morgenlied.texstr +munix +mxlpats +ncsb-ttf +ncsb-ttf.tar.gz +notitle.zip +o2 +ok +optpars.py +optparse.py +optparse.pyc +os +otftest.c out out-g16 +out-g164 +out-g16nothread out-g16opt out-opt +out-optsize out-prof +out-speed out-www +out.ai +out.pfa +out.sk +out.spsc +p +p2 +pango +pango.c patch +patent pats +pic +pl.afm +polyprof +quotpats +re +s +s.py scons.cache +setup.ini +sf.ai +sgz share +sib.py +simple-song.twy +socket-output +stat +string +sys +t +t.gz +t2.c +talk.py +test.py +test.scm +timtekst +ud +uninstalldirs +update-rhsources.sh +us +usr +ver +webdif +wrap.scm +wtk-prof +wtk-prof2 +wtk1-fugue2.scm diff --git a/ChangeLog b/ChangeLog index 8cc4287df1..a3859217cd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2005-12-30 Han-Wen Nienhuys + + * scm/*.scm: use LEFT/RIGHT/UP/DOWN etc. iso. magical numbers. + +2005-12-29 Han-Wen Nienhuys + + * lily/font-config.cc (init_fontconfig): print warning if cache + file is not existant. + + * lily/main.cc: don't use #ifdef but #if + 2005-12-28 Han-Wen Nienhuys * lily/grob-property.cc (internal_set_property): don't abort on diff --git a/lily/font-config.cc b/lily/font-config.cc index b1f08466f3..679bb67e79 100644 --- a/lily/font-config.cc +++ b/lily/font-config.cc @@ -12,10 +12,12 @@ #include #include + #include "file-path.hh" #include "main.hh" #include "warn.hh" + FcConfig *font_config_global = 0; void @@ -24,10 +26,19 @@ init_fontconfig () if (be_verbose_global) message (_ ("Initializing FontConfig...")); - if (!FcInit ()) - error (_ ("initializing FontConfig failed")); + font_config_global = FcInitLoadConfig (); + FcChar8 *cache_file = FcConfigGetCache (font_config_global); - font_config_global = FcConfigGetCurrent (); + /* + This is a terrible kludge, but there is apparently no way for + FontConfig to signal whether it needs to rescan directories. + */ + if (!is_file ((char*)cache_file)) + message (_ ("Rebuilding FontConfig cache; this may take a while...")); + + FcConfigBuildFonts (font_config_global); + FcConfigSetCurrent (font_config_global); + Array dirs; dirs.push (prefix_directory + "/fonts/otf/"); @@ -42,8 +53,18 @@ init_fontconfig () message (_f ("adding font directory: %s", dir.to_str0 ())); } + font_config_global = FcConfigGetCurrent (); + if (be_verbose_global) progress_indication ("\n"); + + if (!is_file ((char*)cache_file)) + { + /* inhibit future messages. */ + FILE *f = fopen ((char*)cache_file, "w"); + fclose (f); + } + } #else diff --git a/lily/main.cc b/lily/main.cc index f97f00a287..a6756fc3ce 100644 --- a/lily/main.cc +++ b/lily/main.cc @@ -87,7 +87,7 @@ bool make_print = true; bool relocate_binary = -#ifdef ARGV0_RELOCATION +#if ARGV0_RELOCATION true; #else false diff --git a/lily/relocate.cc b/lily/relocate.cc index d8efda1a41..0ca4762ead 100644 --- a/lily/relocate.cc +++ b/lily/relocate.cc @@ -113,6 +113,7 @@ set_relocation (String bindir, String prefix) bindtextdomain ("lilypond", localedir.to_str0 ()); #endif + set_env_file ("FONTCONFIG_FILE", sysconfdir + "/fonts/fonts.conf"); #ifdef __MINGW32__ char font_dir[PATH_MAX]; @@ -138,7 +139,8 @@ set_relocation (String bindir, String prefix) set_env_file ("PANGO_RC_FILE", sysconfdir + "/pango/pangorc"); set_env_dir ("PANGO_PREFIX", prefix); - + set_env_dir ("FONTCONFIG_PATH", sysconfdir + "/fonts"); + prepend_env_path ("PATH", bindir); } diff --git a/ly/engraver-init.ly b/ly/engraver-init.ly index b945c759cc..1f8aca50b5 100644 --- a/ly/engraver-init.ly +++ b/ly/engraver-init.ly @@ -560,7 +560,7 @@ AncientRemoveEmptyStaffContext = \context { figuredBassFormatter = #format-bass-figure metronomeMarkFormatter = #format-metronome-markup graceSettings = #`( - (Voice Stem direction 1) + (Voice Stem direction ,UP) (Voice Stem font-size -3) (Voice NoteHead font-size -3) (Voice Dots font-size -3) @@ -569,7 +569,7 @@ AncientRemoveEmptyStaffContext = \context { (Voice Beam thickness 0.384) (Voice Beam length-fraction 0.8) (Voice Accidental font-size -4) - (Voice Slur direction -1) + (Voice Slur direction ,DOWN) ) keepAliveInterfaces = #'(rhythmic-grob-interface lyric-interface percent-repeat-interface) diff --git a/ly/property-init.ly b/ly/property-init.ly index e8bdb855d9..18e3386511 100644 --- a/ly/property-init.ly +++ b/ly/property-init.ly @@ -90,7 +90,7 @@ tupletNeutral = \revert TupletBracket #'direction cadenzaOn = \set Timing.timing = ##f cadenzaOff = { \set Timing.timing = ##t - \set Timing.measurePosition = #(ly:make-moment 0 1) + \set Timing.measurePosition = #ZERO-MOMENT } % dynamic ly:dir? text script, articulation script ly:dir? diff --git a/scm/auto-beam.scm b/scm/auto-beam.scm index d11fb318c3..074494c2ba 100644 --- a/scm/auto-beam.scm +++ b/scm/auto-beam.scm @@ -196,7 +196,7 @@ a fresh copy of the list-head is made." #f (let* ((beat-length (get 'beatLength (ly:make-moment 1 1))) (measure-length (get 'measureLength (ly:make-moment 1 1))) - (measure-pos (get 'measurePosition (ly:make-moment 0 1))) + (measure-pos (get 'measurePosition ZERO-MOMENT)) (settings (get 'autoBeamSettings '())) (function (list (if (= dir START) 'begin 'end))) (num-mom (ly:moment-div measure-length beat-length)) diff --git a/scm/define-grobs.scm b/scm/define-grobs.scm index fbf6239b8b..3970b861a2 100644 --- a/scm/define-grobs.scm +++ b/scm/define-grobs.scm @@ -103,7 +103,7 @@ (font-family . music) (padding . 0.5) (X-offset . ,Side_position_interface::x_aligned_side) - (direction . -1) + (direction . ,LEFT) (cautionary-style . parentheses) (stencil . ,Accidental_interface::print) @@ -138,7 +138,7 @@ (stencil . ,Arpeggio::print) (Y-offset . ,Staff_symbol_referencer::callback) (X-offset . ,Side_position_interface::x_aligned_side) - (direction . -1) + (direction . ,LEFT) (padding . 0.5) (side-axis . ,X) (staff-position . 0.0) @@ -190,7 +190,7 @@ (breakable . #t) (break-visibility . ,begin-of-line-visible) (padding . 1.0) - (direction . 1) + (direction . ,UP) (font-family . roman) (font-size . -2) (Y-offset . ,Side_position_interface::y_aligned_side) @@ -283,7 +283,7 @@ ;; TODO: should be in SLT. (thickness . 0.48) ; in staff-space - (neutral-direction . -1) + (neutral-direction . ,DOWN) ;; Whe have some unreferenced problems here. ;; @@ -462,7 +462,7 @@ (no-spacing-rods . #t) (Y-offset . ,Side_position_interface::y_aligned_side) (X-offset . ,Self_alignment_interface::x_aligned_on_self) - (direction . 1) + (direction . ,UP) (padding . 0.5) (staff-padding . 0.5) (script-priority . 200) @@ -485,7 +485,7 @@ (break-visibility . ,end-of-line-visible) (style . vaticana) - (neutral-direction . -1) + (neutral-direction . ,DOWN) (Y-offset . ,Staff_symbol_referencer::callback) (space-alist . ( (first-note . (minimum-fixed-space . 0.0)) @@ -546,7 +546,7 @@ (font-encoding . fetaNumber) (self-alignment-X . 0) (font-size . -2) - (direction . 1) + (direction . ,UP) (padding . 0.2) (staff-padding . 0.25) (side-axis . ,Y) @@ -565,7 +565,7 @@ (avoid-slur . outside) (slur-padding . 0.3) (minimum-space . 1.2) - (direction . -1) + (direction . ,DOWN) (side-axis . ,Y) (Y-extent . ,Axis_group_interface::height) @@ -718,7 +718,7 @@ (Y-offset . ,Side_position_interface::y_aligned_side) (padding . 0.2) (staff-padding . 0.2) - (direction . -1) + (direction . ,DOWN) (side-axis . ,Y) (bracket-flare . (0.5 . 0.5)) (meta . ((class . Spanner) @@ -734,7 +734,7 @@ ;; This direction is for aligned_on_support_refpoints ;; (?) --hwn - (direction . 0) + (direction . ,CENTER) (space-alist . ( (left-edge . (extra-space . 1.0)))) @@ -862,7 +862,7 @@ (thickness . 1.6) (edge-height . (0.7 . 0.7)) (shorten-pair . (-0.2 . -0.2)) - (direction . 1) + (direction . ,UP) (positions . ,Tuplet_bracket::calc_positions) (stencil . ,Tuplet_bracket::print) @@ -938,7 +938,7 @@ (stencil . ,Measure_grouping::print) (padding . 2) - (direction . 1) + (direction . ,UP) (thickness . 1) (height . 2.0) (staff-padding . 3) @@ -967,7 +967,7 @@ (stencil . ,Text_interface::print) (Y-offset . ,Side_position_interface::y_aligned_side) - (direction . 1) + (direction . ,UP) (padding . 0.8) (side-axis . ,Y) (meta . ((class . Item) @@ -1006,7 +1006,7 @@ (side-axis . ,Y) (self-alignment-X . 0) - (direction . 1) + (direction . ,UP) (padding . 0.4) (staff-padding . 0.4) (font-encoding . fetaNumber) @@ -1027,7 +1027,7 @@ (Y-offset . ,Side_position_interface::y_aligned_side) (self-alignment-X . 0) - (direction . 1) + (direction . ,UP) (padding . 0.2) (staff-padding . 0.25) (meta . ((class . Spanner) @@ -1135,7 +1135,7 @@ (minimum-length . 1.0) (dash-fraction . 0.3) (edge-height . (0 . 1.2)) - (direction . 1) + (direction . ,UP) (meta . ((class . Spanner) (interfaces . (ottava-bracket-interface horizontal-bracket-interface @@ -1216,7 +1216,7 @@ ,(ly:make-simple-closure (list Self_alignment_interface::x_aligned_on_self))))) (Y-offset . ,Side_position_interface::y_aligned_side) (self-alignment-X . 0) - (direction . 1) + (direction . ,UP) (padding . 0.2) (staff-padding . 0.25) (font-size . -2) @@ -1236,7 +1236,7 @@ (style . line) (bound-padding . 1.0) - (direction . -1) + (direction . ,DOWN) (bracket-flare . (0.5 . 0.5)) (edge-height . (1.0 . 1.0)) (shorten-pair . (0.0 . 0.0)) @@ -1257,7 +1257,7 @@ )) (Y-offset . ,Side_position_interface::y_aligned_side) (self-alignment-X . 0) - (direction . 1) + (direction . ,UP) (breakable . #t) (font-size . 2) (baseline-skip . 2) @@ -1455,7 +1455,7 @@ (stencil . ,Text_interface::print) - (direction . 1) + (direction . ,RIGHT) (X-offset . ,Self_alignment_interface::x_aligned_on_self) (no-spacing-rods . #t) (padding . 0.0) ;; padding relative to SostenutoPedalLineSpanner @@ -1477,7 +1477,7 @@ (padding . 1.2) (minimum-space . 1.0) - (direction . -1) + (direction . ,DOWN) (meta . ((class . Spanner) (interfaces . (piano-pedal-interface axis-group-interface @@ -1538,7 +1538,7 @@ ;; default stem direction for note on middle line - (neutral-direction . -1) + (neutral-direction . ,DOWN) ;; We use the normal minima as minimum for the ideal lengths, ;; and the extreme minima as abolute minimum length. @@ -1564,7 +1564,7 @@ (no-spacing-rods . #t) (stencil . ,Sustain_pedal::print) (self-alignment-X . 0) - (direction . 1) + (direction . ,RIGHT) (padding . 0.0) ;; padding relative to SustainPedalLineSpanner (X-offset . ,Self_alignment_interface::x_aligned_on_self) (meta . ((class . Item) @@ -1583,7 +1583,7 @@ (padding . 1.2) (staff-padding . 1.2) (minimum-space . 1.0) - (direction . -1) + (direction . ,DOWN) (meta . ((class . Spanner) (interfaces . (piano-pedal-interface axis-group-interface @@ -1674,7 +1674,7 @@ . ( (no-spacing-rods . #t) (X-offset . ,Self_alignment_interface::x_aligned_on_self) - (direction . -1) + (direction . ,DOWN) ;; sync with Fingering ? (padding . 0.5) @@ -1703,7 +1703,7 @@ (dash-fraction . 0.2) (dash-period . 3.0) (side-axis . ,Y) - (direction . 1) + (direction . ,UP) (meta . ((class . Spanner) (interfaces . (text-spanner-interface side-position-interface @@ -1756,7 +1756,7 @@ (style . trill) (staff-padding . 1.0) (padding . 0.5) - (direction . 1) + (direction . ,UP) (Y-offset . ,Side_position_interface::y_aligned_side) (side-axis . ,Y) (meta . ((class . Spanner) @@ -1841,7 +1841,7 @@ (font-shape . italic) (no-spacing-rods . #t) (self-alignment-X . 0) - (direction . 1) + (direction . ,RIGHT) (padding . 0.0) ;; padding relative to UnaCordaPedalLineSpanner (X-offset . ,Self_alignment_interface::x_aligned_on_self) (meta . ((class . Item) @@ -1858,7 +1858,7 @@ (padding . 1.2) (staff-padding . 1.2) (minimum-space . 1.0) - (direction . -1) + (direction . ,DOWN) (meta . ((class . Spanner) (interfaces . (piano-pedal-interface axis-group-interface @@ -1899,7 +1899,7 @@ . ( (breakable . #t) (Y-offset . ,Side_position_interface::y_aligned_on_support_refpoints) - (direction . 0) + (direction . ,CENTER) (space-alist . ((left-edge . (extra-space . 1.0)))) (break-align-symbol . instrument-name) (stencil . ,Text_interface::print) diff --git a/scm/define-music-display-methods.scm b/scm/define-music-display-methods.scm index 72ebbe9445..202a56c53f 100644 --- a/scm/define-music-display-methods.scm +++ b/scm/define-music-display-methods.scm @@ -170,10 +170,10 @@ (define* (event-direction->lily-string event #:optional (required #t)) (let ((direction (ly:music-property event 'direction))) - (cond ((or (not direction) (null? direction) (= 0 direction)) + (cond ((or (not direction) (null? direction) (= CENTER direction)) (if required "-" "")) - ((= 1 direction) "^") - ((= -1 direction) "_") + ((= UP direction) "^") + ((= DOWN direction) "_") (else "")))) (define-macro (define-post-event-display-method type vars direction-required str) @@ -186,7 +186,7 @@ `(define-display-method ,type ,vars (format #f "~a~a" (event-direction->lily-string ,(car vars) ,direction-required) - (if (= -1 (ly:music-property ,(car vars) 'span-direction)) + (if (= START (ly:music-property ,(car vars) 'span-direction)) ,str-start ,str-stop)))) @@ -281,7 +281,7 @@ duration (ly:make-duration 0 0 0 1)) (music 'SlurEvent - span-direction -1)))))) + span-direction START)))))) #t) (with-music-match (?stop (music 'SequentialMusic @@ -292,7 +292,7 @@ duration (ly:make-duration 0 0 0 1)) (music 'SlurEvent - span-direction 1)))))) + span-direction STOP)))))) (format #f "\\appoggiatura ~a" (music->lily-string ?music)))))) @@ -316,7 +316,7 @@ duration (ly:make-duration 0 0 0 1)) (music 'SlurEvent - span-direction -1))) + span-direction START))) (music 'ContextSpeccedMusic element (music @@ -340,7 +340,7 @@ duration (ly:make-duration 0 0 0 1)) (music 'SlurEvent - span-direction 1)))))) + span-direction STOP)))))) (format #f "\\acciaccatura ~a" (music->lily-string ?music)))))) (define-extra-display-method GraceMusic (expr) @@ -578,7 +578,7 @@ Otherwise, return #f." "\\\\") (define-display-method LigatureEvent (ligature) - (if (= -1 (ly:music-property ligature 'span-direction)) + (if (= START (ly:music-property ligature 'span-direction)) "\\[" "\\]")) diff --git a/scm/define-music-types.scm b/scm/define-music-types.scm index 383d42b4a9..e5272032ff 100644 --- a/scm/define-music-types.scm +++ b/scm/define-music-types.scm @@ -192,7 +192,7 @@ Syntax: @var{note}\\cr . ( (description . "Interpret the argument as grace notes. ") (start-callback . ,Grace_music::start_callback) - (length . ,(ly:make-moment 0 1)) + (length . ,ZERO-MOMENT) (iterator-ctor . ,Grace_iterator::constructor) (types . (grace-music music-wrapper-music general-music)) )) @@ -253,7 +253,7 @@ Syntax @var{\\oldaddlyrics }@var{music} @var{lyrics}.") (description . "Align lyrics to the start of notes. Syntax @var{\\lyricsto }@var{voicename} @var{lyrics}.") - (length . ,(ly:make-moment 0 1)) + (length . ,ZERO-MOMENT) (types . (general-music lyric-combine-music)) (iterator-ctor . ,Lyric_combine_music_iterator::constructor) )) -- 2.39.2