Author: mcbrown
Date: 2007-04-03 12:49:41 +0200 (Tue, 03 Apr 2007)
New Revision: 5704
Log:
Changing multibyte PDF builds so that they dont require special targets
Adding multibyte userconfig file
Remving multibyte instructions from standard xml-pdf
Added:
trunk/make.d/xml-pdf-multibyte
trunk/xsl.d/userconfig.multibyte.xml
Modified:
trunk/make.d/vars-docbook
trunk/make.d/xml-pdf
Modified: trunk/make.d/vars-docbook
===================================================================
--- trunk/make.d/vars-docbook 2007-04-03 06:31:39 UTC (rev 5703)
+++ trunk/make.d/vars-docbook 2007-04-03 10:49:41 UTC (rev 5704)
Changed blocks: 1, Lines Added: 1, Lines Deleted: 0; 440 bytes
@@ -174,6 +174,7 @@
# FOP Configuration file
FOP_CONFIG = $(XSL_DIR)/userconfig.xml
+FOP_MULTIBYTE_CONFIG = $(XSL_DIR)/userconfig.multibyte.xml
# Transform that determines the dependencies for an XML document
Modified: trunk/make.d/xml-pdf
===================================================================
--- trunk/make.d/xml-pdf 2007-04-03 06:31:39 UTC (rev 5703)
+++ trunk/make.d/xml-pdf 2007-04-03 10:49:41 UTC (rev 5704)
Changed blocks: 3, Lines Added: 0, Lines Deleted: 38; 1877 bytes
@@ -29,16 +29,6 @@
--output $@-tmp $(MYSQL_FO_XSL) -
mv $@-tmp $@
-%.a4-mb.fo: %-prepped.xml $(MYSQL_FO_XSL_DEPS) $(STRIP_REMARKS_XSL_DEPS)
- $(XSLTPROC) \
- --output - $(STRIP_REMARKS_XSL) $< \
- | $(XSLTPROC) \
- --stringparam l10n.gentext.default.language $(DOC_LANG) \
- --stringparam paper.type A4 \
- --output $@-tmp $(MYSQL_FO_MULTIBYTE_XSL) -
- mv $@-tmp $@
-
-
%.6x9.fo: %-prepped.xml $(MYSQL_FO_XSL_DEPS) $(STRIP_REMARKS_XSL_DEPS)
$(XSLTPROC) \
--output - $(STRIP_REMARKS_XSL) $< \
@@ -47,14 +37,6 @@
--output $@-tmp $(MYSQL_FO_BOOK_XSL) -
mv $@-tmp $@
-%.mb.fo: %-prepped.xml $(MYSQL_FO_XSL_DEPS) $(STRIP_REMARKS_XSL_DEPS)
- $(XSLTPROC) \
- --output - $(STRIP_REMARKS_XSL) $< \
- | $(XSLTPROC) \
- --stringparam l10n.gentext.default.language $(DOC_LANG) \
- --output $@-tmp $(MYSQL_FO_MULTIBYTE_XSL) -
- mv $@-tmp $@
-
%.fo: %-prepped.xml $(MYSQL_FO_XSL_DEPS) $(STRIP_REMARKS_XSL_DEPS)
$(XSLTPROC) \
--output - $(STRIP_REMARKS_XSL) $< \
@@ -166,26 +148,6 @@
# (Don't use grep to filter messages, because it returns non-zero if no
# match is found, which causes the command to fail.)
-%.mb.pdf: %.mb.fo
- if [ -f $(FOP_CONFIG) ]; then \
- fop -q -c $(FOP_CONFIG) $< $*.pdf-tmp > $*.pdf-err; \
- else \
- fop -q $< $*.pdf-tmp > $*.pdf-err; \
- fi
- mv $*.pdf-tmp $*.pdf
- sed -e '/hyphenation/d' < $*.pdf-err
- $(RM) $*.pdf-err
-
-%.a4-mb.pdf: %.a4-mb.fo
- if [ -f $(FOP_CONFIG) ]; then \
- fop -q -c $(FOP_CONFIG) $< $*.pdf-tmp > $*.pdf-err; \
- else \
- fop -q $< $*.pdf-tmp > $*.pdf-err; \
- fi
- mv $*.pdf-tmp $*.pdf
- sed -e '/hyphenation/d' < $*.pdf-err
- $(RM) $*.pdf-err
-
%.pdf: %.fo
if [ -f $(FOP_CONFIG) ]; then \
$(FIXUP_MULTIBYTE) $< > $<.multibyte; \
Added: trunk/make.d/xml-pdf-multibyte
===================================================================
--- trunk/make.d/xml-pdf-multibyte (rev 0)
+++ trunk/make.d/xml-pdf-multibyte 2007-04-03 10:49:41 UTC (rev 5704)
Changed blocks: 1, Lines Added: 65, Lines Deleted: 0; 2662 bytes
@@ -0,0 +1,65 @@
+# Convert DocBook -> PDF (Multibyte-languages compatible) (letter/A4)
+# (Language sensitive)
+
+# These rules build a PDF (A4 or Letter size) that produces multibyte
+# compatible output. This requires a userconfig.xml for fop that
+# contains suitable font specifications and links to the necessary
+# font file for the transformations.
+# Fonts used by default are in userconfig.multibye.xml
+
+# The main transform is preceded by one that strips remarks to avoid
+# certain linebreak problems. If it's desired to retain remarks in
+# the output, convert them to special paras by setting MAP_REMARK_TO_PARA
+# to 1 in the main Makefile.
+
+# Do not delete these files when they are generated as intermediates
+# for a final target. They are deleted by "make clean".
+
+.PRECIOUS: %.fo
+.PRECIOUS: %.a4.fo
+
+# for page margins, note that you can't set left and right as they
+# will be overridden. The default value is 1in for both.
+
+# These rules can be used for either the full document or for subsidiary
+# files that are part of the full document. However, for subsidiary files,
+# the TOC numbering will begin at chapter one and cross-references may be
+# inaccurate.
+
+%.a4.fo: %-prepped.xml $(MYSQL_FO_XSL_DEPS) $(STRIP_REMARKS_XSL_DEPS)
+ $(XSLTPROC) \
+ --output - $(STRIP_REMARKS_XSL) $< \
+ | $(XSLTPROC) \
+ --stringparam l10n.gentext.default.language $(DOC_LANG) \
+ --stringparam paper.type A4 \
+ --output $@-tmp $(MYSQL_FO_MULTIBYTE_XSL) -
+ mv $@-tmp $@
+
+%.fo: %-prepped.xml $(MYSQL_FO_XSL_DEPS) $(STRIP_REMARKS_XSL_DEPS)
+ $(XSLTPROC) \
+ --output - $(STRIP_REMARKS_XSL) $< \
+ | $(XSLTPROC) \
+ --stringparam l10n.gentext.default.language $(DOC_LANG) \
+ --output $@-tmp $(MYSQL_FO_MULTIBYTE_XSL) -
+ mv $@-tmp $@
+
+# We do NOT need to do the multibyte transform on non-roman characters if we
+# are using a full multibyte character set
+
+%.pdf: %.fo
+ if [ -f $(FOP_CONFIG) ]; then \
+ fop -q -c $(FOP_MULTIBYTE_CONFIG) $< $*.pdf-tmp > $*.pdf-err; \
+ else \
+ echo "Cannot build multibyte PDF without font specification in
$(FOP_MULTIBYTE_CONFIG)\n"; \
+ exit 1
+ fi
+ mv $*.pdf-tmp $*.pdf
+ sed -e '/hyphenation/d' < $*.pdf-err
+ $(RM) $*.pdf-err
+
+clean::
+ $(RM) *.fo *.fo-tmp *.pdf *.pdf-tmp *.pdf-err *.multibyte
+
+help::
+ @echo "make file.pdf - convert file.xml to file.pdf (Multibyte compatible)
(US letter)"
+ @echo "make file.a4.pdf - convert file.xml to file.pdf (Multibyte compatible)
(A4)"
Added: trunk/xsl.d/userconfig.multibyte.xml
===================================================================
--- trunk/xsl.d/userconfig.multibyte.xml (rev 0)
+++ trunk/xsl.d/userconfig.multibyte.xml 2007-04-03 10:49:41 UTC (rev 5704)
Changed blocks: 1, Lines Added: 81, Lines Deleted: 0; 2898 bytes
@@ -0,0 +1,81 @@
+<!--<!DOCTYPE configuration SYSTEM "config.dtd">-->
+<!--
+# Martin MC Brown
+# mc@stripped
+# 2007-04-03
+
+This file defines additional fonts used during the build process for PDFs
+with multibye language support. This includes specification for
+standard font (ArialUnicode) and Mono fonts (GothicMono).
+
+-->
+
+<!--
+ this file contains templates which allow an user easy
+ configuration of Fop. Actually normally you don't need this configuration
+ file, but if you need to change configuration, you should
+ always use this file and *not* config.xml.
+ Usage: java org.apache.fop.apps.Fop -c userconfig.xml -fo fo-file -pdf pdf-file
+-->
+
+
+<configuration>
+
+
+<!--
+************************************************************************
+ HYPHENATION
+************************************************************************
+-->
+
+<!--
+ hyphenation directory
+ if you want to specify your own directory with hyphenation pattern
+ then uncomment the next entry and add the directory name
+-->
+
+<!--
+ <entry>
+ <key>hyphenation-dir</key>
+ <value>/java/xml-fop/hyph</value>
+ </entry>
+-->
+
+<!--
+************************************************************************
+ Add fonts here
+************************************************************************
+-->
+
+<!--
+We currently define three fonts, although only one is included in the
+source files
+-->
+
+<fonts>
+
+<font metrics-file="/home/mysqldoc/fonts/MSArialUnicode.xml" kerning="no"
embed-file="/home/mysqldoc/fonts/MSArialUnicode.ttf">
+ <font-triplet name="ArialUnicode" style="normal" weight="normal"/>
+ <font-triplet name="ArialUnicode" style="italic" weight="normal"/>
+ <font-triplet name="ArialUnicode" style="normal" weight="bold"/>
+ <font-triplet name="ArialUnicode" style="italic" weight="bold"/>
+</font>
+<font metrics-file="/home/mysqldoc/fonts/msgothic2.xml" kerning="no"
embed-file="/home/mysqldoc/fonts/msgothic2.ttf">
+ <font-triplet name="Gothic" style="normal" weight="normal"/>
+ <font-triplet name="Gothic" style="italic" weight="normal"/>
+ <font-triplet name="Gothic" style="normal" weight="bold"/>
+ <font-triplet name="Gothic" style="italic" weight="bold"/>
+</font>
+<font metrics-file="/home/mysqldoc/fonts/msgothic0.xml" kerning="no"
embed-file="/home/mysqldoc/fonts/msgothic0.ttf">
+ <font-triplet name="GothicMono" style="normal" weight="normal"/>
+ <font-triplet name="GothicMono" style="normal" weight="bold"/>
+ <font-triplet name="GothicMono" style="italic" weight="normal"/>
+ <font-triplet name="GothicMono" style="italic" weight="bold"/>
+</font>
+
+</fonts>
+
+</configuration>
+
+
+
| Thread |
|---|
| • svn commit - mysqldoc@docsrva: r5704 - in trunk: make.d xsl.d | mcbrown | 3 Apr |