]> git.donarmstrong.com Git - lilypond.git/blob - scm/output-texstr.scm
* scm/output-texstr.scm (text): use \lilygetmetrics
[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 Han-Wen Nienhuys <hanwen@cs.uu.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  (lily))
15
16 (define (dummy . foo) #f)
17
18 (map (lambda (x) (module-define! this-module x dummy))
19      (ly:all-stencil-expressions))
20
21 (define-public (grob-cause . x) "")
22 (define-public (no-origin . x) "")
23 (define-public (placebox
24                 x y what)
25   (if (string? what)
26       what
27       ""))
28
29 (define-public (text font str)
30   (call-with-output-string
31    (lambda (port)
32      (display (format "\\lilygetmetrics{~a~a}{~a}{1.0}{~a}\n"
33                     (hash str 10000000)
34                     (ly:font-file-name font)
35                     (ly:font-file-name font)
36                     str) port)
37      )))