(ly:progress "\n\n~A properties, top ~a rounded to ~a\n\n~a"
what count rnd
(string-join
- (map (lambda (x) (format "~30a: ~6@a" (car x) (cdr x)))
+ (map (lambda (x) (format #f "~30a: ~6@a" (car x) (cdr x)))
(ly:truncate-list!
(sort alist prop-stats>?) count))
"\n"))))
(set! private-note-counter (1+ private-note-counter))
(let ((text (ly:engraver-make-grob engraver 'TextScript event)))
(ly:grob-set-property! text 'text
- (format "~a.~a" instance-id
+ (format #f "~a.~a" instance-id
private-note-counter))))))))))
}
}
(set! last-grob-action (assv-set! last-grob-action grob node-id))))
#(define (truncate-value val)
- (let ((val-str (format "~a" val)))
+ (let ((val-str (format #f "~a" val)))
(string-take val-str (min 50 (string-length val-str)))))
#(define (grob-mod grob file line func prop val)
(let* ((val-str (truncate-value val))
- (label (format "~a\\n~a:~a\\n~a <- ~a" (grob-name grob) file line prop val-str)))
+ (label (format #f "~a\\n~a:~a\\n~a <- ~a" (grob-name grob) file line prop val-str)))
(if (relevant? grob file line prop)
(grob-event-node grob label file))))
#(define (grob-cache grob prop callback value)
(let* ((val-str (truncate-value value))
- (label (format "caching ~a.~a\\n~a -> ~a" (grob-name grob) prop callback value)))
+ (label (format #f "caching ~a.~a\\n~a -> ~a" (grob-name grob) prop callback value)))
(if (relevant? grob #f #f prop)
(grob-event-node grob label #f))))
#(define (grob-create grob file line func)
- (let ((label (format "~a\\n~a:~a" (grob-name grob) file line)))
+ (let ((label (format #f "~a\\n~a:~a" (grob-name grob) file line)))
(grob-event-node grob label file)))
#(ly:set-grob-modification-callback grob-mod)
#(if (ly:get-option 'include-settings)
(ly:parser-include-string parser
- (format "\\include \"~a\"" (ly:get-option 'include-settings))))
+ (format #f "\\include \"~a\"" (ly:get-option 'include-settings))))
\maininput
%% there is a problem at the end of the input file
%% 2014 = em dash.
#(ly:export
- (format "Music engraving by LilyPond ~a~awww.lilypond.org"
+ (format #f "Music engraving by LilyPond ~a~awww.lilypond.org"
(lilypond-version)
(ly:wide-char->utf-8 #x2014)
))
(base (dir-basename filename ".ps" ".eps"))
(intermediate (remove (lambda (x) (member x formats)) completed)))
(for-each (lambda (f)
- ((eval (string->symbol (format "convert-to-~a" f))
+ ((eval (string->symbol (format #f "convert-to-~a" f))
module) paper-book filename)) completed)
(if (ly:get-option 'delete-intermediate-files)
(for-each (lambda (f)
;; FIXME
(ly:make-stencil
(list 'embedded-ps
- (format "
+ (format #f "
gsave currentpoint translate
0.1 setlinewidth
~a
}
@end lilypond"
(let*
- ((name (format "arrowheads.~a.~a~a"
+ ((name (format #f "arrowheads.~a.~a~a"
(if filled
"close"
"open")
@end lilypond"
(define (get-glyph-name-candidates dir log style)
(map (lambda (dir-name)
- (format "noteheads.~a~a" dir-name
+ (format #f "noteheads.~a~a" dir-name
(if (and (symbol? style)
(not (equal? 'default style)))
(select-head-glyph style (min log 2))
(page-number (if (list? table)
(assoc-get label table)
#f))
- (page-markup (if page-number (format "~a" page-number) default))
+ (page-markup (if page-number (format #f "~a" page-number) default))
(page-stencil (interpret-markup layout props page-markup))
(gap (- (interval-length x-ext)
(interval-length (ly:stencil-extent page-stencil X)))))
(signature-str
(string-join
- (map (lambda (x) (format "@var{~a} (~a)"
+ (map (lambda (x) (format #f "@var{~a} (~a)"
(car x)
(cadr x)))
(zip arg-names type-names)))))
- (format
+ (format #f
"@item @code{~a}~a~a
@findex ~a
~a
(define-public (identifiers-doc-string)
- (format
+ (format #f
"@table @asis
~a
@end table
(string-append
"@item Set "
- (format "grob-property @code{~a} "
+ (format #f "grob-property @code{~a} "
(string-join (map symbol->string path) " "))
- (format "in @ref{~a} to ~a."
+ (format #f "in @ref{~a} to ~a."
context-sym (scm->texi value))
"\n")))
((equal? (object-property context-sym 'is-grob?) #t) "")
((equal? tag 'assign)
- (format "@item Set translator property @code{~a} to ~a.\n"
+ (format #f "@item Set translator property @code{~a} to ~a.\n"
context-sym
(scm->texi (car args))))
)))
,(list->vector
(map (lambda (tup)
(cons (ly:pt (cdr tup))
- (format "~a-~a ~a"
+ (format #f "~a-~a ~a"
name
(car tup)
(ly:pt (cdr tup)))))
,(list->vector
(map (lambda (size-tup)
(delay (ly:system-font-load
- (format "~a-~a" name (car size-tup)))))
+ (format #f "~a-~a" name (car size-tup)))))
design-size-alist
)))
(fetaBraces ,(ly:pt 20.0)
#(,(delay (ly:system-font-load
- (format "~a-brace" name)))))
+ (format #f "~a-brace" name)))))
)))
(define-public (add-pango-fonts node lily-family family factor)
"Return EPS filename."
(let* ((stencil (car stencil-count-pair))
(number (cdr stencil-count-pair))
- (name (format "~a-~a" basename number)))
+ (name (format #f "~a-~a" basename number)))
(dump-stencil-as-EPS paper stencil name
(ly:get-option 'include-eps-fonts))
(string-append name ".eps")))
;; finally write some auxiliary files if desired
(dump-infinite-stack-EPS stencils)
(postprocess-output book framework-eps-module
- (format "~a.eps" basename) (ly:output-formats))
+ (format #f "~a.eps" basename) (ly:output-formats))
;; individual staves (*-1.eps etc.); only print if more than one stencil
;; Otherwise the .eps and the -1.eps file will be identical and waste space
(if create-aux-files
(let* ((write-file (lambda (str-port ext)
(if create-aux-files
- (let* ((name (format "~a-systems.~a" basename ext))
+ (let* ((name (format #f "~a-systems.~a" basename ext))
(port (open-output-file name)))
(ly:message (_ "Writing ~a...") name)
(display (get-output-string str-port) port)
(count-system-port (open-output-string)))
(for-each (lambda (c)
(if (< 0 c)
- (display (format
+ (format tex-system-port
"\\ifx\\betweenLilyPondSystem \\undefined
\\linebreak
\\else
\\expandafter\\betweenLilyPondSystem{~a}%
\\fi
-" c)
- tex-system-port))
- (display (format "\\includegraphics{~a-~a}%\n"
- basename (1+ c)) tex-system-port)
- (display (format "@image{~a-~a}\n"
- basename (1+ c)) texi-system-port))
+" c))
+ (format tex-system-port "\\includegraphics{~a-~a}%\n"
+ basename (1+ c))
+ (format texi-system-port "@image{~a-~a}\n"
+ basename (1+ c)))
(iota (length stencils)))
(display "@c eof\n" texi-system-port)
(display "% eof\n" tex-system-port)
- (display (format "~a" (length stencils)) count-system-port)
+ (format count-system-port "~a" (length stencils))
(write-file texi-system-port "texi")
(write-file tex-system-port "tex")
;; do this as the last action so we know the rest is complete if
(ly:outputter-dump-string
outputter
(string-append
- (format "%%Page: ~a ~a\n" page-number page-number)
+ (format #f "%%Page: ~a ~a\n" page-number page-number)
"%%BeginPageSetup\n"
(if landscape?
"page-width output-scale lily-output-units mul mul 0 translate 90 rotate\n"
(names (apply append (map extract-names fonts))))
(apply string-append
(map (lambda (f)
- (format
+ (format #f
(if load-fonts?
"%%DocumentSuppliedResources: font ~a\n"
"%%DocumentNeededResources: font ~a\n")
"%%EndComments\n"))
(define (procset file-name)
- (format
+ (format #f
"%%BeginResource: procset (~a) 1 0
~a
%%EndResource
file-name (cached-file-contents file-name)))
(define (embed-document file-name)
- (format "%%BeginDocument: ~a
+ (format #f "%%BeginDocument: ~a
~a
%%EndDocument
"
(define-public (ps-embed-cff body font-set-name version)
(let* ((binary-data
(string-append
- (format "/~a ~s StartData " font-set-name (string-length body))
+ (format #f "/~a ~s StartData " font-set-name (string-length body))
body))
(header
- (format
+ (format #f
"%%BeginResource: font ~a
%!PS-Adobe-3.0 Resource-FontSet
%%DocumentNeededResources: ProcSet (FontSetInit)
(begin
(set! file-name (ly:string-substitute (ly:get-option 'datadir)
"" file-name))
- (format
+ (format #f
"lilypond-datadir (~a) concatstrings (r) file .loadfont\n"
file-name))
- (format "(~a) (r) file .loadfont\n" file-name))
- (format "% cannot find font file: ~a\n" file-name)))
+ (format #f "(~a) (r) file .loadfont\n" file-name))
+ (format #f "% cannot find font file: ~a\n" file-name)))
(let* ((font (car font-name-filename))
(name (cadr font-name-filename))
(cond
((internal-font? file-name)
(ps-load-file (ly:find-file
- (format "~a.otf" file-name))))
+ (format #f "~a.otf" file-name))))
((string? bare-file-name)
(ps-load-file file-name))
(else
(define-public (output-framework basename book scopes fields)
- (let* ((filename (format "~a.ps" basename))
+ (let* ((filename (format #f "~a.ps" basename))
(outputter (ly:make-paper-outputter
;; FIXME: better wrap open/open-file,
;; content-mangling is always bad.
;; FIXME: better wrap open/open-file,
;; content-mangling is always bad.
;; MINGW hack: need to have "b"inary for embedding CFFs
- (open-file (format "~a.eps" filename) "wb")
+ (open-file (format #f "~a.eps" filename) "wb")
'ps))
(port (ly:outputter-port outputter))
(rounded-bbox (to-rounded-bp-box bbox))
(bbox (list (car xext) (car yext)
(cdr xext) (cdr yext)))
(filename (if (< 0 count)
- (format "~a-~a" basename count)
+ (format #f "~a-~a" basename count)
basename)))
(set! count (1+ count))
(dump-stencil-as-EPS-with-bbox paper
(ly:get-option 'include-eps-fonts)
bbox)
(if do-pdf
- (postscript->pdf 0 0 (format "~a.eps" filename)))
+ (postscript->pdf 0 0 (format #f "~a.eps" filename)))
(if do-png
(postscript->png (ly:get-option 'resolution) 0 0
- (format "~a.eps" filename)))))
+ (format #f "~a.eps" filename)))))
extents-system-pairs)))
(define-public (clip-system-EPSes basename paper-book)
(for-each
(lambda (region)
(clip-systems-to-region
- (format "~a-from-~a-to-~a-clip"
+ (format #f "~a-from-~a-to-~a-clip"
basename
(rhythmic-location->file-string (car region))
(rhythmic-location->file-string (cdr region)))
(if (pair? system-list)
(clip-score-systems
(if (> count 0)
- (format "~a-~a" basename count)
+ (format #f "~a-~a" basename count)
basename)
system-list)))
score-system-list)))
(stack-stencils Y DOWN 0.0
(map paper-system-stencil
(reverse to-dump-systems)))
- (format "~a.preview" basename)
+ (format #f "~a.preview" basename)
#t)
(postprocess-output book framework-ps-module
- (format "~a.preview.eps" basename)
+ (format #f "~a.preview.eps" basename)
(cons "png" (ly:output-formats)))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define format ergonomic-simple-format)
(define-public (output-framework basename book scopes fields)
- (let* ((file (open-output-file (format "~a.scm" basename))))
+ (let* ((file (open-output-file (format #f "~a.scm" basename))))
(display ";;Creator: LilyPond\n" file)
(display ";; raw SCM output\n" file)
(define-public (output-framework channel book scopes fields)
(let* ((ctor-arg (if (string? channel)
- (open-output-file (format "~a.socket" channel))
+ (open-output-file (format #f "~a.socket" channel))
channel))
(outputter (ly:make-paper-outputter
ctor-arg
(let* ((system-stencil (paper-system-stencil x))
(x-extent (ly:stencil-extent system-stencil X))
(y-extent (ly:stencil-extent system-stencil Y)))
- (format ctor-arg (ly:format "system ~4l ~4l ~4l ~4l\n"
- (car x-extent) (car y-extent) (cdr x-extent) (cdr y-extent)))
+ (display (ly:format "system ~4l ~4l ~4l ~4l\n"
+ (car x-extent) (car y-extent) (cdr x-extent) (cdr y-extent)) ctor-arg)
(ly:outputter-dump-stencil outputter system-stencil)))
systems)))
(define-public (output-classic-framework channel book scopes fields)
(let* ((ctor-arg (if (string? channel)
- (open-output-file (format "~a.socket" channel))
+ (open-output-file (format #f "~a.socket" channel))
channel))
(outputter (ly:make-paper-outputter
ctor-arg
'socket))
(systems (ly:paper-book-systems book))
(paper (ly:paper-book-paper book)))
- (format ctor-arg (ly:format "paper ~4l\n" (get-page-dimensions paper)))
+ (display (ly:format "paper ~4l\n" (get-page-dimensions paper)) ctor-arg)
(for-each (lambda (x)
(let* ((system-stencil (paper-system-stencil x))
(x-extent (ly:stencil-extent system-stencil X))
(y-extent (ly:stencil-extent system-stencil Y)))
- (format ctor-arg (ly:format "system ~4l ~4l ~4l ~4l\n"
- (car x-extent) (car y-extent) (cdr x-extent) (cdr y-extent)))
+ (display (ly:format "system ~4l ~4l ~4l ~4l\n"
+ (car x-extent) (car y-extent) (cdr x-extent) (cdr y-extent)) ctor-arg)
(ly:outputter-dump-stencil outputter system-stencil)))
systems)))
(module-remove! (ly:outputter-module outputter) 'paper))
(if (ly:get-option 'svg-woff)
(dump (woff-header paper (dirname filename))))
- (dump (comment (format "Page: ~S/~S" page-number page-count)))
+ (dump (comment (format #f "Page: ~S/~S" page-number page-count)))
(ly:outputter-output-scheme outputter
`(begin (set! lily-unit-length ,unit-length)
""))
(page-count (length page-stencils))
(filename "")
(file-suffix (lambda (num)
- (if (= page-count 1) "" (format "-page-~a" num)))))
+ (if (= page-count 1) "" (format #f "-page-~a" num)))))
(for-each
(lambda (page)
(set! page-number (1+ page-number))
- (set! filename (format "~a~a.svg"
+ (set! filename (format #f "~a~a.svg"
basename
(file-suffix page-number)))
(dump-page paper filename page page-number page-count))
(stack-stencils Y DOWN 0.0
(map paper-system-stencil
(reverse to-dump-systems)))
- (format "~a.preview.svg" basename))))
+ (format #f "~a.preview.svg" basename))))
(let ((ns (nodes graph))
(es (edges graph))
(cs (clusters graph)))
- (ly:message (format (_ "Writing graph `~a'...") (port-filename out)))
+ (ly:message (format #f (_ "Writing graph `~a'...") (port-filename out)))
(display "digraph G {\nrankdir=\"LR\"\nnode [shape=rectangle]\n" out)
- (map (lambda (n) (display (format "~a [label=\"~a\"]\n" (car n) (cdr n)) out))
- ns)
- (map (lambda (e) (display (format "~a -> ~a\n" (car e) (cdr e)) out))
- es)
- (map (lambda (c)
- (display (format "subgraph cluster_~a {\nlabel= \"~a\"\ncolor=blue\n"
- (string-filter (car c) char-alphabetic?)
- (car c))
- out)
- (map (lambda (n) (display (format "~a\n" n) out)) (cdr c))
- (display "}\n" out))
- cs)
+ (for-each (lambda (n) (format out "~a [label=\"~a\"]\n" (car n) (cdr n)))
+ ns)
+ (for-each (lambda (e) (format out "~a -> ~a\n" (car e) (cdr e)))
+ es)
+ (for-each (lambda (c)
+ (format out "subgraph cluster_~a {\nlabel= \"~a\"\ncolor=blue\n"
+ (string-filter (car c) char-alphabetic?)
+ (car c))
+ (for-each (lambda (n) (format out "~a\n" n)) (cdr c))
+ (display "}\n" out))
+ cs)
(display "}" out)))
(ly:warning (_ "Error in beam quanting. Expected (~S,~S) found ~S.")
want-l want-r posns)
(set! (ly:grob-property beam 'annotation)
- (format "(~S,~S)" want-l want-r))))
+ (format #f "(~S,~S)" want-l want-r))))
posns))))
(define check-beam-slope-sign
(ly:warning (_ "Error in beam quanting. Expected ~S 0, found ~S.")
(procedure-name comparison) slope-sign)
(set! (ly:grob-property beam 'annotation)
- (format "~S 0" (procedure-name comparison))))
+ (format #f "~S 0" (procedure-name comparison))))
(set! (ly:grob-property beam 'annotation) ""))
posns))))
;; as the key to out internal a-list
(let* ((base-name (get-current-filename parser))
(output-suffix (get-current-suffix parser))
- (alist-key (format "~a~a" base-name output-suffix))
+ (alist-key (format #f "~a~a" base-name output-suffix))
(counter-alist (ly:parser-lookup parser 'counter-alist))
(output-count (assoc-get alist-key counter-alist 0))
(result base-name))
;; Allow all ASCII alphanumerics, including accents
(if (string? output-suffix)
(set! result
- (format "~a-~a"
+ (format #f "~a-~a"
result
(string-regexp-substitute
"[^-[:alnum:]]"
(assoc-get 'total-cells-allocated stats 0))))
(define (dump-profile base last this)
- (let* ((outname (format "~a.profile" (dir-basename base ".ly")))
+ (let* ((outname (format #f "~a.profile" (dir-basename base ".ly")))
(diff (map (lambda (y) (apply - y)) (zip this last))))
(ly:progress "\nWriting timing to ~a..." outname)
(format (open-file outname "w")
".scm"))
(outfile (open-file out-file-name "w")))
(set! gc-dumping #t)
- (display (format "Dumping GC statistics ~a...\n" out-file-name))
- (display (map (lambda (y)
- (let ((x (car y))
- (c (cdr y)))
- (display
- (format "~a (~a) = ~a\n" (object-address x) c x)
- outfile)))
- (filter
- (lambda (x)
- (not (symbol? (car x))))
- protects))
- outfile)
+ (format #t "Dumping GC statistics ~a...\n" out-file-name)
+ (for-each (lambda (y)
+ (let ((x (car y))
+ (c (cdr y)))
+ (format outfile "~a (~a) = ~a\n" (object-address x) c x)))
+ (filter
+ (lambda (x)
+ (not (symbol? (car x))))
+ protects))
(format outfile "\nprotected symbols: ~a\n"
(apply + (map (lambda (obj-count)
(if (symbol? (car obj-count))
(newline outfile)
(let* ((stats (gc-stats)))
(for-each (lambda (sym)
- (display
- (format "~a ~a ~a\n"
- gc-protect-stat-count
- sym
- (assoc-get sym stats "?"))
-
- outfile))
+ (format outfile "~a ~a ~a\n"
+ gc-protect-stat-count
+ sym
+ (assoc-get sym stats "?")))
'(protected-objects bytes-malloced cell-heap-size)))
(set! gc-dumping #f)
(close-port outfile)))
(string-match "^VmData:[ \t]*([0-9]*) kB" l))
lines)))
(mem (string->number (match:substring (car interesting) 1))))
- (display (format "VMDATA: ~a\n" mem))
+ (format #t "VMDATA: ~a\n" mem)
(display (gc-stats))
(if (> mem 100000)
(begin (dump-gc-protects)
(ly:set-option 'log-file "lilypond-multi-run"))
(if (number? joblist)
(begin (ly:set-option
- 'log-file (format "~a-~a"
+ 'log-file (format #f "~a-~a"
(ly:get-option 'log-file) joblist))
(set! files (vector-ref split-todo joblist)))
(begin (ly:progress "\nForking into jobs: ~a\n" joblist)
(lambda (x)
(let* ((job (car x))
(state (cdr x))
- (logfile (format "~a-~a.log"
+ (logfile (format #f "~a-~a.log"
(ly:get-option 'log-file) job))
(log (ly:gulp-file logfile))
(len (string-length log))
(if (status:term-sig state)
(ly:message
"\n\n~a\n"
- (format (_ "job ~a terminated with signal: ~a")
+ (format #f (_ "job ~a terminated with signal: ~a")
job (status:term-sig state)))
(ly:message
(_ "logfile ~a (exit ~a):\n~a")
(ly:exit 1 #f))))))
(if (string-or-symbol? (ly:get-option 'log-file))
- (ly:stderr-redirect (format "~a.log" (ly:get-option 'log-file)) "w"))
+ (ly:stderr-redirect (format #f "~a.log" (ly:get-option 'log-file)) "w"))
(let ((failed (lilypond-all files)))
(if (ly:get-option 'trace-scheme-coverage)
(begin
(ping-log
(if separate-logs
(open-file (if (string-or-symbol? (ly:get-option 'log-file))
- (format "~a.log" (ly:get-option 'log-file))
+ (format #f "~a.log" (ly:get-option 'log-file))
"/dev/stderr") "a") #f))
(do-measurements (ly:get-option 'dump-profile))
(handler (lambda (key failed-file)
(base (dir-basename x ".ly"))
(all-settings (ly:all-options)))
(if separate-logs
- (ly:stderr-redirect (format "~a.log" base) "w"))
+ (ly:stderr-redirect (format #f "~a.log" base) "w"))
(if ping-log
(format ping-log "Processing ~a\n" base))
(if (ly:get-option 'trace-memory-frequency)
(define-public (tuplet-number::calc-fraction-text grob)
(let ((ev (event-cause grob)))
- (format "~a:~a"
+ (format #f "~a:~a"
(ly:event-property ev 'denominator)
(ly:event-property ev 'numerator))))
(den (if denominator denominator (ly:event-property ev 'denominator)))
(num (if numerator numerator (ly:event-property ev 'numerator))))
- (format "~a:~a" den num)))
+ (format #f "~a:~a" den num)))
;; Print a tuplet fraction with note durations appended to the numerator and the
;; denominator
(num (if numerator numerator (ly:event-property ev 'numerator))))
(make-concat-markup (list
- (make-simple-markup (format "~a" den))
+ (make-simple-markup (format #f "~a" den))
(markup #:fontsize -5 #:note denominatornote UP)
(make-simple-markup " : ")
- (make-simple-markup (format "~a" num))
+ (make-simple-markup (format #f "~a" num))
(markup #:fontsize -5 #:note numeratornote UP)))))
;;;
(define (bezier-sandwich lst thick)
- (format "bezier_sandwich ~a [~a]"
+ (format #f "bezier_sandwich ~a [~a]"
thick
(string-append
(string-join (map
(lambda (x)
- (format "(~a,~a)" (car x) (cdr x)))
+ (format #f "(~a,~a)" (car x) (cdr x)))
lst)
","))))
(define (draw-line thick x1 y1 x2 y2)
- (format "drawline ~a ~a ~a ~a ~a"
+ (format #f "drawline ~a ~a ~a ~a ~a"
thick x1 y2 x2 y2))
(define (grob-cause offset grob)
(grob-bbox grob offset)))))
(define (named-glyph font glyph)
- (format "glyphshow ~a \"~a\" ~a \"~a\""
+ (format #f "glyphshow ~a \"~a\" ~a \"~a\""
(ly:font-glyph-name-to-charcode font glyph)
(ly:font-name font)
(modified-font-metric-font-scaling font)
(define (placebox x y s)
(if (not (string-null? s))
- (format "at ~a ~a ~a\n" x y s)
+ (format #f "at ~a ~a ~a\n" x y s)
""))
(define (polygon xy-coords blot do-fill)
- (format "polygon ~a ~a ~a"
+ (format #f "polygon ~a ~a ~a"
blot
(if do-fill "True" "False")
(string-join (map number->string xy-coords))))
(define (round-filled-box breapth width depth height blot-diameter)
- (format "draw_round_box ~a ~a ~a ~a ~a"
+ (format #f "draw_round_box ~a ~a ~a ~a ~a"
breapth width depth height blot-diameter))
(define (utf-8-string descr string)
- (format "utf-8 \"~a\" \"~a\""
+ (format #f "utf-8 \"~a\" \"~a\""
(escape-string descr)
;; don't want unescaped spaces.
(escape-string string)))
(value (cdr x)))
(if (number? value)
(set! value (ly:format "~4f" value)))
- (format " ~s=\"~a\"" attr value)))
+ (format #f " ~s=\"~a\"" attr value)))
attributes-alist)))
(define-public (eo entity . attributes-alist)
"o = open"
- (format "<~S~a>\n" entity (attributes attributes-alist)))
+ (format #f "<~S~a>\n" entity (attributes attributes-alist)))
(define-public (eoc entity . attributes-alist)
"oc = open/close"
- (format "<~S~a/>\n" entity (attributes attributes-alist)))
+ (format #f "<~S~a/>\n" entity (attributes attributes-alist)))
(define-public (ec entity)
"c = close"
- (format "</~S>\n" entity))
+ (format #f "</~S>\n" entity))
(define-public (comment s)
(string-append "<!-- " s " -->\n"))
(define (helper lst)
(if (null? lst)
'()
- (cons (format "~S ~S" (car lst) (- (cadr lst)))
+ (cons (format #f "~S ~S" (car lst) (- (cadr lst)))
(helper (cddr lst)))))
(string-join (helper lst) " "))
(define (dashed-line thick on off dx dy phase)
(draw-line thick 0 0 dx dy
- `(stroke-dasharray . ,(format "~a,~a" on off))))
+ `(stroke-dasharray . ,(format #f "~a,~a" on off))))
(define (draw-line thick x1 y1 x2 y2 . alist)
(apply entity 'line ""
(closepath . z))
"")))
- (cons (format "~a~a" svg-head (number-list->point args))
+ (cons (format #f "~a~a" svg-head (number-list->point args))
(convert-path-exps (drop rest arity))))
'()))
'(fill . "currentColor")))
(define (setcolor r g b)
- (format "<g color=\"rgb(~a%, ~a%, ~a%)\">\n"
+ (format #f "<g color=\"rgb(~a%, ~a%, ~a%)\">\n"
(* 100 r) (* 100 g) (* 100 b)))
;; rotate around given point
(lambda (j)
(module-define!
page-module
- (string->symbol (format "page-~a" j))
+ (string->symbol (format #f "page-~a" j))
(lambda (pg)
(page-property pg j))))
(pixmap-format 'png16m)
(anti-alias-factor 1))
- (let* ((format-str (format "~a" pixmap-format))
+ (let* ((format-str (format #f "~a" pixmap-format))
(extension (cond
((string-contains format-str "png") "png")
((string-contains format-str "jpg") "jpeg")
(else
(ly:error "Unknown pixmap format ~a" pixmap-format))))
(base (dir-basename ps-name ".ps" ".eps"))
- (png1 (format "~a.~a" base extension))
- (pngn (format "~a-page%d.~a" base extension))
+ (png1 (format #f "~a.~a" base extension))
+ (pngn (format #f "~a-page%d.~a" base extension))
(page-count (ps-page-count ps-name))
(multi-page? (> page-count 1))
(output-file (if multi-page? pngn png1))
(if multi-page?
(map
(lambda (n)
- (format "~a-page~a.png" base (1+ n)))
+ (format #f "~a-page~a.png" base (1+ n)))
(iota page-count))
- (list (format "~a.png" base))))
+ (list (format #f "~a.png" base))))
(if (not (= 0 status))
(begin
(markup #:whiteout
#:simple (cond
((interval-empty? extent)
- (format "empty"))
+ "empty")
(is-length
(ly:format "~$" (interval-length extent)))
(else
(define-public (fret-number-tablature-format
context string-number fret-number)
(make-vcenter-markup
- (format "~a" fret-number)))
+ (format #f "~a" fret-number)))
;; The 5-string banjo has got a extra string, the fifth (duh), which
;; starts at the fifth fret on the neck. Frets on the fifth string
(define (run-browser uri)
(system
(if (getenv "BROWSER")
- (format "~a ~a" (getenv "BROWSER") uri)
+ (format #f "~a ~a" (getenv "BROWSER") uri)
(format #f "firefox -remote 'OpenURL(~a,new-tab)'" uri))))
(let* ((ev (event-cause grob))
(den (if denominator denominator (ly:event-property ev 'denominator)))
(num (if numerator numerator (ly:event-property ev 'numerator))))
- (format "~a:~a" den num)))
+ (format #f "~a:~a" den num)))
""",
}