From 7098bdc2e3608c04ea4142085f3b7feaa04ae452 Mon Sep 17 00:00:00 2001 From: Hironori Kitagawa Date: Sun, 2 Feb 2014 09:37:37 +0900 Subject: [PATCH] Fix lltjp-unicode-math.sty. --- doc/luatexja.dtx | 44 +++++++++++++++++++++++++------------- src/ltj-charrange.lua | 2 +- src/ltj-jfont.lua | 3 --- src/luatexja-core.sty | 11 +++++++--- src/patches/lltjp-unicode-math.sty | 23 ++++++++++++++++++-- 5 files changed, 59 insertions(+), 24 deletions(-) diff --git a/doc/luatexja.dtx b/doc/luatexja.dtx index 65d40d5..366d8ed 100644 --- a/doc/luatexja.dtx +++ b/doc/luatexja.dtx @@ -3033,7 +3033,8 @@ Furthermore, the glyph is shifted according to values of fields は \Pkg{luatexja-adjust} による優先順位付き 行長調整(\ref{ssec-adj}節)が有効なときのみ意味を持つ. このフィールドは省略可能であり,行調整処理におけるこのglueの優先 - 度を$-2$から$+2$の間の整数で指定する.の省略時の値 + 度を$-2$から$+2$の間の整数で指定する.大きい値ほど「伸びやすく,縮みやすい」 + ことを意味する.省略時の値 は0であり,範囲外の値が指定されたときの動作は未定義である. も省略可能フィールドであり,$-1$から$+1$の実数値をとる.省略時の値は0である. @@ -3062,7 +3063,8 @@ between characters in character class~$i$ and those in character class~$j$. is an integer in $[-2,2]$ (treated as 0 if omitted), and this is used only in line adjustment with priority by \Pkg{luatexja-adjust} -(see Subsection~\ref{ssec-adj}). +(see Subsection~\ref{ssec-adj}). Higher value means the glue is easy to shretch, +and is also easy to shrink. is \dots % @@ -3260,7 +3262,7 @@ The following is the list of imaginary characters: \texttt{'parbdd'}を入れれば全角下がりとなる. \begin{LTXexample}[width=0.4\textwidth] -\jfont\g=file:KozMinPr6N-Regular.otf:jfm=test \g +\jfont\g=KozMinPr6N-Regular:jfm=test \g \parindent1\zw\noindent{}◆◆◆◆◆ \par 「◆◆←二分下がり \par 【◆◆←全角下がり @@ -4883,19 +4885,19 @@ Glues from an italic correction Penalties inserted for the word-wrapping process (\emph{kinsoku shori}) of Japanese characters. % %禁則処理のために挿入されたペナルティ. -\item[\textit{from\_jfm} (6)] +\item[$(\textit{from\_jfm}-2)$--$(\textit{from\_jfm}+2)$~(4--8)] %Glues/kerns from JFM. %JFM由来のグルー/カーン. -\item[\textit{kanji\_skip} (9)] -%Glues for \Param{\hyperlink{fld:kanjiskip}{kanjiskip}}. -%\Param{\hyperlink{fld:kanjiskip}{kanjiskip}}のグルー. -\item[\textit{xkanji\_skip} (10)] -%Glues for \Param{\hyperlink{fld:xks}{xkanjiskip}}. -%\Param{\hyperlink{fld:xks}{xkanjiskip}}のグルー. -\item[\textit{processed} (11)] +\item[\textit{kanji\_skip}~(9), \textit{kanji\_skip\_jfm}~(10)] +%Glues from \Param{\hyperlink{fld:kanjiskip}{kanjiskip}}. +%和文間空白\Param{\hyperlink{fld:kanjiskip}{kanjiskip}}を表すグルー. +\item[\textit{xkanji\_skip}~(11), \textit{xkanji\_skip\_jfm}~(12)] +%Glues from \Param{\hyperlink{fld:xks}{xkanjiskip}}. +%和欧文間空白\Param{\hyperlink{fld:xks}{xkanjiskip}}を表すグルー. +\item[\textit{processed} (13)] %Nodes which is already processed by \ldots. %\LuaTeX-ja の内部処理によって既に処理されたノード. -\item[\textit{ic\_processed} (12)] +\item[\textit{ic\_processed} (14)] %<*en> Glues from an italic correction, but already processed in the insertion process of \textbf{JAglue}s. % @@ -4907,7 +4909,7 @@ Glues from an italic correction, but already processed in the insertion process %<*ja> また,挿入処理の結果であるリストの最初のノードでは,\verb+\ltj@icflag+ の値に -\textit{processed\_begin\_flag}~(32)が追加される.これによって,\verb+\unhbox+ が +\textit{processed\_begin\_flag}~(128)が追加される.これによって,\verb+\unhbox+ が 連続した場合でも「ボックスの境界」が識別できるようになっている. % @@ -4961,7 +4963,7 @@ Nodes for \LuaTeX-ja's stack system (see the next \item[\textit{char\_by\_cid}] %<*en> -Nodes for Japanese Characters which the callback process of +Nodes for \textbf{JAchar} which the callback process of \Pkg{luaotfload} won't be applied, and the character code is stored in the \texttt{value} field. Each node of this type are converted to a \textit{glyph\_node} \emph{after} @@ -4969,13 +4971,25 @@ Nodes for Japanese Characters which the callback process of Nodes of this type is used in \verb+\CID+, \verb+\UTF+ and IVS support. % %<*ja> -\Pkg{luaotfload}のコールバックによる処理が適用されない和文文字のためのノードで, +\Pkg{luaotfload}のコールバックによる処理が適用されない\textbf{JAchar}のためのノードで, \texttt{value} フィールドに文字コードが格納されている. この種類のノードはそれぞれが\Pkg{luaotfload}のコールバックの処理の \emph{後で}\textit{glyph\_node}に変換される. \verb+\CID+, \verb+\UTF+やIVS対応処理でこの種類のノードが利用されている. % +\item[\textit{replace\_vs}] +%<*en> +Similar to \textit{char\_by\_cid} whatsits above. +These nodes are for \textbf{ALchar} which the callback process of + \Pkg{luaotfload} won't be applied. +% +%<*ja> +上の\textit{char\_by\_cid}と同様に, +これらのノードは\Pkg{luaotfload}のコールバックによる処理が適用されない\textbf{ALchar}のた + めものである. +% + \item[\textit{begin\_par}] %<*en> Nodes for indicating beginning of a paragraph. diff --git a/src/ltj-charrange.lua b/src/ltj-charrange.lua index e3b6e7a..79002cb 100644 --- a/src/ltj-charrange.lua +++ b/src/ltj-charrange.lua @@ -97,7 +97,7 @@ function is_ucs_in_japanese_char_direct(p) if c<0x80 then return false else - return fn_table[jcr_table_main[c]] + return fn_table[jcr_table_main[c]](p) end end diff --git a/src/ltj-jfont.lua b/src/ltj-jfont.lua index ec0cf23..7e10815 100644 --- a/src/ltj-jfont.lua +++ b/src/ltj-jfont.lua @@ -321,10 +321,7 @@ end -- LATEX INTERFACE ------------------------------------------------------------------------ do -<<<<<<< HEAD -======= -- these function are called from ltj-latex.sty ->>>>>>> kitagawa_direct local kyenc_list, ktenc_list = {}, {} function add_kyenc_list(enc) kyenc_list[enc] = 'true ' end function add_ktenc_list(enc) ktenc_list[enc] = 'true ' end diff --git a/src/luatexja-core.sty b/src/luatexja-core.sty index db94c78..553e200 100644 --- a/src/luatexja-core.sty +++ b/src/luatexja-core.sty @@ -444,9 +444,14 @@ \def\ltj@@alchar{{\directlua{tex.globaldefs = 0}\ltj@allalchar\ltj@@origchar\ltj@tempcnta}} %%%%%%%% \ltjsetmathletter, \ltjunsetmathletter -\protected\def\ltjsetmathletter#1{\directlua{luatexja.math.is_math_letters[#1]=true}} -\protected\def\ltjunsetmathletter#1{\directlua{luatexja.math.is_math_letters[#1]=false}} - +\protected\def\ltjsetmathletter#1{% + \ltj@tempcnta=#1 + \directlua{luatexja.math.is_math_letters[\the\ltj@tempcnta]=true}% +} +\protected\def\ltjunsetmathletter#1{% + \ltj@tempcnta=#1 + \directlua{luatexja.math.is_math_letters[\the\ltj@tempcnta]=false}% +} %%%%%%%% \ltjdeclarealtfont{100-200,3000-,5000,...} % の 第 3 引数の文字達は で組む diff --git a/src/patches/lltjp-unicode-math.sty b/src/patches/lltjp-unicode-math.sty index 722d66f..75da566 100644 --- a/src/patches/lltjp-unicode-math.sty +++ b/src/patches/lltjp-unicode-math.sty @@ -10,10 +10,29 @@ \ExplSyntaxOn \group_begin: + \cs_gset:Nn \um_define_math_chars: { + \group_begin: + \char_set_catcode_math_superscript:N \^ + \cs_set:Npn \_um_sym:nnn ##1##2##3 { + \bool_if:nTF { \cs_if_eq_p:NN ##3 \mathaccent || + \cs_if_eq_p:NN ##3 \mathopen || + \cs_if_eq_p:NN ##3 \mathclose || + \cs_if_eq_p:NN ##3 \mathover || + \cs_if_eq_p:NN ##3 \mathunder || + \cs_if_eq_p:NN ##3 \mathbotaccent } { + \ltjsetmathletter{ ##1 } + } { + \um_cs_set_eq_active_char:Nw ##2 = ##1 \q_nil \ignorespaces + } + } + \char_set_catcode_other:N \# + \um_input_math_symbol_table: + \group_end: + } \cs_gset:Npn \um_cs_set_eq_active_char:Nw #1 = "#2 \q_nil {%" \group_begin: - %\typeout {um: \string#1, \int_from_hexadecimal:n {#2}} <- for debug - \char_set_lccode:nn { `! } { "#2 } + %\typeout {um: \string#1, \int_from_hexadecimal:n {#2}, #2}% <- for debug + \char_set_lccode:nn { `! } { "#2 }%" \tex_lowercase:D { \tl_set:Nn \l_tmpa_tl {\relax\ifmmode!\else{\directlua{tex.globaldefs = 0}\ltj@allalchar!}\fi} \cs_gset_eq:NN #1 \l_tmpa_tl -- 2.11.0