OSDN Git Service

fix
authorHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Tue, 14 Jan 2020 06:33:19 +0000 (15:33 +0900)
committerHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Tue, 14 Jan 2020 06:33:19 +0000 (15:33 +0900)
doc/luatexja.dtx
src/luatexja.lua
src/patches/lltjfont.sty

index 1a0d580..63d08e3 100644 (file)
@@ -653,10 +653,27 @@ and \emph{Japanese fonts} for fonts used in \textbf{JAchar}.
   \Pkg{everysel} (if you want to use \LuaTeX-ja with \LaTeXe)
 \item \Pkg{ltxcmds}, \Pkg{pdftexcmds}, \Pkg{filehook}, \Pkg{atbegshi}
 \item \href{https://github.com/wspr/fontspec/}{\Pkg{fontspec}} v2.7c (or later)
-%<en>\item \emph{IPAex fonts} (\url{http://ipafont.ipa.go.jp/})
-%<ja>\item \emph{IPAexフォント(\url{http://ipafont.ipa.go.jp/})}
+%<en>\item IPAex fonts (\url{http://ipafont.ipa.go.jp/})
+%<ja>\item IPAexフォント(\url{http://ipafont.ipa.go.jp/})
 \end{itemize}
-
+%<*en>
+Note that color specification in font~definitions, such as
+\begin{lstlisting}
+\font\test=file:lmromandunh10-regular.otf:color=FF0000BB % \font primitive
+\addfontfeatures{Color=00FF00} % fontspec
+\end{lstlisting}
+are not compatible with \LuaTeX-ja in plain \LuaTeX\ and \LaTeX~2019-10-01~(or prior).
+So we recommend to use \LaTeX~2020-02-02.
+%</en>
+%<*ja>
+なお,フォント定義の際の色指定,例えば
+\begin{lstlisting}
+\font\test=file:lmromandunh10-regular.otf:color=FF0000BB % \font primitive
+\addfontfeatures{Color=00FF00} % fontspec
+\end{lstlisting}
+は,plain \LuaTeX や\LaTeX~2019-10-01以前において\LuaTeX-jaとは\emph{共存しない}.
+そのため,\LaTeX~2020-02-02以降を用いることを勧める.
+%</ja>
 
 %<*en>
 Now \LuaTeX-ja is available from
@@ -1424,7 +1441,7 @@ this chapter. For the method, please see Subsection~\ref{ssec:math}.
 と考えており,したがってこの節では数式モード中の和文フォントを変更する方法については
 記述しない.この方法については\ref{ssec:math}節を参照のこと.
 
-{\gtfamily\bfseries
+{\bfseries
   既に記述した通り,\texttt{disablejfam}オプションを指定して\LuaTeX-jaを読み込んだ場合は,
   \verb+$素$+ のように直接和文文字を数式モード中に記述することはできなくなる.
   \cs{mbox},あるいは\Pkg{amsmath}パッケージの提供する\cs{text}命令などを使うことになる.
@@ -4997,6 +5014,17 @@ a \emph{horizontal} Japanese font.
 \end{tabular}
 \end{table}
 
+%<*en>
+Note that any OpenType features are not applied to Japanese characters in math mode.
+Other features, such as \texttt{color}~and~\texttt{embolden} may be applied to these
+characters, but one should not expect this.
+%</en>
+%<*ja>
+なお,数式中に直に記述した和文文字に対してはOpenType機能は適用されない.
+\texttt{color}や\texttt{embolden}など他の「機能」は適用される可能性があるが,
+ユーザは期待すべきではない.
+%</ja>
+
 %<en>\subsection{Callbacks}
 %<ja>\subsection{コールバック}
 
index 5ad31b3..767659a 100644 (file)
@@ -402,7 +402,7 @@ end
 
 local prefix, inner_depth
 local utfchar = utf.char
-local function debug_show_node_X(p,print_fn, limit)
+local function debug_show_node_X(p,print_fn, limit, inner_depth)
    local k = prefix
    local s
    local pt=node_type(p.id)
@@ -451,7 +451,7 @@ local function debug_show_node_X(p,print_fn, limit)
       prefix, inner_depth = prefix.. '.', inner_depth + 1
       if inner_depth < limit then
         for q in node.traverse(p.head) do
-           debug_show_node_X(q, print_fn, limit)
+           debug_show_node_X(q, print_fn, limit, inner_depth)
         end
       end
       prefix=k
@@ -466,15 +466,15 @@ local function debug_show_node_X(p,print_fn, limit)
       if inner_depth < limit then
          prefix, inner_depth = k.. 'p.', inner_depth + 1
         for q in node.traverse(p.pre) do
-           debug_show_node_X(q, print_fn, limit)
+           debug_show_node_X(q, print_fn, limit, inner_depth)
         end
          prefix = k.. 'P.'
         for q in node.traverse(p.post) do
-           debug_show_node_X(q, print_fn, limit)
+           debug_show_node_X(q, print_fn, limit, inner_depth)
         end
          prefix = k.. 'R.'
         for q in node.traverse(p.replace) do
-           debug_show_node_X(q, print_fn, limit)
+           debug_show_node_X(q, print_fn, limit, inner_depth)
         end
       end
       prefix=k
@@ -532,7 +532,7 @@ local function debug_show_node_X(p,print_fn, limit)
             prefix, inner_depth =prefix.. '.', inner_depth + 1
             if inner_depth < limit then
               for q in node.traverse(p.value) do
-                 debug_show_node_X(q, print_fn, limit)
+                 debug_show_node_X(q, print_fn, limit, inner_depth)
               end
            end
             prefix, inner_depth = k, bid
@@ -553,13 +553,13 @@ local function debug_show_node_X(p,print_fn, limit)
    elseif pt=='noad' then
       s = base ; print_fn(s)
       if p.nucleus then
-         prefix = k .. 'N'; debug_show_node_X(p.nucleus, print_fn, limit);
+         prefix = k .. 'N'; debug_show_node_X(p.nucleus, print_fn, limit, inner_depth);
       end
       if p.sup then
-         prefix = k .. '^'; debug_show_node_X(p.sup, print_fn, limit);
+         prefix = k .. '^'; debug_show_node_X(p.sup, print_fn, limit, inner_depth);
       end
       if p.sub then
-         prefix = k .. '_'; debug_show_node_X(p.sub, print_fn, limit);
+         prefix = k .. '_'; debug_show_node_X(p.sub, print_fn, limit, inner_depth);
       end
       prefix = k;
    elseif pt=='math_char' then
@@ -570,7 +570,7 @@ local function debug_show_node_X(p,print_fn, limit)
       if p.head then
          prefix = k .. '.';
         for q in node.traverse(p.head) do
-           debug_show_node_X(q, print_fn)
+           debug_show_node_X(q, print_fn, limit, inner_depth)
         end
       end
    else
@@ -583,7 +583,7 @@ function luatexja.ext_show_node_list(head,depth,print_fn, lim)
    inner_depth = 0
    if head then
       while head do
-         debug_show_node_X(head, print_fn, lim or 1/0); head = node_next(head)
+         debug_show_node_X(head, print_fn, lim or 1/0, inner_depth); head = node_next(head)
       end
    else
       print_fn(prefix .. ' (null list)')
@@ -593,7 +593,7 @@ function luatexja.ext_show_node(head,depth,print_fn, lim)
    prefix = depth
    inner_depth = 0
    if head then
-      debug_show_node_X(head, print_fn, lim or 1/0)
+      debug_show_node_X(head, print_fn, lim or 1/0, inner_depth)
    else
       print_fn(prefix .. ' (null list)')
    end
index 3e159bf..8ad7e45 100644 (file)
 \patchcmd\prepare@family@series@update@kanji{\maybe@load@fontshape}
   {\begingroup\let\f@encoding\k@encoding\let\f@family\k@family
     \maybe@load@fontshape\endgroup}{}{}
-\appto\@meta@family@list{\@elt{mc}\@elt{gt}\@elt{jtt}}
+\patchcmd\prepare@family@series@update@kanji{\@meta@family@list}{\@meta@family@kanji@list}{}{}
+\def\@meta@family@kanji@list{\@elt{mc}\@elt{gt}\@elt{jtt}}
+%%\appto\@meta@family@list{\@elt{mc}\@elt{gt}\@elt{jtt}}
 \DeclareRobustCommand\bfseries{%
   \not@math@alphabet\bfseries\mathbf
   \expand@font@defaults