From: Hironori Kitagawa Date: Sat, 8 Oct 2011 00:16:59 +0000 (+0900) Subject: 'parbdd' should be effective if the paragraph is indented. X-Git-Tag: 20120419.0~56 X-Git-Url: http://git.osdn.jp/view?a=commitdiff_plain;h=c09ff5c4525ea6acf25d2d0e5fea53ed88202754;p=luatex-ja%2Fluatexja.git 'parbdd' should be effective if the paragraph is indented. --- diff --git a/doc/man-en.pdf b/doc/man-en.pdf index f4cd1eb..9847a1a 100644 Binary files a/doc/man-en.pdf and b/doc/man-en.pdf differ diff --git a/doc/manual.dtx b/doc/manual.dtx index 4bb6b6e..8ea5b72 100644 --- a/doc/manual.dtx +++ b/doc/manual.dtx @@ -861,8 +861,8 @@ In addition to those `real' characters, the following `imaginary \begin{list}{}{\def\makelabel{\ttfamily}\def\{{\char`\{}\def\}{\char`\}}} \item['lineend'] An ending of a line. \item['diffmet'] Used at a boundary between two \textbf{JAchar}s whose JFM or size is different. -\item['boxbdd'] The beginning/ending of a horizontal box. -\item['parbdd'] The beginning of a paragraph. +\item['boxbdd'] The beginning/ending of a horizontal box, and the beginging of a noindented paragraph. +\item['parbdd'] The beginning of an (indented) paragraph. \item['jcharbdd'] A boundary between \textbf{JAchar} and anything else (such as \textbf{ALchar}, kern, glue, ...). \item[$-1$] The left/right boundary of an inline math formula. @@ -1335,8 +1335,7 @@ This problem is resolved by using \section{Linebreak after Japanese Character}\label{sec-lbreak} \subsection{Reference: Behavior in \pTeX} -(NOT COMPLETED) - +%<*en> In~\pTeX, a linebreak after a Japanese character doesn't emit a space, since words are not separated by spaces in Japanese writings. However, this feature isn't fully implemented in \LuaTeX-ja due to the @@ -1358,8 +1357,36 @@ processor. State~$K$ is similar to state~$M$, and is entered after Japanese characters. The diagram of state transitions are indicated in Figure~\ref{fig-ptexipro}. Note that \pTeX\ doesn't leave state~$K$ after `beginning/ending of a group' characters. +% + +%<*ja> +欧文では文章の改行は単語間でしか行わない.そのため,\TeX では,(文字の直後の)改行は +空白文字と同じ扱いとして扱われる.一方,和文ではほとんどどどこでも改行が可能なため, +\pTeX では和文文字の直後の改行は単純に無視されるようになっている. + +このような動作は,\pTeX が\TeX からエンジンとして拡張されたことによって可能になったことである. +\pTeX の入力処理部は,\TeX におけるそれと同じように,有限オートマトンとして記述することができ, +以下に述べるような4状態を持っている. + +\begin{itemize} +\item State~$N$: 行の開始. +\item State~$S$: 空白読み飛ばし. +\item State~$M$: 行中. +\item State~$K$: 行中(和文文字の後). +\end{itemize} +また,状態遷移は,図\label{fig-ptexipro}のようになっており,図中の数字は +カテゴリーコードを表している.最初の3状態は\TeX の入力処理部と同じであり, +図中から状態$K$と「$j$」と書かれた矢印を取り除けば,\TeX の入力処理部と同 +じものになる. + +この図から分かることは, +\begin{quote} +行が和文文字(とグループ境界文字)で終わっていれば,改行は無視される +\end{quote} +ということである. +% + \begin{figure}[tb] -\label{fig-ptexipro} \begin{gather*} \def\sp{\text{\tt\char32}} \xymatrix{&& @@ -1382,10 +1409,12 @@ after `beginning/ending of a group' characters. \item Category codes 9~(ignored), 14~(comment)~and~15~(invalid) are omitted in above diagram. \end{itemize} \caption{State transitions of \pTeX's input processor.} +\label{fig-ptexipro} \end{figure} \subsection{Behavior in \LuaTeX-ja} +%<*en> States in the input processoe of \LuaTeX\ is the same as that of \TeX, and they can't be customized by any callbacks. Hence, we can only use \verb+process_input_buffer+ and \verb+token_filter+ callbacks for to @@ -1397,11 +1426,11 @@ token \emph{in the input processor}. So we can use only the \verb+process_input_buffer+ callback. This means that suppressing a space must be done \emph{just before} an input line is read. -Considering these situations, handling of a end-of-line in \LuaTeX-ja are as follows: +Considering these situations, handling of an end-of-line in \LuaTeX-ja are as follows: \begin{quote} A character U+FFFFF (its category code is set to 14~(comment) by -\LuaTeX-ja) is appended to an input line, before \LuaTeX\ actually -process it, if and only if the following two conditions are satisfied: +\LuaTeX-ja) is appended to an input line, \emph{before \LuaTeX\ actually +process it}, if and only if the following two conditions are satisfied: \begin{enumerate} \item The category code of the character $\langle${return}$\rangle$ (whose character code is 13) is 5~(end-of-line). @@ -1411,11 +1440,88 @@ process it, if and only if the following two conditions are satisfied: \bigl(\{\text{catcode}=1\}\cup\{\text{catcode}=2\}\bigr)^* \] \end{enumerate} +\end{quote} + +\paragraph{Remark} +The following example shows the major difference from the behavior of \pTeX: +\begin{LTXexample} +\ltjsetparameter{autoxspacing=false} +\ltjsetparameter{jacharrange={-6}}xあ +y\ltjsetparameter{jacharrange={+6}}zあ +u +\end{LTXexample} +\begin{itemize} +\item There is no space between `x' and `y', since the line~2 ends with a \textbf{JAchar} `あ' +(this `あ' considered as an \textbf{JAchar} at the ending of line~1). +\item There is no space between `あ' (in the line~3) and `u', since the + line~3 ends with an \textbf{ALchar} +(the letter `あ' considered as an \textbf{ALchar} at the ending of line~2). +\end{itemize} +% +%<*ja> +\LuaTeX の入力処理部は\TeX のそれと全く同じであり,callbackによりユーザが +カスタマイズすることはできない.このため,改行抑制の目的でユーザが利用で +きそうなcallbackとしては,\verb+process_input_buffer+や +\verb+token_filter+に限られてしまう.しかし,\TeX の入力処理部をよく見る +と,後者も役には経たないことが分かる:改行文字は,入力処理部によってトー +クン化される時に,カテゴリーコード10の32番文字へと置き換えられてしまうた +め,\verb+token_filter+で非標準なトークン読み出しを行おうとしても,空白文 +字由来のトークンと,改行文字由来のトークンは区別できないのだ. + +すると,我々のとれる道は,\verb+process_input_buffer+を用いて +\LuaTeX の入力処理部に引き渡される前に入力文字列を編集するというものしかない. +以上を踏まえ,\LuaTeX-jaにおける「和文文字直後の改行抑制」の処理は,次のようになっている: + +\begin{quote} +各入力行に対し,\textbf{その入力行が読まれる前の内部状態で} +以下の2条件が満たされている場合,\LuaTeX-jaはU+FFFFF番の文字 +\footnote{この文字はコメント文字として扱われるように\LuaTeX-ja内部で設定をしている.} +を末尾に追加する.よって,その場合に改行は空白とは見做されないこととなる. +\begin{enumerate} +\item 改行文字(文字コード13番)のカテゴリーコードが5~(end-of-line)である. +\item 入力行は次の「正規表現」にマッチしている: +\[ + (\text{any char})^*(\textbf{JAchar}) + \bigl(\{\text{catcode}=1\}\cup\{\text{catcode}=2\}\bigr)^* +\] +\end{enumerate} \end{quote} +この仕様は,前節で述べた\pTeX の仕様にできるだけ近づけたものとなっている.最初の条件は, +\texttt{verbatim}系環境などの日本語対応マクロを書かなくてすませるためのものである. +しかしながら,完全に同じ挙動が実現できたわけではない. +差異は,次の例が示すように,和文文字の範囲を変更した行の改行において見られる: +\begin{LTXexample} +\ltjsetparameter{autoxspacing=false} +\ltjsetparameter{jacharrange={-6}}xあ +y\ltjsetparameter{jacharrange={+6}}zあ +u +\end{LTXexample} +もし\pTeX とまったく同じ挙動を示すならば,出力は +「\hbox{\ltjsetparameter{autoxspacing=false}x yzあu}」となるべきである.しかし,実際には +上のように異なる挙動となっている. +\begin{itemize} +\item 2行目は「あ」という和文文字で終わる(2行目を処理する前の時点では, + 「あ」は和文文字扱いである)ため,直後の改行文字は無視される. +\item 3行目は「あ」という欧文文字で終わる(2行目を処理する前の時点では, + 「あ」は欧文文字扱いである)ため,直後の改行文字は空白に置き換わる. +\end{itemize} +このため,トラブルを避けるために,和文文字の範囲を\verb+\ltjsetparameter+で編集した場合, +その行はそこで改行するようにした方がいいだろう. +% + + \section{Insertion of JFM glues, \textsf{kanjiskip} and \textsf{xkanjiskip}} -This is the longest section of the document. +%<*en> +This will be the longest section of the document. +However, ... +% + +%<*ja> +\LuaTeX-ja における和文処理グルーの挿入方法は,\pTeX のそれとは全く異なる.…… + +% + -jfmglue.tex の内容をここに入れる \end{document} diff --git a/src/jfm-min.lua b/src/jfm-min.lua index 7b89006..91a71a4 100644 --- a/src/jfm-min.lua +++ b/src/jfm-min.lua @@ -11,6 +11,9 @@ luatexja.jfont.define_jfm { zw = 1.0, zh = vscale, [0] = { + chars = {'parbdd'}, + -- this line has no effect, but it is useful to note + -- that 'parbdd' is in the character class 0. align = 'left', left = 0.0, down = 0.0, width = 1.0, height = vht, depth = vdp, italic=0.0, glue = { @@ -257,9 +260,4 @@ luatexja.jfont.define_jfm { [99] = { -- box末尾 chars = {'boxbdd'}, }, - [199] = { -- box末尾 - chars = {'parbdd'}, - kern = {[6] = 0.476196} - }, - -} \ No newline at end of file +} diff --git a/src/luatexja/jfmglue.lua b/src/luatexja/jfmglue.lua index 4da6f2a..8aec0fd 100644 --- a/src/luatexja/jfmglue.lua +++ b/src/luatexja/jfmglue.lua @@ -76,6 +76,7 @@ local ltjs_get_skip_table = ltjs.get_skip_table local ltjf_font_metric_table = ltjf.font_metric_table local ltjf_metrics = ltjf.metrics local box_stack_level +local par_indented -- is the paragraph indented? -------------------- Helper functions @@ -770,7 +771,7 @@ local function handle_list_head() if Np.id == id_jglyph or (Np.id==id_pbox and Np.met) then if not ihb_flag then local g - if mode then + if par_indented then g = new_jfm_glue(Np, find_char_class('parbdd',Np.met), Np.class) else g = new_jfm_glue(Np, find_char_class('boxbdd',Np.met), Np.class) @@ -790,6 +791,7 @@ end -- initialize local function init_var() lp = head; Bp = {}; widow_Bp = {}; widow_Np = {first = nil} + par_indented = false box_stack_level = ltjp.box_stack_level kanji_skip=skip_table_to_spec('kanjiskip') xkanji_skip=skip_table_to_spec('xkanjiskip') @@ -808,6 +810,7 @@ local function init_var() -- hbox from \parindent is skipped. while lp and ((lp.id==id_whatsit and lp.subtype~=sid_user) or ((lp.id==id_hlist) and (lp.subtype==3))) do + if (lp.id==id_hlist) and (lp.subtype==3) then par_indented = true end lp=node_next(lp) end last=node.tail(head) else diff --git a/test/jfm-test.lua b/test/jfm-test.lua index aa74647..cd7fe02 100644 --- a/test/jfm-test.lua +++ b/test/jfm-test.lua @@ -12,7 +12,7 @@ luatexja.jfont.define_jfm { chars = { 'あ' }, align = 'left', left = 0.0, down = 0.0, width = 1.0, height = 0.88, depth = 0.12, italic=0.0, - glue = { [3] = { 1.41, 0, 0} }, + glue = { [3] = { 1.41, 0, 0}, [399] = {1.25, 0.43, 0.87} }, kern = { [8] = -1.41 , [2] = 2.0, [99] = 1.21 } }, [11] = { @@ -59,6 +59,12 @@ luatexja.jfont.define_jfm { align = 'left', left = 0.0, down = 0.0, width = 1.0, height = 0.88, depth = 0.12, italic=0.0 }, + [4] = { + chars = { 'エ' }, + align = 'left', left = 0.0, down = 0.0, + width = 1.0, height = 0.88, depth = 0.12, italic=0.0, + glue = { [199] = { 0.78, 0, 0} }, + }, [99] = { chars = { 'jcharbdd' }, glue = { [11] = { 1.41, 0, 0} }, @@ -68,6 +74,14 @@ luatexja.jfont.define_jfm { chars = { 'boxbdd' }, glue = { [51] = { 1.03, 0, 0} , [1] = { 0.94, 0.23, 0.45 }}, }, + [299] = { + chars = { 'parbdd' }, + glue = { [51] = { 0.68, 0.02, 0.04} }, + }, + [399] = { + chars = { -1 }, -- math + glue = { [0] = { 0.68, 0.02, 0.04} }, + }, [8] = { chars = { 'lineend' }, } diff --git a/test/jfm-ujiso16.lua b/test/jfm-ujiso16.lua index 4994d61..a9f5082 100644 --- a/test/jfm-ujiso16.lua +++ b/test/jfm-ujiso16.lua @@ -13,8 +13,8 @@ luatexja.jfont.define_jfm { [1] = { -- 開き括弧類 chars = { - 0x2018, 0x201C, 0x3008, 0x300A, 0x300C, 0x300E, 0x3010, 0x3014, 0x3016, - 0x3018, 0x301D, 0xFF08, 0xFF3B, 0xFF5B, 0xFF5F + '‘', '“', '〈', '《', '「', '『', '【', '〔', '〖', + '〘', '〝', '(', '[', '{', '⦅' }, align = 'right', left = 0.0, down = 0.0, width = 0.5, height = 0.88, depth = 0.12, italic=0.88*0.16, @@ -25,8 +25,8 @@ luatexja.jfont.define_jfm { [2] = { -- 閉じ括弧類 chars = { - 0x2019, 0x201D, 0x3001, 0x3009, 0x300B, 0x300D, 0x300F, 0x3011, 0x3015, - 0x3017, 0x3019, 0x301F, 0xFF09, 0xFF0C, 0xFF3D, 0xFF5D, 0xFF60 + '’', '”', '、', '〉', '》', '」', '』', '】', '〕', + '〗', '〙', '〟', ')', ',', ']', '}', '⦆' }, align = 'left', left = 0.0, down = 0.0, width = 0.5, height = 0.88, depth = 0.12, italic=0.88*0.16, @@ -35,12 +35,13 @@ luatexja.jfont.define_jfm { [1] = { 0.5 , 0.0, 0.5 }, [3] = { 0.25, 0.0, 0.25 }, [5] = { 0.5 , 0.0, 0.5 }, + [6] = { 0.5 , 0.0, 0.5 }, [7] = { 0.5 , 0.0, 0.5 } } }, [3] = { -- 中点類 - chars = {0x30FB, 0xFF1A, 0xFF1B}, + chars = {'・', ':', ';'}, align = 'middle', left = 0.0, down = 0.0, width = 0.5, height = 0.88, depth = 0.12, italic=0.88*0.16, glue = { @@ -50,12 +51,13 @@ luatexja.jfont.define_jfm { [3] = { 0.5 , 0.0, 0.5 }, [4] = { 0.25, 0.0, 0.25 }, [5] = { 0.25, 0.0, 0.25 }, + [6] = { 0.25, 0.0, 0.25 }, [7] = { 0.25, 0.0, 0.25 } } }, [4] = { -- 句点類 - chars = {0x3002, 0xFF0E}, + chars = {'。', '.'}, align = 'left', left = 0.0, down = 0.0, width = 0.5, height = 0.88, depth = 0.12, italic=0.88*0.16, glue = { @@ -63,12 +65,13 @@ luatexja.jfont.define_jfm { [1] = { 0.5 , 0.0, 0.0 }, [3] = { 0.75, 0.0, 0.25 }, [5] = { 0.5 , 0.0, 0.0 }, + [6] = { 0.5 , 0.0, 0.0 }, [7] = { 0.5 , 0.0, 0.0 } } }, [5] = { -- ダッシュ - chars = { 0x2015, 0x2025, 0x2026 }, + chars = { '―', '‥', '…' }, align = 'left', left = 0.0, down = 0.0, width = 1.0, height = 0.88, depth = 0.12, italic=0.88*0.16, glue = { @@ -80,19 +83,42 @@ luatexja.jfont.define_jfm { } }, - [6] = { -- box末尾 - chars = {'boxbdd'}, + [6] = { -- 感嘆符・疑問符 + chars = { '?', '!' }, + align = 'left', left = 0.0, down = 0.0, + width = 1.0, height = 0.88, depth = 0.12, italic=0.88*0.16, + glue = { + [0] = { 0.5 , 0.0, 0.5 }, + [1] = { 0.5 , 0.0, 0.5 }, + [3] = { 0.25, 0.0, 0.25 }, + [7] = { 0.5 , 0.0, 0.5 }, + }, + kern = { + [5] = 0.0 + } }, [7] = { -- 半角カナ chars = { - 0xFF61, 0xFF62, 0xFF63, 0xFF64, 0xFF65, 0xFF66, 0xFF67, 0xFF68, 0xFF69, - 0xFF6A, 0xFF6B, 0xFF6C, 0xFF6D, 0xFF6E, 0xFF6F, 0xFF70, 0xFF71, 0xFF72, - 0xFF73, 0xFF74, 0xFF75, 0xFF76, 0xFF77, 0xFF78, 0xFF79, 0xFF7A, 0xFF7B, - 0xFF7C, 0xFF7D, 0xFF7E, 0xFF7F, 0xFF80, 0xFF81, 0xFF82, 0xFF83, 0xFF84, - 0xFF85, 0xFF86, 0xFF87, 0xFF88, 0xFF89, 0xFF8A, 0xFF8B, 0xFF8C, 0xFF8D, - 0xFF8E, 0xFF8F, 0xFF90, 0xFF91, 0xFF92, 0xFF93, 0xFF94, 0xFF95, 0xFF96, - 0xFF97, 0xFF98, 0xFF99, 0xFF9A, 0xFF9B, 0xFF9C, 0xFF9D, 0xFF9E, 0xFF9F + '。', '「', '」', '、', '・', 'ヲ', 'ァ', 'ィ', 'ゥ', + 'ェ', 'ォ', 'ャ', 'ュ', 'ョ', 'ッ', 'ー', 'ア', 'イ', + 'ウ', 'エ', 'オ', 'カ', 'キ', 'ク', 'ケ', 'コ', 'サ', + 'シ', 'ス', 'セ', 'ソ', 'タ', 'チ', 'ツ', 'テ', 'ト', + 'ナ', 'ニ', 'ヌ', 'ネ', 'ノ', 'ハ', 'ヒ', 'フ', 'ヘ', + 'ホ', 'マ', 'ミ', 'ム', 'メ', 'モ', 'ヤ', 'ユ', 'ヨ', + 'ラ', 'リ', 'ル', 'レ', 'ロ', 'ワ', 'ン', '゙', '゚', + "AJ1-516", "AJ1-517", "AJ1-518", "AJ1-519", "AJ1-520", "AJ1-521", "AJ1-522", + "AJ1-523", "AJ1-524", "AJ1-525", "AJ1-526", "AJ1-527", "AJ1-528", "AJ1-529", + "AJ1-530", "AJ1-531", "AJ1-532", "AJ1-533", "AJ1-534", "AJ1-535", "AJ1-536", + "AJ1-537", "AJ1-538", "AJ1-539", "AJ1-540", "AJ1-541", "AJ1-542", "AJ1-543", + "AJ1-544", "AJ1-545", "AJ1-546", "AJ1-547", "AJ1-548", "AJ1-549", "AJ1-550", + "AJ1-551", "AJ1-552", "AJ1-553", "AJ1-554", "AJ1-555", "AJ1-556", "AJ1-557", + "AJ1-558", "AJ1-559", "AJ1-560", "AJ1-561", "AJ1-562", "AJ1-563", "AJ1-564", + "AJ1-565", "AJ1-566", "AJ1-567", "AJ1-568", "AJ1-569", "AJ1-570", "AJ1-571", + "AJ1-572", "AJ1-573", "AJ1-574", "AJ1-575", "AJ1-576", "AJ1-577", "AJ1-578", + "AJ1-579", "AJ1-580", "AJ1-581", "AJ1-582", "AJ1-583", "AJ1-584", "AJ1-585", + "AJ1-586", "AJ1-587", "AJ1-588", "AJ1-589", "AJ1-590", "AJ1-591", "AJ1-592", + "AJ1-593", "AJ1-594", "AJ1-595", "AJ1-596", "AJ1-597", "AJ1-598", }, align = 'left', left = 0.0, down = 0.0, width = 0.5, height = 0.88, depth = 0.12, italic=0.88*0.16, @@ -101,4 +127,9 @@ luatexja.jfont.define_jfm { [3] = { 0.25, 0.0, 0.25 } } }, -} \ No newline at end of file + + [99] = { -- box末尾 + chars = {'boxbdd', 'parbdd'}, + }, + +} diff --git a/test/jfm-ujiso25.lua b/test/jfm-ujiso25.lua index 4c1e088..73bac71 100644 --- a/test/jfm-ujiso25.lua +++ b/test/jfm-ujiso25.lua @@ -13,8 +13,8 @@ luatexja.jfont.define_jfm { [1] = { -- 開き括弧類 chars = { - 0x2018, 0x201C, 0x3008, 0x300A, 0x300C, 0x300E, 0x3010, 0x3014, 0x3025, - 0x3018, 0x301D, 0xFF08, 0xFF3B, 0xFF5B, 0xFF5F + '‘', '“', '〈', '《', '「', '『', '【', '〔', '〖', + '〘', '〝', '(', '[', '{', '⦅' }, align = 'right', left = 0.0, down = 0.0, width = 0.5, height = 0.88, depth = 0.12, italic=0.88*0.25, @@ -25,8 +25,8 @@ luatexja.jfont.define_jfm { [2] = { -- 閉じ括弧類 chars = { - 0x2019, 0x201D, 0x3001, 0x3009, 0x300B, 0x300D, 0x300F, 0x3011, 0x3015, - 0x3017, 0x3019, 0x301F, 0xFF09, 0xFF0C, 0xFF3D, 0xFF5D, 0xFF60 + '’', '”', '、', '〉', '》', '」', '』', '】', '〕', + '〗', '〙', '〟', ')', ',', ']', '}', '⦆' }, align = 'left', left = 0.0, down = 0.0, width = 0.5, height = 0.88, depth = 0.12, italic=0.88*0.25, @@ -35,12 +35,13 @@ luatexja.jfont.define_jfm { [1] = { 0.5 , 0.0, 0.5 }, [3] = { 0.25, 0.0, 0.25 }, [5] = { 0.5 , 0.0, 0.5 }, + [6] = { 0.5 , 0.0, 0.5 }, [7] = { 0.5 , 0.0, 0.5 } } }, [3] = { -- 中点類 - chars = {0x30FB, 0xFF1A, 0xFF1B}, + chars = {'・', ':', ';'}, align = 'middle', left = 0.0, down = 0.0, width = 0.5, height = 0.88, depth = 0.12, italic=0.88*0.25, glue = { @@ -50,12 +51,13 @@ luatexja.jfont.define_jfm { [3] = { 0.5 , 0.0, 0.5 }, [4] = { 0.25, 0.0, 0.25 }, [5] = { 0.25, 0.0, 0.25 }, + [6] = { 0.25, 0.0, 0.25 }, [7] = { 0.25, 0.0, 0.25 } } }, [4] = { -- 句点類 - chars = {0x3002, 0xFF0E}, + chars = {'。', '.'}, align = 'left', left = 0.0, down = 0.0, width = 0.5, height = 0.88, depth = 0.12, italic=0.88*0.25, glue = { @@ -63,12 +65,13 @@ luatexja.jfont.define_jfm { [1] = { 0.5 , 0.0, 0.0 }, [3] = { 0.75, 0.0, 0.25 }, [5] = { 0.5 , 0.0, 0.0 }, + [6] = { 0.5 , 0.0, 0.0 }, [7] = { 0.5 , 0.0, 0.0 } } }, [5] = { -- ダッシュ - chars = { 0x2015, 0x2025, 0x2026 }, + chars = { '―', '‥', '…' }, align = 'left', left = 0.0, down = 0.0, width = 1.0, height = 0.88, depth = 0.12, italic=0.88*0.25, glue = { @@ -80,19 +83,42 @@ luatexja.jfont.define_jfm { } }, - [6] = { -- box末尾 - chars = {'boxbdd'}, + [6] = { -- 感嘆符・疑問符 + chars = { '?', '!' }, + align = 'left', left = 0.0, down = 0.0, + width = 1.0, height = 0.88, depth = 0.12, italic=0.88*0.25, + glue = { + [0] = { 0.5 , 0.0, 0.5 }, + [1] = { 0.5 , 0.0, 0.5 }, + [3] = { 0.25, 0.0, 0.25 }, + [7] = { 0.5 , 0.0, 0.5 }, + }, + kern = { + [5] = 0.0 + } }, [7] = { -- 半角カナ chars = { - 0xFF61, 0xFF62, 0xFF63, 0xFF64, 0xFF65, 0xFF66, 0xFF67, 0xFF68, 0xFF69, - 0xFF6A, 0xFF6B, 0xFF6C, 0xFF6D, 0xFF6E, 0xFF6F, 0xFF70, 0xFF71, 0xFF72, - 0xFF73, 0xFF74, 0xFF75, 0xFF76, 0xFF77, 0xFF78, 0xFF79, 0xFF7A, 0xFF7B, - 0xFF7C, 0xFF7D, 0xFF7E, 0xFF7F, 0xFF80, 0xFF81, 0xFF82, 0xFF83, 0xFF84, - 0xFF85, 0xFF86, 0xFF87, 0xFF88, 0xFF89, 0xFF8A, 0xFF8B, 0xFF8C, 0xFF8D, - 0xFF8E, 0xFF8F, 0xFF90, 0xFF91, 0xFF92, 0xFF93, 0xFF94, 0xFF95, 0xFF96, - 0xFF97, 0xFF98, 0xFF99, 0xFF9A, 0xFF9B, 0xFF9C, 0xFF9D, 0xFF9E, 0xFF9F + '。', '「', '」', '、', '・', 'ヲ', 'ァ', 'ィ', 'ゥ', + 'ェ', 'ォ', 'ャ', 'ュ', 'ョ', 'ッ', 'ー', 'ア', 'イ', + 'ウ', 'エ', 'オ', 'カ', 'キ', 'ク', 'ケ', 'コ', 'サ', + 'シ', 'ス', 'セ', 'ソ', 'タ', 'チ', 'ツ', 'テ', 'ト', + 'ナ', 'ニ', 'ヌ', 'ネ', 'ノ', 'ハ', 'ヒ', 'フ', 'ヘ', + 'ホ', 'マ', 'ミ', 'ム', 'メ', 'モ', 'ヤ', 'ユ', 'ヨ', + 'ラ', 'リ', 'ル', 'レ', 'ロ', 'ワ', 'ン', '゙', '゚', + "AJ1-516", "AJ1-517", "AJ1-518", "AJ1-519", "AJ1-520", "AJ1-521", "AJ1-522", + "AJ1-523", "AJ1-524", "AJ1-525", "AJ1-526", "AJ1-527", "AJ1-528", "AJ1-529", + "AJ1-530", "AJ1-531", "AJ1-532", "AJ1-533", "AJ1-534", "AJ1-535", "AJ1-536", + "AJ1-537", "AJ1-538", "AJ1-539", "AJ1-540", "AJ1-541", "AJ1-542", "AJ1-543", + "AJ1-544", "AJ1-545", "AJ1-546", "AJ1-547", "AJ1-548", "AJ1-549", "AJ1-550", + "AJ1-551", "AJ1-552", "AJ1-553", "AJ1-554", "AJ1-555", "AJ1-556", "AJ1-557", + "AJ1-558", "AJ1-559", "AJ1-560", "AJ1-561", "AJ1-562", "AJ1-563", "AJ1-564", + "AJ1-565", "AJ1-566", "AJ1-567", "AJ1-568", "AJ1-569", "AJ1-570", "AJ1-571", + "AJ1-572", "AJ1-573", "AJ1-574", "AJ1-575", "AJ1-576", "AJ1-577", "AJ1-578", + "AJ1-579", "AJ1-580", "AJ1-581", "AJ1-582", "AJ1-583", "AJ1-584", "AJ1-585", + "AJ1-586", "AJ1-587", "AJ1-588", "AJ1-589", "AJ1-590", "AJ1-591", "AJ1-592", + "AJ1-593", "AJ1-594", "AJ1-595", "AJ1-596", "AJ1-597", "AJ1-598", }, align = 'left', left = 0.0, down = 0.0, width = 0.5, height = 0.88, depth = 0.12, italic=0.88*0.25, @@ -101,4 +127,9 @@ luatexja.jfont.define_jfm { [3] = { 0.25, 0.0, 0.25 } } }, -} \ No newline at end of file + + [99] = { -- box末尾 + chars = {'boxbdd', 'parbdd'}, + }, + +} diff --git a/test/jfm-ujisx50.lua b/test/jfm-ujisx50.lua index 1dfa16d..9c20dd4 100644 --- a/test/jfm-ujisx50.lua +++ b/test/jfm-ujisx50.lua @@ -13,8 +13,8 @@ luatexja.jfont.define_jfm { [1] = { -- 開き括弧類 chars = { - 0x2018, 0x201C, 0x3008, 0x300A, 0x300C, 0x300E, 0x3010, 0x3014, 0x3025, - 0x3018, 0x301D, 0xFF08, 0xFF3B, 0xFF5B, 0xFF5F + '‘', '“', '〈', '《', '「', '『', '【', '〔', '〖', + '〘', '〝', '(', '[', '{', '⦅' }, align = 'right', left = 0.0, down = 0.0, width = 0.5*1.5, height = 0.88, depth = 0.12, italic=0.0, @@ -25,8 +25,8 @@ luatexja.jfont.define_jfm { [2] = { -- 閉じ括弧類 chars = { - 0x2019, 0x201D, 0x3001, 0x3009, 0x300B, 0x300D, 0x300F, 0x3011, 0x3015, - 0x3017, 0x3019, 0x301F, 0xFF09, 0xFF0C, 0xFF3D, 0xFF5D, 0xFF60 + '’', '”', '、', '〉', '》', '」', '』', '】', '〕', + '〗', '〙', '〟', ')', ',', ']', '}', '⦆' }, align = 'left', left = 0.0, down = 0.0, width = 0.5*1.5, height = 0.88, depth = 0.12, italic=0.0, @@ -35,12 +35,13 @@ luatexja.jfont.define_jfm { [1] = { 0.5*1.5 , 0.0, 0.5 }, [3] = { 0.25*1.5, 0.0, 0.25 }, [5] = { 0.5*1.5 , 0.0, 0.5 }, + [6] = { 0.5*1.5 , 0.0, 0.5 }, [7] = { 0.5*1.5 , 0.0, 0.5 } } }, [3] = { -- 中点類 - chars = {0x30FB, 0xFF1A, 0xFF1B}, + chars = {'・', ':', ';'}, align = 'middle', left = 0.0, down = 0.0, width = 0.5*1.5, height = 0.88, depth = 0.12, italic=0.0, glue = { @@ -50,12 +51,13 @@ luatexja.jfont.define_jfm { [3] = { 0.5*1.5 , 0.0, 0.5 }, [4] = { 0.25*1.5, 0.0, 0.25 }, [5] = { 0.25*1.5, 0.0, 0.25 }, + [6] = { 0.25*1.5, 0.0, 0.25 }, [7] = { 0.25*1.5, 0.0, 0.25 } } }, [4] = { -- 句点類 - chars = {0x3002, 0xFF0E}, + chars = {'。', '.'}, align = 'left', left = 0.0, down = 0.0, width = 0.5*1.5, height = 0.88, depth = 0.12, italic=0.0, glue = { @@ -63,12 +65,13 @@ luatexja.jfont.define_jfm { [1] = { 0.5*1.5 , 0.0, 0.0 }, [3] = { 0.75*1.5, 0.0, 0.25 }, [5] = { 0.5*1.5 , 0.0, 0.0 }, + [6] = { 0.5*1.5 , 0.0, 0.0 }, [7] = { 0.5*1.5 , 0.0, 0.0 } } }, [5] = { -- ダッシュ - chars = { 0x2015, 0x2025, 0x2026 }, + chars = { '―', '‥', '…' }, align = 'left', left = 0.0, down = 0.0, width = 1.0*1.5, height = 0.88, depth = 0.12, italic=0.0, glue = { @@ -80,19 +83,42 @@ luatexja.jfont.define_jfm { } }, - [6] = { -- box末尾 - chars = {'boxbdd'}, + [6] = { -- 感嘆符・疑問符 + chars = { '?', '!' }, + align = 'left', left = 0.0, down = 0.0, + width = 1.0, height = 0.88, depth = 0.12, italic=0.0, + glue = { + [0] = { 0.5*1.5 , 0.0, 0.5 }, + [1] = { 0.5*1.5 , 0.0, 0.5 }, + [3] = { 0.25*1.5, 0.0, 0.25 }, + [7] = { 0.5*1.5 , 0.0, 0.5 }, + }, + kern = { + [5] = 0.0 + } }, [7] = { -- 半角カナ chars = { - 0xFF61, 0xFF62, 0xFF63, 0xFF64, 0xFF65, 0xFF66, 0xFF67, 0xFF68, 0xFF69, - 0xFF6A, 0xFF6B, 0xFF6C, 0xFF6D, 0xFF6E, 0xFF6F, 0xFF70, 0xFF71, 0xFF72, - 0xFF73, 0xFF74, 0xFF75, 0xFF76, 0xFF77, 0xFF78, 0xFF79, 0xFF7A, 0xFF7B, - 0xFF7C, 0xFF7D, 0xFF7E, 0xFF7F, 0xFF80, 0xFF81, 0xFF82, 0xFF83, 0xFF84, - 0xFF85, 0xFF86, 0xFF87, 0xFF88, 0xFF89, 0xFF8A, 0xFF8B, 0xFF8C, 0xFF8D, - 0xFF8E, 0xFF8F, 0xFF90, 0xFF91, 0xFF92, 0xFF93, 0xFF94, 0xFF95, 0xFF96, - 0xFF97, 0xFF98, 0xFF99, 0xFF9A, 0xFF9B, 0xFF9C, 0xFF9D, 0xFF9E, 0xFF9F + '。', '「', '」', '、', '・', 'ヲ', 'ァ', 'ィ', 'ゥ', + 'ェ', 'ォ', 'ャ', 'ュ', 'ョ', 'ッ', 'ー', 'ア', 'イ', + 'ウ', 'エ', 'オ', 'カ', 'キ', 'ク', 'ケ', 'コ', 'サ', + 'シ', 'ス', 'セ', 'ソ', 'タ', 'チ', 'ツ', 'テ', 'ト', + 'ナ', 'ニ', 'ヌ', 'ネ', 'ノ', 'ハ', 'ヒ', 'フ', 'ヘ', + 'ホ', 'マ', 'ミ', 'ム', 'メ', 'モ', 'ヤ', 'ユ', 'ヨ', + 'ラ', 'リ', 'ル', 'レ', 'ロ', 'ワ', 'ン', '゙', '゚', + "AJ1-516", "AJ1-517", "AJ1-518", "AJ1-519", "AJ1-520", "AJ1-521", "AJ1-522", + "AJ1-523", "AJ1-524", "AJ1-525", "AJ1-526", "AJ1-527", "AJ1-528", "AJ1-529", + "AJ1-530", "AJ1-531", "AJ1-532", "AJ1-533", "AJ1-534", "AJ1-535", "AJ1-536", + "AJ1-537", "AJ1-538", "AJ1-539", "AJ1-540", "AJ1-541", "AJ1-542", "AJ1-543", + "AJ1-544", "AJ1-545", "AJ1-546", "AJ1-547", "AJ1-548", "AJ1-549", "AJ1-550", + "AJ1-551", "AJ1-552", "AJ1-553", "AJ1-554", "AJ1-555", "AJ1-556", "AJ1-557", + "AJ1-558", "AJ1-559", "AJ1-560", "AJ1-561", "AJ1-562", "AJ1-563", "AJ1-564", + "AJ1-565", "AJ1-566", "AJ1-567", "AJ1-568", "AJ1-569", "AJ1-570", "AJ1-571", + "AJ1-572", "AJ1-573", "AJ1-574", "AJ1-575", "AJ1-576", "AJ1-577", "AJ1-578", + "AJ1-579", "AJ1-580", "AJ1-581", "AJ1-582", "AJ1-583", "AJ1-584", "AJ1-585", + "AJ1-586", "AJ1-587", "AJ1-588", "AJ1-589", "AJ1-590", "AJ1-591", "AJ1-592", + "AJ1-593", "AJ1-594", "AJ1-595", "AJ1-596", "AJ1-597", "AJ1-598", }, align = 'left', left = 0.0, down = 0.0, width = 0.5*1.5, height = 0.88, depth = 0.12, italic=0.0, @@ -101,4 +127,9 @@ luatexja.jfont.define_jfm { [3] = { 0.25*1.5, 0.0, 0.25 } } }, + + [99] = { -- box末尾 + chars = {'boxbdd', 'parbdd'}, + }, + } \ No newline at end of file diff --git a/test/test02-latex.pdf b/test/test02-latex.pdf index 0536481..99b93a2 100644 Binary files a/test/test02-latex.pdf and b/test/test02-latex.pdf differ diff --git a/test/test04-jfm.pdf b/test/test04-jfm.pdf index 5a957ef..15c8eab 100644 Binary files a/test/test04-jfm.pdf and b/test/test04-jfm.pdf differ diff --git a/test/test04-jfm.tex b/test/test04-jfm.tex index e9b190b..16b68f6 100644 --- a/test/test04-jfm.tex +++ b/test/test04-jfm.tex @@ -303,6 +303,10 @@ かエ\par\global\setbox0=\lastbox} \dumplist0 +\setbox1=\vbox{\noindent\rmlh\hsize=100pt\parfillskip=30pt +かエ\par\global\setbox0=\lastbox} +\dumplist0 + \setbox0=\hbox{\rmlh かエ} \dumplist0