X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Foutput-texstr.scm;h=324b5b1fe1abd09eba479e27bdd171474f747c4f;hb=5b4b0d6e9a197e8f9eb085b7c2ad78b8be3e5cfc;hp=54fd4f067e9ed102ff3d9bc5a019ab6f83cf6acc;hpb=c2f07cdcb1aa36338ebe0b88f52bc042e95e31d4;p=lilypond.git diff --git a/scm/output-texstr.scm b/scm/output-texstr.scm index 54fd4f067e..324b5b1fe1 100644 --- a/scm/output-texstr.scm +++ b/scm/output-texstr.scm @@ -1,3 +1,8 @@ +;;;; texstr.scm -- implement Scheme output routines for TeX strings +;;;; +;;;; source file of the GNU LilyPond music typesetter +;;;; +;;;; (c) 2004--2008 Han-Wen Nienhuys (define-module (scm output-texstr)) (define this-module (current-module)) @@ -6,9 +11,9 @@ (guile) (ice-9 regex) (srfi srfi-13) + (scm framework-tex) (lily)) - (define (dummy . foo) #f) (map (lambda (x) (module-define! this-module x dummy)) @@ -21,12 +26,16 @@ (if (string? what) what "")) - -(define-public (text font s) + + +(define-public (text font str) (call-with-output-string (lambda (port) - (write (list - (ly:font-file-name font) - (ly:font-magnification font) - s) port) - (newline port)))) + (display (format "\\lilygetmetrics{~a~a}{~a}{1.0}{~a}\n" + + (hash str TEX_STRING_HASHLIMIT) + (ly:font-file-name font) + (ly:font-file-name font) + (sanitize-tex-string str)) + port) + )))