$(tree-share-prefix)/mf-link-tree link-mf-tree: $(tree-share-prefix)/lilypond-force
-rm -f $(tree-share-prefix)/fonts/otf/* && \
rm -f $(tree-share-prefix)/fonts/svg/* && \
+ rm -f $(tree-share-prefix)/fonts/fonts.conf && \
rm -f $(tree-share-prefix)/fonts/tfm/* && \
rm -f $(tree-share-prefix)/fonts/type1/* && \
cd $(tree-share-prefix)/fonts/otf && \
ln -s ../../../../../../mf/$(outconfbase)/*.otf .
+ -cd $(tree-share-prefix)/fonts/ && \
+ ln -s ../../../../../mf/$(outconfbase)/fonts.conf .
-cd $(tree-share-prefix)/fonts/svg && \
ln -s ../../../../../../mf/$(outconfbase)/*.svg .
-cd $(tree-share-prefix)/fonts/tfm && \
#(display "Invoking inkscape...\n")
%% LD_LIBRARY_PATH is necesssary, otherwise, it doesn't build in GUB.
-#(system (format #f "LD_LIBRARY_PATH= inkscape -T -E ~a-1.eps ~a-1.svg" outname outname))
+#(ly:system (format #f "inkscape -T -E ~a-inkscape.eps ~a-1.svg" outname outname)
+ (cons
+ (format #f "FONTCONFIG_FILE=~a/fonts/fonts.conf" (ly:effective-prefix))
+ (ly:start-environment)))
+
#(set! output-count 0)
#(set-default-paper-size "a5")
\score {
\lyrics {
\markup {
- \epsfile #X #30.0 #(format #f "~a-1.eps" outname)
+ \epsfile #X #30.0 #(format #f "~a-inkscape.eps" outname)
}
- x x x
+ bla bla bla
}
}
}
-default: $(ALL_GEN_FILES) $(outdir)/emmentaler-20.otf tree-regen
+default: $(ALL_GEN_FILES) $(outdir)/emmentaler-20.otf tree-regen $(outdir)/fonts.conf
.PHONY: tree-regen
rm -f mfplain.mem mfplain.log
rm -f *.tfm *.log
+
+## fixme: why is this necessary?
$(outdir)/%.enc.in: %.enc
cp $< $@
+$(outdir)/fonts.conf:
+ echo '<fontconfig><dir>'$(shell cd $(outdir); pwd)'</dir></fontconfig>' > $@
+
$(NCSB_OTFS): $(NCSB_SOURCE_FILES) $(buildscript-dir)/pfx2ttf.fontforge
$(foreach i, $(basename $(NCSB_SOURCE_FILES)), \
$(FONTFORGE) -script $(buildscript-dir)/pfx2ttf.fontforge \
$(i).pfb $(i).afm $(outdir)/ && ) true
+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; backend helpers.
-(define-public (ly:system command)
+(define-public (ly:system command . rest)
(let* ((status 0)
(dev-null "/dev/null")
(silenced (if (or (ly:get-option 'verbose)
(format #f "~a > ~a 2>&1 " command dev-null))))
(if (ly:get-option 'verbose)
(ly:message (_ "Invoking `~a'...") command))
-
- (set! status (system silenced))
+
+ (set! status
+ (if (pair? rest)
+ (system-with-env silenced (car rest))
+ (system silenced)))
+
(if (> status 0)
(begin
(ly:message (_ "`~a' failed (~a)") command status)
;; hmmm. what's the best failure option?
(throw 'ly-file-failed)))))
+(define-public (system-with-env cmd env)
+
+ "Execute CMD in fork, with ENV (a list of strings) as the environment"
+ (let*
+ ;; laziness: should use execle?
+
+ ((pid (primitive-fork)))
+ (if (= 0 pid)
+ ;; child
+ (begin
+ (environ env)
+ (system cmd))
+
+ ;; parent
+ (cdr (waitpid pid)))))
+
(define-public (sanitize-command-option str)
"Kill dubious shell quoting"