lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Add using Extract PDFmark for document building (issue 314130043 by


From: trueroad
Subject: Re: Add using Extract PDFmark for document building (issue 314130043 by address@hidden)
Date: Fri, 18 Nov 2016 18:51:30 -0800

Reviewers: lemzwerg,

Message:
Thank you for your reviewing.


https://codereview.appspot.com/314130043/diff/1/configure.ac
File configure.ac (right):

https://codereview.appspot.com/314130043/diff/1/configure.ac#newcode300
configure.ac:300: STEPMAKE_ADD_ENTRY(OPTIONAL,"(gs >= 9.20 and
extractpdfmark can reduce the disk space required for document building.
They also can reduce the size of generated PDF document files. Even if
they are missing, you can build documents.)")
On 2016/11/18 18:04:55, lemzwerg wrote:
Is it necessary to have such a long line?

How about the following messages?

1.
(gs >= 9.20 and extractpdfmark can reduce the size of generated PDF
document files and the disk space required for document building. Even
if they are missing, you can build documents.)

2.
(gs >= 9.20 and extractpdfmark can reduce the disk space required for
document building. Even if they are missing, you can build documents.)

3.
(gs >= 9.20 and extractpdfmark can reduce the size of generated PDF
document files and the disk space required for document building.)

4.
(gs >= 9.20 and extractpdfmark can reduce the disk space required for
document building.)

Description:
Add using Extract PDFmark for document building

Issue 5000/5: Add using Extract PDFmark for DocBook

  This commit adds using Extract PDFmark for Doc Book documents.

Issue 5000/4: Add using Extract PDFmark for LaTeX

  This commit adds using Extract PDFmark for LaTeX documents.

Issue 5000/3: Add using Extract PDFmark for Texinfo

  This commit adds using Extract PDFmark for Texinfo PDF documents.

Issue 5000/2: Add font-export and never-embed options for document
building

  This commit adds `-dfont-export-dir=[dir]` option
  and `-dgs-never-embed-fonts` option for document building.

Issue 5000/1: Add checking Ghostscript 9.20+ and Extract PDFmark

  This commit adds checking Ghostscript 9.20+ and Extract PDFmark.
  They can reduce the disk space required for document building.
  They also can reduce the size of generated PDF document files.

  Even if they are missing, you can build documents.

  Ghostscript 9.20+:
  It is necessary for string named destinations.
  Ghostscript 9.19 and prior cannot handle them.
  http://bugs.ghostscript.com/show_bug.cgi?id=696974

  Extract PDFmark:
  It is necessary for preserving named destinations and page mode.
  https://github.com/trueroad/extractpdfmark
  http://www.ctan.org/pkg/extractpdfmark

Please review this at https://codereview.appspot.com/314130043/

Affected files (+51, -0 lines):
  M config.make.in
  M configure.ac
  M make/lilypond-book-rules.make
  M make/lilypond-vars.make
  M make/lysdoc-targets.make
  M stepmake/stepmake/texinfo-rules.make


Index: config.make.in
diff --git a/config.make.in b/config.make.in
index d376a59f481c18a385d8b9703617d94ab8aa4662..3bf17671a029f0b3123277d98e0afb322fe415d9 100644
--- a/config.make.in
+++ b/config.make.in
@@ -38,6 +38,8 @@ PACKAGE_NAME = @PACKAGE_NAME@

 address@hidden@

address@hidden@
+
 ################################################################
 ## FILESYSTEM
 ################################################################
@@ -110,12 +112,14 @@ DBLATEX = @DBLATEX@
 DEFINES = @DEFS@ @DEFINES@
 DEFS = @DEFS@
 DOCUMENTATION = @DOCUMENTATION@
+EXTRACTPDFMARK = @EXTRACTPDFMARK@
 FIND = @FIND@
 FCLIST = @FCLIST@
 FLEX = @FLEX@
 FLEXLEXER_FILE = @FLEXLEXER_FILE@
 FONTFORGE = @FONTFORGE@
 GROFF = @GROFF@
+GS920 = @GS920@
 GUILE = @GUILE@
 GUILE_CFLAGS = @GUILE_CFLAGS@
 GUILE_CONFIG = @GUILE_CONFIG@
Index: configure.ac
diff --git a/configure.ac b/configure.ac
index 19ffd18bf31663cda5177993589e8f7d6edcb405..7a24208d3ad50486591ea13f9391a368b30b70d0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -281,6 +281,25 @@ fi

 STEPMAKE_PATH_PROG(GHOSTSCRIPT, gs, $DOCUMENTATION_REQUIRED, 8.60)

+AC_SUBST(GS920)
+AC_SUBST(EXTRACTPDFMARK)
+AC_SUBST(USE_EXTRACTPDFMARK)
+STEPMAKE_PROGS(GS920, gs, OPTIONAL, 9.20)
+STEPMAKE_PROGS(EXTRACTPDFMARK, extractpdfmark, OPTIONAL)
+req=`STEPMAKE_NUMERIC_VERSION(9.20)`
+USE_EXTRACTPDFMARK=yes
+if test "$GS920_VERSION" -lt "$req"; then
+    GS920=
+    USE_EXTRACTPDFMARK=no
+fi
+if test "$EXTRACTPDFMARK" != "extractpdfmark"; then
+    EXTRACTPDFMARK=
+    USE_EXTRACTPDFMARK=no
+fi
+if test "$USE_EXTRACTPDFMARK" != "yes"; then
+ STEPMAKE_ADD_ENTRY(OPTIONAL,"(gs >= 9.20 and extractpdfmark can reduce the disk space required for document building. They also can reduce the size of generated PDF document files. Even if they are missing, you can build documents.)")
+fi
+
 STEPMAKE_PROGS(MAKEINFO, makeinfo, REQUIRED, 4.11)
 STEPMAKE_PROGS(TEXI2HTML, texi2html, $DOCUMENTATION_REQUIRED, 1.82)
 STEPMAKE_PROGS(DBLATEX, dblatex, $DOCUMENTATION_REQUIRED, 0.1.4)
Index: make/lilypond-book-rules.make
diff --git a/make/lilypond-book-rules.make b/make/lilypond-book-rules.make
index 3dda429003e092aa813c3ab319b7036c257b68d7..e0c0756bc403af37cb02b5a4f339c72d6ee5ed4a 100644
--- a/make/lilypond-book-rules.make
+++ b/make/lilypond-book-rules.make
@@ -27,6 +27,12 @@ $(outdir)/%.tex:  %.latex
 ifeq (,$(findstring pdflatex,$(MISSING_OPTIONAL)))
 $(outdir)/%.pdf:  $(outdir)/%.tex
cd $(outdir) && $(buildscript-dir)/run-and-check "$(PDFLATEX) -halt-on-error $(notdir $<)" "$*.pdflatex.log"
+ifeq ($(USE_EXTRACTPDFMARK),yes)
+       $(EXTRACTPDFMARK) -o $(outdir)/$*.pdfmark $@
+ $(GS920) -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=$(outdir)/$*.final.pdf -c "30000000 setvmthreshold" -f $(top-build-dir)/out-fonts/*.font.ps $(outdir)/$*.pdfmark $@
+       rm $@
+       mv $(outdir)/$*.final.pdf $@
+endif
 endif

 ############## Texinfo ######################
@@ -53,4 +59,10 @@ $(outdir)/%.xml:  %.lyxml
 ifeq (,$(findstring dblatex,$(MISSING_OPTIONAL)))
 $(outdir)/%.pdf:  $(outdir)/%.xml
cd $(outdir) && $(buildscript-dir)/run-and-check "$(DBLATEX) $(DBLATEX_BACKEND) $(notdir $<)" "$*.dblatex.log"
+ifeq ($(USE_EXTRACTPDFMARK),yes)
+       $(EXTRACTPDFMARK) -o $(outdir)/$*.pdfmark $@
+ $(GS920) -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=$(outdir)/$*.final.pdf -c "30000000 setvmthreshold" -f $(top-build-dir)/out-fonts/*.font.ps $(outdir)/$*.pdfmark $@
+       rm $@
+       mv $(outdir)/$*.final.pdf $@
+endif
 endif
Index: make/lilypond-vars.make
diff --git a/make/lilypond-vars.make b/make/lilypond-vars.make
index e67a570c92706d79e0913034b599577ef3e656ce..1fd163caa174dec5cf62a6fac438266049a219b1 100644
--- a/make/lilypond-vars.make
+++ b/make/lilypond-vars.make
@@ -48,6 +48,12 @@ $(LANG_TEXIDOC_FLAGS) \
 -ddump-signatures \
 -danti-alias-factor=$(ANTI_ALIAS_FACTOR)

+ifeq ($(USE_EXTRACTPDFMARK),yes)
+LILYPOND_BOOK_LILYPOND_FLAGS+= \
+-dfont-export-dir=$(top-build-dir)/out-fonts \
+-dgs-never-embed-fonts
+endif
+
 ifdef QUIET_BUILD
 LILYPOND_BOOK_WARN = --loglevel=NONE
 else
Index: make/lysdoc-targets.make
diff --git a/make/lysdoc-targets.make b/make/lysdoc-targets.make
index 5290e3962feb6cbc06192050791facc66f2349fe..547614cbd5164842da94832aa7123a841e51fe02 100644
--- a/make/lysdoc-targets.make
+++ b/make/lysdoc-targets.make
@@ -16,6 +16,10 @@ local-test:
                echo -e '\n\n\n' ; \
                (cd $(top-src-dir) && git diff ) ; \
        fi > $(outdir)/tree.gittxt
+ifeq ($(USE_EXTRACTPDFMARK),yes)
+ $(MAKE) LILYPOND_BOOK_LILYPOND_FLAGS="-dbackend=eps --formats=ps $(LILYPOND_JOBS) -dseparate-log-files -dinclude-eps-fonts -dgs-load-fonts --header=texidoc -I $(top-src-dir)/Documentation/included/ -ddump-profile -dcheck-internal-types -ddump-signatures -danti-alias-factor=1 -dfont-export-dir=$(top-build-dir)/out-fonts -dgs-never-embed-fonts" LILYPOND_BOOK_WARN= $(outdir)/collated-files.html LYS_OUTPUT_DIR=$(top-build-dir)/out/lybook-testdb
+else
$(MAKE) LILYPOND_BOOK_LILYPOND_FLAGS="-dbackend=eps --formats=ps $(LILYPOND_JOBS) -dseparate-log-files -dinclude-eps-fonts -dgs-load-lily-fonts --header=texidoc -I $(top-src-dir)/Documentation/included/ -ddump-profile -dcheck-internal-types -ddump-signatures -danti-alias-factor=1" LILYPOND_BOOK_WARN= $(outdir)/collated-files.html LYS_OUTPUT_DIR=$(top-build-dir)/out/lybook-testdb
+endif
rsync -L -a --exclude 'out-*' --exclude 'out' --exclude mf --exclude source --exclude mf $(top-build-dir)/out/share $(outdir)

Index: stepmake/stepmake/texinfo-rules.make
diff --git a/stepmake/stepmake/texinfo-rules.make b/stepmake/stepmake/texinfo-rules.make index 4747347a9042909e3466373ba888833f5889f8fa..007f88fdad9eb87bab1d4f4e62010c6c428e6584 100644
--- a/stepmake/stepmake/texinfo-rules.make
+++ b/stepmake/stepmake/texinfo-rules.make
@@ -72,6 +72,12 @@ ifeq ($(WEB_VERSION),yes)
 else
PDFTEX=$(PDFTEX) PDFLATEX=$(PDFLATEX) $(buildscript-dir)/run-and-check "cd $(outdir); texi2pdf $(TEXI2PDF_FLAGS) -I $(abs-src-dir) $(TEXINFO_PAPERSIZE_OPTION) $(<F) < /dev/null" "$*.texi2pdf.log"
 endif
+ifeq ($(USE_EXTRACTPDFMARK),yes)
+       $(EXTRACTPDFMARK) -o $(outdir)/$*.pdfmark $@
+ $(GS920) -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=$(outdir)/$*.final.pdf -c "30000000 setvmthreshold" -f $(top-build-dir)/out-fonts/*.font.ps $(outdir)/$*.pdfmark $@
+       rm $@
+       mv $(outdir)/$*.final.pdf $@
+endif

$(outdir)/%.txt: $(outdir)/%.texi $(outdir)/version.itexi $(outdir)/weblinks.itexi | $(OUT_TEXINFO_MANUALS) $(buildscript-dir)/run-and-check "$(MAKEINFO) -I$(src-dir) -I$(outdir) --no-split --no-headers --output $@ $<" "$*.makeinfotxt.log"





reply via email to

[Prev in Thread] Current Thread [Next in Thread]