X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Foutput-tex.scm;h=4e43277a6dda7e31d1c269b2e74e8f7d7d9e95b8;hb=33f2e59ea0b2a1ba41e943b5afa29e5fee97ba94;hp=afd15e374f541935fe05f01dd7dfae2ac032f9ca;hpb=aab300b4e582627497ab12f8ea8609f03a3c8d84;p=lilypond.git diff --git a/scm/output-tex.scm b/scm/output-tex.scm index afd15e374f..4e43277a6d 100644 --- a/scm/output-tex.scm +++ b/scm/output-tex.scm @@ -8,7 +8,7 @@ (define-module (scm output-tex) ) -(debug-enable 'backtrace) +; (debug-enable 'backtrace) (use-modules (scm output-ps) (ice-9 regex) (ice-9 string-fun) @@ -28,6 +28,7 @@ (define (tex-encoded-fontswitch name-mag) (let* ((iname-mag (car name-mag)) (ename-mag (cdr name-mag))) + (cons iname-mag (cons ename-mag (string-append "magfont" @@ -35,7 +36,7 @@ (hashq (car ename-mag) 1000000)) "m" (string-encode-integer - (inexact->exact (* 1000 (cdr ename-mag))))))))) + (inexact->exact (round (* 1000 (cdr ename-mag)))))))))) (define (define-fonts internal-external-name-mag-pairs) (set! font-name-alist (map tex-encoded-fontswitch @@ -87,8 +88,8 @@ (define (dot x y radius) (embedded-ps (list 'dot x y radius))) -(define (beam width slope thick) - (embedded-ps (list 'beam width slope thick))) +(define (beam width slope thick blot) + (embedded-ps (list 'beam width slope thick blot))) (define (bracket arch_angle arch_width arch_height height arch_thick thick) (embedded-ps (list 'bracket arch_angle arch_width arch_height height arch_thick thick))) @@ -113,7 +114,7 @@ "\\font\\" command "=" (car name-mag) " scaled " - (ly:number->string (inexact->exact (* 1000 (cdr name-mag)))) + (ly:number->string (inexact->exact (round (* 1000 (cdr name-mag))))) "\n")) (define (ez-ball c l b) @@ -138,20 +139,12 @@ "" ) -(if (or (equal? (minor-version) "4.1") - (equal? (minor-version) "4") - (equal? (minor-version) "3.4")) - (define (embedded-ps expr) - (let ((ps-string - (with-output-to-string - (lambda () (ps-output-expression expr (current-output-port)))))) - (string-append "\\embeddedps{" ps-string "}"))) - (define (embedded-ps expr) - (let - ((os (open-output-string))) - (ps-output-expression expr os) - (string-append "\\embeddedps{" (get-output-string os) "}")))) - +(define (embedded-ps expr) + (let ((ps-string + (with-output-to-string + (lambda () (ps-output-expression expr (current-output-port)))))) + (string-append "\\embeddedps{" ps-string "}"))) + (define (comment s) (string-append "% " s "\n")) @@ -187,7 +180,7 @@ "\\lilypondspecial\n" "\\lilypondpostscript\n")) -;; Note: this string must match the string in ly2dvi.py!!! +;; Note: this string must match the string in lilypond.py!!! (define (header creator generate) (string-append "% Generated automatically by: " creator generate "\n")) @@ -225,9 +218,6 @@ (ly:number->string x) "}{" s "}%\n")) -(define (bezier-bow l thick) - (embedded-ps (list 'bezier-bow `(quote ,l) thick))) - (define (bezier-sandwich l thick) (embedded-ps (list 'bezier-sandwich `(quote ,l) thick))) @@ -246,6 +236,9 @@ (define (stop-last-system) "}%\n") +(define (horizontal-line x1 x2 th) + (filledbox (- x1) (- x2 x1) (* .5 th) (* .5 th ))) + (define (filledbox breapth width depth height) (if (and #f (defined? 'ps-testing)) (embedded-ps @@ -257,8 +250,8 @@ (ly:number->string depth) "}{" (ly:number->string height) "}"))) -(define (roundfilledbox x y width height blotdiam) - (embedded-ps (list 'roundfilledbox x y width height blotdiam))) +(define (round-filled-box x y width height blotdiam) + (embedded-ps (list 'round-filled-box x y width height blotdiam))) (define (text s) (string-append "\\hbox{" (output-tex-string s) "}")) @@ -272,6 +265,7 @@ (define (draw-line thick fx fy tx ty) (embedded-ps (list 'draw-line thick fx fy tx ty))) +;; TODO: this should be a default, which is overriden in PS (define (between-system-string string) string ) @@ -287,7 +281,6 @@ (define (no-origin) "") (define-public (tex-output-expression expr port) - (display (eval expr this-module) port ) - ) + (display (eval expr this-module) port ))