summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-04-21 23:46:31 +0000
committerKarl Berry <karl@freefriends.org>2015-04-21 23:46:31 +0000
commitdbf06c3ecc6528bd2410630d2a251940ec0c9b23 (patch)
treec875bdd9f4e6a021f50e1e36e2779c07b828347c /Master/texmf-dist/source
parent142d903dcd96ad083d58f5518aa138a676eb68c0 (diff)
luatexja (21apr15)
git-svn-id: svn://tug.org/texlive/trunk@36992 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source')
-rw-r--r--Master/texmf-dist/source/luatex/luatexja/ltjclasses.dtx147
-rw-r--r--Master/texmf-dist/source/luatex/luatexja/ltjclasses.ins18
-rw-r--r--Master/texmf-dist/source/luatex/luatexja/ltjltxdoc.dtx13
-rw-r--r--Master/texmf-dist/source/luatex/luatexja/ltjsclasses.dtx62
-rwxr-xr-xMaster/texmf-dist/source/luatex/luatexja/tool/jfm-convert.lua281
5 files changed, 430 insertions, 91 deletions
diff --git a/Master/texmf-dist/source/luatex/luatexja/ltjclasses.dtx b/Master/texmf-dist/source/luatex/luatexja/ltjclasses.dtx
index cbd2dde3608..19f9234868b 100644
--- a/Master/texmf-dist/source/luatex/luatexja/ltjclasses.dtx
+++ b/Master/texmf-dist/source/luatex/luatexja/ltjclasses.dtx
@@ -10,7 +10,7 @@
%
% \fi
%
-% \CheckSum{4478}
+% \CheckSum{4499}
%% \CharacterTable
%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
@@ -76,7 +76,14 @@
% (ありがとうございます、鈴木た@MILNさん)}
% \changes{v1.6}{2006/06/27}{フォントコマンドを修正。ありがとう、ymtさん。}
% \changes{v1.6-ltj}{2011/09/27}{jclasses.dtx v1.6 をベースにLua\LaTeX-ja用に修正。}
-% \changes{v1.6-ltj-2}{2013/06/06}{jclasses.dtx luatexja.cfgに対応.}
+% \changes{v1.6-ltj-2}{2013/06/06}{luatexja.cfgに対応.}
+% \changes{v1.6-ltj-3}{2014/06/08}{縦組クラスの時のgeometry.styに対応.}
+% \changes{v1.6-ltj-4}{2014/06/30}{組方向の変更箇所を現行のLua\TeX-jaの仕様に合うように修正.}
+% \changes{v1.6-ltj-5}{2014/07/02}{\cs{ifydir}, \cs{iftdir}を使わないように修正.}
+% \changes{v1.6-ltj-6}{2014/07/28}{縦組クラスでlltjext.styを読み込むように修正.}
+% \changes{v1.6-ltj-7}{2014/11/15}{縦組クラスとeveryshi.styとの相性が悪い問題を修正.}
+% \changes{v1.6-ltj-8}{2014/11/22}{縦組時のgeometry.styへの対応を別ファイル(lltjp-geometry.sty)に分離.それに伴いv1.6-ltj-3での変更を削除.}
+% \changes{v1.6-ltj-9}{2015/01/01}{縦組クラスの日付出力でエラーになることなどを修正.}
% \fi
%
% \iffalse
@@ -106,7 +113,7 @@
%<11pt&bk>\ProvidesFile{ltjtbk11.clo}
%<12pt&bk>\ProvidesFile{ltjtbk12.clo}
%</tate>
- [2013/06/06 v1.6-ltj-2
+ [2015/01/01 v1.6-ltj-9
%<article|report|book> Standard LuaLaTeX-ja class]
%<10pt|11pt|12pt> Standard LuaLaTeX-ja file (size option)]
%<*driver>
@@ -147,7 +154,7 @@
% 11pt & 11ptサイズの設定を生成\\
% 12pt & 12ptサイズの設定を生成\\
% bk & bookクラス用のサイズの設定を生成\\
-% tate & 縦組用の設定を生成(現在無効)\\
+% tate & 縦組用の設定を生成\\
% yoko & 横組用の設定を生成\\
% \end{tabular}
% \end{center}
@@ -163,6 +170,7 @@
% \end{quotation}
% のエラーが起こった場合は、|lualatex-math|パッケージを読み込んでみて下さい。
% \item 出力PDFの用紙サイズが自動的に設定されるようにしてあります。
+% %%%\item 縦組みクラスにおいて、|geometry|パッケージを読み込んだときに意図通りにならない問題に対応しました。%
% \end{itemize}
%
% \section{Lua\TeX-ja の読み込み}
@@ -374,15 +382,34 @@
%
% \subsection{組方向オプション}
% このオプションが指定されると、縦組で組版をします。
-% しかしLua\TeX-jaではまだ縦組は未対応なのでコメントアウトします。
% \changes{v1.0g}{1997/01/25}{Insert \cs{hbox}, to switch tate-mode.}
% \changes{v1.1d}{1997/02/05}{開始ページがおかしくなるのを修正}
% \changes{v1.1f}{1997/07/08}{縦組時にベースラインがおかしくなるのを修正}
+%
+% \changes{v1.6-ltj-4}{2014/06/30}{本文の組方向を \cs{AtBeginDocument} で
+% 変更することができなくなったことに対応}
% \begin{macrocode}
-%% \DeclareOption{tate}{%
-%% \AtBeginDocument{\tate\message{《縦組モード》}%
-%% \adjustbaseline}%
-%% }
+\DeclareOption{tate}{%
+ \tate\AtBeginDocument{\message{《縦組モード》}\adjustbaseline}%
+}
+% \end{macrocode}
+%
+% 縦組クラスと|everyshi|パッケージの相性が悪い問題に対処します。
+% この処理は、ZRさんの|pxeveryshi|パッケージと実質的に同じ内容です。
+% \begin{macrocode}
+%<*tate>
+\AtEndOfPackageFile{everyshi}{%
+ \def\@EveryShipout@Output{%
+ \setbox8\vbox{%
+ \yoko
+ \@EveryShipout@Hook
+ \@EveryShipout@AtNextHook
+ \global\setbox\luatexoutputbox=\box\luatexoutputbox
+ }%
+ \gdef\@EveryShipout@AtNextHook{}%
+ \@EveryShipout@Org@Shipout\box\luatexoutputbox
+ }}
+%</tate>
% \end{macrocode}
%
% \subsection{両面、片面オプション}
@@ -479,38 +506,8 @@
%</article|report|book>
% \end{macrocode}
%
-% \subsection{オプションの実行}
-% オプションの実行、およびサイズクラスのロードを行ないます。
-% \begin{macrocode}
-%<*article|report|book>
-%<*article>
-%<tate>\ExecuteOptions{a4paper,10pt,oneside,onecolumn,final,tate}
-%<yoko>\ExecuteOptions{a4paper,10pt,oneside,onecolumn,final}
-%</article>
-%<*report>
-%<tate>\ExecuteOptions{a4paper,10pt,oneside,onecolumn,final,openany,tate}
-%<yoko>\ExecuteOptions{a4paper,10pt,oneside,onecolumn,final,openany}
-%</report>
-%<*book>
-%<tate>\ExecuteOptions{a4paper,10pt,twoside,onecolumn,final,openright,tate}
-%<yoko>\ExecuteOptions{a4paper,10pt,twoside,onecolumn,final,openright}
-%</book>
-\ProcessOptions\relax
-%<book&tate>\input{ltjtbk1\@ptsize.clo}
-%<!book&tate>\input{ltjtsize1\@ptsize.clo}
-%<book&yoko>\input{ltjbk1\@ptsize.clo}
-%<!book&yoko>\input{ltjsize1\@ptsize.clo}
-% \end{macrocode}
-% 縦組用クラスファイルの場合は、ここで\file{plext.sty}が読み込まれていました。
-% Lua\TeX-jaでどうなるかは未定です。
-% \changes{v1.0e}{1996/03/21}{\cs{usepackage} to \cs{RequirePackage}}
-% \begin{macrocode}
-%<tate>%\RequirePackage{plext}
-%</article|report|book>
-% \end{macrocode}
-%
-% \section{フォント}
-%
+% \subsection{フォントメトリックの変更}
+%
% Lua\LaTeX-jaの標準では、OTFパッケージ由来のメトリックが使われるようになっています。
% 本クラスでは、「p\TeX の組版と互換性をできるだけ持たせる」例を提示するため、
% \begin{itemize}
@@ -527,8 +524,10 @@
% 設定に対応しました。この2つの命令の値はユーザが日々の利用でその都度指定するものではなく、
% 何らかの理由で非埋め込みフォントが正しく利用できない場合にのみ |luatexja.cfg| によって
% セットされるものです。
-%
%
+% \changes{v1.6-ltj-9}{2015/01/01}{サイズクラスのロード前にメトリックの変更を行わないと,
+% \cs{Cht}等の値が反映されないのでこの場所に移動させました.}
+%
% \begin{macrocode}
%<*article|report|book>
\directlua{luatexbase.add_to_callback('luatexja.load_jfm',
@@ -543,6 +542,39 @@
%</article|report|book>
% \end{macrocode}
%
+% \subsection{オプションの実行}
+% オプションの実行、およびサイズクラスのロードを行ないます。
+% \begin{macrocode}
+%<*article|report|book>
+%<*article>
+%<tate>\ExecuteOptions{a4paper,10pt,oneside,onecolumn,final,tate}
+%<yoko>\ExecuteOptions{a4paper,10pt,oneside,onecolumn,final}
+%</article>
+%<*report>
+%<tate>\ExecuteOptions{a4paper,10pt,oneside,onecolumn,final,openany,tate}
+%<yoko>\ExecuteOptions{a4paper,10pt,oneside,onecolumn,final,openany}
+%</report>
+%<*book>
+%<tate>\ExecuteOptions{a4paper,10pt,twoside,onecolumn,final,openright,tate}
+%<yoko>\ExecuteOptions{a4paper,10pt,twoside,onecolumn,final,openright}
+%</book>
+\ProcessOptions\relax
+%<book&tate>\input{ltjtbk1\@ptsize.clo}
+%<!book&tate>\input{ltjtsize1\@ptsize.clo}
+%<book&yoko>\input{ltjbk1\@ptsize.clo}
+%<!book&yoko>\input{ltjsize1\@ptsize.clo}
+% \end{macrocode}
+% 縦組用クラスファイルの場合は、ここで\file{plext.sty}も読み込みます。
+% \changes{v1.0e}{1996/03/21}{\cs{usepackage} to \cs{RequirePackage}}
+% \changes{v1.6-ltj-6}{2014/07/28}{Lua\TeX-jaでは,代わりに\file{lltjext.sty}を読み込みま
+% す.これは\file{plext.sty}をLua\TeX-ja用に書きなおしたものです.}
+% \begin{macrocode}
+%<tate>\RequirePackage{lltjext}
+%</article|report|book>
+% \end{macrocode}
+%
+% \section{フォント}
+%
% ここでは、\LaTeX{}のフォントサイズコマンドの定義をしています。
% フォントサイズコマンドの定義は、次のコマンドを用います。
%
@@ -2123,7 +2155,7 @@
\newcommand{\maketitle}{\par
\begingroup
\renewcommand{\thefootnote}{\fnsymbol{footnote}}%
- \def\@makefnmark{\hbox{\ifydir $\m@th^{\@thefnmark}$
+ \def\@makefnmark{\hbox{\unless\ifnum\ltjgetparameter{direction}=3 $\m@th^{\@thefnmark}$
\else\hbox{\yoko$\m@th^{\@thefnmark}$}\fi}}%
%<*tate>
\long\def\@makefntext##1{\parindent 1\zw\noindent
@@ -3040,7 +3072,7 @@
\advance\@enumdepth\@ne
\edef\@enumctr{enum\romannumeral\the\@enumdepth}%
\list{\csname label\@enumctr\endcsname}{%
- \iftdir
+ \ifnum\ltjgetparameter{direction}=3
\ifnum \@listdepth=\@ne \topsep.5\normalbaselineskip
\else\topsep\z@\fi
\parskip\z@ \itemsep\z@ \parsep\z@
@@ -3068,7 +3100,7 @@
% \begin{macrocode}
\newcommand{\labelitemi}{\textbullet}
\newcommand{\labelitemii}{%
- \iftdir
+ \ifnum\ltjgetparameter{direction}=3
{\textcircled{~}}
\else
{\normalfont\bfseries\textendash}
@@ -3093,7 +3125,7 @@
\edef\@itemitem{labelitem\romannumeral\the\@itemdepth}%
\expandafter
\list{\csname \@itemitem\endcsname}{%
- \iftdir
+ \ifnum\ltjgetparameter{direction}=3
\ifnum \@listdepth=\@ne \topsep.5\normalbaselineskip
\else\topsep\z@\fi
\parskip\z@ \itemsep\z@ \parsep\z@
@@ -3118,7 +3150,7 @@
% \begin{macrocode}
\newenvironment{description}
{\list{}{\labelwidth\z@ \itemindent-\leftmargin
- \iftdir
+ \ifnum\ltjgetparameter{direction}=3
\leftmargin\leftskip \advance\leftmargin3\Cwd
\rightmargin\rightskip
\labelsep=1\zw \itemsep\z@
@@ -3355,11 +3387,11 @@
% \begin{macrocode}
\long\def\@makecaption#1#2{%
\vskip\abovecaptionskip
- \iftdir\sbox\@tempboxa{#1\hskip1\zw#2}%
+ \ifnum\ltjgetparameter{direction}=3 \sbox\@tempboxa{#1\hskip1\zw#2}%
\else\sbox\@tempboxa{#1: #2}%
\fi
\ifdim \wd\@tempboxa >\hsize
- \iftdir #1\hskip1\zw#2\relax\par
+ \ifnum\ltjgetparameter{direction}=3 #1\hskip1\zw#2\relax\par
\else #1: #2\relax\par\fi
\else
\global \@minipagefalse
@@ -4064,17 +4096,20 @@
%
% \begin{macro}{\today}
% 縦組の場合は、漢数字で出力します。
+%
+% \changes{v1.6-ltj-9}{2015/01/01}{縦組では,この漢数字による日付出力でエラーになりました.
+% Lua\TeX-ja では,\cs{kansuji}の後に\cs{number}を続けることは出来ないので\cs{number}を削除しました.}
% \begin{macrocode}
\def\today{{%
- \iftdir
+ \ifnum\ltjgetparameter{direction}=3
\if西暦
- \kansuji\number\year 年
- \kansuji\number\month 月
- \kansuji\number\day 日
+ \kansuji\year 年
+ \kansuji\month 月
+ \kansuji\day 日
\else
- 平成\ifnum\heisei=1 元年\else\kansuji\number\heisei 年\fi
- \kansuji\number\month 月
- \kansuji\number\day 日
+ 平成\ifnum\heisei=1 元年\else\kansuji\heisei 年\fi
+ \kansuji\month 月
+ \kansuji\day 日
\fi
\else
\if西暦
diff --git a/Master/texmf-dist/source/luatex/luatexja/ltjclasses.ins b/Master/texmf-dist/source/luatex/luatexja/ltjclasses.ins
index 36931de1816..a4977146c78 100644
--- a/Master/texmf-dist/source/luatex/luatexja/ltjclasses.ins
+++ b/Master/texmf-dist/source/luatex/luatexja/ltjclasses.ins
@@ -15,14 +15,14 @@
\generateFile{ltjbk11.clo}{f}{\from{ltjclasses.dtx}{11pt,bk,yoko}}
\generateFile{ltjbk12.clo}{f}{\from{ltjclasses.dtx}{12pt,bk,yoko}}
-%% \generateFile{ltjtarticle.cls}{f}{\from{ltjclasses.dtx}{article,tate}}
-%% \generateFile{ltjtreport.cls}{f}{\from{ltjclasses.dtx}{report,tate}}
-%% \generateFile{ltjtbook.cls}{f}{\from{ltjclasses.dtx}{book,tate}}
-%% \generateFile{ltjtsize10.clo}{f}{\from{ltjclasses.dtx}{10pt,tate}}
-%% \generateFile{ltjtsize11.clo}{f}{\from{ltjclasses.dtx}{11pt,tate}}
-%% \generateFile{ltjtsize12.clo}{f}{\from{ltjclasses.dtx}{12pt,tate}}
-%% \generateFile{ltjtbk10.clo}{f}{\from{ltjclasses.dtx}{10pt,bk,tate}}
-%% \generateFile{ltjtbk11.clo}{f}{\from{ltjclasses.dtx}{11pt,bk,tate}}
-%% \generateFile{ltjtbk12.clo}{f}{\from{ltjclasses.dtx}{12pt,bk,tate}}
+\generateFile{ltjtarticle.cls}{f}{\from{ltjclasses.dtx}{article,tate}}
+\generateFile{ltjtreport.cls}{f}{\from{ltjclasses.dtx}{report,tate}}
+\generateFile{ltjtbook.cls}{f}{\from{ltjclasses.dtx}{book,tate}}
+\generateFile{ltjtsize10.clo}{f}{\from{ltjclasses.dtx}{10pt,tate}}
+\generateFile{ltjtsize11.clo}{f}{\from{ltjclasses.dtx}{11pt,tate}}
+\generateFile{ltjtsize12.clo}{f}{\from{ltjclasses.dtx}{12pt,tate}}
+\generateFile{ltjtbk10.clo}{f}{\from{ltjclasses.dtx}{10pt,bk,tate}}
+\generateFile{ltjtbk11.clo}{f}{\from{ltjclasses.dtx}{11pt,bk,tate}}
+\generateFile{ltjtbk12.clo}{f}{\from{ltjclasses.dtx}{12pt,bk,tate}}
\endbatchfile
diff --git a/Master/texmf-dist/source/luatex/luatexja/ltjltxdoc.dtx b/Master/texmf-dist/source/luatex/luatexja/ltjltxdoc.dtx
index 8eed22cd5cd..00f537b2e2e 100644
--- a/Master/texmf-dist/source/luatex/luatexja/ltjltxdoc.dtx
+++ b/Master/texmf-dist/source/luatex/luatexja/ltjltxdoc.dtx
@@ -10,7 +10,7 @@
%
% \fi
%
-% \CheckSum{137}
+% \CheckSum{151}
%% \CharacterTable
%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
@@ -36,6 +36,7 @@
% 合わせて修正}
% \changes{v1.0b}{1997/07/29}{\cs{}と\texttt{"}の\cs{xspcode}を変更}
% \changes{v1.0b-ltj}{2011/09/27}{Lua\LaTeX-ja 用に修正}
+% \changes{v1.0b-ltj-2}{2014/07/03}{orを意味する縦棒の出力が異常だったので修正}
% \fi
%
% \iffalse
@@ -189,6 +190,16 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{mod@math@codes}
+% docパッケージでは,ドライバ指定の表示の部分における\texttt{\char`\|}の
+% \cs{mathcode}は\texttt{"226A}になっており,これにより\texttt{\char`\|}が小文字のjで表示されて
+% しまう状況になっています.改善するため,\texttt{"207C}に変更します.
+% \begin{macrocode}
+\def\mod@math@codes{\mathcode`\|="207C \mathcode`\&="2026
+ \mathcode`\-="702D \mathcode`\+="702B
+ \mathcode`\:="703A \mathcode`\=="703D }
+% \end{macrocode}
+% \end{macro}
% \Finale
%
\endinput
diff --git a/Master/texmf-dist/source/luatex/luatexja/ltjsclasses.dtx b/Master/texmf-dist/source/luatex/luatexja/ltjsclasses.dtx
index 53b2f0524b5..6a5c905201c 100644
--- a/Master/texmf-dist/source/luatex/luatexja/ltjsclasses.dtx
+++ b/Master/texmf-dist/source/luatex/luatexja/ltjsclasses.dtx
@@ -22,7 +22,7 @@
% -----------------------------------------
%
% \fi
-% \CheckSum{5210}
+% \CheckSum{5223}
%% \CharacterTable
%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
@@ -50,7 +50,7 @@
%<*driver>
\ProvidesFile{ltjsclasses.dtx}
%</driver>
- [2014/12/24 ]
+ [2015/01/07 ]
%<*driver>
\documentclass{ltjsarticle}
\usepackage{doc}
@@ -132,6 +132,8 @@
%
% [2014-02-07 LTJ] jsclasses 2014-02-07 ベースにしました.
%
+% [2014-07-26 LTJ] 縦組用和文フォントの設定を加えました.
+%
% [2014-12-24 LTJ] |\@setfontsize| 中の和欧文間空白の設定で if 文が抜けていたのを直しました.
%
% \StopEventually{}
@@ -751,6 +753,8 @@
% 何らかの理由で非埋め込みフォントが正しく利用できない場合にのみ |luatexja.cfg| によって
% セットされるものです。
%
+% [2014-07-26 LTJ] なお,現状のところ,縦組用JFMは |jfm-ujisv.lua| しか準備していません.
+%
% \begin{macrocode}
%<*!jspf>
\expandafter\let\csname JY3/mc/m/n/10\endcsname\relax
@@ -766,6 +770,8 @@
\DeclareFontShape{JY3}{gt}{m}{n}{<-> s * [0.924872] \ltj@stdgtfont:jfm=ujis}{}
\fi
\fi
+\DeclareFontShape{JT3}{mc}{m}{n}{<-> s * [0.924872] \ltj@stdmcfont:jfm=ujisv}{}
+\DeclareFontShape{JT3}{gt}{m}{n}{<-> s * [0.924872] \ltj@stdgtfont:jfm=ujisv}{}
%</!jspf>
% \end{macrocode}
%
@@ -793,6 +799,8 @@
\DeclareFontShape{JY3}{gt}{m}{n}{<-> s * [0.903375] \ltj@stdgtfont:jfm=ujis}{}
\fi
\fi
+\DeclareFontShape{JT3}{mc}{m}{n}{<-> s * [0.903375] \ltj@stdmcfont:jfm=ujisv}{}
+\DeclareFontShape{JT3}{gt}{m}{n}{<-> s * [0.903375] \ltj@stdgtfont:jfm=ujisv}{}
%</jspf>
% \end{macrocode}
%
@@ -981,13 +989,13 @@
\fi
\fi
\ltj@setpar@global
- \ltjsetkanjiskip{\z@ plus .1\zw minus .01\zw}
+ \ltjsetkanjiskip\z@ plus .1\zw minus .01\zw
\@tempskipa=\ltjgetparameter{xkanjiskip}
\ifdim\@tempskipa>\z@
\if@slide
- \ltjsetxkanjiskip{0.1em}
+ \ltjsetxkanjiskip .1em
\else
- \ltjsetxkanjiskip{0.25em plus 0.15em minus 0.06em}
+ \ltjsetxkanjiskip .25em plus .15em minus .06em
\fi
\fi}
% \end{macrocode}
@@ -1015,6 +1023,9 @@
%
% TODO: Hasumiさん [qa:54539] のご指摘は考慮中です。
%
+% [2015-01-07 LTJ] 遅くなりましたが,
+% \url{http://oku.edu.mie-u.ac.jp/tex/mod/forum/discuss.php?d=1005} にあったZRさんのパッチを取り込みました.
+%
% \begin{macrocode}
\newif\ifnarrowbaselines
\if@english
@@ -1032,6 +1043,11 @@
\belowdisplayskip=\skip4
\belowdisplayshortskip=\skip6\relax}
\def\widebaselines{\narrowbaselinesfalse\@currsize\selectfont}
+\def\ltj@@ifnarrowbaselines{%
+ \ifnarrowbaselines\expandafter\@firstoftwo
+ \else \expandafter\@secondoftwo
+ \fi
+}
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -1056,11 +1072,9 @@
%
% \begin{macrocode}
\renewcommand{\normalsize}{%
- \ifnarrowbaselines
- \@setfontsize\normalsize\@xpt\@xiipt
- \else
- \@setfontsize\normalsize\@xpt{\n@baseline}%
- \fi
+ \ltj@@ifnarrowbaselines
+ {\@setfontsize\normalsize\@xpt\@xiipt}%
+ {\@setfontsize\normalsize\@xpt{\n@baseline}}%
% \end{macrocode}
%
% 数式の上のアキ(|\abovedisplayskip|),
@@ -1131,13 +1145,11 @@
%
% \begin{macrocode}
\newcommand{\small}{%
- \ifnarrowbaselines
-%<!kiyou> \@setfontsize\small\@ixpt{11}%
-%<kiyou> \@setfontsize\small{8.8888}{11}%
- \else
-%<!kiyou> \@setfontsize\small\@ixpt{13}%
-%<kiyou> \@setfontsize\small{8.8888}{13.2418}%
- \fi
+ \ltj@@ifnarrowbaselines
+%<!kiyou> {\@setfontsize\small\@ixpt{11}}%
+%<kiyou> {\@setfontsize\small{8.8888}{11}}%
+%<!kiyou> {\@setfontsize\small\@ixpt{13}}%
+%<kiyou> {\@setfontsize\small{8.8888}{13.2418}}%
\abovedisplayskip 9\p@ \@plus3\p@ \@minus4\p@
\abovedisplayshortskip \z@ \@plus3\p@
\belowdisplayskip \abovedisplayskip
@@ -1157,13 +1169,11 @@
%
% \begin{macrocode}
\newcommand{\footnotesize}{%
- \ifnarrowbaselines
-%<!kiyou> \@setfontsize\footnotesize\@viiipt{9.5}%
-%<kiyou> \@setfontsize\footnotesize{8.8888}{11}%
- \else
-%<!kiyou> \@setfontsize\footnotesize\@viiipt{11}%
-%<kiyou> \@setfontsize\footnotesize{8.8888}{13.2418}%
- \fi
+ \ltj@@ifnarrowbaselines
+%<!kiyou> {\@setfontsize\footnotesize\@viiipt{9.5}}%
+%<kiyou> {\@setfontsize\footnotesize{8.8888}{11}}%
+%<!kiyou> {\@setfontsize\footnotesize\@viiipt{11}}%
+%<kiyou> {\@setfontsize\footnotesize{8.8888}{13.2418}}%
\abovedisplayskip 6\p@ \@plus2\p@ \@minus3\p@
\abovedisplayshortskip \z@ \@plus2\p@
\belowdisplayskip \abovedisplayskip
@@ -4610,9 +4620,11 @@
%
% [2013-05-14] plcore.ltx に倣った形に書き直しました(Thanks: 北川さん)。
%
+% [2014-07-02 LTJ] |\ifydir| を使わない形に書換えました.
+%
% \begin{macrocode}
\renewcommand\@makefnmark{\hbox{}\hbox{%
- \ifydir \@textsuperscript{\normalfont\@thefnmark}%
+ \unless\ifnum\ltjgetparameter{direction}=3 \@textsuperscript{\normalfont\@thefnmark}%
\else\hbox{\yoko\@textsuperscript{\normalfont\@thefnmark}}\fi}\hbox{}}
% \end{macrocode}
% \end{macro}
diff --git a/Master/texmf-dist/source/luatex/luatexja/tool/jfm-convert.lua b/Master/texmf-dist/source/luatex/luatexja/tool/jfm-convert.lua
new file mode 100755
index 00000000000..66b73a02cd8
--- /dev/null
+++ b/Master/texmf-dist/source/luatex/luatexja/tool/jfm-convert.lua
@@ -0,0 +1,281 @@
+#!/usr/bin/env texlua
+
+local stderr = io.stderr
+local function show_usage(s)
+ stderr:write('Error: ' .. s .. '\n');
+ stderr:write('Usage: jfm-convert [-J|-U] <ptex_jfm>\n');
+ stderr:write('-J: JIS mode, -U: UCS mode \n');
+ stderr:write(' * The output will be written to stdout.\n');
+ stderr:write(' * I do not read virtual fonts which corresponded to <ptex_jfm>.\n');
+ stderr:write(" You will need to adjust 'align', 'left', 'down' entries by hand.\n");
+ stderr:write(" * In JIS mode, characters which are not included in JIS X 0208\n");
+ stderr:write(" (e.g., 0x2257) are written as 0x202577.\n");
+ os.exit(1)
+end
+
+require('unicode'); local uchar = unicode.utf8.char
+kpse.set_program_name('luatex')
+jisx0208 = require('ltj-jisx0208.lua').table_jisx0208_uptex
+local function pass_ucs(s)
+ return "'" .. uchar(s) .. "'"
+end
+local function jis_to_ucs(s)
+ local a = jisx0208[s-0x2020]
+ return a and pass_ucs(a) or string.format('0x%X',s+0x200000)
+end
+
+-------- 引数解釈 --------
+
+require('unicode')
+local filename
+local mode
+
+for i=1,#arg do
+ if arg[i]=='-u' or arg[i]=='-U' then
+ mode = pass_ucs
+ elseif arg[i]=='-j' or arg[i]=='-J' then
+ mode = jis_to_ucs
+ elseif filename then
+ show_usage('Multiple JFM files.')
+ else
+ filename = arg[i]
+ end
+end
+
+if not filename then show_usage('Missing JFM file argument.') end
+kpse.set_program_name('ptex')
+local nf = kpse.find_file(filename, 'tfm')
+if not nf then show_usage("JFM file can't be opened: " .. filename) end
+
+-------- OPEN --------
+
+local jfm_ptex = io.open(nf, 'rb')
+local function get_word()
+ local d = table.pack(string.byte(jfm_ptex:read(4),1,4))
+ return d[1]*16777216+d[2]*65536+d[3]*256+d[4]
+end
+local function get_signed_word()
+ local d = get_word()
+ return (d>=2147483648) and -(4294967296-d) or d
+end
+local extract = bit32.extract
+local function get_two()
+ local d = get_word()
+ return extract(d,16,16), extract(d,0,16)
+end
+local function get_four()
+ local d = get_word()
+ return extract(d,24,8), extract(d,16,8), extract(d,8,8), extract(d,0,8)
+end
+
+local id, nt = get_two()
+local lf, lh = get_two()
+local bc, ec = get_two()
+local nw, nh = get_two()
+local nd, ni = get_two()
+local nl, nk = get_two()
+local ng, np = get_two()
+
+if bc~=0 or
+ lf~= 7 + lh + nt + (ec - bc + 1) + nw + nh + nd + ni + nl + nk + ng + np or
+ (id~=11 and id~=9) then
+ stderr:write('Bad JFM "' .. filename .. '".\n'); jfm_ptex:close(); os.exit(1)
+end
+
+local result = {}
+result.dir = (id==11) and 'yoko' or 'tate'
+
+-------- HEADER --------
+
+_ = get_word() -- checksum, unused
+local designsize = get_word()/1048576 -- ignored
+
+local encoding
+if lh>=3 then
+ encoding = ''
+ for i=1,math.min(10,lh-2) do encoding = encoding .. jfm_ptex:read(4) end
+ encoding = encoding:sub(2, 1+string.byte(encoding))
+end
+if not encoding then encoding = 'UNSPECIFIED' end
+
+local family = ''
+if lh>=13 then
+ for i=1,math.min(5,lh-12) do family = family .. jfm_ptex:read(4) end
+ family = family:sub(2, 1+string.byte(family))
+end
+
+local face = 0
+if lh>=18 then
+ _, _, _, face = get_four()
+ for i=1,lh-19 do jfm_ptex:read(4) end -- ignored
+end
+
+-------- CHAR_TYPE --------
+result[0] = {}
+local all_ctype = {}
+for i=1,nt do
+ local ccode, ctype = get_two()
+ if ccode~=0 then
+ all_ctype[#all_ctype+1] = ccode
+ end
+ if ctype~=0 then
+ if not result[ctype] then result[ctype] = {} end
+ if not result[ctype].chars then result[ctype].chars = {} end
+ local t = result[ctype].chars
+ t[#t+1] = ccode
+ end
+end
+
+-------- CHAR_INFO --------
+for i=0,ec do
+ if not result[i] then result[i] = {} end
+ local t, info = result[i], get_word()
+ t.align, t.left, t.down = 'left', 0, 0
+ t.width = extract(info, 24, 8)
+ t.height = extract(info, 20, 4)
+ t.depth = extract(info, 16, 4)
+ t.italic = extract(info, 10, 6)
+ t.tag = extract(info, 8, 2)
+ t.rem = extract(info, 0, 8)
+end
+
+local wi, hi, di, ii = {}, {}, {}, {}
+for i=0,nw-1 do wi[i] = get_signed_word() end
+for i=0,nh-1 do hi[i] = get_signed_word() end
+for i=0,nd-1 do di[i] = get_signed_word() end
+for i=0,ni-1 do ii[i] = get_signed_word() end
+
+
+-------- GLUE/KERN --------
+
+local gk_table = {}
+for i=0,nl-1 do gk_table[i] = table.pack(get_four()) end
+
+local kerns = {}
+for i=0,nk-1 do kerns[i] = get_signed_word() end
+
+local glues = {}
+for i=0,ng/3-1 do glues[i] = { get_signed_word(), get_signed_word(), get_signed_word() } end
+
+
+-------- PARAM --------
+local param = {}
+for i=1,math.min(9, np) do param[i] = get_word() end
+local zw = param[6]
+result.kanjiskip = {
+ param[2]/zw, param[3]/zw, param[4]/zw
+}
+result.xkanjiskip = {
+ param[7]/zw, param[8]/zw, param[9]/zw
+}
+result.zw, result.zh = 1.0, param[5]/zw
+
+
+
+-------- 各種 index の解決 --------
+for i=0,ec do
+ local t = result[i]
+ t.width = wi[t.width]/zw
+ t.height = hi[t.height]/zw
+ t.depth = di[t.depth]/zw
+ t.italic = ii[t.italic]/zw
+ if t.tag==1 then
+ local j = t.rem
+ while j do
+ local gkp = gk_table[j]
+ j = (gkp[1]<128) and j+gkp[1]+1 or nil
+ if gkp[3]<128 then
+ if not t.glue then t.glue = {} end
+ t.glue[gkp[2]] = {
+ glues[gkp[4]][1]/zw,
+ glues[gkp[4]][2]/zw,
+ glues[gkp[4]][3]/zw,
+ }
+ else
+ if not t.kern then t.kern = {} end
+ t.kern[gkp[2]] = kerns[gkp[4]]/zw
+ end
+ end
+ end
+ t.tag, t.rem = nil, nil
+end
+
+jfm_ptex:close()
+
+
+-------- モード判定 --------
+if not mode then
+ mode = jis_to_ucs
+ for i=1, #all_ctype do
+ if not jisx0208[all_ctype[i]-0x2020] then
+ mode = pass_ucs; break
+ end
+ end
+end
+
+-------- 出力 --------
+local function S(a)
+ if type(a)=='number' then
+ return tostring(math.floor(a*1000000+0.5)/1000000)
+ elseif type(a)=='table' then -- glue
+ return '{ ' .. S(a[1]) .. ', ' .. S(a[2]) .. ', ' .. S(a[3]) .. '},'
+ elseif type(a)=='string' then
+ return "'" .. a .. "'"
+ else
+ tostring(a)
+ end
+end
+
+print('-- -*- coding: utf-8 -*-')
+print('-- converted from ' .. filename .. ' by jfm_convert.lua')
+print('-- assumed encoding: ' .. (mode==jis_to_ucs and 'JIS' or 'UCS') .. '\n')
+print('luatexja.jfont.define_jfm {')
+print(' -- original design size = ' .. S(designsize))
+print(' -- original encoding = (' .. encoding .. ')')
+print(' -- original family = (' .. family .. ')')
+print(" dir = " .. S(result.dir) .. ",")
+print(' zw = ' .. S(result.zw) .. ', zh = ' .. S(result.zh) .. ', ')
+print(' kanjiskip = ' .. S(result.kanjiskip))
+print(' xkanjiskip = ' .. S(result.xkanjiskip))
+for i=0, ec do
+ local t = result[i]
+ print(' [' .. tostring(i) .. '] = {')
+ if t.chars then
+ print(' chars = {')
+ local d = ' '
+ for j=1,#(t.chars) do
+ d = d .. mode(t.chars[j]) .. ', '
+ if j%8==0 and j<#(t.chars) then
+ d = d .. '\n '
+ end
+ end
+ print(d)
+ print(' },')
+ end
+ print(' align = ' .. S(t.align) .. ', left = ' .. S(0.0)
+ .. ', down = ' .. S(0.0) .. ', ')
+ print(' width = ' .. S(t.width) .. ', height = ' .. S(t.height)
+ .. ', depth = ' .. S(t.depth) .. ', italic = ' .. S(t.italic) .. ',')
+ if t.glue then
+ print(' glue = {')
+ local gi = {}
+ for m,_ in pairs(t.glue) do gi[#gi+1]=m end
+ table.sort(gi)
+ for _,m in ipairs(gi) do
+ print(' [' .. tostring(m) .. '] = ' .. S(t.glue[m]))
+ end
+ print(' },')
+ end
+ if t.kern then
+ print(' kern = {')
+ local gi = {}
+ for m,_ in pairs(t.kern) do gi[#gi+1]=m end
+ table.sort(gi)
+ for _,m in ipairs(gi) do
+ print(' [' .. tostring(m) .. '] = ' .. S(t.kern[m]) .. ',')
+ end
+ print(' },')
+ end
+ print(' },')
+end
+print('}')