From: Jan Nieuwenhuizen Date: Fri, 7 May 2004 19:52:19 +0000 (+0000) Subject: Resurrect sodipodi output. X-Git-Tag: release/2.3.1~12 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=b0bac764ef1cae5908b575dae68696925688b24a;p=lilypond.git Resurrect sodipodi output. --- diff --git a/ChangeLog b/ChangeLog index bcca2259f6..d66a9cc1e4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2004-05-07 Jan Nieuwenhuizen + + * scm/output-sodipodi.scm: Resurrect sodipodi output. + 2004-05-07 Han-Wen Nienhuys * scm/bass-figure.scm (format-bass-figure): don't set diff --git a/buildscripts/mf-to-table.py b/buildscripts/mf-to-table.py index 017bb420b1..3e102d76ad 100644 --- a/buildscripts/mf-to-table.py +++ b/buildscripts/mf-to-table.py @@ -69,6 +69,8 @@ def parse_logfile (fn): tags = string.split(l, '@:') if tags[0] == 'group': group = tags[1] + elif tags[0] == 'puorg': + group = '' elif tags[0] == 'char': name = tags[9] if group: diff --git a/scm/output-ps.scm b/scm/output-ps.scm index 681db24776..1e6fec5ce0 100644 --- a/scm/output-ps.scm +++ b/scm/output-ps.scm @@ -288,8 +288,9 @@ (ly:gulp-file "lilyponddefs.ps") (ly:gulp-file "music-drawing-routines.ps"))) +;; WTF is this in every backend? (define (horizontal-line x1 x2 th) - (draw-line th x1 0 x2 0)) + (draw-line th x1 0 x2 0)) (define (lily-def key val) (let ((prefix "lilypondpaper")) diff --git a/scm/output-sodipodi.scm b/scm/output-sodipodi.scm index 18fcf28f00..954372a18c 100644 --- a/scm/output-sodipodi.scm +++ b/scm/output-sodipodi.scm @@ -72,7 +72,12 @@ ;; Global vars -(define output-scale 1) +;;; Global vars +(define page-count 0) +(define page-number 0) + +;;(define output-scale 2.83464566929134) +(define output-scale (* 2 2.83464566929134)) (define system-y 0) ;; huh? (define urg-line-thickness 0) @@ -86,12 +91,7 @@ ((equal? (ly:unit) "pt") (/ 72.0 72.27)) (else (error "unknown unit" (ly:unit))))) -;; alist containing fontname -> fontcommand assoc (both strings) -;;(define font-name-alist '()) - ;; Helper functions - - (define (tagify tag string . attribute-alist) (string-append "<" tag @@ -233,28 +233,23 @@ `(d . ,(string-append (svg-bezier first #f) (svg-bezier second first-c0)))))) -(define (char i) - (if #t - ;;(tagify "tspan" (format #f "à~2,'0x;" i)) - (tagify "tspan" (ascii->upm-string i)) - (begin - (format #t "can't display char: ~x\n" i) - " "))) +(define (char font i) + (tagify "tspan" + (dispatch `(fontify ,font ,(ascii->upm-string i))))) +(define (nchar font i) + (format (current-error-port) "can't display char: ~x\n" i) + " ") (define (comment s) (string-append "\n")) -(define (define-fonts internal-external-name-mag-pairs) - (comment (format #f "Fonts used: ~S" internal-external-name-mag-pairs))) +(define (define-fonts paper font-list) + (comment (format #f "Fonts used: ~S" font-list))) (define (end-output) "") -;;TODO -;(define (horizontal-line x1 x2 th) -; (draw-line th x1 0 x2 0)) - (define (filledbox breapth width depth height) (round-filled-box breapth width depth height line-thickness)) @@ -267,6 +262,9 @@ ("cmr8" . ,(string-append font-cruft "font-family:cmr;font-style:normal;font-size:8;")) + ("ecrm10" . ,(string-append + font-cruft + "font-family:ecmr;font-style:normal;font-size:10;")) ("feta13" . ,(string-append font-cruft "font-family:LilyPond-Feta;font-style:-Feta;font-size:13;")) @@ -280,25 +278,36 @@ font-cruft "font-family:LilyPond-Parmesan;font-style:-Parmesan;font-size:20;")))) -(define (get-font name-mag-pair) - ;; name-mag-pair: (quote ("feta20" . 0.569055118110236))"feta20"(quote ("feta20" . 0.569055118110236)) - (let ((f (assoc (caadr name-mag-pair) font-alist))) - (if (pair? f) - (cdr f) - (begin - (format #t "font not found: ~s\n" (caadr name-mag-pair)) - (cdr (assoc "feta20" font-alist)))))) +(define (get-font font) + (let* ((name (ly:font-filename font)) + (magnify (ly:font-magnification font))) + ;; name-mag-pair: (quote ("feta20" . 0.569055118110236))"feta20"(quote ("feta20" . 0.569055118110236)) + (let ((font-string (assoc-get name font-alist))) + (if (not font-string) + (begin + (format #t "font not found: ~S\n" font) + (cdr (assoc "feta20" font-alist))) + font-string)))) (define (header-end) (comment "header-end")) -(define (header creator generate) +(define (header creator time-stamp paper page-count- classic?) (string-append xml-header (comment creator) - (comment generate) + (comment time-stamp) svg-header)) +;; FIXME: duplicated in other output backends +;; FIXME: silly interface name +(define (output-scopes paper scopes fields basename) + (format (current-error-port) "TODO: FIX ps/tex/interface\n")) + +;; FIXME: duplictates output-scopes, duplicated in other backends +;; FIXME: silly interface name +(define (output-paper-def pd) + (format (current-error-port) "TODO: FIX ps/tex/interface\n")) (define (lily-def key val) (cond @@ -317,7 +326,10 @@ (define (placebox x y expr) - (tagify "g" (dispatch expr) + (tagify "g" + ;; FIXME -- JCN + ;;(dispatch expr) + expr `(transform . ,(string-append "translate(" @@ -341,29 +353,46 @@ ;; TODO: use height, set scaling? -(define (start-system width height) +(define (start-system origin dim) +;;(define (start-system width height) (let ((y system-y)) - ;;" - (set! system-y (+ system-y height)) - ;;(format #f "" y))) + (set! system-y (+ system-y (cdr dim))) (string-append "\n" (comment "start-system") (format #f "\n" (* output-scale y))))) -(define (stop-system) +(define (stop-system last?) (string-append "\n" (comment "stop-system") "\n")) -(define stop-last-system stop-system) +(define (fontify font expr) + (string-append +;; (tagify "text" (dispatch expr) (cons 'style (get-font font))))) + (tagify "text" expr (cons 'style (get-font font))))) + +(define (utext font s) + (tagify "tspan" + (apply string-appendb + (map (lambda (x) (ascii->upm-string (char->integer x))) + (string->list s))))) -(define (text s) +(define (text font s) + ;; (fontify font ;; to unicode or not? - (if #t - (tagify "tspan" s) - (tagify "tspan" - (apply string-appendb - (map (lambda (x) (ascii->upm-string (char->integer x))) - (string->list s)))))) + (tagify "tspan" (dispatch `(fontify ,font ,s)))) + +(define (start-page) + (set! page-number (+ page-number 1)) + (comment "start-page")) + +(define (stop-page last?) + (comment "stop-page")) + +;; WTF is this in every backend? +(define (horizontal-line x1 x2 th) +;; (draw-line th x1 0 x2 0)) + (filledbox (- x1) (- x2 x1) (* .5 th) (* .5 th))) + diff --git a/scm/output-tex.scm b/scm/output-tex.scm index c8997b78d4..51453320e4 100644 --- a/scm/output-tex.scm +++ b/scm/output-tex.scm @@ -296,8 +296,9 @@ ;; FIXME: still used by lilypond.py for --preview "}%\n%\n\\interscoreline\n%\n")) +;; WTF is this in every backend? (define (horizontal-line x1 x2 th) - (filledbox (- x1) (- x2 x1) (* .5 th) (* .5 th ))) + (filledbox (- x1) (- x2 x1) (* .5 th) (* .5 th))) (define (filledbox breapth width depth height) (if (and #f (defined? 'ps-testing))