chiark / gitweb /
[dev-ref] Use XeTeX backend (closes: #629530) and add the Japanese PDF
authortaffit <taffit@313b444b-1b9f-4f58-a734-7bb04f332e8d>
Wed, 11 Jan 2012 04:21:34 +0000 (04:21 +0000)
committertaffit <taffit@313b444b-1b9f-4f58-a734-7bb04f332e8d>
Wed, 11 Jan 2012 04:21:34 +0000 (04:21 +0000)
git-svn-id: svn://anonscm.debian.org/ddp/manuals/trunk/developers-reference@9033 313b444b-1b9f-4f58-a734-7bb04f332e8d

Makefile
debian/changelog
debian/control
debian/developers-reference-ja.doc-base
debian/rules
xslt/user_param.xsl [new file with mode: 0644]
xslt/xetex_param.xsl [new file with mode: 0644]

index 860e219beef476f25b8028d75ab2710ffe55695a..cfc064bd7ac0d5e85546c3f3226a836e653696ac 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -11,7 +11,7 @@ TARGETS               := $(foreach fmt,$(FORMATS),developers-reference.$(fmt)) \
                       $(foreach fmt,$(FORMATS), \
                           $(lng)/developers-reference.$(fmt)))
 # list of targets, that currently cannot build
-BLACKLIST      := ja/developers-reference.pdf
+#BLACKLIST     := ja/developers-reference.pdf
 
 # hopefully overwritten by caller, e.g. debian/rules
 VERSION=unknown
@@ -80,11 +80,7 @@ ifndef LINGUA
 FORCE:
 else
 $(LINGUA)/%.dbk:       %.dbk $(patsubst %.dbk,po4a/$(LINGUA)/%.po,%.dbk)
-#      $(TRANSLATE) -m $< -p po4a/$(@:.dbk=.po) -l $@ -a ?po4a/$(@:.dbk=.add)
-# workaround to "-a ?" only possible with po4a version in Squeeze, otherwise build is broken in Lenny
-       if [ -f po4a/$(@:.dbk=.add) ]; then \
-               $(TRANSLATE) -m $< -p po4a/$(@:.dbk=.po) -l $@ -a po4a/$(@:.dbk=.add); else \
-               $(TRANSLATE) -m $< -p po4a/$(@:.dbk=.po) -l $@; fi
+       $(TRANSLATE) -m $< -p po4a/$(@:.dbk=.po) -l $@ -a ?po4a/$(@:.dbk=.add)
 
 $(LINGUA)/common.ent:  common.ent
        cd $(@D) && ln -sf ../$(@F) .
@@ -95,10 +91,16 @@ developers-reference.txt:   $(CURDIR)/developers-reference.txt
        $(XP) $(DBK2HTML1) $(@D)/index.dbk \
            | w3m -o display_charset=UTF-8 -cols 70 -dump -no-graph -T text/html > $@
 
+XSLT           := xslt
+
 developers-reference.pdf:       $(CURDIR)/developers-reference.pdf
 %/developers-reference.pdf:     $(addprefix %/,$(SOURCES))
-       TOP=`pwd` && cd $(@D) && $(DBLATEX) index.dbk \
-           && mv index.dbk.pdf $(@F)
+       $(DBLATEX) $(@D)/index.dbk \
+           --backend=xetex \
+           --xsl-user=$(XSLT)/user_param.xsl \
+           --xsl-user=$(XSLT)/xetex_param.xsl \
+           --param=lingua=$(@D) \
+           && mv $(@D)/index.dbk.pdf $@
 
 .PHONY: pot
 pot:                           $(patsubst %.dbk,po4a/po/%.pot,$(SOURCES))
index fd918ae8e5816503488fa856a6e03ee5d25930c3..d4c60bce2f07c7bcbf239721efd5861290e1f6d5 100644 (file)
@@ -26,8 +26,11 @@ developers-reference (3.4.7) UNRELEASED; urgency=low
   * Add doc-base file for the German translation.
   * Update French translation.
   * Typo fix, thanks to Andreas Moog. Closes: #655096
+  * Use XeTeX backend, that fix quotes in examples. Closes: #629530
+  * Build the Japanese PDF, thanks to Osamu Aoki and the maint-guide build
+    process.
 
- -- David Prévot <taffit@debian.org>  Sun, 08 Jan 2012 14:57:56 -0400
+ -- David Prévot <taffit@debian.org>  Tue, 10 Jan 2012 23:46:30 -0400
 
 developers-reference (3.4.6) unstable; urgency=low
 
index a0f76e75592ddde80f5c3b9e5b72b06a2a03cf13..35e3f9d473573de9b568965c67686575cd7b405c 100644 (file)
@@ -4,7 +4,9 @@ Priority: optional
 Maintainer: Developers Reference Maintainers <debian-policy@lists.debian.org>
 Uploaders: Lucas Nussbaum <lucas@debian.org>, Marc 'HE' Brockschmidt <he@debian.org>, Raphaël Hertzog <hertzog@debian.org>
 Standards-Version: 3.9.2
