]> git.donarmstrong.com Git - lilypond.git/commitdiff
* ly/generate-embedded-cff.ly: write .cff.ps files.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 28 Jan 2005 16:28:39 +0000 (16:28 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 28 Jan 2005 16:28:39 +0000 (16:28 +0000)
* mf/GNUmakefile ($(outdir)/lilypond.map): add .cff.ps to .map file.

* stepmake/stepmake/metafont-rules.make ($(outdir)/%.pfb
$(outdir)/%.svg $(outdir)/%.pfa): remove --simplify

ChangeLog
lily/box.cc
lily/stencil-scheme.cc
ly/generate-embedded-cff.ly [new file with mode: 0644]
make/lilypond-vars.make
mf/GNUmakefile
scm/framework-ps.scm
scm/lily-library.scm
scripts/lilypond-book.py

index 65f026242dddb0648b01bb8b93310303852e6428..f306e3ba6cfdee70379e50930d03ef2a6d794f4f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2005-01-28  Han-Wen Nienhuys  <hanwen@xs4all.nl>
+
+       * ly/generate-embedded-cff.ly: write .cff.ps files.
+
+       * mf/GNUmakefile ($(outdir)/lilypond.map): add .cff.ps to .map file.
+
+       * stepmake/stepmake/metafont-rules.make ($(outdir)/%.pfb
+       $(outdir)/%.svg $(outdir)/%.pfa): remove --simplify
+
 2005-01-28  Jan Nieuwenhuizen  <janneke@gnu.org>
 
        * lily/include/guile-compatibility.hh (SCM_VECTOR_P): Compile fix.
index 5463abef8633e85cbc5e5c6c0f35f80bbf3a42ba..03bc5bc86e8a6118408d8416826e9ce73ee3004d 100644 (file)
@@ -7,7 +7,6 @@
 */
 
 #include "box.hh"
-
 #include "array.hh"
 
 void
@@ -76,6 +75,7 @@ Box::center () const
   return Offset (interval_a_[X_AXIS].center (),
                 interval_a_[Y_AXIS].center ()); 
 }
+
 void
 Box::widen (Real x, Real y)
 {
index 0bffa6edb356a43d9720b9ba0db6fbf18f431bd5..ee6ea6e7ba4097a4988af2f4f2b610cdb1047dba 100644 (file)
@@ -47,8 +47,10 @@ LY_DEFINE (ly_translate_stencil_axis, "ly:stencil-translate-axis",
   SCM_ASSERT_TYPE (scm_is_number (amount), amount, SCM_ARG2, __FUNCTION__, "number");
 
   Real real_amount = scm_to_double (amount);
+#if 0
   SCM_ASSERT_TYPE (!isinf (real_amount) && !isnan (real_amount),
                   amount, SCM_ARG2, __FUNCTION__, "finite number");
+#endif
   
   SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG3, __FUNCTION__, "axis");
 
diff --git a/ly/generate-embedded-cff.ly b/ly/generate-embedded-cff.ly
new file mode 100644 (file)
index 0000000..780280f
--- /dev/null
@@ -0,0 +1,21 @@
+#(define (write-cff name filename)
+  (let*
+      ((body (ly:gulp-file filename))
+       (outname (format "~a.ps" filename))
+       (out-port (open-output-file outname))
+       )
+    
+
+    (display (ps-embed-cff body name 0)
+            out-port)
+  ))
+
+#(write-cff "emmentaler-26" "emmentaler26.cff")
+#(write-cff "emmentaler-23" "emmentaler23.cff")
+#(write-cff "emmentaler-20" "emmentaler20.cff")
+#(write-cff "emmentaler-18" "emmentaler18.cff")
+#(write-cff "emmentaler-16" "emmentaler16.cff")
+#(write-cff "emmentaler-14" "emmentaler14.cff")
+#(write-cff "emmentaler-13" "emmentaler13.cff")
+#(write-cff "emmentaler-11" "emmentaler11.cff")
+#(write-cff "aybabtu" "aybabtu.cff")
index 3b3b95b5d1fa500d53df3601fdce3696541f28ea..521017bd54ef5810a8fa8d296ff79aa7045fc175 100644 (file)
@@ -38,7 +38,7 @@ CONVERT_LY = $(script-dir)/convert-ly.py
 LILYPOND = $(builddir)/lily/$(outconfbase)/lilypond
 LILYPOND_BOOK = $(script-dir)/lilypond-book.py
 LILYPOND_BOOK_INCLUDES = -I $(pwd) -I $(outdir) -I$(input-dir) -I $(input-dir)/regression/ -I $(input-dir)/test/ -I $(input-dir)/tutorial/ -I $(builddir)/mf/$(outconfbase)/  -I $(builddir)/mf/out/
