From 4448cec4917ffd202530ff95760bd25733b3ff35 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Tue, 27 May 2003 15:49:27 +0000 Subject: [PATCH] * scripts/as2text.scm: Use rdelim module. (start-system): Rename from start-line. (stop-system): Rename from stop-line. (af-gulp-file): Use string iso symbol for getenv. * scm/output-ascii-script.scm: Add guile and lily modules. (font-name-alist): New variable. (draw-line): New function. * scm/output-lib.scm (func, arg->string): Re-add from archive. (Were these silently removed, without ChangeLog entry?) --- ChangeLog | 14 ++++++++++++++ scm/output-ascii-script.scm | 8 ++++++++ scm/output-lib.scm | 16 +++++++++++++++- scripts/as2text.scm | 15 ++++++++------- 4 files changed, 45 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6a6e0e019f..176fa35907 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2003-05-27 Jan Nieuwenhuizen + + * scripts/as2text.scm: Use rdelim module. + (start-system): Rename from start-line. + (stop-system): Rename from stop-line. + (af-gulp-file): Use string iso symbol for getenv. + + * scm/output-ascii-script.scm: Add guile and lily modules. + (font-name-alist): New variable. + (draw-line): New function. + + * scm/output-lib.scm (func, arg->string): Re-add from archive. + (Were these silently removed, without ChangeLog entry?) + 2003-05-27 Han-Wen Nienhuys * scm/music-functions.scm (make-ottava-set): bugfixes: also diff --git a/scm/output-ascii-script.scm b/scm/output-ascii-script.scm index d938458813..c98c383a35 100644 --- a/scm/output-ascii-script.scm +++ b/scm/output-ascii-script.scm @@ -1,8 +1,13 @@ (define-module (scm output-ascii-script) ) +(use-modules (guile) + (lily)) + (define this-module (current-module)) +(define font-name-alist '()) + (define-public (as-output-expression expr port) (display (eval expr this-module) port) ) @@ -161,6 +166,9 @@ (define (roundfilledbox breapth width depth height blot) (filledbox breapth width depth height)) +(define (draw-line thick x1 y1 x2 y2) + (filledbox 0 (- x2 x1) 0 (- y2 y1))) + (define (font-load-command name-mag command) ;; (display "name-mag: ") ;; (write name-mag) diff --git a/scm/output-lib.scm b/scm/output-lib.scm index 7e0aea7f83..fbc4cfd8ad 100644 --- a/scm/output-lib.scm +++ b/scm/output-lib.scm @@ -94,11 +94,25 @@ molecule-boxer ) +(define-public (arg->string arg) + (cond ((number? arg) (inexact->string arg 10)) + ((string? arg) (string-append "\"" arg "\"")) + ((symbol? arg) (string-append "\"" (symbol->string arg) "\"")))) + +(define-public (func name . args) + (string-append + "(" name + (if (null? args) + "" + (apply string-append + (map (lambda (x) (string-append " " (arg->string x))) args))) + ")\n")) + ;;(define (mm-to-pt x) ;; (* (/ 72.27 25.40) x)) ;; do nothing in .scm output -(define (comment s) "") +(define-public (comment s) "") (define-public (numbers->string l) (apply string-append (map ly:number->string l))) diff --git a/scripts/as2text.scm b/scripts/as2text.scm index 52381cd706..04f3c51e36 100644 --- a/scripts/as2text.scm +++ b/scripts/as2text.scm @@ -9,10 +9,11 @@ ;;;; library funtions (use-modules - (ice-9 debug) - (ice-9 getopt-long) - (ice-9 string-fun) - (ice-9 regex)) + (ice-9 debug) + (ice-9 getopt-long) + (ice-9 string-fun) + (ice-9 rdelim) + (ice-9 regex)) ;;; Script stuff (define program-name "as2text") @@ -167,7 +168,7 @@ Options: (let ((old-load-path %load-path)) (set! %load-path (cons (string-append - (or (getenv 'LILYPONDPREFIX) ".") "/mf") + (or (getenv "LILYPONDPREFIX") ".") "/mf") (cons (string-append lily-home "/mf") %load-path))) (let* ((path (%search-load-path name)) (text (if path @@ -390,7 +391,7 @@ Options: (define (set-line-char c) (set! line-char c)) -(define (start-line height) +(define (start-system width height) (if first-line (begin (set! fonts (cons (cons "default" (generate-default-font)) fonts)) @@ -410,7 +411,7 @@ Options: (set! canvas-height (inexact->exact (* scaling height))) (set! canvas (make-array " " canvas-height canvas-width))) -(define (stop-line) +(define (stop-system) (if first-line (let ((output-file (if (equal? cur-output-name "-") (current-output-port) -- 2.39.5