OSDN Git Service

Fix lltjp-unicode-math.sty.
authorHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Sun, 2 Feb 2014 00:37:37 +0000 (09:37 +0900)
committerHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Sun, 2 Feb 2014 00:37:37 +0000 (09:37 +0900)
doc/luatexja.dtx
src/ltj-charrange.lua
src/ltj-jfont.lua
src/luatexja-core.sty
src/patches/lltjp-unicode-math.sty

index 65d40d5..366d8ed 100644 (file)
@@ -3033,7 +3033,8 @@ Furthermore, the glyph is shifted according to values of fields
              <priority>は \Pkg{luatexja-adjust} による優先順位付き
             行長調整(\ref{ssec-adj}節)が有効なときのみ意味を持つ.
 このフィールドは省略可能であり,行調整処理におけるこのglueの優先
-             度を$-2$から$+2$の間の整数で指定する.<priority>の省略時の値
+             度を$-2$から$+2$の間の整数で指定する.大きい値ほど「伸びやすく,縮みやすい」
+             ことを意味する.省略時の値
              は0であり,範囲外の値が指定されたときの動作は未定義である.
 
 <ratio>も省略可能フィールドであり,$-1$から$+1$の実数値をとる.省略時の値は0である.
@@ -3062,7 +3063,8 @@ between characters in character class~$i$ and those in character class~$j$.
 
 <priority> 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.
 
 <ratio> is \dots
 %</en>
@@ -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.
 %</en>
 %<ja>禁則処理のために挿入されたペナルティ.
-\item[\textit{from\_jfm} (6)]
+\item[$(\textit{from\_jfm}-2)$--$(\textit{from\_jfm}+2)$~(4--8)]
 %<en>Glues/kerns from JFM.
 %<ja>JFM由来のグルー/カーン.
-\item[\textit{kanji\_skip} (9)]
-%<en>Glues for \Param{\hyperlink{fld:kanjiskip}{kanjiskip}}.
-%<ja>\Param{\hyperlink{fld:kanjiskip}{kanjiskip}}のグルー.
-\item[\textit{xkanji\_skip} (10)]
-%<en>Glues for \Param{\hyperlink{fld:xks}{xkanjiskip}}.
-%<ja>\Param{\hyperlink{fld:xks}{xkanjiskip}}のグルー.
-\item[\textit{processed} (11)]
+\item[\textit{kanji\_skip}~(9), \textit{kanji\_skip\_jfm}~(10)]
+%<en>Glues from \Param{\hyperlink{fld:kanjiskip}{kanjiskip}}.
+%<ja>和文間空白\Param{\hyperlink{fld:kanjiskip}{kanjiskip}}を表すグルー.
+\item[\textit{xkanji\_skip}~(11), \textit{xkanji\_skip\_jfm}~(12)]
+%<en>Glues from \Param{\hyperlink{fld:xks}{xkanjiskip}}.
+%<ja>和欧文間空白\Param{\hyperlink{fld:xks}{xkanjiskip}}を表すグルー.
+\item[\textit{processed} (13)]
 %<en>Nodes which is already processed by \ldots.
 %<ja>\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.
 %</en>
@@ -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+ が
 連続した場合でも「ボックスの境界」が識別できるようになっている.
 %</ja>
 
@@ -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.
 %</en>
 %<*ja>
-\Pkg{luaotfload}のコールバックによる処理が適用されない和文文字のためのノードで,
+\Pkg{luaotfload}のコールバックによる処理が適用されない\textbf{JAchar}のためのノードで,
 \texttt{value} フィールドに文字コードが格納されている.
 この種類のノードはそれぞれが\Pkg{luaotfload}のコールバックの処理の
 \emph{後で}\textit{glyph\_node}に変換される.
 \verb+\CID+, \verb+\UTF+やIVS対応処理でこの種類のノードが利用されている.
 %</ja>
 
+\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.
+%</en>
+%<*ja>
+上の\textit{char\_by\_cid}と同様に,
+これらのノードは\Pkg{luaotfload}のコールバックによる処理が適用されない\textbf{ALchar}のた
+          めものである.
+%</ja>
+
 \item[\textit{begin\_par}]
 %<*en>
 Nodes for indicating beginning of a paragraph.
index e3b6e7a..79002cb 100644 (file)
@@ -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
 
index ec0cf23..7e10815 100644 (file)
@@ -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
index db94c78..553e200 100644 (file)
 \def\ltj@@alchar{{\directlua{tex.globaldefs = 0}\ltj@allalchar\ltj@@origchar\ltj@tempcnta}}
 
 %%%%%%%% \ltjsetmathletter<number>, \ltjunsetmathletter<number>
-\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<base_font_cs><alt_font_cs>{100-200,3000-,5000,...}
 % <base_font_cs> の 第 3 引数の文字達は <alt_font_cs> で組む
index 722d66f..75da566 100644 (file)
 \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