-LILYPOND_BOOK_FLAGS = --process="lilypond --backend tex  --formats=tex --header=texidoc -I $(srcdir)/input/test -e '(ly:set-option (quote internal-type-checking) \#t)'"
+LILYPOND_BOOK_FLAGS = --process="lilypond --backend ps  --formats=ps --header=texidoc -I $(srcdir)/input/test -e '(ly:set-option (quote internal-type-checking) \#t)'"
 
 #texi-html for www only:
 LILYPOND_BOOK_FORMAT=$(if $(subst out-www,,$(notdir $(outdir))),texi,texi-html)
index 35d96e90ee114bd36cec9a9e9fd7d475d581a041..810180b45de6e2063c4425f1f41033ba2f6afcbd 100644 (file)
@@ -26,6 +26,7 @@ OTF_TABLES = $(addsuffix .otf-table, $(addprefix $(outdir)/feta, $(STAFF_SIZES))
 FETA_FONTS = $(FETA_MF_FILES:.mf=)
 SVG_FILES = $(OTF_FILES:%.otf=%.svg) $(ALL_FONTS:%=$(outdir)/%.svg)
 CFF_FILES = $(OTF_FILES:%.otf=%.cff)
+CFF_PS_FILES = $(OTF_FILES:%.otf=%.cff.ps)
 
 
 $(outdir)/aybabtu.otf-table: $(BRACES:%=$(outdir)/feta-braces-%.otf-table)
@@ -60,6 +61,9 @@ foe:
 $(outdir)/%.cff $(outdir)/%.otf $(outdir)/%.svg: $(outdir)/%.pe
        (cd $(outdir) && fontforge -script $(notdir $<)) 
 
+$(CFF_PS_FILES): $(CFF_FILES)
+       cd $(outdir) && $(builddir)/lily/$(outconfbase)/lilypond --verbose $(abs-srcdir)/ly/generate-embedded-cff
+
 $(outdir)/%.otf-table: $(outdir)/%.lisp $(if $(findstring brace,$<),,$(subst feta,parmesan,$<)) 
        cat $< \
                $(if $(findstring brace,$<),,$(subst feta,parmesan,$<)) \
@@ -79,7 +83,7 @@ PFA_FILES = $(ALL_FONTS:%=$(outdir)/%.pfa)
 
 # Make tfm files first, log files last, 
 # so that normally log files aren't made twice
-ALL_GEN_FILES= $(TFM_FILES) $(TEXTABLES) $(TFM_FILES) $(LOG_FILES) $(ENC_FILES) $(LISP_FILES) $(FETA_LIST_FILES)  $(OTF_TABLES) $(PFA_FILES) $(outdir)/lilypond.map $(OTF_FILES) $(SVG_FILES)
+ALL_GEN_FILES= $(TFM_FILES) $(TEXTABLES) $(TFM_FILES) $(LOG_FILES) $(ENC_FILES) $(LISP_FILES) $(FETA_LIST_FILES)  $(OTF_TABLES) $(PFA_FILES) $(outdir)/lilypond.map $(OTF_FILES) $(SVG_FILES) $(CFF_PS_FILES)
 
 #PRE_INSTALL=$(MAKE) "$(ALL_GEN_FILES)"
 INSTALLATION_DIR=$(local_lilypond_datadir)/fonts/source
@@ -171,6 +175,9 @@ fontdir: $(addprefix $(outdir)/, lilypond.map lilypond.sfd private-fonts fonts.s
 
 $(outdir)/lilypond.map: $(AFM_FILES)
        for i in $(FETA_FONTS); do echo $$i $$i '<'$$i.pfa; done > $@
+       for i in $(STAFF_SIZES); \
+               do echo "emmentaler$$i emmentaler-$$i <emmentaler$$i.cff.ps" ; done \
+       >> $@
 
 
 local-clean:
index 0c743dfeea212dcc26308b6ef09cdec83931ebec..7063fa5d530becf9f9781e307c69dabefe56e8f3 100644 (file)
 %%EndResource"
     font-name body)))
 