-Build-Depends-Indep: docbook-xsl (>= 1.71.0), dblatex (>= 0.2), xsltproc, libxml2-utils, po4a, w3m
+Build-Depends-Indep: docbook-xsl (>= 1.71.0), dblatex (>= 0.2), xsltproc, libxml2-utils, po4a, w3m,
+ fonts-ipafont-gothic, fonts-ipafont-mincho, gsfonts, latex-cjk-xcjk, lmodern,
+ texlive-lang-cyrillic, texlive-lang-french, texlive-lang-german, texlive-xetex
 Build-Depends: debhelper (>= 5)
 Vcs-Svn: svn://svn.debian.org/ddp/manuals/trunk/developers-reference
 Vcs-Browser: http://svn.debian.org/wsvn/ddp/manuals/trunk/developers-reference?op=log
index 874fe3c08e1dafe02c7b10430e7b5035ea819ca8..495c4c95819e61f009bb26ed41c7ddcf12008b66 100644 (file)
@@ -12,3 +12,6 @@ Section: Debian
 Format: HTML
 Index: /usr/share/doc/developers-reference-ja/index.html
 Files: /usr/share/doc/developers-reference-ja/*.html
+
+Format: PDF
+Files: /usr/share/doc/developers-reference-ja/developers-reference.pdf
index 899b1452bdf3361ca3306ec3bc912b261e817823..5ca0113812a4632dd3c97be0d20ae4047ac5f625 100755 (executable)
@@ -11,8 +11,8 @@ docbasedir    := $(prefix)$(docbaserel)
 
 # list of language packages, in the form pkg-LANG; must jibe
 # with debian/control
-langs          := fr de
-langs_nopdf    := ja
+langs          := de fr ja
+langs_nopdf    := 
 
 # tool abstraction
 install_file   := install -o root -g root -m 644 -p
diff --git a/xslt/user_param.xsl b/xslt/user_param.xsl
new file mode 100644 (file)
index 0000000..7248736
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version='1.0'?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
+
+<!--############################################################################
+    XSLT Stylesheet DocBook -> LaTeX 
+    ############################################################################ -->
+
+  <xsl:param name="draft.mode">maybe</xsl:param>
+  <xsl:param name="glossterm.auto.link">1</xsl:param>
+  <xsl:param name="latex.encoding">utf8</xsl:param>
+  <xsl:param name="latex.unicode.use">1</xsl:param>
+  <xsl:param name="monoseq.hyphenation">nohyphen</xsl:param>
+  <xsl:template match="book|article" mode="docinfo">
+    <!-- Apply default settings -->
+    <xsl:apply-imports/>
+    <!--
+    <xsl:text>\input{</xsl:text>po4a/hyphenation.<xsl:value-of select="$lingua"/><xsl:text>.tex}</xsl:text>
+    -->
+  </xsl:template>
+</xsl:stylesheet>
+
diff --git a/xslt/xetex_param.xsl b/xslt/xetex_param.xsl
new file mode 100644 (file)
index 0000000..04ea199
--- /dev/null
@@ -0,0 +1,117 @@
+<?xml version='1.0'?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
+<!-- vim: set sts=2 ai expandtab: -->
+
+<!--############################################################################
+    XSLT Stylesheet DocBook -> LaTeX 
+    ############################################################################ -->
+
+  <xsl:param name="xetex.font">
+    <!-- Western centric Adobe PostScript looks-alike: gsfonts -->
+    <xsl:text>\setmainfont{Nimbus Roman No9 L}&#10;</xsl:text>
+    <xsl:text>\setsansfont{Nimbus Sans L}&#10;</xsl:text>
+    <xsl:text>\setmonofont{Nimbus Mono L}&#10;</xsl:text>
+    <xsl:text>\usepackage{xeCJK}&#10;</xsl:text>
+    <xsl:choose>
+      <xsl:when test="$lingua = 'zh-cn'">
+       <!-- zh_CN centric: ttf-arphic-gbsn00lp, ttf-wqy-zenhei -->
+        <xsl:text>\setCJKmainfont{AR PL SungtiL GB}&#10;</xsl:text>
+        <xsl:text>\setCJKsansfont{WenQuanYi Zen Hei}&#10;</xsl:text>
+        <xsl:text>\setCJKmonofont{WenQuanYi Zen Hei Mono}&#10;</xsl:text>
+      </xsl:when>
+      <xsl:when test="$lingua = 'zh-tw'">
+        <!-- zh_TW centric: ttf-arphic-bsmi00lp, ttf-wqy-zenhei -->
+        <xsl:text>\setCJKmainfont{AR PL Mingti2L Big5}&#10;</xsl:text>
+        <xsl:text>\setCJKsansfont{WenQuanYi Zen Hei}&#10;</xsl:text>
+        <xsl:text>\setCJKmonofont{WenQuanYi Zen Hei Mono}&#10;</xsl:text>
+      </xsl:when>
+      <xsl:when test="$lingua = 'ja'">
+        <!-- ja centric: otf-ipafont-mincho otf-ipafont-gothic -->
+        <xsl:text>\setCJKmainfont{IPAMincho}&#10;</xsl:text>
+        <xsl:text>\setCJKsansfont{IPAPGothic}&#10;</xsl:text>
+        <xsl:text>\setCJKmonofont{IPAGothic}&#10;</xsl:text>
+      </xsl:when>
+      <xsl:when test="$lingua = 'ko'">
+        <!-- ko centric: ttf-unfonts-core -->
+        <xsl:text>\setCJKmainfont{UnBatang}&#10;</xsl:text>
+        <xsl:text>\setCJKsansfont{UnDotum}&#10;</xsl:text>
+        <xsl:text>\setCJKmonofont{UnDotum}&#10;</xsl:text>
+      </xsl:when>
+    </xsl:choose>
+  </xsl:param>
+
+</xsl:stylesheet>
+
+<!--
+= Asian font basics =
+
+== Sanserif ==
+  simplified Chinese: 黑体 hēi tǐ
+    ttf-wqy-zenhei (zh_CN centric)
+      WenQuanYi Zen Hei,文泉驛正黑,文泉驿正黑
+      WenQuanYi Zen Hei Sharp,文泉驛點陣正黑,文泉驿点阵正黑
+      WenQuanYi Zen Hei Mono,文泉驛等寬正黑,文泉驿等宽正黑
+  traditional Chinese: 黑體 hēi tǐ 
+  Japanese: ゴシック kaku goshikku, gothic
+    otf-ipafont-gothic (ja centric)
+      IPAGothic,IPAゴシック
+      IPAPGothic,IPA Pゴシック
+
+== Serif ==
+中国大陆一般称:宋体;台湾香港一般称:明體
+  simplified Chinese: 宋体/(明体), Sòngtǐ
+    ttf-arphic-gbsn00lp (zh_CN centric)
+      AR PL SungtiL GB
+  traditional Chinese: (宋體)/明體, Sòngtǐ
+    ttf-arphic-bsmi00lp (zh_TW centric)
+      AR PL Mingti2L Big5
+      (Missing some character in output...)
+    ttf-arphic-uming    (zh_TW centric)
+      AR PL UMing
+       = "AR PL Mingti2L Big5" and "AR PL SungtiL GB" + extra in Taiwan-style
+       (BUild failure happened thus not used)
+  Japanese: 明朝体, Minchōtai
+    otf-ipafont-mincho (ja centric)
+      IPAMincho,IPA明朝:style=Regular
+      IPAPMincho,IPA P明朝:style=Regular
+  Korean: Hangul: 명조체; Hanja: 明朝體; Revised Romanization: Myeongjoche
+
+== Script () ==
+  simplified Chinese: 楷书; kǎishū
+    ttf-arphic-gkai00mp (zh_CN centric)
+      AR PL KaitiM GB
+  traditional Chinese: 楷書; kǎishū
+    ttf-arphic-bkai00mp (zh_TW centric)
+      AR PL KaitiM Big5
+    ttf-arphic-ukai     (zh_TW centric)
+      AR PL UKai
+       = AR PL KaitiM Big5" + "AR PL KaitiM GB" + extra in Taiwan-style
+  Japanese: 楷書, kaisho (教科書体)
+
+Korean:
+ttf-baekmuk 1st most popular    which contains 4 font families.
+                                latex-cjk-xcjk suggest this
+      /usr/share/fonts/truetype/baekmuk/dotum.ttf
+      /usr/share/fonts/truetype/baekmuk/hline.ttf
+      /usr/share/fonts/truetype/baekmuk/gulim.ttf
+      /usr/share/fonts/truetype/baekmuk/batang.ttf
+      Baekmuk Batang,백묵 바탕:style=Regular       ... serif
+      Baekmuk Dotum,백묵 돋움:style=Regular        ... san-serif  medium (print?)
+      Baekmuk Gulim,백묵 굴림:style=Regular        ... san-serif  thin   (screen?)
+      Baekmuk Headline,백묵 헤드라인:style=Regular ... bold san-serif    (best screen small)
+ttf-unfonts-core    2nd popular and increasing
+                    made from the HLaTeX's PostScript fonts
+                    UnBatang, UnDotum, Ungraphic, Unpilgi, and UnGungseo
+      UnBatang  ... serif
+      UnDotum   ... san-serif
+      UnGungseo ... Kai/kaisho
+                    latex-cjk-xcjk uses UnBatang as example
+ttf-alee    3rd most popular    many fonts by alee
+ttf-nanum                       Myeongjo and Gothic Korean font families/screen font
+ttf-nanum-coding                Korean fixed width font family
+
+encoding names:
+  * GB2312, GBK or GB18030: Simplified Chinese
+  * Big5:                   Traditional Chinese
+-->
+