OSDN Git Service

ltjsclasses: bug fix
[luatex-ja/luatexja.git] / test / test01.tex
index 9e7176f..83fc40b 100644 (file)
@@ -1,43 +1,45 @@
-%#! luatex
+%#! time luatex test01
 \input luatexja-core.sty
 
-\loadjfontmetric{mt}{ujis}
-\font\tenmin={file:ipaexm.ttf}\jfont\tenmin{mt}\tenmin
-\font\tengoth={file:ipaexg.ttf}\jfont\tengoth{mt}
-\font\jisninety={file:ipaexm.ttf:script=latn;+jp90}\jfont\jisninety{mt}
-\font\jisexpt={file:ipaexm.ttf:script=latn;+expt}\jfont\jisexpt{mt}
-\font\jishwid={file:ipaexm.ttf:script=latn;+hwid}\jfont\jishwid{mt}
-%\font\tmihwid={file:ipaexm.ttf:script=latn;+hwid}
-\font\jisnalt={file:ipaexm.ttf:script=latn;+nalt}\jfont\jisnalt{mt}
-\font\jistrad={file:ipaexm.ttf:script=latn;+trad}\jfont\jistrad{mt}
-\font\jissups={file:ipaexm.ttf:script=latn;+sups}\jfont\jissups{mt}
-\font\jisliga={file:ipaexm.ttf:script=latn;+liga}\jfont\jisliga{mt}
-%\font\tmiliga={file:ipaexm.ttf:script=latn;+liga}
-\font\jisvert={file:ipaexm.ttf:script=latn;+vert}\jfont\jisvert{mt}
+\jfont\jisninety={file:KozMinPr6N-Regular.otf:script=latn;+jp90;jfm=ujis}
+\jfont\jisfour={file:KozMinPr6N-Regular.otf:script=latn;+jp04;jfm=ujis}
+\jfont\jisexpt={file:KozMinPr6N-Regular.otf:script=latn;+expt;jfm=ujis}
+\jfont\jishwid={file:KozMinPr6N-Regular.otf:script=latn;+hwid;jfm=ujis}
+\jfont\jispalt={file:KozMinPr6N-Regular.otf:script=latn;+palt;jfm=ujis}
+%\font\tmihwid={file:KozMinPr6N-Regular.otf:script=latn;+hwid}
+\jfont\jisnalt={file:KozMinPr6N-Regular.otf:script=latn;+nalt;jfm=ujis}
+\jfont\jistrad={file:KozMinPr6N-Regular.otf:script=latn;+trad;jfm=ujis}
+\jfont\jissups={file:KozMinPr6N-Regular.otf:script=latn;+sups;jfm=ujis}
+\jfont\jisliga={file:KozMinPr6N-Regular.otf:script=latn;+liga;jfm=ujis}
+%\font\tmiliga={file:KozMinPr6N-Regular.otf:script=latn;+liga}
+\jfont\jisvert={file:KozMinPr6N-Regular.otf:script=latn;+vert;jfm=ujis}
 \parskip=\smallskipamount\parindent=1\zw
 
-{\noindent\bf\tengoth luatj-ujis.lua を使用}
+{\noindent\bf\tengt jfm-ujis.luaを使用}
 
 \bigskip
 
-{\noindent\bf\tengoth luaotf\/load による feature との共存状況}
+{\noindent\bf\tengt ■luaotf\/loadによるfeatureとの共存状況}
 
 {\tentt expt} feature: 剥→{\jisexpt 剥}
 
 {\tentt jp90} feature: 辻→{\jisninety 辻}
 
-{\tentt hwid} feature: アイウエ→{\jishwid アイウエ}\hfil\break
-↑文字クラスが変わらないので幅も変わらない.
+{\tentt jp04} feature: 辻→{\jisfour 辻}
+
+{\tentt hwid} feature: アイウエ→{\jishwid アイウエ}
+
+{\tentt palt} feature: トップクォーク→{\jispalt トップクォーク}\hfil\break
 
 {\tentt nalt} feature: 男→{\jisnalt 男}
 
 {\tentt trad} feature: 医学→{\jistrad 医学}
 
 {\tentt sups} feature: 注1注1→{\jissups 注1注1}\hfil\break
-↑文字クラスが変わらないので幅も変わらない.
+↑まだ上付き文字用の文字クラスを作ってない.
 