-(define (ps-embed-cff body font-set-name version)
-  (let* ((binary-data
-         (string-append
-          (format "/~a ~s StartData " font-set-name (string-length body))
-          body)))
-
-    (string-append
-     (format
-      "%%BeginResource: font ~a
-%!PS-Adobe-3.0 Resource-FontSet
-%%DocumentNeededResources: ProcSet (FontSetInit)
-%%Title: (FontSet/~a)
-%%Version: ~s
-%%EndComments
-%%IncludeResource: ProcSet (FontSetInit)
-%%BeginResource: FontSet (~a)
-/FontSetInit /ProcSet findresource begin
-%%BeginData: ~s Binary Bytes
-"
-      font-set-name font-set-name version font-set-name
-      (string-length binary-data))
-     binary-data
-     "\n%%EndData
-%%EndResource
-%%EOF
-%%EndResource
-")))
 
 (define (define-fonts paper)
   (define font-list (ly:paper-fonts paper))
    (setup paper)))
 
 (define-public (output-framework basename book scopes fields)
-;  (display (gc-live-object-stats))
   (let* ((filename (format "~a.ps" basename))
         (outputter  (ly:make-paper-outputter filename
                                              (ly:output-backend)))
          )))
 
   (let* ((lines (ly:paper-book-systems book))
-        (tex-port (open-output-file (format "~a.tex" basename)))
-        (last-line (car (last-pair lines))))
+        (tex-system-port (open-output-file (format "~a-systems.tex" basename)))
+g       (last-line (car (last-pair lines))))
 
     (dump-lines lines 1)
     (for-each (lambda (c)
-               (display (format "\\includegraphics{~a-~a.eps}%\n"
-                                basename (1+ c)) tex-port))
+               (display (format "\\lilypondEpsGraphics{~a-~a.eps}%\n"
+                                basename (1+ c)) tex-system-port))
              (iota (length lines))
              )))
 
index 44b2fd3f15344194f37607f3da4d7ad407183186..195196e73211efe32c5da574a02e926421b017d0 100644 (file)
@@ -312,3 +312,37 @@ possibly turned off."
        (if (not (null? (cdr name-style)))
            name-style
            (append name-style '("Regular"))))))
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(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))
+          body))
+
+        (header
+         (format
+          "%%BeginResource: font ~a
+%!PS-Adobe-3.0 Resource-FontSet
+%%DocumentNeededResources: ProcSet (FontSetInit)
+%%Title: (FontSet/~a)
+%%Version: ~s
+%%EndComments
+%%IncludeResource: ProcSet (FontSetInit)
+%%BeginResource: FontSet (~a)
+/FontSetInit /ProcSet findresource begin
+%%BeginData: ~s Binary Bytes
+"
+          font-set-name font-set-name version font-set-name
+          (string-length binary-data)))
+        (footer "\n%%EndData
+%%EndResource
+%%EOF
+%%EndResource"))
+
+    (string-append
+     header
+     binary-data
+     footer)))
index 9fd3ffba08458beb24c744ec6846b6d98306e4ac..2edce7156b5b026cbb56541a0d4ce6c50603373c 100644 (file)
@@ -64,6 +64,7 @@ program_name = sys.argv[0]
 verbose_p = 0
 pseudo_filter_p = 0
 original_dir = os.getcwd ()
+backend = 'ps'
 
 help_summary = _ (
 '''Process LilyPond snippets in hybrid HTML, LaTeX, or texinfo document.
@@ -892,6 +893,9 @@ class Lilypond_snippet (Snippet):
                                     or glob.glob (base + '-page*.png'))
                return not ok
        def texstr_is_outdated (self):
+               if backend == 'ps':
+                       return 0
+               
                base = self.basename ()
                ok = self.ly_is_outdated ()
                ok = ok and (os.path.exists (base + '.texstr'))
@@ -1410,6 +1414,8 @@ def do_options ():
                        format = a
                        if a == 'texi-html' or a == 'texi':
                                format = TEXINFO
+               elif o == '--tex-backend ':
+                       backend = 'tex'
                elif o == '--help' or o == '-h':
                        ly.help ()
                        sys.exit (0)