summaryrefslogtreecommitdiff
path: root/Master/texmf-dist
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2014-06-23 23:35:40 +0000
committerKarl Berry <karl@freefriends.org>2014-06-23 23:35:40 +0000
commitd82e5391f0626307e306305eb3fe00eac8c8da3f (patch)
tree4b85bc59b049d9b7025d666cd0fc324d83d98e4a /Master/texmf-dist
parent2290bfdf9afc805d8a73d6d9728c1362486db3fd (diff)
luatexja (22jun14)
git-svn-id: svn://tug.org/texlive/trunk@34369 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r--Master/texmf-dist/doc/luatex/luatexja/COPYING4
-rw-r--r--Master/texmf-dist/doc/luatex/luatexja/README8
-rw-r--r--Master/texmf-dist/doc/luatex/luatexja/ltjsclasses.pdfbin393817 -> 393146 bytes
-rw-r--r--Master/texmf-dist/doc/luatex/luatexja/luatexja-en.pdfbin362167 -> 365271 bytes
-rw-r--r--Master/texmf-dist/doc/luatex/luatexja/luatexja-ja.pdfbin727474 -> 731379 bytes
-rw-r--r--Master/texmf-dist/doc/luatex/luatexja/luatexja.dtx100
-rw-r--r--Master/texmf-dist/source/luatex/luatexja/ltjsclasses.dtx20
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-adjust.sty18
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-fontspec-23.sty334
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-fontspec-24.sty332
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-fontspec.sty325
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/ltj-jfmglue.lua16
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/ltjsarticle.cls14
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/ltjsbook.cls14
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/ltjskiyou.cls14
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/ltjspf.cls14
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/luatexja-core.sty21
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty64
18 files changed, 878 insertions, 420 deletions
diff --git a/Master/texmf-dist/doc/luatex/luatexja/COPYING b/Master/texmf-dist/doc/luatex/luatexja/COPYING
index bb732b6d883..ba2ed9a72c6 100644
--- a/Master/texmf-dist/doc/luatex/luatexja/COPYING
+++ b/Master/texmf-dist/doc/luatex/luatexja/COPYING
@@ -1,4 +1,4 @@
-Copyright (c) 2011--2013 The LuaTeX-ja project, All rights reserved.
+Copyright (c) 2011--2014 The LuaTeX-ja project, All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -14,7 +14,7 @@ modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE LUATEX-JA PROJECT OR CONTRIBUTORS BE LIABLE
+DISCLAIMED. IN NO EVENT SHALL THE LUATEX-JA PROJECT OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
diff --git a/Master/texmf-dist/doc/luatex/luatexja/README b/Master/texmf-dist/doc/luatex/luatexja/README
index 3668aeb2158..2bebe5b1ad7 100644
--- a/Master/texmf-dist/doc/luatex/luatexja/README
+++ b/Master/texmf-dist/doc/luatex/luatexja/README
@@ -1,4 +1,4 @@
-The LuaTeX-ja Package 20140504.0
+The LuaTeX-ja Package 20140621.1
--------------------------------
Copyright (c) 2011--2014 The LuaTeX-ja project
License: modified BSD (see COPYING)
@@ -33,9 +33,9 @@ Installation
2. If you must/want to install manually:
a. Download the source archive from CTAN,
- or tagged as 20140504.0 in the Git repository by
+ or tagged as 20140621.1 in the Git repository by
<http://git.sourceforge.jp/view?p=luatex-ja/luatexja.git
- ;a=snapshot;h=refs/tags/20140504.0;sf=tgz>
+ ;a=snapshot;h=refs/tags/20140621.1;sf=tgz>
b1. Extract the archive and process following three files by LuaLaTeX
to generate classes for Japanese typesetting:
@@ -80,4 +80,4 @@ Notes
* src/*.{ins.dtx} and src/ltj-kinsoku_make.tex are not needed in regular use.
-Last commit date: Sun May 4 06:31:45 2014 +0900
+Last commit date: Sat Jun 21 21:42:39 2014 +0900
diff --git a/Master/texmf-dist/doc/luatex/luatexja/ltjsclasses.pdf b/Master/texmf-dist/doc/luatex/luatexja/ltjsclasses.pdf
index 24f1be48df1..c42dbc652a5 100644
--- a/Master/texmf-dist/doc/luatex/luatexja/ltjsclasses.pdf
+++ b/Master/texmf-dist/doc/luatex/luatexja/ltjsclasses.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/luatex/luatexja/luatexja-en.pdf b/Master/texmf-dist/doc/luatex/luatexja/luatexja-en.pdf
index 4c398d686a5..b30d16fc26b 100644
--- a/Master/texmf-dist/doc/luatex/luatexja/luatexja-en.pdf
+++ b/Master/texmf-dist/doc/luatex/luatexja/luatexja-en.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/luatex/luatexja/luatexja-ja.pdf b/Master/texmf-dist/doc/luatex/luatexja/luatexja-ja.pdf
index 187b498f942..746adb84246 100644
--- a/Master/texmf-dist/doc/luatex/luatexja/luatexja-ja.pdf
+++ b/Master/texmf-dist/doc/luatex/luatexja/luatexja-ja.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/luatex/luatexja/luatexja.dtx b/Master/texmf-dist/doc/luatex/luatexja/luatexja.dtx
index ed343fefb84..69fc7e16ab5 100644
--- a/Master/texmf-dist/doc/luatex/luatexja/luatexja.dtx
+++ b/Master/texmf-dist/doc/luatex/luatexja/luatexja.dtx
@@ -142,7 +142,7 @@
\parindent=0pt\def\makelabel##1{{\tt\textbackslash ##1}}
\def\{{\char`\{}\def\}{\char`\}}
\let\origitem=\item
- \def\item[##1]{\par\smallskip\par\hskip-\leftskip\makelabel{##1}\par}
+ \def\item[##1]{\par\smallskip\par\hskip-\leftskip\makelabel{##1}\par\nobreak}
\@totalleftmargin\leftskip
}{\par%
%<en>\medskip
@@ -525,12 +525,13 @@ and \emph{Japanese fonts} for fonts used in \textbf{JAchar}.
%<en>\subsection{Installation}
%<ja>\subsection{インストール}
-%<en>To install the \LuaTeX-ja\ package, you will need:
+%<en>To install the \LuaTeX-ja\ package, you will need the following engine and packages:
%<ja>\LuaTeX-jaパッケージのインストールには,次のものが必要である.
\begin{itemize}
\item \LuaTeX\ beta-0.74.0 (or later)
\item \Pkg{luaotfload} v2.2 (or later)
-\item \Pkg{luatexbase} v0.6
+\item \Pkg{luatexbase} v0.6 (or later)
+\item \Pkg{everysel} v1.2 (or later)
\item \Pkg{xunicode} v0.981~(2011/09/09)
\item \Pkg{adobemapping} (Adobe cmap and pdfmapping files)
\end{itemize}
@@ -550,7 +551,7 @@ Now \LuaTeX-ja is available from the following archive and distributions:
\item W32\TeX\ (in \texttt{luatexja.tar.xz})
\end{itemize}
-If you are using \TeX~Live~2013, you can install \LuaTeX-ja
+If you are using \TeX~Live~2014, you can install \LuaTeX-ja
from \TeX~Live manager (\texttt{tlmgr}):
\begin{verbatim}
$ tlmgr install luatexja
@@ -570,7 +571,7 @@ $ tlmgr install luatexja
\item W32\TeX\ (\texttt{luatexja.tar.xz})
\end{itemize}
-例えば\TeX~Live~2013を利用しているなら,\LuaTeX-jaは\TeX~Live manager (\texttt{tlmgr})を
+例えば\TeX~Live~2014を利用しているなら,\LuaTeX-jaは\TeX~Live manager (\texttt{tlmgr})を
使ってインストールすることができる.
\begin{verbatim}
$ tlmgr install luatexja
@@ -2117,12 +2118,12 @@ Here the horizontal line in above is the baseline of a line.
%<*en>
There is an interesting side-effect: characters in different size can be
-vertically aligned center in a line, by setting two parameters appropriately.
+``vertically aligned center'' in a line, by setting two parameters appropriately.
The following is an example (beware the value is not well tuned):
%</en>
%<*ja>
この機能には面白い使い方がある:2つのパラメータを適切に設定することで,サイズの
-異なる文字を中心線に揃えることができる.
+異なる文字を「中心線」に揃えることができる.
以下は一つの例である(値はあまり調整されていないことに注意):
%</ja>
\begin{LTXexample}
@@ -2134,6 +2135,33 @@ xyz漢字
}abcかな
\end{LTXexample}
+%<*en>
+Note that setting a positive value to \Param{yalbaselineshift} does not
+increase the depth of \textbf{ALchar}, as shown below.
+This is because \Param{yalbaselineshift} is implemented by setting \verb+xoffset+
+field of a glyph node, and this does not increase the depth of the glyph.
+This problem does not apply for \Param{yjabaselineshift}, since
+\Param{yjabaselineshift} uses a different implementation method.
+%</en>
+%<*ja>
+なお,\Param{yalbaselineshift}パラメータに正の値を指定しても,
+下の例のように\textbf{ALchar}の深さは増加しないことに注意.
+\Param{yjabaselineshift}パラメータは別の方法を使って実装しているので,
+このような問題は起こらない.
+%</ja>
+\begin{LTXexample}[width=.3\textwidth]
+\leavevmode\fboxsep=0pt
+ \ltjsetparameter{yjabaselineshift=0pt,
+ yalbaselineshift=0pt}
+\vrule width 105pt height 0.4pt depth 0pt \hskip-95pt
+\fbox{\ltjsetparameter{yalbaselineshift=10pt}あいうxyz}
+\fbox{\ltjsetparameter{yalbaselineshift=-10pt}あいうxyz}\\
+\vrule width 105pt height 0.4pt depth 0pt \hskip-95pt
+\fbox{\ltjsetparameter{yjabaselineshift=10pt}あいうxyz}
+\fbox{\ltjsetparameter{yjabaselineshift=-10pt}あいうxyz}
+\end{LTXexample}
+
+
%<*ja>
\paragraph{数式における挙動:\pTeX との違い}
@@ -3471,9 +3499,9 @@ An example of this callback is the \texttt{ltjarticle} class, with
%<en>\item[\texttt{luatexja.define\_jfont} callback]
%<ja>\item[\texttt{luatexja.define\_jfont}コールバック]
%<*en>
-This callback and the next callback form a pair, and you can assign characters
- which do not have fixed code points in Unicode to non-zero character classes.
-This \texttt{luatexja.define\_font} callback is called just when new Japanese font is loaded.
+This callback and the next callback form a pair, and you can assign characters
+ which do not have fixed code points in Unicode to non-zero character classes.\\
+This \texttt{luatexja.define\_jfont} callback is called just when new Japanese font is loaded.
%</en>
%<*ja>
このコールバックと次のコールバックは組をなしており,Unicode中に固定された文字コード
@@ -4107,6 +4135,56 @@ by the following:
\end{itemize}
+\subsection{\texttt{\textbackslash ltjsetkanjiskip}, \texttt{\textbackslash ltjsetxkanjiskip}}
+%<*ja>
+\verb+\ltjsetparameter+ と \verb+\ltjglobalsetparameter+ は,引数が常にkey-valueリストであ
+るため,一回の実行に時間がかかるという難点がある.特にクラス \Pkg{ltjsclasses} においては,
+フォントサイズの設定(\verb+\@setfontsize+)ごとに毎回
+\Param{kanjiskip}と\Param{xkanjiskip}が設定されるため,
+それによる速度低下が顕著なものとなっていた.
+
+これを解決するため,より内部に近い命令として\
+\verb+\ltjsetkanjiskip{+<skip>\verb+}+ と\\
+\verb+\ltjsetxkanjiskip{+<skip>\verb+}+\ を
+用意した.これらの実行の前には,\TeX の \verb+\globaldefs+ の値を反映させるために\
+\verb+\ltj@setpar@global+\ の実行を必要とし,
+\begin{lstlisting}
+\ltj@setpar@global
+\ltjsetkanjiskip{0pt plus .1\zw minus .01\zw}
+\ltjsetxkanjiskip{0.25em plus 0.15em minus 0.06em}
+\end{lstlisting}
+と
+\begin{lstlisting}
+\ltjsetparemeter{%
+ kanjiskip=0pt plus .1\zw minus .01\zw,
+ xkanjiskip=0.25em plus 0.15em minus 0.06em}
+\end{lstlisting}
+は同じ意味を持つ.
+%</ja>
+%<*en>
+\verb+\ltjsetparameter+ and \verb+\ltjglobalsetparameter+ are slow,
+since their argument is a key-value list.
+This can be a problem in \Pkg{ltjsclasses}, because
+\Param{kanjiskip} and \Param{xkanjiskip} are set in every font resizing commands
+(\verb+\@setfontsize+). To overcome this problem,
+this version of \LuaTeX-ja provides two more internal commands, namely
+\verb+\ltjsetkanjiskip{+<skip>\verb+}+ and \verb+\ltjsetxkanjiskip{+<skip>\verb+}+.
+
+Note that \verb+\ltj@setpar@global+ command is needed before these two commands
+to reflect \TeX's internal parameter \verb+\globaldefs+.
+\begin{lstlisting}
+\ltj@setpar@global
+\ltjsetkanjiskip{0pt plus .1\zw minus .01\zw}
+\ltjsetxkanjiskip{0.25em plus 0.15em minus 0.06em}
+\end{lstlisting}
+and
+\begin{lstlisting}
+\ltjsetparemeter{%
+ kanjiskip=0pt plus .1\zw minus .01\zw,
+ xkanjiskip=0.25em plus 0.15em minus 0.06em}
+\end{lstlisting}
+have the same meaning.
+%</en>
@@ -4331,7 +4409,7 @@ commands which are not described in Subsection~\ref{ssec-chgfnt}.
\par\smallskip\par\hskip-\leftskip{\bfseries%
%<ja>追加の長さ変数達
%<en>additonal dimensions
-}\par
+}\par\nobreak
%<*en>
Like \pLaTeXe, \LuaTeX-ja defines the following dimensions
diff --git a/Master/texmf-dist/source/luatex/luatexja/ltjsclasses.dtx b/Master/texmf-dist/source/luatex/luatexja/ltjsclasses.dtx
index 80b488c8a87..6bff5843602 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{5202}
+% \CheckSum{5203}
%% \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/03/28 ]
+ [2014/05/14 ]
%<*driver>
\documentclass{ltjsarticle}
\usepackage{doc}
@@ -956,6 +956,10 @@
%
% [2008-02-18] |english| オプションで |\parindent| を 1em にしました。
%
+% [2014-05-14 LTJ] |\ltjsetparameter|の実行は時間がかかるので,
+% |\ltjsetkanjiskip| と |\ltjsetxkanjiskip|(両者とも,
+% 実行前には |\ltj@setpar@global| の実行が必要)にしました.
+%
% \begin{macrocode}
\def\@setfontsize#1#2#3{%
% \@nomath#1%
@@ -970,9 +974,12 @@
\parindent=1\zw
\fi
\fi
- \ltjsetparameter{kanjiskip={0\zw plus .1\zw minus .01\zw}}
- \if@slide \ltjsetparameter{xkanjiskip={0.1em}} \else
- \ltjsetparameter{xkanjiskip={0.25em plus 0.15em minus 0.06em}}
+ \ltj@setpar@global
+ \ltjsetkanjiskip{0pt plus .1\zw minus .01\zw}
+ \if@slide
+ \ltjsetxkanjiskip{0.1em}
+ \else
+ \ltjsetxkanjiskip{0.25em plus 0.15em minus 0.06em}
\fi}
% \end{macrocode}
% \end{macro}
@@ -5144,7 +5151,8 @@
\renewcommand\kanjifamilydefault{\gtdefault}
\renewcommand\familydefault{\sfdefault}
\raggedright
- \ltjsetparameter{xkanjiskip={0.1em}}\relax
+ \ltj@setpar@global
+ \ltjsetxkanjiskip{0.1em}\relax
\fi
% \end{macrocode}
%
diff --git a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-adjust.sty b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-adjust.sty
index cdfad90572b..b25e7060d39 100644
--- a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-adjust.sty
+++ b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-adjust.sty
@@ -82,6 +82,7 @@
\expandafter\endinput\fi\relax
%%------------------
+
%! Main part of luatexja-adjust
\RequireLuaTeXjaSubmodule{adjust}
@@ -94,23 +95,6 @@
\ifltj@japaram@adjust\ltjenableadjust\else\ltjdisableadjust\fi
}
-\ifltj@in@latex
- \RequirePackage{expl3}
- \ExplSyntaxOn
- \cs_new:Nn \ltj_adjust_inittable: {
- % To be filled...
- }
- \cs_new:Nn \ltj_adjust_appendtable:n {
- % To be filled
- }
- \clist_new:N \l_ltj_adjust_priority
- \define@key[ltj]{japaram}{adjustpriority}{% COMMA LIST
- \clist_set:Nx \l_ltj_adjust_priority {#1}
- \ltj_adjust_inittable:
- \clist_map_function:NN \l_ltj_adjust_priority \ltj_adjust_appendtable:n
- }
- \ExplSyntaxOff
-\fi
%%------------------ all done
\ltj@adjust@AtEnd
diff --git a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-fontspec-23.sty b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-fontspec-23.sty
new file mode 100644
index 00000000000..993cbf4670f
--- /dev/null
+++ b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-fontspec-23.sty
@@ -0,0 +1,334 @@
+%
+% luatexja-fontspec-23.sty
+%
+% This package is compatible with fontspec <=2.3,
+% will be removed in a future version.
+%
+
+
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{luatexja-fontspec-23}[2014/06/19 fontspec support of LuaTeX-ja]
+\RequirePackage{l3keys2e,luatexja}
+\ExplSyntaxOn
+
+%%%%%%%% Change Japanese font family by \rmfamily or not
+\bool_if:NTF \ltj_fontspec_match
+{
+ \renewcommand\jttdefault{\gtdefault}
+ \DeclareRobustCommand\rmfamily
+ {\not@math@alphabet\rmfamily\mathrm
+ \romanfamily\rmdefault\kanjifamily\mcdefault\selectfont}
+ \DeclareRobustCommand\sffamily
+ {\not@math@alphabet\sffamily\mathsf
+ \romanfamily\sfdefault\kanjifamily\gtdefault\selectfont}
+ \DeclareRobustCommand\ttfamily
+ {\not@math@alphabet\ttfamily\mathtt
+ \romanfamily\ttdefault\kanjifamily\jttdefault\selectfont}
+ \DeclareDocumentCommand \setmonojfont { O{} m } {
+ \__ltj_fontspec_set_family:Nnn \jttdefault {#1}{#2}
+ \normalfont
+ }
+}{
+}
+
+%%%%%%%% Messages
+
+\msg_new:nnn {luatexja-fontspec} {addjfontfeatures-ignored}
+{
+ \string\addjfontfeature (s)~ ignored;\\
+ it~ cannot~ be~ used~ with~ a~ font~ that~ wasn't~ selected~ by~ luatexja-fontspec.
+}
+
+\msg_new:nnn {luatexja-fontspec} {altfont-ignored-by-norange}
+{
+ ignored~ sublist~ `#1'~ in~ AltFont~ (no~ range~ is~ specified).
+}
+
+\msg_new:nnn {luatexja-fontspec} {altfont-ignored-by-rangeonly}
+{
+ ignored~ sublist~ `#1'~ in~ AltFont~ (only~ range~ is~ specified).
+}
+
+\cs_generate_variant:Nn \prg_new_conditional:Nnn {Nnx}
+
+%%%%%%%% \g_ltj_fontspec_scale_fp
+%% Default scale value for jfont.
+\fp_new:N \g_ltj_fontspec_scale_fp
+\group_begin:
+\fontsize{10}{10}\selectfont
+\fp_gset:Nn \g_ltj_fontspec_scale_fp {\zw / 10}
+\group_end:
+
+%%%%%%%% Internal control sequences
+%% Each CS is ltj_fontspec version that corresponds to original CS of fontspec.
+\cs_new:Nn \ltj_fontspec_define_option:nn {
+ \keys_define:nn {fontspec} { #1 .code:n = {#2}}
+}
+
+\cs_new:Nn \ltj_fontspec_define_preparse_external:nn {
+ \keys_define:nn {fontspec-preparse-external} { #1 .code:n = {#2}}
+}
+
+\cs_new:Nn \ltj_fontspec_define_altfont_option:nn {
+ \keys_define:nn {fontspec-ltjaltfont} { #1 .code:n = {#2}}
+}
+
+%% Alternate Fonts
+%% Spec: AltFont = {
+%% ...
+%% { Range = <range>, <font features> },
+%% { Range = <range>, Font = <font name>, <font features> },
+%% { Range = <range>, Font = <font name> },
+%% ...
+%% }
+\tl_new:N \l_ltj_fontspec_altname_tl
+\tl_new:N \l_ltj_fontspec_altrange_tl
+\clist_new:N \l_ltj_fontspec_altfont_clist
+\clist_new:N \l_ltj_fontspec_altfont_leftover_clist
+\int_new:N \g_ltj_fontspec_altnumber_int
+
+\ltj_fontspec_define_altfont_option:nn {Range} {
+ \tl_set:Nn \l_ltj_fontspec_altrange_tl {#1}
+}
+\ltj_fontspec_define_altfont_option:nn {Font} {
+ \fontspec_complete_fontname:Nn \l_ltj_fontspec_altname_tl {#1}
+}
+
+\cs_new:Nn \__ltj_fontspec_altfont_key_code:n
+ {
+ \clist_set:Nn \l_ltj_fontspec_altfont_clist {#1}
+ \fontspec_update_fontid:n {alt:#1}
+ }
+
+\cs_new:Nn \ltj_fontspec_select:nn {
+ \group_begin:
+ \ltj_fontspec_define_option:nn {AltFont} {
+ \__ltj_fontspec_altfont_key_code:n { ##1 }
+ }
+ \ltj_fontspec_define_option:nn {CID} {
+ \fontspec_update_fontid:n {+cid=##1}
+ \fontspec_update_featstr:n {cid=##1}
+ }
+ \ltj_fontspec_define_option:nn {JFM} {
+ \fontspec_update_fontid:n {+jfm=##1}
+ \fontspec_update_featstr:n {jfm=##1}
+ }
+ \ltj_fontspec_define_option:nn {JFM-var} {
+ \fontspec_update_fontid:n {+jfmvar=##1}
+ \fontspec_update_featstr:n {jfmvar=##1}
+ }
+ \ltj_fontspec_define_preparse_external:nn {NoEmbed} {
+ \cs_set:Nn \fontspec_namewrap:n {psft:####1}
+ }
+ %% Omit the warning message
+ %% "OpenType feature 'Kerning=Off' (-kern) not available ..."
+ \ltj_fontspec_define_option:nn {Kerning/Off} {
+ \fontspec_update_fontid:n {-kern}
+ \fontspec_update_featstr:n {-kern}
+ }
+ \tl_set:Nn \g_fontspec_encoding_tl {JY3}
+ \tl_set:Nx \g_fontspec_default_fontopts_tl
+ {JFM=ujis, Scale=\fp_use:N \g_ltj_fontspec_scale_fp,
+ Kerning=Off, \g_ltj_fontspec_default_fontopts_tl}
+ \prop_set_eq:NN \g__fontspec_fontopts_prop \g__ltj_fontspec_fontopts_prop
+ \cs_set_eq:NN \fontspec_make_font_shapes:nnnn \ltj_fontspec_make_font_shapes:nnnn
+ \cs_set_eq:NN \DeclareFontFamily \DeclareKanjiFamily
+ \fontspec_select:nn{#1}{#2}
+ \group_end:
+}
+
+\cs_new:Nn \__ltj_fontspec_set_family:Nnn {
+ \ltj_fontspec_select:nn{#2}{#3}
+ \tl_set_eq:NN #1 \l_fontspec_family_tl
+}
+\cs_set_eq:NN \__ltj_orig_fontspec_make_font_shapes:nnnn \fontspec_make_font_shapes:nnnn
+\cs_set_eq:NN \__ltj_fontspec_orig_DeclareFontShape \DeclareFontShape
+\cs_new:Nn \ltj_fontspec_make_font_shapes:nnnn {
+ \__ltj_orig_fontspec_make_font_shapes:nnnn {#1} {#2} {#3} {#4}
+ \group_begin:
+ %% Parse font features. However, we have to avoid redefine already defined shape.
+ \__fontspec_load_fontname:n {#1}
+ \cs_set_eq:NN \DeclareFontShape \use_none:nnnnnn
+ \fontspec_declare_shape:nnn {#2}{#3}
+ { \quark_if_no_value:NF \l__fontspec_fontopts_clist {\l__fontspec_fontopts_clist,} #4 }
+ \cs_set_eq:NN \DeclareFontShape \__ltj_fontspec_orig_DeclareFontShape
+ %%
+ \clist_if_empty:NF \l_ltj_fontspec_altfont_clist {
+ \int_gzero:N \g_ltj_fontspec_altnumber_int
+ \clist_map_inline:Nn \l_ltj_fontspec_altfont_clist {
+ \tl_clear:N \l_ltj_fontspec_altrange_tl
+ \tl_set:Nn \l_ltj_fontspec_altname_tl { #1 }
+ \tl_set:Nn \l_tmpa_tl { #1 }
+
+ \keys_set_known:nxN {fontspec-ltjaltfont} { \exp_after:wN \use:n ##1 }
+ \l_ltj_fontspec_altfont_leftover_clist
+
+ \tl_if_empty:NT \l_ltj_fontspec_altrange_tl {
+ \msg_warning:nnn {luatexja-fontspec} {altfont-ignored-by-norange} { ##1 }
+ } {
+ \bool_if:nTF {
+ \tl_if_eq_p:NN \l_ltj_fontspec_altname_tl \l_tmpa_tl
+ &&
+ \tl_if_empty_p:N \l_ltj_fontspec_altfont_leftover_clist
+ } {
+ \msg_warning:nnn {luatexja-fontspec} {altfont-ignored-by-rangeonly} { ##1 }
+ } {
+ \group_begin:
+ \__fontspec_load_fontname:n { \l_ltj_fontspec_altname_tl }
+ \fontspec_declare_shape:nnn {#2}
+ {#3 _ alt \int_use:N \g_ltj_fontspec_altnumber_int }
+ {
+ \quark_if_no_value:NF \l__fontspec_fontopts_clist {\l__fontspec_fontopts_clist,}
+ #4 , \l_ltj_fontspec_altfont_leftover_clist
+ }
+ \group_end:
+ \DeclareAlternateKanjiFont
+ {JY3}{ \l_fontspec_family_tl }{#2}{#3}%
+ {JY3}{ \l_fontspec_family_tl }{#2}
+ { #3 _alt \int_use:N \g_ltj_fontspec_altnumber_int }
+ { \l_ltj_fontspec_altrange_tl }
+ \int_gincr:N \g_ltj_fontspec_altnumber_int
+ }
+ }
+ }
+ }
+ \group_end:
+ }
+
+%%%%%%%% User commands
+\DeclareDocumentCommand \jfontspec { O{} m } {
+ \__ltj_fontspec_set_family:Nnn \k@family {#1}{#2}
+ \selectfont
+ \ignorespaces
+}
+
+\DeclareDocumentCommand \setmainjfont { O{} m } {
+ \__ltj_fontspec_set_family:Nnn \mcdefault {#1}{#2}
+ \DeclareSymbolFont{mincho}{JY3}{\l_fontspec_family_tl}{m}{n}
+ \SetSymbolFont{mincho}{bold}{JY3}{\l_fontspec_family_tl}{bx}{n}
+ \normalfont
+}
+
+\DeclareDocumentCommand \setsansjfont { O{} m } {
+ \__ltj_fontspec_set_family:Nnn \gtdefault {#1}{#2}
+ \DeclareMathAlphabet{\mathgt}{JY3}{\l_fontspec_family_tl}{m}{n}
+ \normalfont
+}
+
+\DeclareDocumentCommand \newjfontfamily { m O{} m } {
+ \ltj_fontspec_select:nn{#2}{#3}
+ \use:x {
+ \exp_not:N \DeclareRobustCommand \exp_not:N #1 {
+ \exp_not:N \kanjifamily {\l_fontspec_family_tl} \exp_not:N \selectfont
+ }
+ }
+}
+
+\DeclareDocumentCommand \newjfontface { m O{} m } {
+ \newjfontfamily #1 [ BoldFont={},ItalicFont={},SmallCapsFont={},#2 ] {#3}
+}
+
+\tl_new:N \g_ltj_fontspec_default_fontopts_tl
+\prop_new:N \g__ltj_fontspec_fontopts_prop
+\DeclareDocumentCommand \defaultjfontfeatures { o m }
+ {
+ \IfNoValueTF {#1}
+ { \__ltj_fontspec_set_default_features:n {#2} }
+ { \__ltj_fontspec_set_font_default_features:nn {#1} {#2} }
+ }
+\cs_new:Nn \__ltj_fontspec_set_default_features:n
+ {
+ \tl_set:Nn \g_ltj_fontspec_default_fontopts_tl {#1,}
+ }
+\cs_new:Nn \__ltj_fontspec_set_font_default_features:nn
+ {
+ \__fontspec_sanitise_fontname:Nn \l__fontspec_tmp_tl {#1}
+ \tl_if_empty:nTF {#2}
+ { \prop_gremove:NV \g__ltj_fontspec_fontopts_prop \l__fontspec_tmp_tl }
+ { \prop_gput:NVn \g__ltj_fontspec_fontopts_prop \l__fontspec_tmp_tl {#2} }
+ }
+
+\DeclareDocumentCommand \addjfontfeatures {m} {
+ \ifcsname zf@family@fontdef\k@family\endcsname
+ \group_begin:
+ \tl_clear:N \g_ltj_fontspec_default_fontopts_tl
+ \use:x {
+ \exp_not:N\ltj_fontspec_select:nn
+ {\csname zf@family@options\k@family\endcsname,#1}
+ {\csname zf@family@fontname\k@family\endcsname}
+ }
+ \group_end:
+ \fontfamily\l_fontspec_family_tl\selectfont
+ \else
+ \msg_warning:nn {luatexja-fontspec} {addjfontfeatures-ignored}
+ \fi
+ \ignorespaces
+}
+
+\cs_set_eq:NN \addjfontfeature \addjfontfeatures
+
+%%% CJKShape=JIS2004
+\fontspec_define_feature_option:nnnnn{CJKShape}{JIS2004}{20}{5}{+jp04}
+
+\ExplSyntaxOff
+%%%%%%%% Now we completely ignore kanjifont definition file.
+
+\DeclareRobustCommand\fontfamily[1]{%
+ \@notkfamfalse\@notffamfalse
+ \edef\tmp@item{'\luatexluaescapestring{#1}'}%
+ \edef\tmp@enc{'\luatexluaescapestring{\f@encoding}'}%
+ \ifcsname \k@encoding+#1\endcsname % if \k@encoding+#1 is already defined
+ \edef\k@family{#1}%
+ \else\@notkfamtrue\fi
+ \ifcsname \f@encoding+#1\endcsname
+ \edef\f@family{#1}%
+ \else % search font definition file...
+ \directlua{luatexja.jfont.is_ffam(\tmp@enc, \tmp@item)}%
+ \ifin@\edef\k@family{#1}\else%
+ \directlua{luatexja.jfont.is_Nffam(\tmp@enc, \tmp@item)}%
+ \ifin@\@notffamtrue\else%
+ % filename of font definition file is always lowercase
+ \edef\@temp{\lowercase{\noexpand\IfFileExists{\f@encoding#1.fd}}}%
+ \message{(I search font definition file)}%
+ \@temp{\@tempswztrue}{\@tempswzfalse}%
+ \if@tempswz
+ \directlua{luatexja.jfont.add_ffam_list(\tmp@enc, \tmp@item)}%
+ \edef\f@family{#1}%
+ \else
+ \directlua{luatexja.jfont.add_Nffam_list(\tmp@enc, \tmp@item)}%
+ \@notffamtrue%
+ \fi
+ \fi
+ \fi
+ \fi
+ \if@notkfam\if@notffam
+ {\ifcsname D@\k@encoding\endcsname\@nameuse{D@\k@encoding}\fi
+ \xdef\@@temp{\default@family}}\edef\k@family{\@@temp}%
+ {\ifcsname D@\f@encoding\endcsname\@nameuse{D@\f@encoding}\fi
+ \xdef\@@temp{\default@family}}\edef\f@family{\@@temp}%
+ \fi\fi
+}
+
+% We must redefine \try@load@fontshape to ignore kanjifont definitions at all.
+\def\try@load@fontshape{%
+ \expandafter
+ \ifx\csname \f@encoding+\f@family\endcsname\relax
+ \directlua{luatexja.jfont.is_kenc('\luatexluaescapestring{\f@encoding}')}%
+\ifin@ % Japanese font: we don't search fd.
+ \@font@warning{We don't search kanjifont definition
+ \MessageBreak for \f@encoding/\f@family}%
+\else % Alphabetic font
+ \@font@info{Try loading font information for \f@encoding+\f@family}%
+ \global\expandafter\let
+ \csname\f@encoding+\f@family\endcsname\@empty
+ \nfss@catcodes
+ \let\nfss@catcodes\relax
+ \edef\reserved@a{%
+ \lowercase{%
+ \noexpand\InputIfFileExists{\f@encoding\f@family.fd}}}%
+ \reserved@a\relax
+ {\@input@{\f@encoding\f@family.fd}}%
+\fi
+ \fi}
+
+\endinput
diff --git a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-fontspec-24.sty b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-fontspec-24.sty
new file mode 100644
index 00000000000..4bd81c62cc9
--- /dev/null
+++ b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-fontspec-24.sty
@@ -0,0 +1,332 @@
+%
+% luatexja-fontspec-24.sty
+%
+
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{luatexja-fontspec-24}[2014/06/19 fontspec support of LuaTeX-ja]
+\RequirePackage{l3keys2e,luatexja}
+\ExplSyntaxOn
+
+%%%%%%%% Change Japanese font family by \rmfamily or not
+\bool_if:NTF \ltj_fontspec_match
+{
+ \renewcommand\jttdefault{\gtdefault}
+ \DeclareRobustCommand\rmfamily
+ {\not@math@alphabet\rmfamily\mathrm
+ \romanfamily\rmdefault\kanjifamily\mcdefault\selectfont}
+ \DeclareRobustCommand\sffamily
+ {\not@math@alphabet\sffamily\mathsf
+ \romanfamily\sfdefault\kanjifamily\gtdefault\selectfont}
+ \DeclareRobustCommand\ttfamily
+ {\not@math@alphabet\ttfamily\mathtt
+ \romanfamily\ttdefault\kanjifamily\jttdefault\selectfont}
+ \DeclareDocumentCommand \setmonojfont { O{} m } {
+ \ltj_fontspec_set_family:Nnn \jttdefault {#1}{#2}
+ \normalfont
+ }
+}{
+}
+
+%%%%%%%% Messages
+
+\msg_new:nnn {luatexja-fontspec} {addjfontfeatures-ignored}
+{
+ \string\addjfontfeature (s)~ ignored;\\
+ it~ cannot~ be~ used~ with~ a~ font~ that~ wasn't~ selected~ by~ luatexja-fontspec.
+}
+
+\msg_new:nnn {luatexja-fontspec} {altfont-ignored-by-norange}
+{
+ ignored~ sublist~ `#1'~ in~ AltFont~ (no~ range~ is~ specified).
+}
+
+\msg_new:nnn {luatexja-fontspec} {altfont-ignored-by-rangeonly}
+{
+ ignored~ sublist~ `#1'~ in~ AltFont~ (only~ range~ is~ specified).
+}
+
+\cs_generate_variant:Nn \prg_new_conditional:Nnn {Nnx}
+
+%%%%%%%% \g_ltj_fontspec_scale_fp
+%% Default scale value for jfont.
+\fp_new:N \g_ltj_fontspec_scale_fp
+\group_begin:
+\fontsize{10}{10}\selectfont
+\fp_gset:Nn \g_ltj_fontspec_scale_fp {\zw / 10}
+\group_end:
+
+%%%%%%%% Internal control sequences
+%% Each CS is ltj_fontspec version that corresponds to original CS of fontspec.
+\cs_new:Nn \ltj_fontspec_define_option:nn {
+ \__fontspec_keys_define_code:nnn {fontspec} {#1} {#2}
+}
+
+\cs_new:Nn \ltj_fontspec_define_preparse_external:nn {
+ \__fontspec_keys_define_code:nnn {fontspec-preparse-external} {#1} {#2}
+}
+
+\cs_new:Nn \ltj_fontspec_define_altfont_option:nn {
+ \__fontspec_keys_define_code:nnn {fontspec-ltjaltfont} {#1} {#2}
+}
+
+%% Alternate Fonts
+%% Spec: AltFont = {
+%% ...
+%% { Range = <range>, <font features> },
+%% { Range = <range>, Font = <font name>, <font features> },
+%% { Range = <range>, Font = <font name> },
+%% ...
+%% }
+\tl_new:N \l_ltj_fontspec_altname_tl
+\tl_new:N \l_ltj_fontspec_altrange_tl
+\clist_new:N \l_ltj_fontspec_altfont_clist
+\clist_new:N \l_ltj_fontspec_altfont_leftover_clist
+\int_new:N \g_ltj_fontspec_altnumber_int
+
+\ltj_fontspec_define_altfont_option:nn {Range} {
+ \tl_set:Nn \l_ltj_fontspec_altrange_tl {#1}
+}
+\ltj_fontspec_define_altfont_option:nn {Font} {
+ \fontspec_complete_fontname:Nn \l_ltj_fontspec_altname_tl {#1}
+}
+
+\cs_new:Nn \__ltj_fontspec_altfont_key_code:n
+{
+ \clist_set:Nn \l_ltj_fontspec_altfont_clist {#1}
+}
+
+\cs_set_eq:NN \__ltj_orig_fontspec_select:nn \fontspec_select:nn
+\cs_new:Nn \ltj_fontspec_select:nn {
+ \group_begin:
+ \ltj_fontspec_define_option:nn {AltFont} {
+ \__ltj_fontspec_altfont_key_code:n { ##1 }
+ }
+ \ltj_fontspec_define_option:nn {CID} {
+ \__fontspec_update_featstr:n {cid=##1}
+ }
+ \ltj_fontspec_define_option:nn {JFM} {
+ \__fontspec_update_featstr:n {jfm=##1}
+ }
+
+ \ltj_fontspec_define_option:nn {JFM-var} {
+ \__fontspec_update_featstr:n {jfmvar=##1}
+ }
+ \ltj_fontspec_define_preparse_external:nn {NoEmbed} {
+ \cs_set:Nn \__fontspec_namewrap:n {psft:####1}
+ }
+ %% Omit the warning message
+ %% "OpenType feature 'Kerning=Off' (-kern) not available ..."
+ \ltj_fontspec_define_option:nn {Kerning/Off} {
+ \__fontspec_update_featstr:n {-kern}
+ }
+ \tl_set:Nn \g_fontspec_encoding_tl {JY3}
+ \clist_set:Nx \g__fontspec_default_fontopts_clist
+ {JFM=ujis, Scale=\fp_use:N \g_ltj_fontspec_scale_fp,
+ Kerning=Off, \g__ltj_fontspec_default_fontopts_clist}
+ \prop_set_eq:NN \g__fontspec_fontopts_prop \g__ltj_fontspec_fontopts_prop
+ \cs_set_eq:NN \__fontspec_make_font_shapes:Nnnnn \ltj_fontspec_make_font_shapes:Nnnnn
+ \cs_set_eq:NN \DeclareFontFamily \DeclareKanjiFamily
+ \__ltj_orig_fontspec_select:nn{#1}{#2}
+ \group_end:
+}
+
+\cs_new:Nn \ltj_fontspec_set_family:Nnn {
+ \cs_set_eq:NN \fontspec_select:nn \ltj_fontspec_select:nn
+ \__ltj_orig_fontspec_set_family:Nnn #1 {#2} {#3}
+ \cs_set_eq:NN \fontspec_select:nn \__ltj_orig_fontspec_select:nn
+}
+\cs_set_eq:NN \__ltj_orig_fontspec_set_family:Nnn \fontspec_set_family:Nnn
+\cs_set_eq:NN \__ltj_orig_fontspec_make_font_shapes:Nnnnn \__fontspec_make_font_shapes:Nnnnn
+\cs_set_eq:NN \__ltj_fontspec_orig_DeclareFontShape \DeclareFontShape
+\cs_new:Nn \ltj_fontspec_make_font_shapes:Nnnnn {
+ \__ltj_orig_fontspec_make_font_shapes:Nnnnn {#1} {#2} {#3} {#4} {#5}
+ \group_begin:
+ %% Parse font features. However, we have to avoid redefine already defined shape.
+ \__fontspec_load_fontname:n {#1}
+ \cs_set_eq:NN \DeclareFontShape \use_none:nnnnnn
+ \__fontspec_declare_shape:nnxx {#2} {#3} { \l__fontspec_fontopts_clist, #4 } {#5}
+ \cs_set_eq:NN \DeclareFontShape \__ltj_fontspec_orig_DeclareFontShape
+ %%
+ \clist_if_empty:NF \l_ltj_fontspec_altfont_clist {
+ \int_gzero:N \g_ltj_fontspec_altnumber_int
+ \clist_map_inline:Nn \l_ltj_fontspec_altfont_clist {
+ \tl_clear:N \l_ltj_fontspec_altrange_tl
+ \tl_set:Nn \l_ltj_fontspec_altname_tl { #1 }
+ \tl_set:Nn \l_tmpa_tl { #1 }
+
+ \keys_set_known:nxN {fontspec-ltjaltfont} { \exp_after:wN \use:n ##1 }
+ \l_ltj_fontspec_altfont_leftover_clist
+
+ \tl_if_empty:NT \l_ltj_fontspec_altrange_tl {
+ \msg_warning:nnn {luatexja-fontspec} {altfont-ignored-by-norange} { ##1 }
+ } {
+ \bool_if:nTF {
+ \tl_if_eq_p:NN \l_ltj_fontspec_altname_tl \l_tmpa_tl
+ &&
+ \tl_if_empty_p:N \l_ltj_fontspec_altfont_leftover_clist
+ } {
+ \msg_warning:nnn {luatexja-fontspec} {altfont-ignored-by-rangeonly} { ##1 }
+ } {
+ \group_begin:
+ \__fontspec_load_fontname:n { \l_ltj_fontspec_altname_tl }
+ \__fontspec_declare_shape:nnxx {#2}
+ {#3 _ alt \int_use:N \g_ltj_fontspec_altnumber_int }
+ {\l__fontspec_fontopts_clist, #4 , \l_ltj_fontspec_altfont_leftover_clist}
+ {#5}
+ \group_end:
+ \DeclareAlternateKanjiFont
+ {JY3}{ \l_fontspec_family_tl }{#2}{#3}%
+ {JY3}{ \l_fontspec_family_tl }{#2}
+ { #3 _alt \int_use:N \g_ltj_fontspec_altnumber_int }
+ { \l_ltj_fontspec_altrange_tl }
+ \int_gincr:N \g_ltj_fontspec_altnumber_int
+ }
+ }
+ }
+ }
+ \group_end:
+ }
+
+%%%%%%%% User commands
+\DeclareDocumentCommand \jfontspec { O{} m O{} } {
+ \ltj_fontspec_set_family:Nnn \k@family {#1,#3}{#2}
+ \selectfont
+ \ignorespaces
+}
+
+\DeclareDocumentCommand \setmainjfont { O{} m O{} } {
+ \ltj_fontspec_set_family:Nnn \mcdefault {#1,#3}{#2}
+ \DeclareSymbolFont{mincho}{JY3}{\l_fontspec_family_tl}{m}{n}
+ \SetSymbolFont{mincho}{bold}{JY3}{\l_fontspec_family_tl}{bx}{n}
+ \normalfont
+}
+
+\DeclareDocumentCommand \setsansjfont { O{} m O{} } {
+ \ltj_fontspec_set_family:Nnn \gtdefault {#1,#3}{#2}
+ \DeclareMathAlphabet{\mathgt}{JY3}{\l_fontspec_family_tl}{m}{n}
+ \normalfont
+}
+
+\DeclareDocumentCommand \newjfontfamily { m O{} m O{} } {
+ \cs_set_eq:NN \fontspec_set_family:Nnn \ltj_fontspec_set_family:Nnn
+ \newfontfamily #1 [#2] {#3} [#4]
+ \cs_set_eq:NN \fontspec_set_family:Nnn \__ltj_orig_fontspec_set_family:Nnn
+}
+
+\DeclareDocumentCommand \newjfontface { m O{} m O{} } {
+ \newjfontfamily #1 [ BoldFont={},ItalicFont={},SmallCapsFont={},#2,#4 ] {#3}
+}
+
+\clist_new:N \g__ltj_fontspec_default_fontopts_clist
+\prop_new:N \g__ltj_fontspec_fontopts_prop
+\DeclareDocumentCommand \defaultjfontfeatures { t+ o m }
+ {
+ \IfNoValueTF {#2}
+ { \__ltj_fontspec_set_default_features:nn {#1} {#3} }
+ { \__ltj_fontspec_set_font_default_features:nnn {#1} {#2} {#3} }
+ \ignorespaces
+ }
+\cs_new:Nn \__ltj_fontspec_set_default_features:nn
+ {
+ \clist_set_eq:NN \l__ltj_fontspec_tmp_clist \g__fontspec_default_fontopts_clist
+ \clist_set_eq:NN \g__fontspec_default_fontopts_clist \g__ltj_fontspec_default_fontopts_clist
+ \__fontspec_set_default_features:nn {#1} {#2}
+ \clist_set_eq:NN \g__ltj_fontspec_default_fontopts_clist \g__fontspec_default_fontopts_clist
+ \clist_set_eq:NN \g__fontspec_default_fontopts_clist \l__ltj_fontspec_tmp_clist
+ }
+\cs_new:Nn \__ltj_fontspec_set_font_default_features:nnn
+ {
+ \prop_set_eq:NN \l__ltj_fontspec_tmp_prop \g__fontspec_fontopts_prop
+ \prop_set_eq:NN \g__fontspec_fontopts_prop \g__ltj_fontspec_fontopts_prop
+ \__fontspec_set_font_default_features:nnn {#1} {#2} {#3}
+ \prop_set_eq:NN \g__ltj_fontspec_fontopts_prop \g__fontspec_fontopts_prop
+ \prop_set_eq:NN \g__fontspec_fontopts_prop \l__ltj_fontspec_tmp_prop
+ }
+
+\DeclareDocumentCommand \addjfontfeatures {m} {
+ \ltj_fontspec_if_fontspec_font:TF
+ {
+ \group_begin:
+ \tl_set_eq:NN \f@family \k@family
+ \cs_set_eq:NN \fontspec_select:nn \ltj_fontspec_select:nn
+ \addfontfeatures {#1}
+ \group_end:
+ \fontfamily\l_fontspec_family_tl\selectfont
+ }{
+ \msg_warning:nn {luatexja-fontspec} {addjfontfeatures-ignored}
+ }
+ \ignorespaces
+}
+
+\cs_set_eq:NN \addjfontfeature \addjfontfeatures
+
+\prg_new_conditional:Nnn \ltj_fontspec_if_fontspec_font: {TF,T,F}
+{
+ \cs_if_exist:cTF {g__fontspec_ \k@family _prop} \prg_return_true: \prg_return_false:
+}
+
+%%% CJKShape=JIS2004
+\__fontspec_define_feature_option:nnnnn{CJKShape}{JIS2004}{20}{5}{+jp04}
+
+\ExplSyntaxOff
+%%%%%%%% Now we completely ignore kanjifont definition file.
+
+\DeclareRobustCommand\fontfamily[1]{%
+ \@notkfamfalse\@notffamfalse
+ \edef\tmp@item{'\luatexluaescapestring{#1}'}%
+ \edef\tmp@enc{'\luatexluaescapestring{\f@encoding}'}%
+ \ifcsname \k@encoding+#1\endcsname % if \k@encoding+#1 is already defined
+ \edef\k@family{#1}%
+ \else\@notkfamtrue\fi
+ \ifcsname \f@encoding+#1\endcsname
+ \edef\f@family{#1}%
+ \else % search font definition file...
+ \directlua{luatexja.jfont.is_ffam(\tmp@enc, \tmp@item)}%
+ \ifin@\edef\k@family{#1}\else%
+ \directlua{luatexja.jfont.is_Nffam(\tmp@enc, \tmp@item)}%
+ \ifin@\@notffamtrue\else%
+ % filename of font definition file is always lowercase
+ \edef\@temp{\lowercase{\noexpand\IfFileExists{\f@encoding#1.fd}}}%
+ \message{(I search font definition file)}%
+ \@temp{\@tempswztrue}{\@tempswzfalse}%
+ \if@tempswz
+ \directlua{luatexja.jfont.add_ffam_list(\tmp@enc, \tmp@item)}%
+ \edef\f@family{#1}%
+ \else
+ \directlua{luatexja.jfont.add_Nffam_list(\tmp@enc, \tmp@item)}%
+ \@notffamtrue%
+ \fi
+ \fi
+ \fi
+ \fi
+ \if@notkfam\if@notffam
+ {\ifcsname D@\k@encoding\endcsname\@nameuse{D@\k@encoding}\fi
+ \xdef\@@temp{\default@family}}\edef\k@family{\@@temp}%
+ {\ifcsname D@\f@encoding\endcsname\@nameuse{D@\f@encoding}\fi
+ \xdef\@@temp{\default@family}}\edef\f@family{\@@temp}%
+ \fi\fi
+}
+
+% We must redefine \try@load@fontshape to ignore kanjifont definitions at all.
+\def\try@load@fontshape{%
+ \expandafter
+ \ifx\csname \f@encoding+\f@family\endcsname\relax
+ \directlua{luatexja.jfont.is_kenc('\luatexluaescapestring{\f@encoding}')}%
+\ifin@ % Japanese font: we don't search fd.
+ \@font@warning{We don't search kanjifont definition
+ \MessageBreak for \f@encoding/\f@family}%
+\else % Alphabetic font
+ \@font@info{Try loading font information for \f@encoding+\f@family}%
+ \global\expandafter\let
+ \csname\f@encoding+\f@family\endcsname\@empty
+ \nfss@catcodes
+ \let\nfss@catcodes\relax
+ \edef\reserved@a{%
+ \lowercase{%
+ \noexpand\InputIfFileExists{\f@encoding\f@family.fd}}}%
+ \reserved@a\relax
+ {\@input@{\f@encoding\f@family.fd}}%
+\fi
+ \fi}
+
+\endinput
diff --git a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-fontspec.sty b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-fontspec.sty
index 43666d3b3f3..51346d56d14 100644
--- a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-fontspec.sty
+++ b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-fontspec.sty
@@ -3,7 +3,7 @@
%
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{luatexja-fontspec}[2014/04/16 fontspec support of LuaTeX-ja]
+\ProvidesPackage{luatexja-fontspec}[2014/06/19 fontspec support of LuaTeX-ja]
\RequirePackage{l3keys2e,luatexja}
\ExplSyntaxOn
@@ -17,325 +17,10 @@
}
\ProcessKeysOptions { luatexja-fontspec }
\RequirePackage[\ltj_fontspec_pass_opts:]{fontspec}[2011/09/13]
-
-%%%%%%%% Change Japanese font family by \rmfamily or not
-\bool_if:NTF \ltj_fontspec_match
-{
- \renewcommand\jttdefault{\gtdefault}
- \DeclareRobustCommand\rmfamily
- {\not@math@alphabet\rmfamily\mathrm
- \romanfamily\rmdefault\kanjifamily\mcdefault\selectfont}
- \DeclareRobustCommand\sffamily
- {\not@math@alphabet\sffamily\mathsf
- \romanfamily\sfdefault\kanjifamily\gtdefault\selectfont}
- \DeclareRobustCommand\ttfamily
- {\not@math@alphabet\ttfamily\mathtt
- \romanfamily\ttdefault\kanjifamily\jttdefault\selectfont}
- \DeclareDocumentCommand \setmonojfont { O{} m } {
- \__ltj_fontspec_set_family:Nnn \jttdefault {#1}{#2}
- \normalfont
- }
-}{
-}
-
-%%%%%%%% Messages
-
-\msg_new:nnn {luatexja-fontspec} {addjfontfeatures-ignored}
-{
- \string\addjfontfeature (s)~ ignored;\\
- it~ cannot~ be~ used~ with~ a~ font~ that~ wasn't~ selected~ by~ luatexja-fontspec.
-}
-
-\msg_new:nnn {luatexja-fontspec} {altfont-ignored-by-norange}
-{
- ignored~ sublist~ `#1'~ in~ AltFont~ (no~ range~ is~ specified).
-}
-
-\msg_new:nnn {luatexja-fontspec} {altfont-ignored-by-rangeonly}
-{
- ignored~ sublist~ `#1'~ in~ AltFont~ (only~ range~ is~ specified).
-}
-
-\cs_generate_variant:Nn \prg_new_conditional:Nnn {Nnx}
-
-%%%%%%%% \g_ltj_fontspec_scale_fp
-%% Default scale value for jfont.
-\fp_new:N \g_ltj_fontspec_scale_fp
-\group_begin:
-\fontsize{10}{10}\selectfont
-\fp_gset:Nn \g_ltj_fontspec_scale_fp {\zw / 10}
-\group_end:
-
-%%%%%%%% Internal control sequences
-%% Each CS is ltj_fontspec version that corresponds to original CS of fontspec.
-\cs_new:Nn \ltj_fontspec_define_option:nn {
- \keys_define:nn {fontspec} { #1 .code:n = {#2}}
-}
-
-\cs_new:Nn \ltj_fontspec_define_preparse_external:nn {
- \keys_define:nn {fontspec-preparse-external} { #1 .code:n = {#2}}
-}
-
-\cs_new:Nn \ltj_fontspec_define_altfont_option:nn {
- \keys_define:nn {fontspec-ltjaltfont} { #1 .code:n = {#2}}
-}
-
-%% Alternate Fonts
-%% Spec: AltFont = {
-%% ...
-%% { Range = <range>, <font features> },
-%% { Range = <range>, Font = <font name>, <font features> },
-%% { Range = <range>, Font = <font name> },
-%% ...
-%% }
-\tl_new:N \l_ltj_fontspec_altname_tl
-\tl_new:N \l_ltj_fontspec_altrange_tl
-\clist_new:N \l_ltj_fontspec_altfont_clist
-\clist_new:N \l_ltj_fontspec_altfont_leftover_clist
-\int_new:N \g_ltj_fontspec_altnumber_int
-
-\ltj_fontspec_define_altfont_option:nn {Range} {
- \tl_set:Nn \l_ltj_fontspec_altrange_tl {#1}
-}
-\ltj_fontspec_define_altfont_option:nn {Font} {
- \fontspec_complete_fontname:Nn \l_ltj_fontspec_altname_tl {#1}
-}
-
-\cs_new:Nn \__ltj_fontspec_altfont_key_code:n
- {
- \clist_set:Nn \l_ltj_fontspec_altfont_clist {#1}
- \fontspec_update_fontid:n {alt:#1}
- }
-
-\cs_new:Nn \ltj_fontspec_select:nn {
- \group_begin:
- \ltj_fontspec_define_option:nn {AltFont} {
- \__ltj_fontspec_altfont_key_code:n { ##1 }
- }
- \ltj_fontspec_define_option:nn {CID} {
- \fontspec_update_fontid:n {+cid=##1}
- \fontspec_update_featstr:n {cid=##1}
- }
- \ltj_fontspec_define_option:nn {JFM} {
- \fontspec_update_fontid:n {+jfm=##1}
- \fontspec_update_featstr:n {jfm=##1}
- }
- \ltj_fontspec_define_option:nn {JFM-var} {
- \fontspec_update_fontid:n {+jfmvar=##1}
- \fontspec_update_featstr:n {jfmvar=##1}
- }
- \ltj_fontspec_define_preparse_external:nn {NoEmbed} {
- \cs_set:Nn \fontspec_namewrap:n {psft:####1}
- }
- %% Omit the warning message
- %% "OpenType feature 'Kerning=Off' (-kern) not available ..."
- \ltj_fontspec_define_option:nn {Kerning/Off} {
- \fontspec_update_fontid:n {-kern}
- \fontspec_update_featstr:n {-kern}
- }
- \tl_set:Nn \g_fontspec_encoding_tl {JY3}
- \tl_set:Nx \g_fontspec_default_fontopts_tl
- {JFM=ujis, Scale=\fp_use:N \g_ltj_fontspec_scale_fp,
- Kerning=Off, \g_ltj_fontspec_default_fontopts_tl}
- \prop_set_eq:NN \g__fontspec_fontopts_prop \g__ltj_fontspec_fontopts_prop
- \cs_set_eq:NN \fontspec_make_font_shapes:nnnn \ltj_fontspec_make_font_shapes:nnnn
- \cs_set_eq:NN \DeclareFontFamily \DeclareKanjiFamily
- \fontspec_select:nn{#1}{#2}
- \group_end:
-}
-
-\cs_new:Nn \__ltj_fontspec_set_family:Nnn {
- \ltj_fontspec_select:nn{#2}{#3}
- \tl_set_eq:NN #1 \l_fontspec_family_tl
-}
-\cs_set_eq:NN \__ltj_orig_fontspec_make_font_shapes:nnnn \fontspec_make_font_shapes:nnnn
-\cs_set_eq:NN \__ltj_fontspec_orig_DeclareFontShape \DeclareFontShape
-\cs_new:Nn \ltj_fontspec_make_font_shapes:nnnn {
- \__ltj_orig_fontspec_make_font_shapes:nnnn {#1} {#2} {#3} {#4}
- \group_begin:
- %% Parse font features. However, we have to avoid redefine already defined shape.
- \__fontspec_load_fontname:n {#1}
- \cs_set_eq:NN \DeclareFontShape \use_none:nnnnnn
- \fontspec_declare_shape:nnn {#2}{#3}
- { \quark_if_no_value:NF \l__fontspec_fontopts_clist {\l__fontspec_fontopts_clist,} #4 }
- \cs_set_eq:NN \DeclareFontShape \__ltj_fontspec_orig_DeclareFontShape
- %%
- \clist_if_empty:NF \l_ltj_fontspec_altfont_clist {
- \int_gzero:N \g_ltj_fontspec_altnumber_int
- \clist_map_inline:Nn \l_ltj_fontspec_altfont_clist {
- \tl_clear:N \l_ltj_fontspec_altrange_tl
- \tl_set:Nn \l_ltj_fontspec_altname_tl { #1 }
- \tl_set:Nn \l_tmpa_tl { #1 }
-
- \keys_set_known:nxN {fontspec-ltjaltfont} { \exp_after:wN \use:n ##1 }
- \l_ltj_fontspec_altfont_leftover_clist
-
- \tl_if_empty:NT \l_ltj_fontspec_altrange_tl {
- \msg_warning:nnn {luatexja-fontspec} {altfont-ignored-by-norange} { ##1 }
- } {
- \bool_if:nTF {
- \tl_if_eq_p:NN \l_ltj_fontspec_altname_tl \l_tmpa_tl
- &&
- \tl_if_empty_p:N \l_ltj_fontspec_altfont_leftover_clist
- } {
- \msg_warning:nnn {luatexja-fontspec} {altfont-ignored-by-rangeonly} { ##1 }
- } {
- \group_begin:
- \__fontspec_load_fontname:n { \l_ltj_fontspec_altname_tl }
- \fontspec_declare_shape:nnn {#2}
- {#3 _ alt \int_use:N \g_ltj_fontspec_altnumber_int }
- {
- \quark_if_no_value:NF \l__fontspec_fontopts_clist {\l__fontspec_fontopts_clist,}
- #4 , \l_ltj_fontspec_altfont_leftover_clist
- }
- \group_end:
- \DeclareAlternateKanjiFont
- {JY3}{ \l_fontspec_family_tl }{#2}{#3}%
- {JY3}{ \l_fontspec_family_tl }{#2}
- { #3 _alt \int_use:N \g_ltj_fontspec_altnumber_int }
- { \l_ltj_fontspec_altrange_tl }
- \int_gincr:N \g_ltj_fontspec_altnumber_int
- }
- }
- }
- }
- \group_end:
- }
-
-%%%%%%%% User commands
-\DeclareDocumentCommand \jfontspec { O{} m } {
- \__ltj_fontspec_set_family:Nnn \k@family {#1}{#2}
- \selectfont
- \ignorespaces
-}
-
-\DeclareDocumentCommand \setmainjfont { O{} m } {
- \__ltj_fontspec_set_family:Nnn \mcdefault {#1}{#2}
- \DeclareSymbolFont{mincho}{JY3}{\l_fontspec_family_tl}{m}{n}
- \SetSymbolFont{mincho}{bold}{JY3}{\l_fontspec_family_tl}{bx}{n}
- \normalfont
+\cs_if_exist:NTF \fontspec_update_featstr:n {
+ \RequirePackage{luatexja-fontspec-23}
+} {
+ \RequirePackage{luatexja-fontspec-24}
}
-\DeclareDocumentCommand \setsansjfont { O{} m } {
- \__ltj_fontspec_set_family:Nnn \gtdefault {#1}{#2}
- \DeclareMathAlphabet{\mathgt}{JY3}{\l_fontspec_family_tl}{m}{n}
- \normalfont
-}
-
-\DeclareDocumentCommand \newjfontfamily { m O{} m } {
- \ltj_fontspec_select:nn{#2}{#3}
- \use:x {
- \exp_not:N \DeclareRobustCommand \exp_not:N #1 {
- \exp_not:N \kanjifamily {\l_fontspec_family_tl} \exp_not:N \selectfont
- }
- }
-}
-
-\DeclareDocumentCommand \newjfontface { m O{} m } {
- \newjfontfamily #1 [ BoldFont={},ItalicFont={},SmallCapsFont={},#2 ] {#3}
-}
-
-\tl_new:N \g_ltj_fontspec_default_fontopts_tl
-\prop_new:N \g__ltj_fontspec_fontopts_prop
-\DeclareDocumentCommand \defaultjfontfeatures { o m }
- {
- \IfNoValueTF {#1}
- { \__ltj_fontspec_set_default_features:n {#2} }
- { \__ltj_fontspec_set_font_default_features:nn {#1} {#2} }
- }
-\cs_new:Nn \__ltj_fontspec_set_default_features:n
- {
- \tl_set:Nn \g_ltj_fontspec_default_fontopts_tl {#1,}
- }
-\cs_new:Nn \__ltj_fontspec_set_font_default_features:nn
- {
- \__fontspec_sanitise_fontname:Nn \l__fontspec_tmp_tl {#1}
- \tl_if_empty:nTF {#2}
- { \prop_gremove:NV \g__ltj_fontspec_fontopts_prop \l__fontspec_tmp_tl }
- { \prop_gput:NVn \g__ltj_fontspec_fontopts_prop \l__fontspec_tmp_tl {#2} }
- }
-
-\DeclareDocumentCommand \addjfontfeatures {m} {
- \ifcsname zf@family@fontdef\k@family\endcsname
- \group_begin:
- \tl_clear:N \g_ltj_fontspec_default_fontopts_tl
- \use:x {
- \exp_not:N\ltj_fontspec_select:nn
- {\csname zf@family@options\k@family\endcsname,#1}
- {\csname zf@family@fontname\k@family\endcsname}
- }
- \group_end:
- \fontfamily\l_fontspec_family_tl\selectfont
- \else
- \msg_warning:nn {luatexja-fontspec} {addjfontfeatures-ignored}
- \fi
- \ignorespaces
-}
-
-\cs_set_eq:NN \addjfontfeature \addjfontfeatures
-
-%%% CJKShape=JIS2004
-\fontspec_define_feature_option:nnnnn{CJKShape}{JIS2004}{20}{5}{+jp04}
-
-\ExplSyntaxOff
-%%%%%%%% Now we completely ignore kanjifont definition file.
-
-\DeclareRobustCommand\fontfamily[1]{%
- \@notkfamfalse\@notffamfalse
- \edef\tmp@item{'\luatexluaescapestring{#1}'}%
- \edef\tmp@enc{'\luatexluaescapestring{\f@encoding}'}%
- \ifcsname \k@encoding+#1\endcsname % if \k@encoding+#1 is already defined
- \edef\k@family{#1}%
- \else\@notkfamtrue\fi
- \ifcsname \f@encoding+#1\endcsname
- \edef\f@family{#1}%
- \else % search font definition file...
- \directlua{luatexja.jfont.is_ffam(\tmp@enc, \tmp@item)}%
- \ifin@\edef\k@family{#1}\else%
- \directlua{luatexja.jfont.is_Nffam(\tmp@enc, \tmp@item)}%
- \ifin@\@notffamtrue\else%
- % filename of font definition file is always lowercase
- \edef\@temp{\lowercase{\noexpand\IfFileExists{\f@encoding#1.fd}}}%
- \message{(I search font definition file)}%
- \@temp{\@tempswztrue}{\@tempswzfalse}%
- \if@tempswz
- \directlua{luatexja.jfont.add_ffam_list(\tmp@enc, \tmp@item)}%
- \edef\f@family{#1}%
- \else
- \directlua{luatexja.jfont.add_Nffam_list(\tmp@enc, \tmp@item)}%
- \@notffamtrue%
- \fi
- \fi
- \fi
- \fi
- \if@notkfam\if@notffam
- {\ifcsname D@\k@encoding\endcsname\@nameuse{D@\k@encoding}\fi
- \xdef\@@temp{\default@family}}\edef\k@family{\@@temp}%
- {\ifcsname D@\f@encoding\endcsname\@nameuse{D@\f@encoding}\fi
- \xdef\@@temp{\default@family}}\edef\f@family{\@@temp}%
- \fi\fi
-}
-
-% We must redefine \try@load@fontshape to ignore kanjifont definitions at all.
-\def\try@load@fontshape{%
- \expandafter
- \ifx\csname \f@encoding+\f@family\endcsname\relax
- \directlua{luatexja.jfont.is_kenc('\luatexluaescapestring{\f@encoding}')}%
-\ifin@ % Japanese font: we don't search fd.
- \@font@warning{We don't search kanjifont definition
- \MessageBreak for \f@encoding/\f@family}%
-\else % Alphabetic font
- \@font@info{Try loading font information for \f@encoding+\f@family}%
- \global\expandafter\let
- \csname\f@encoding+\f@family\endcsname\@empty
- \nfss@catcodes
- \let\nfss@catcodes\relax
- \edef\reserved@a{%
- \lowercase{%
- \noexpand\InputIfFileExists{\f@encoding\f@family.fd}}}%
- \reserved@a\relax
- {\@input@{\f@encoding\f@family.fd}}%
-\fi
- \fi}
-
\endinput
diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltj-jfmglue.lua b/Master/texmf-dist/tex/luatex/luatexja/ltj-jfmglue.lua
index eb0174729e3..9486c322ca6 100644
--- a/Master/texmf-dist/tex/luatex/luatexja/ltj-jfmglue.lua
+++ b/Master/texmf-dist/tex/luatex/luatexja/ltj-jfmglue.lua
@@ -9,6 +9,7 @@ luatexbase.provides_module({
module('luatexja.jfmglue', package.seeall)
local err, warn, info, log = luatexbase .errwarinf(_NAME)
+luatexja.load_module('base'); local ltjb = luatexja.base
luatexja.load_module('stack'); local ltjs = luatexja.stack
luatexja.load_module('jfont'); local ltjf = luatexja.jfont
local pairs = pairs
@@ -100,11 +101,16 @@ local function fast_find_char_class(c,m)
end
-- 文字クラスの決定
-local function slow_find_char_class(c, m, oc)
- local xc = c or oc
- local cls = ltjf_find_char_class(oc, m)
- if xc ~= oc and cls==0 then cls = ltjf_find_char_class(-xc, m) end
- return cls, xc
+local slow_find_char_class
+do
+ slow_find_char_class = function (c, m, oc)
+ local cls = ltjf_find_char_class(oc, m)
+ if not c and cls==0 then
+ return ltjf_find_char_class(-c, m), oc
+ else
+ return cls, oc
+ end
+ end
end
local zero_glue = node_new(id_glue)
diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltjsarticle.cls b/Master/texmf-dist/tex/luatex/luatexja/ltjsarticle.cls
index 62ddad71674..3d31a054427 100644
--- a/Master/texmf-dist/tex/luatex/luatexja/ltjsarticle.cls
+++ b/Master/texmf-dist/tex/luatex/luatexja/ltjsarticle.cls
@@ -38,7 +38,7 @@
%% Right brace \} Tilde \~}
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{ltjsarticle}
- [2014/03/28 ]
+ [2014/05/14 ]
\RequirePackage{luatexja}
\newif\if@restonecol
\newif\if@titlepage
@@ -363,9 +363,12 @@
\parindent=1\zw
\fi
\fi
- \ltjsetparameter{kanjiskip={0\zw plus .1\zw minus .01\zw}}
- \if@slide \ltjsetparameter{xkanjiskip={0.1em}} \else
- \ltjsetparameter{xkanjiskip={0.25em plus 0.15em minus 0.06em}}
+ \ltj@setpar@global
+ \ltjsetkanjiskip{0pt plus .1\zw minus .01\zw}
+ \if@slide
+ \ltjsetxkanjiskip{0.1em}
+ \else
+ \ltjsetxkanjiskip{0.25em plus 0.15em minus 0.06em}
\fi}
\emergencystretch 3\zw
\newif\ifnarrowbaselines
@@ -1580,7 +1583,8 @@
\renewcommand\kanjifamilydefault{\gtdefault}
\renewcommand\familydefault{\sfdefault}
\raggedright
- \ltjsetparameter{xkanjiskip={0.1em}}\relax
+ \ltj@setpar@global
+ \ltjsetxkanjiskip{0.1em}\relax
\fi
\endinput
%%
diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltjsbook.cls b/Master/texmf-dist/tex/luatex/luatexja/ltjsbook.cls
index 813909f0d6f..4e3e12bf3d3 100644
--- a/Master/texmf-dist/tex/luatex/luatexja/ltjsbook.cls
+++ b/Master/texmf-dist/tex/luatex/luatexja/ltjsbook.cls
@@ -38,7 +38,7 @@
%% Right brace \} Tilde \~}
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{ltjsbook}
- [2014/03/28 ]
+ [2014/05/14 ]
\RequirePackage{luatexja}
\newif\if@restonecol
\newif\if@titlepage
@@ -370,9 +370,12 @@
\parindent=1\zw
\fi
\fi
- \ltjsetparameter{kanjiskip={0\zw plus .1\zw minus .01\zw}}
- \if@slide \ltjsetparameter{xkanjiskip={0.1em}} \else
- \ltjsetparameter{xkanjiskip={0.25em plus 0.15em minus 0.06em}}
+ \ltj@setpar@global
+ \ltjsetkanjiskip{0pt plus .1\zw minus .01\zw}
+ \if@slide
+ \ltjsetxkanjiskip{0.1em}
+ \else
+ \ltjsetxkanjiskip{0.25em plus 0.15em minus 0.06em}
\fi}
\emergencystretch 3\zw
\newif\ifnarrowbaselines
@@ -1665,7 +1668,8 @@
\renewcommand\kanjifamilydefault{\gtdefault}
\renewcommand\familydefault{\sfdefault}
\raggedright
- \ltjsetparameter{xkanjiskip={0.1em}}\relax
+ \ltj@setpar@global
+ \ltjsetxkanjiskip{0.1em}\relax
\fi
\endinput
%%
diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltjskiyou.cls b/Master/texmf-dist/tex/luatex/luatexja/ltjskiyou.cls
index 145d94ba1b4..1311decaa0a 100644
--- a/Master/texmf-dist/tex/luatex/luatexja/ltjskiyou.cls
+++ b/Master/texmf-dist/tex/luatex/luatexja/ltjskiyou.cls
@@ -38,7 +38,7 @@
%% Right brace \} Tilde \~}
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{ltjskiyou}
- [2014/03/28 ]
+ [2014/05/14 ]
\RequirePackage{luatexja}
\newif\if@restonecol
\newif\if@titlepage
@@ -365,9 +365,12 @@
\parindent=1\zw
\fi
\fi
- \ltjsetparameter{kanjiskip={0\zw plus .1\zw minus .01\zw}}
- \if@slide \ltjsetparameter{xkanjiskip={0.1em}} \else
- \ltjsetparameter{xkanjiskip={0.25em plus 0.15em minus 0.06em}}
+ \ltj@setpar@global
+ \ltjsetkanjiskip{0pt plus .1\zw minus .01\zw}
+ \if@slide
+ \ltjsetxkanjiskip{0.1em}
+ \else
+ \ltjsetxkanjiskip{0.25em plus 0.15em minus 0.06em}
\fi}
\emergencystretch 3\zw
\newif\ifnarrowbaselines
@@ -1567,7 +1570,8 @@
\renewcommand\kanjifamilydefault{\gtdefault}
\renewcommand\familydefault{\sfdefault}
\raggedright
- \ltjsetparameter{xkanjiskip={0.1em}}\relax
+ \ltj@setpar@global
+ \ltjsetxkanjiskip{0.1em}\relax
\fi
\endinput
%%
diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltjspf.cls b/Master/texmf-dist/tex/luatex/luatexja/ltjspf.cls
index b56a2343531..fab8f0cd061 100644
--- a/Master/texmf-dist/tex/luatex/luatexja/ltjspf.cls
+++ b/Master/texmf-dist/tex/luatex/luatexja/ltjspf.cls
@@ -38,7 +38,7 @@
%% Right brace \} Tilde \~}
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{ltjspf}
- [2014/03/28 ]
+ [2014/05/14 ]
\RequirePackage{luatexja}
\newif\if@restonecol
\newif\if@titlepage
@@ -363,9 +363,12 @@
\parindent=1\zw
\fi
\fi
- \ltjsetparameter{kanjiskip={0\zw plus .1\zw minus .01\zw}}
- \if@slide \ltjsetparameter{xkanjiskip={0.1em}} \else
- \ltjsetparameter{xkanjiskip={0.25em plus 0.15em minus 0.06em}}
+ \ltj@setpar@global
+ \ltjsetkanjiskip{0pt plus .1\zw minus .01\zw}
+ \if@slide
+ \ltjsetxkanjiskip{0.1em}
+ \else
+ \ltjsetxkanjiskip{0.25em plus 0.15em minus 0.06em}
\fi}
\emergencystretch 3\zw
\newif\ifnarrowbaselines
@@ -1463,7 +1466,8 @@
\renewcommand\kanjifamilydefault{\gtdefault}
\renewcommand\familydefault{\sfdefault}
\raggedright
- \ltjsetparameter{xkanjiskip={0.1em}}\relax
+ \ltj@setpar@global
+ \ltjsetxkanjiskip{0.1em}\relax
\fi
\endinput
%%
diff --git a/Master/texmf-dist/tex/luatex/luatexja/luatexja-core.sty b/Master/texmf-dist/tex/luatex/luatexja/luatexja-core.sty
index d0a4a47fe43..b4fd007f79f 100644
--- a/Master/texmf-dist/tex/luatex/luatexja/luatexja-core.sty
+++ b/Master/texmf-dist/tex/luatex/luatexja/luatexja-core.sty
@@ -339,16 +339,19 @@
\fi}
% [x]]kanjiskip = <dimen>
-\define@key[ltj]{japaram}{kanjiskip}{% % SKIP
+\define@key[ltj]{japaram}{kanjiskip}{\ltjsetkanjiskip{#1}}
+\define@key[ltj]{japaram}{xkanjiskip}{\ltjsetxkanjiskip{#1}}
+\protected\def\ltjsetkanjiskip#1{% % SKIP
\directlua{%
local d = \ltj@safe@glue{#1}
luatexja.stack.set_stack_skip(luatexja.stack_table_index.KSK, d); node.free(d)
-}}
-\define@key[ltj]{japaram}{xkanjiskip}{% % SKIP
+}\ignorespaces}
+\protected\def\ltjsetxkanjiskip#1{% % SKIP
\directlua{%
local d = \ltj@safe@glue{#1}
luatexja.stack.set_stack_skip(luatexja.stack_table_index.XSK, d); node.free(d)
-}}
+}\ignorespaces}
+
% jcharwidowpenalty = <count>
\define@key[ltj]{japaram}{jcharwidowpenalty}{% %COUNT
@@ -387,11 +390,13 @@
\else\directlua{luatexja.isglobal=''}\fi
}
\protected\def\ltjsetparameter#1{%
- \ltj@setpar@global\setkeys[ltj]{japaram}{#1}\ignorespaces}
+ \ltj@setpar@global\setkeys[ltj]{japaram}{#1}%
+ \ignorespaces}
\protected\def\ltjglobalsetparameter#1{%
\relax\ifnum\globaldefs<0\directlua{luatexja.isglobal=''}%
\else\directlua{luatexja.isglobal='global'}\fi%
- \setkeys[ltj]{japaram}{#1}\ignorespaces}
+ \setkeys[ltj]{japaram}{#1}%
+ \ignorespaces}
%%%%%%%% \ltjgetparameter
\def\ltj@@decl@array@param#1{%
@@ -414,7 +419,8 @@
{\ltj@@getparam@one{#1}}%
}
\def\ltj@@getparam@one#1{%
- \directlua{luatexja.ext_get_parameter_unary('#1')}}%
+ \directlua{luatexja.ext_get_parameter_unary('#1')}%
+}%
\def\ltj@@getparam@two#1#2{%
\directlua{luatexja.ext_get_parameter_binary('#1', \ltj@safe@num@or{nil}{#2})}%
}
@@ -496,7 +502,6 @@
{\ltj@@getjfontnumber#1%
\directlua{luatexja.jfont.clear_alt_font(\the\ltj@tempcntc)}}\ignorespaces}
-
%%------------------ Load module for the format
\ifltj@in@latex %<*LaTeX>
diff --git a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty
index 2933844817a..65d86aceced 100644
--- a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty
+++ b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty
@@ -1,6 +1,6 @@
%
% lltjfont.sty: derived from plfonts.dtx in pLaTeX.
-%
+%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{lltjfont}[2014/01/23 Patch to NFSS2 for LuaTeX-ja]
@@ -203,7 +203,7 @@
\else
%\directlua{luatexja.jfont.is_ktenc('\luatexluaescapestring{#2}')}\ifin@%
% \usekanji{#2}{#3}{#4}{#5}%
- % \let\font\tfont
+ % \global\let#1\gettfont
%\else
\useroman{#2}{#3}{#4}{#5}%
\global\expandafter\let\expandafter#1\the\font
@@ -213,7 +213,7 @@
}
\def\DLMfontsw@standard#1#2#3{#1{#2{#3}}}
\def\reDeclareMathAlphabet#1#2#3{%
- \ifdefined#2
+ \ifdefined#2
\@temptokena\expandafter{#2}%
\else
\@temptokena{#2}%
@@ -256,7 +256,18 @@
}
\newif\if@knjcmd
\def\userelfont{\@knjcmdtrue}
-\DeclareRobustCommand\selectfont{%
+
+
+\RequirePackage{everysel}
+\let\ltj@@EverySelectfont@Init=\@EverySelectfont@Init
+\expandafter\expandafter\expandafter\let
+\expandafter\expandafter\csname ltj@@orig@selectfont\endcsname\csname selectfont\space\endcsname
+\@EverySelectfont@Init
+\def\@EverySelectfont@Init{%
+ \expandafter\let\csname selectfont\space \endcsname \ltj@@orig@selectfont
+ \ltj@@EverySelectfont@Init
+}
+\def\ltj@selectfont@patch{%
\let\tmp@error@fontshape\error@fontshape
\let\error@fontshape\error@kfontshape
\directlua{luatexja.jfont.is_kyenc('\luatexluaescapestring{\k@encoding}')}\ifin@%
@@ -270,41 +281,39 @@
\@latex@error{KANJI Encoding scheme `\k@encoding' unknown}\@eha
%\fi
\fi
+%
\let\k@encoding\cy@encoding
\xdef\font@name{\csname\curr@kfontshape/\f@size\endcsname}%
\pickup@jfont
\font@name
+ \ltj@@does@alt@set{\curr@kfontshape}%
+ % alt fonts の定義
+ \directlua{luatexja.jfont.output_alt_font_cmd('\luatexluaescapestring{\curr@kfontshape}')}%
+ % 定義した alt fonts のデータを \ltjdeclarealtfont に渡すのと同等の処理をする
+ \directlua{luatexja.jfont.pickup_alt_font_a('\f@size')}%
+ \fi
+%
\edef\tmp@item{{\k@encoding}}\expandafter\def\expandafter\k@encoding\tmp@item
\kenc@update
\let\error@fontshape\tmp@error@fontshape
+%
\if@knjcmd \@knjcmdfalse
\expandafter\ifx
\csname rel@\k@encoding/\k@family/\k@series/\k@shape\endcsname\relax
\expandafter\ifx
\csname rel@\k@encoding/\k@family/\k@series/all\endcsname\relax
\else
- \csname rel@\k@encoding/\k@family/\k@series/all\endcsname
+ \csname rel@\k@encoding/\k@family/\k@series/all\endcsname\selectfont
+ % 警告: 再び \selectfont を呼んでいる.無限ループの可能性あり
\fi
\else
- \csname rel@\k@encoding/\k@family/\k@series/\k@shape\endcsname
+ \csname rel@\k@encoding/\k@family/\k@series/\k@shape\endcsname\selectfont
+ % 警告: 再び \selectfont を呼んでいる.無限ループの可能性あり
\fi
\fi
- \xdef\font@name{\csname\curr@fontshape/\f@size\endcsname}%
- \pickup@font
- \font@name
- \enc@update
- \ifx\f@linespread\baselinestretch \else
- \set@fontsize\baselinestretch\f@size\f@baselineskip
- \fi
- \size@update
-% ここからは altfont 用
- \ltj@@does@alt@set{\curr@kfontshape}%
- % alt fonts の定義
- \directlua{luatexja.jfont.output_alt_font_cmd('\luatexluaescapestring{\curr@kfontshape}')}%
- % 定義した alt fonts のデータを \ltjdeclarealtfont に渡すのと同等の処理をする
- \directlua{luatexja.jfont.pickup_alt_font_a('\f@size')}%
- \fi
}
+\EverySelectfont{\ltj@selectfont@patch}
+
\def\KanjiEncodingPair#1#2{\@namedef{t@enc@#1}{#2}\@namedef{y@enc@#2}{#1}}
\KanjiEncodingPair{JY3}{JT3}
\def\set@fontsize#1#2#3{%
@@ -332,7 +341,7 @@
\newbox\adjust@box
\newdimen\adjust@dimen
\def\adjustbaseline{%
- \setbox\adjust@box\hbox{\ltjsetparameter{yjabaselineshift=\z@}あ}%
+ \setbox\adjust@box\hbox{\ltj@ykblshift=0あ}%
\cht\ht\adjust@box
\cdp\dp\adjust@box
\cwd\wd\adjust@box
@@ -340,14 +349,15 @@
\chs\cwd
\cHT\cht \advance\cHT\cdp
% \iftdir
- % \setbox\adjust@box\hbox{\tbaselineshift\z@ M}%
+ % \setbox0\hbox{\tate\ltjsetparameter{tjabaselineshift=\z@}あ}%
+ % \setbox\adjust@box\hbox{\tate\ltjsetparameter{talbaselineshift=\z@}M}%
% \adjust@dimen\ht\adjust@box
% \advance\adjust@dimen\dp\adjust@box
- % \advance\adjust@dimen-\cHT
+ % \advance\adjust@dimen-\ht0
% \divide\adjust@dimen\tw@
- % \advance\adjust@dimen\cdp
+ % \advance\adjust@dimen0.5\dp0
% \advance\adjust@dimen-\dp\adjust@box
- % \tbaselineshift\adjust@dimen
+ % \ltjsetparameter{talbaselineshift=\adjust@dimen}
% \fi
}
\DeclareRobustCommand\romanencoding[1]{%
@@ -630,7 +640,7 @@
\ifx\ltj@temp\empty\ltj@tempcntb="10FFFF\else\ltj@tempcntb=#2\fi\relax%"
\fi
\directlua{luatexja.jfont.set_alt_font_latex(
- \the\ltj@tempcnta,\the\ltj@tempcntb,
+ \the\ltj@tempcnta,\the\ltj@tempcntb,
'\luatexluaescapestring{\ltj@temp@afont}',
'\luatexluaescapestring{\ltj@temp@bfont}')}%
}