jlreq
jlreq copied to clipboard
jlreq + \DeclareFontShape
以下のように,jlreq 下で新たに \DeclareFontShape を使ってフォント定義を行うと,\selectfont した地点で ! LaTeX Error: Font JY3/hoge/m/n/10 not found. というエラーが発生します:
%#!lualatex
\documentclass{jlreq}
\DeclareKanjiFamily{JY3}{hoge}{}
\DeclareFontShape{JY3}{hoge}{m}{n}{<-> s*file:HaranoAjiMincho-Heavy.otf:jfm=ujis}{}
\makeatletter
%\jlreq@useoriginalcs{DeclareFontShape}{JY3}{hoge}{m}{n}{<-> s*file:HaranoAjiMincho-Heavy.otf:jfm=ujis}{}
% ==> OK
\makeatother
\kanjifamily{hoge}\selectfont % ==> ! LaTeX Error: Font JY3/hoge/m/n/10 not found.
\begin{document}
\end{document}
% LaTeX2e <2021-11-15>
% luatexja 2021-10-24
% jlreq 2021/11/05
オリジナルの\DeclareFontShapeでは
\def\DeclareFontShape{\begingroup
\nfss@catcodes
\expandafter\endgroup
\DeclareFontShape@}
と catcode の変更後に引数を読んでいることを考えると,jlreq による \DeclareFontShape の再定義のところには \scantokens あたりが必要な気がしています.
とりあえず\DeclareFontShape@の再定義に切り替えてみました( 1284baa ).本体の変更をおっかけないとならないのは変わらなそうなのでもっとさぼれないか考えてみます.