+
+ (define (define-font command fontname scaling)
+ (string-append
+ "/" command " { /" fontname " findfont "
+ (ly:number->string scaling) " output-scale div scalefont } bind def\n"))
+
+ (define (reencode-font raw encoding command)
+ (string-append
+ raw " " encoding " /" command " reencode-font\n"
+ "/" command "{ /" command " findfont 1 scalefont } bind def\n"))
+
+ ;; frobnicate NAME to jibe with external definitions.
+ (define (possibly-mangle-fontname fontname)
+ (cond
+ ((tex-font? fontname)
+ ;; FIXME: we need proper Fontmap for CM fonts, like so:
+ ;; /CMR10 (cmr10.pfb);
+ ;; (string-upcase fontname)
+ (string-append fontname ".pfb"))
+ ((or (equal? (substring fontname 0 4) "feta")
+ (equal? (substring fontname 0 4) "parm"))
+ (regexp-substitute/global
+ #f "(feta|parmesan)([a-z-]*)([0-9]+)"
+ fontname 'pre "GNU-LilyPond-" 1 2 "-" 3 'post))
+ (else fontname)))