]> git.donarmstrong.com Git - lilypond.git/blob - scm/output-texstr.scm
324b5b1fe1abd09eba479e27bdd171474f747c4f
[lilypond.git] / scm / output-texstr.scm
1 ;;;; texstr.scm -- implement Scheme output routines for TeX strings
2 ;;;;
3 ;;;;  source file of the GNU LilyPond music typesetter
4 ;;;; 
5 ;;;; (c) 2004--2008 Han-Wen Nienhuys <hanwen@xs4all.nl>
6
7 (define-module (scm output-texstr))
8 (define this-module (current-module))
9
10 (use-modules
11  (guile)
12  (ice-9 regex)
13  (srfi srfi-13)
14  (scm framework-tex)
15  (lily))
16
17 (define (dummy . foo) #f)
18
19 (map (lambda (x) (module-define! this-module x dummy))
20      (ly:all-stencil-expressions))
21
22 (define-public (grob-cause . x) "")
23 (define-public (no-origin . x) "")
24 (define-public (placebox
25                 x y what)
26   (if (string? what)
27       what
28       ""))
29
30
31 (define-public (text font str)
32   (call-with-output-string
33    (lambda (port)
34      (display (format "\\lilygetmetrics{~a~a}{~a}{1.0}{~a}\n"
35                       
36                       (hash str TEX_STRING_HASHLIMIT)
37                     (ly:font-file-name font)
38                     (ly:font-file-name font)
39                     (sanitize-tex-string str))
40               port)
41      )))