-{\tentt liga} feature: ã\81\8bã\82\9cã\81\8dã\82\9cã\81\8fã\82\9cã\81\91ã\82\9cã\81\93ã\82\9câ\86\92{\jisliga ã\81\8bã\82\9cã\81\8dã\82\9cã\81\8fã\82\9cã\81\91ã\82\9cã\81\93ã\82\9c}\hfil\break
-↑なぜかうまくいかない.%比較:{\tmiliga か゜き゜く゜け゜こ゜}
+{\tentt liga} feature: ã\81\8bã\82\9aã\81\8dã\82\9aã\81\8fã\82\9aã\81\91ã\82\9aã\81\93ã\82\9aâ\86\92{\jisliga ã\81\8bã\82\9aã\81\8dã\82\9aã\81\8fã\82\9aã\81\91ã\82\9aã\81\93ã\82\9a}\hfil\break
+↑合字用の半濁点({\tentt U+309A})を用いれば成功する.単体用({\tentt U+309C})では失敗する.%比較:{\tmiliga か゜き゜く゜け゜こ゜}
 
 {\tentt vert} feature: あ(㌢㍍),い→{\jisvert あ(㌢㍍),い}\hfil\break
 ↑縦組み時に気にすればいいか.
 
 {\tt'boxbdd'}のテスト2: \vrule\hbox{「」}\vrule ←正しい実装ならば2本の罫線の間は全角幅
 
-\end
 
+\bigskip
+{\noindent\bf\tengt ■{\tt differentjfm}による挙動の違い}
+
+\jfont\tenMa={file:KozMinPr6N-Regular.otf:jfm=ujis}
+\jfont\tenMb={file:KozMinPr6N-Regular.otf:jfm=jis;jfmvar=a}
+\jfont\tenGa={file:ipaexg.ttf:jfm=ujis} at 15pt
+\jfont\tenGb={file:ipaexg.ttf:jfm=jis;jfmvar=a} at 15pt\relax
+\def\djtest{%
+{\tt Ma-Ma}: \setbox0=\hbox{{\tenMa )}{\tenMa  ・}}\hbox to 90pt{\copy0\hss(\the\wd0)},
+{\tt Ma-Mb}: \setbox0=\hbox{{\tenMa )}{\tenMb ・}}\hbox to 90pt{\copy0\hss(\the\wd0)},
+{\tt Mb-Mb}: \setbox0=\hbox{{\tenMb )}{\tenMb ・}}\hbox to 90pt{\copy0\hss(\the\wd0)},
+
+{\tt Ma-Ga}: \setbox0=\hbox{{\tenMa )}{\tenGa ・}}\hbox to 90pt{\copy0\hss(\the\wd0)},
+{\tt Ma-Gb}: \setbox0=\hbox{{\tenMa )}{\tenGb ・}}\hbox to 90pt{\copy0\hss(\the\wd0)},
+{\tt Mb-Gb}: \setbox0=\hbox{{\tenMb )}{\tenGb ・}}\hbox to 90pt{\copy0\hss(\the\wd0)}%
+}
+
+{\noindent\bf\tengt {\tt differentjfm=small}(小さい方)}
+
+\ltjsetparameter{differentjfm=small}\djtest
+
+{\noindent\bf\tengt {\tt differentjfm=large}(大きい方)}
+
+\ltjsetparameter{differentjfm=LARGE}\djtest
+
+{\noindent\bf\tengt {\tt differentjfm=average}(平均)}
+
+\ltjsetparameter{differentjfm=AVERAGE}\djtest
+
+{\noindent\bf\tengt {\tt differentjfm=both}(合計)}
+
+\ltjsetparameter{differentjfm=Both}\djtest
+
+{\noindent\bf\tengt {\tt differentjfm=pleft}(左側の指定で比例配分)}
+
+\ltjsetparameter{differentjfm=pleft}\djtest
+
+{\noindent\bf\tengt {\tt differentjfm=pright}(右側の指定で比例配分)}
+
+\ltjsetparameter{differentjfm=pright}\djtest
+
+{\noindent\bf\tengt {\tt differentjfm=paverage}(default, 左・右それぞれの指定で比例配分した値の平均)}
+
+\ltjsetparameter{differentjfm=paverage}\djtest
+
+\bigskip
+{\noindent\bf\tengt ■ujis, jis, min}
+
+\def\test#1{\jfont\mx={file:KozMinPr6N-Regular.otf:jfm=#1}
+\par\noindent\hbox to 30pt{#1}%
+\hbox to 250pt{\mx ちょっとチェックしちゃった!が,まあいいです。\hss}%
+\hbox{\mx「大」、「小」,‘国’“国”――……}}
+
+\test{ujis}
+\test{jis}
+\test{min}
+
+\bigskip
+{\noindent\bf\tengt ■pdftotext}
+\jfont\jisnorm={file:KozMinPr6N-Regular.otf:script=latn;color=0000007f;jfm=ujis}
+\jfont\jishkna={file:KozMinPr6N-Regular.otf:script=latn;+hkna;color=ff00007f;jfm=ujis}
+\jfont\jisvkna={file:KozMinPr6N-Regular.otf:script=latn;+vkna;color=0000ff7f;jfm=ujis}
+
+\setbox0=\hbox{\jisnorm あいうえお}
+\setbox2=\hbox{\jishkna あいうえお}
+\setbox4=\hbox{\jisvkna あいうえお}
+
+\leavevmode \copy0 \rlap{\copy0}\copy2 \copy2
+
+\leavevmode \rlap{\copy0}\copy4 \rlap{\copy2}\copy4
+
+\leavevmode \copy4
+
+\end