Skip to content

Commit

Permalink
Add user style sheet and conditional branch for appropriate Japanese …
Browse files Browse the repository at this point in the history
…PDF typesetting

* Japanese-specific style sheet for good Japanese typesetting.
* conditional branch for using the style sheet if '--lang=ja-JP' specified.
  • Loading branch information
AYANOKOUZI, Ryuunosuke committed Nov 3, 2015
1 parent 367fcfe commit bcd1342
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
6 changes: 6 additions & 0 deletions build/build-pdf
Expand Up @@ -27,6 +27,12 @@ fi
cp -a build/dblatex tmp/$OPT_lang/xml/
cd tmp/$OPT_lang/xml/

if [ "${OPT_lang}" = "ja-JP" ];
then
_XSL_USER_STYLESHEET=./dblatex/librement-ja-JP.xsl;
OPT_opts="--backend=xetex --xsl-user=${_XSL_USER_STYLESHEET} "${OPT_opts};

This comment has been minimized.

Copy link
@rhertzog

rhertzog Nov 3, 2015

Note that --backend=xetex is already set via build/dblatex/librement.conf ("Options: -b xetex").

fi

echo "RUN: dblatex -c dblatex/librement.conf $OPT_opts debian-handbook.xml"
if dblatex -c dblatex/librement.conf $OPT_opts debian-handbook.xml; then

This comment has been minimized.

Copy link
@rhertzog

rhertzog Nov 3, 2015

But you might want to add here -P tdah.lang=$OPT_lang so that you can use the $tdah.lang parameter in build/diblatex/config.xsl to inject the changes you have made through build/dblatex/librement-ja-JP.xsl

targetdir="$topdir/publish/$OPT_lang/Debian/$version/pdf/debian-handbook"
Expand Down
34 changes: 34 additions & 0 deletions build/dblatex/librement-ja-JP.xsl
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:param name="latex.engine.options">
<xsl:text>-output-driver='xdvipdfmx'</xsl:text>
<!--
This is for overriding xelatex's default
-output-driver option 'xdvipdfmx -q -E'.
xdvipdfmx should respect to the Font Embedding Permissions,
'-E' option neglects this behavior and
'-q' will suppress showing the warning.
-->
</xsl:param>
<xsl:param name="xetex.font">
<xsl:text>
\XeTeXtracingfonts=1
\defaultfontfeatures+{Scale=0.8}
\setmainfont{DejaVu Serif}
\setsansfont{DejaVu Sans}
\setmonofont{DejaVu Sans Mono}
\usepackage[AutoFallBack=true]{zxjatype}
\usepackage[ipa,scale=0.8]{zxjafont}
%
% Please don't use IPAex family fonts like IPAexMincho and/or IPAexGothic.
% Because some characters are converted into Kangxi radical.
% Example:
% 一 (U+4E00) -&gt; ⼀ (U+2F00),
% 人 (U+4EBA) -&gt; ⼈ (U+2F08),
% 非 (U+975E) -&gt; ⾮ (U+2FAE),
% 高 (U+9AD8) -&gt; ⾼ (U+2FBC) etc...
% This conversion is not problem for printing, but
% is problem for searching pdf and converting pdf into text.
</xsl:text>
</xsl:param>
</xsl:stylesheet>

0 comments on commit bcd1342

Please sign in to comment.