%! Main part of luatexja-otf
\RequireLuaModule{luatexja.otf}
-\protected\def\CID#1{\directlua{luatexja.otf.cid(#1)}}
+\protected\def\CID#1{\char\directlua{luatexja.otf.cid(#1)}\relax}
%% \UTF being compatible with the OTF package for pLaTeX
-\protected\def\UTF#1{\char"#1}
+\protected\def\UTF#1{\char"#1\relax}
%%------------------ all done
\ltj@otf@AtEnd
module('luatexja.otf', package.seeall)
require('luatexja.base'); local ltjb = luatexja.base
-require('luatexja.jfont'); local ltjf = luatexja.jfont
local attr_curjfnt = luatexbase.attributes['ltj@curjfnt']
'Use a font including the specified CID character.')
return
end
- tex.print("\\char"..tostring(char).."\\relax")
+ tex.print(char)
end
-------------------- all done
\documentclass{bxjsarticle}
\usepackage{luatexja}
\usepackage{luatexja-otf}
+\usepackage{luatexja-fontspec}
\begin{document}
※このファイルはフォントを埋め込んでいないため,代替されるフォントによっては正しく
\item \UTF{9B87}とは岩魚(イワナ)のことであり,嘉魚とも書く。
\end{itemize}
+\section*{要検討}
+現在の実装だと,対応する Unicode の符号位置を取得して単純に \verb|\char| に
+渡しているだけなので,以下の問題がある.
+\begin{itemize}
+\item 欧文文字範囲に設定されている文字は CID で出力しても欧文フォントになる.
+ 例: あ\CID{18}1あ
+\item OpenType の feature が指定されているとそちらが優先される.
+ 例: {\jfontspec[NoEmbed,CJKShape=JIS1978]{Ryumin-Light}\CID{3056}\CID{8267}}
+ (左は一点,右は二点になってほしい.)
+\end{itemize}
+
\end{document}