From: Han-Wen Nienhuys Date: Sat, 8 Jan 2005 12:22:24 +0000 (+0000) Subject: * lily/pango-select.cc (symbol_to_pango_variant): init local variable. X-Git-Tag: release/2.5.14~292 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=a5457b887fc91e5a582e6460c9d557a4bb077054;p=lilypond.git * lily/pango-select.cc (symbol_to_pango_variant): init local variable. * Documentation/user/examples.itely (String quartet): uncomment broken example. --- diff --git a/ChangeLog b/ChangeLog index 50f3846903..2d9347f304 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2005-01-08 Han-Wen Nienhuys + + * lily/pango-select.cc (symbol_to_pango_variant): init local variable. + + * Documentation/user/examples.itely (String quartet): uncomment + broken example. + + * lily/font-config.cc: new file. + 2005-01-08 Jan Nieuwenhuizen * scm/output-svg.scm: diff --git a/Documentation/user/examples.itely b/Documentation/user/examples.itely index 2190029fc7..c0226a5b77 100644 --- a/Documentation/user/examples.itely +++ b/Documentation/user/examples.itely @@ -435,7 +435,8 @@ pedal = { This template demonstrates a string quartet. It also uses a @code{\global} section for time and key signatures. -@lilypond[quote,verbatim,raggedright] +@ignore +@li lypond[quote,verbatim,raggedright] version "2.4.0" global= { @@ -481,7 +482,7 @@ Cello = \new Voice { \relative c' { \midi { \tempo 4=60} } @end lilypond - +@end ignore @subsection String quartet parts diff --git a/lily/main.cc b/lily/main.cc index 4e04b8b7b2..46890e593a 100644 --- a/lily/main.cc +++ b/lily/main.cc @@ -126,7 +126,7 @@ static Long_option_init options_static[] = /* Bug in option parser: --output =foe is taken as an abbreviation for --output-format. */ {_i ("EXT"), "backend", 'b', _i ("select back-end to use")}, - {_i ("EXTs"), "format", 'f', _i ("list of formats to dump")}, + {_i ("EXTs"), "formats", 'f', _i ("list of formats to dump")}, {0, "help", 'h', _i ("print this help")}, {_i ("FIELD"), "header", 'H', _i ("write header field to BASENAME.FIELD")}, {_i ("DIR"), "include", 'I', _i ("add DIR to search path")}, diff --git a/lily/pango-select.cc b/lily/pango-select.cc index c1e21965ae..fabc6f6fcb 100644 --- a/lily/pango-select.cc +++ b/lily/pango-select.cc @@ -67,7 +67,7 @@ symbol_to_pango_style (SCM style) PangoStyle pstyle = PANGO_STYLE_NORMAL; if (style == ly_symbol2scm ("italic")) { - pstyle = PANGO_STYLE_NORMAL; + pstyle = PANGO_STYLE_ITALIC; } else if (style == ly_symbol2scm ("oblique") || style == ly_symbol2scm ("slanted") @@ -82,7 +82,7 @@ symbol_to_pango_style (SCM style) PangoVariant symbol_to_pango_variant (SCM variant) { - PangoVariant pvariant; + PangoVariant pvariant = PANGO_VARIANT_NORMAL; if (variant == ly_symbol2scm ("caps")) { pvariant = PANGO_VARIANT_SMALL_CAPS; diff --git a/make/lilypond-vars.make b/make/lilypond-vars.make index 28a312bbd2..3b3b95b5d1 100644 --- a/make/lilypond-vars.make +++ b/make/lilypond-vars.make @@ -38,7 +38,7 @@ CONVERT_LY = $(script-dir)/convert-ly.py LILYPOND = $(builddir)/lily/$(outconfbase)/lilypond LILYPOND_BOOK = $(script-dir)/lilypond-book.py LILYPOND_BOOK_INCLUDES = -I $(pwd) -I $(outdir) -I$(input-dir) -I $(input-dir)/regression/ -I $(input-dir)/test/ -I $(input-dir)/tutorial/ -I $(builddir)/mf/$(outconfbase)/ -I $(builddir)/mf/out/ -LILYPOND_BOOK_FLAGS = --process="lilypond -f tex --tex --header=texidoc -I $(srcdir)/input/test -e '(ly:set-option (quote internal-type-checking) \#t)'" +LILYPOND_BOOK_FLAGS = --process="lilypond --backend tex --formats=tex --header=texidoc -I $(srcdir)/input/test -e '(ly:set-option (quote internal-type-checking) \#t)'" #texi-html for www only: LILYPOND_BOOK_FORMAT=$(if $(subst out-www,,$(notdir $(outdir))),texi,texi-html) diff --git a/scm/framework-scm.scm b/scm/framework-scm.scm index 23fc0c19e9..0d03320712 100644 --- a/scm/framework-scm.scm +++ b/scm/framework-scm.scm @@ -12,19 +12,18 @@ (srfi srfi-13) (lily)) -(define-public (output-framework outputter book scopes fields basename) - (ly:outputter-dump-string outputter ";; raw SCM output\n") +(define-public (output-framework basename book scopes fields ) + (let* + ((file (open-output-file (format "~a.scm" basename)))) + + (display ";; raw SCM output\n" file) (for-each (lambda (page) - (ly:outputter-dump-string - outputter ";;;;;;;;;;;;;;;;;;;;;;;;;;\n;;;PAGE\n") - (ly:outputter-dump-string - outputter - (call-with-output-string - (lambda (port) - (pretty-print (ly:stencil-expr page) port))))) - (ly:paper-book-pages book))) + (display + ";;;;;;;;;;;;;;;;;;;;;;;;;;\n;;;PAGE\n" file) + (pretty-print (ly:stencil-expr page) file)) + (ly:paper-book-pages book)))) (define-public (convert-to-ps . args) #t) diff --git a/scm/framework-texstr.scm b/scm/framework-texstr.scm index 903cd19310..231b1cc1ee 100644 --- a/scm/framework-texstr.scm +++ b/scm/framework-texstr.scm @@ -31,8 +31,11 @@ ") -(define-public (output-classic-framework outputter book scopes fields basename) - (let* ((paper (ly:paper-book-paper book)) +(define-public (output-classic-framework basename book scopes fields) + (let* ((filename (format "~a.texstr" basename)) + (outputter (ly:make-paper-outputter filename + (ly:output-backend))) + (paper (ly:paper-book-paper book)) (lines (ly:paper-book-systems book)) ) (ly:outputter-dump-string outputter (header basename)) @@ -42,8 +45,11 @@ lines) (ly:outputter-dump-string outputter (footer)))) -(define-public (output-framework outputter book scopes fields basename) - (let* ((paper (ly:paper-book-paper book)) +(define-public (output-framework basename book scopes fields ) + (let* ((filename (format "~a.texstr" basename)) + (outputter (ly:make-paper-outputter filename + (ly:output-backend))) + (paper (ly:paper-book-paper book)) (pages (ly:paper-book-pages book)) ) (ly:outputter-dump-string outputter (header basename)) diff --git a/scm/lily.scm b/scm/lily.scm index 5b431730e1..a9d5d15c39 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -47,7 +47,7 @@ (define-public point-and-click #f) (define-public tex-backend? - (memq (ly:output-backend) '("texstr" "tex"))) + (member (ly:output-backend) '("texstr" "tex"))) (define-public parser #f) diff --git a/scm/output-ps.scm b/scm/output-ps.scm index 65ecc55deb..c56fe21a3f 100644 --- a/scm/output-ps.scm +++ b/scm/output-ps.scm @@ -236,36 +236,9 @@ (ly:numbers->string (list x y width height blotdiam)) " draw_round_box")) -(define (old-text font s) - ;; ugh, we should find a better way to - ;; extract the hsbw for /space from the font. - (let* ((space-length (cdar (ly:text-dimension font " "))) - (commands '()) - (add-command (lambda (x) (set! commands (cons x commands))))) - - (string-fold - (lambda (chr word) - "Translate space as into moveto, group the rest in words." - (if (and (< 0 (string-length word)) - (equal? #\space chr)) - (add-command - (string-append "(" (ps-encoding word) ") show\n"))) - - (if (equal? #\space chr) - (add-command (string-append (number->string space-length) - " 0.0 rmoveto "))) - - (if (equal? #\space chr) - "" - (string-append word (make-string 1 chr)))) - "" - (string-append s " ")) - - (string-append - (ps-font-command font) " setfont " - (string-join (reverse commands))))) - -(define (new-text font s) +(define (text font s) +; (ly:warn "TEXT backend-command encountered in Pango backend\nargs: ~a ~a" font str) + (let* ((space-length (cdar (ly:text-dimension font " "))) (space-move (string-append (number->string space-length) " 0.0 rmoveto ")) @@ -284,11 +257,6 @@ (string-append "/" (symbol->string sym) " glyphshow"))) out-vec)))))) -;;(define text old-text) -(define (text font str) - (ly:warn "TEXT backend-command encountered in Pango backend\nargs: ~a ~a" font str) - (new-text font str)) - ;; FIXME: BARF helvetica? (define (white-text scale s) (let ((mystring (string-append diff --git a/scripts/lilypond-book.py b/scripts/lilypond-book.py index 4818437702..65c025feda 100644 --- a/scripts/lilypond-book.py +++ b/scripts/lilypond-book.py @@ -15,7 +15,7 @@ classic lilypond-book: TODO: * ly-options: intertext? * --linewidth? - * eps in latex / eps by lilypond -fps? + * eps in latex / eps by lilypond -b ps? * check latex parameters, twocolumn, multicolumn? * use --png --ps --pdf for making images? @@ -1151,7 +1151,7 @@ def process_snippets (cmd, ly_snippets, texstr_snippets, png_snippets): # it is too generic for lilypond-book. if texstr_names and re.search ('^[0-9A-Za-z/]*lilypond', cmd): - my_system (string.join ([cmd + ' -f texstr ' ] + texstr_names)) + my_system (string.join ([cmd + ' --backend texstr ' ] + texstr_names)) for l in texstr_names: my_system ('latex %s.texstr' % l)