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

Fw: Debian release-notes: enable PDF build for Japanese ?



Hi,

I have just sent the following mail to henrich.
Sending it to the mailinglist would not work IMO, because of too big
attachments. So I sent here only the patch.

Holger




Date: Thu, 15 Jun 2017 22:01:22 +0200
From: Holger Wansing <hwansing@mailbox.org>
To: Hideki Yamane <henrich@debian.or.jp>
Subject: Debian release-notes: enable PDF build for Japanese ?


Hi henrich,


I just managed to get the PDF build successfully running for Japanese
(that is currently disabled for the release-notes, but now possible due
to improvements in dblatex).

Attached is a patch to introduce this.
It moves font selection from the Makefile into a separate xetex_param.xsl
file: there vlgothic fonts are selected for Japanese, and for all other 
languages the same fonts as before are used.
It also switches ja from xmlroff to dblatex.

I have attached Japanese variants of the release-notes for amd64, for you 
to check the result: the PDF and also the txt and the html variants, because
they have also changed (because the whole build process for Japanese is
switched from xmlroff to dblatex).
Could you take the time to check, if everything is fine?

When building the PDF, I get the following notes:

Character U+30B1 (ケ) not in font '[lmmono10-italic]'
Character U+30B8 (ジ) not in font '[lmmono10-italic]'
Character U+30C3 (ッ) not in font '[lmmono10-italic]'
Character U+30D1 (パ) not in font '[lmmono10-italic]'
Character U+30FC (ー) not in font '[lmmono10-italic]'

What are these characters? Can you see places, where they are missing?
And even if they are missing somewhere, maybe we can enable the PDF build
nevertheless, because it's better with the missing characters then having
no PDF at all?


Thanks

So long
Holger


-- 
Holger Wansing <hwansing@mailbox.org>
PGP-Finterprint: 496A C6E8 1442 4B34 8508  3529 59F1 87CA 156E B076


-- 
Holger Wansing <hwansing@mailbox.org>
PGP-Finterprint: 496A C6E8 1442 4B34 8508  3529 59F1 87CA 156E B076
Index: Makefile
===================================================================
--- Makefile	(Revision 11645)
+++ Makefile	(Arbeitskopie)
@@ -44,14 +44,14 @@
 # (either original English or translators don't like .po)
 DBK_LANGUAGES := en ca cs
 PO_LANGUAGES := $(filter-out $(DBK_LANGUAGES), $(ALL_LANGUAGES))
-XMLROFF_LANGS=be ja ml vi zh-cn zh-tw
+XMLROFF_LANGS=be ml vi zh-cn zh-tw
 PO_FILES := $(wildcard */*.po)
 DBK_FILES := $(wildcard $(patsubst %,%/*.dbk,$(DBK_LANGUAGES)))
 
 # DISABLED_PDF are the languages we will not generate PDF versions for:
-DISABLED_PDF=ja vi zh-cn zh-tw
+DISABLED_PDF=vi zh-cn zh-tw
 # cairo backend of xmlroff 0.6.0 crashes on some languages (#492597)
-GPLIST=ja ml vi
+GPLIST=ml vi
 
 LANGUAGES-publish := $(addsuffix -publish,$(LANGUAGES))
 LANGUAGES-clean := $(addsuffix -clean,$(LANGUAGES))
@@ -75,13 +75,7 @@
 DBLATEX=dblatex --backend=xetex --style=db2latex \
     --xslt-opts=--nonet --no-external \
     --xsl-user=hyphenation.xsl \
-    --param=xetex.font='                 \
-\setmainfont{CharisSIL-R.ttf}[           \
-  BoldFont       = CharisSIL-B.ttf ,     \
-  ItalicFont     = CharisSIL-I.ttf ,     \
-  BoldItalicFont = CharisSIL-BI.ttf]     \
-\setsansfont{FreeSans}                   \
-\setmonofont{FreeMono}' \
+    --xsl-user=$(CURDIR)/xetex_param.xsl \
     --param=draft.mode=$(draftmode) \
     --param=format=a4 \
     --param=glossterm.auto.link=1 \
Index: debian/control
===================================================================
--- debian/control	(Revision 11639)
+++ debian/control	(Arbeitskopie)
@@ -4,7 +4,7 @@
 Maintainer: Debian Documentation Project <debian-doc@lists.debian.org>
 Uploaders: 
 Standards-Version: 3.8.2
-Build-Depends-Indep: docbook-xsl, dblatex, xsltproc, po4a, w3m, libxml2-utils, xmlroff, texlive-lang-cyrillic, subversion
+Build-Depends-Indep: docbook-xsl, dblatex, xsltproc, po4a, w3m, libxml2-utils, xmlroff, texlive-lang-cyrillic, subversion, fonts-vlgothic
 # WARNING: network needed (svn)
 # ttf-arphic-ukai, ttf-arphic-uming, ttf-arphic-bkai00mp, ttf-arphic-bsmi00lp, ttf-arphic-gbsn00lp, ttf-arphic-gkai00mp
 # texlive- (used by dblatex)
Index: ja/hyphenation.tex
===================================================================
--- ja/hyphenation.tex	(Revision 0)
+++ ja/hyphenation.tex	(Arbeitskopie)
@@ -0,0 +1 @@
+\hyphenation{}
Index: xetex_param.xsl
===================================================================
--- xetex_param.xsl	(Revision 0)
+++ xetex_param.xsl	(Arbeitskopie)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version='1.0'>
+<!-- vim: set sts=2 ai expandtab: -->
+
+<!--############################################################################
+    XSLT Stylesheet DocBook -> LaTeX  (XeTeX focused)
+    ############################################################################ -->
+
+  <xsl:param name="xetex.font">
+    <xsl:choose>
+      <xsl:when test="$lingua = 'ja'">
+          <!-- Depends: fonts-vlgothic -->
+	<xsl:text>\usepackage{xeCJK}&#10;</xsl:text>
+	<xsl:text>\setCJKmainfont{VL PGothic}&#10;</xsl:text>
+	<xsl:text>\setCJKsansfont{VL PGothic}&#10;</xsl:text>
+	<xsl:text>\setCJKmonofont{VL Gothic}&#10;</xsl:text>
+      </xsl:when>
+    <xsl:otherwise>
+        <xsl:text>\setmainfont{CharisSIL-R.ttf}[BoldFont = CharisSIL-B.ttf , ItalicFont = CharisSIL-I.ttf , BoldItalicFont = CharisSIL-BI.ttf]&#10;</xsl:text>
+        <xsl:text>\setsansfont{FreeSans}&#10;</xsl:text>
+        <xsl:text>\setmonofont{FreeMono}&#10;</xsl:text>
+    </xsl:otherwise>
+    </xsl:choose>
+  </xsl:param>
+</xsl:stylesheet>

Reply to: