texlive[72090] Master/texmf-dist: pxchfon (23aug24)

commits+karl at tug.org commits+karl at tug.org
Fri Aug 23 22:58:29 CEST 2024


Revision: 72090
          https://tug.org/svn/texlive?view=revision&revision=72090
Author:   karl
Date:     2024-08-23 22:58:28 +0200 (Fri, 23 Aug 2024)
Log Message:
-----------
pxchfon (23aug24)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/platex/pxchfon/LICENSE
    trunk/Master/texmf-dist/doc/platex/pxchfon/README-ja.md
    trunk/Master/texmf-dist/doc/platex/pxchfon/README.md
    trunk/Master/texmf-dist/doc/platex/pxchfon/pxchfon.pdf
    trunk/Master/texmf-dist/doc/platex/pxchfon/pxchfon.tex
    trunk/Master/texmf-dist/doc/platex/pxchfon/sample-2000jis.pdf
    trunk/Master/texmf-dist/doc/platex/pxchfon/sample-2000jis.tex
    trunk/Master/texmf-dist/doc/platex/pxchfon/sample-2004jis.pdf
    trunk/Master/texmf-dist/doc/platex/pxchfon/sample-2004jis.tex
    trunk/Master/texmf-dist/doc/platex/pxchfon/sample-pxchfon.pdf
    trunk/Master/texmf-dist/doc/platex/pxchfon/sample-pxchfon.tex
    trunk/Master/texmf-dist/tex/platex/pxchfon/pxchfon.sty
    trunk/Master/texmf-dist/tex/platex/pxchfon/pxchfon0.def

Modified: trunk/Master/texmf-dist/doc/platex/pxchfon/LICENSE
===================================================================
--- trunk/Master/texmf-dist/doc/platex/pxchfon/LICENSE	2024-08-23 20:58:08 UTC (rev 72089)
+++ trunk/Master/texmf-dist/doc/platex/pxchfon/LICENSE	2024-08-23 20:58:28 UTC (rev 72090)
@@ -1,6 +1,6 @@
 The MIT License
 
-Copyright (c) 2009-2023 Takayuki YATO (aka. "ZR")
+Copyright (c) 2009-2024 Takayuki YATO (aka. "ZR")
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal

Modified: trunk/Master/texmf-dist/doc/platex/pxchfon/README-ja.md
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/platex/pxchfon/README.md
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/platex/pxchfon/pxchfon.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/platex/pxchfon/pxchfon.tex
===================================================================
--- trunk/Master/texmf-dist/doc/platex/pxchfon/pxchfon.tex	2024-08-23 20:58:08 UTC (rev 72089)
+++ trunk/Master/texmf-dist/doc/platex/pxchfon/pxchfon.tex	2024-08-23 20:58:28 UTC (rev 72090)
@@ -14,15 +14,17 @@
   pdfauthor={八登崇之}}
 \usepackage{bxtexlogo}
 \bxtexlogoimport{*,logo-e}
-\usepackage{shortvrb}
+\usepackage{shortvrb,alltt}
 \MakeShortVerb{\|}
-\newcommand{\PkgVersion}{2.0}
-\newcommand{\PkgDate}{2023/08/28}
+\newcommand{\PkgVersion}{2.2}
+\newcommand{\PkgDate}{2024/08/22}
 \newcommand{\Pkg}[1]{\textsf{#1}}
 \newcommand{\Meta}[1]{$\langle$\mbox{}#1\mbox{}$\rangle$}
+\newcommand{\RMeta}[1]{{\rmfamily\Meta{#1}}}
 \newcommand{\Note}{\par\noindent ※}
 \newcommand{\Means}{:\ }
 \newcommand{\Zk}{\mbox{}}
+\newcommand{\cs}[1]{\symbol{`\\}#1}
 \providecommand{\Strong}[1]{\textsf{#1}}
 %-----------------------------------------------------------
 \begin{document}
@@ -88,9 +90,10 @@
 
 \begin{itemize}
 \item \Strong{ドライバオプション}\Means
-  |dvipdfmx|、|dvips|、|dviout|、|xdvi| および |nodvidriver|%
-  (ドライバ依存動作の無効化を明示的に指示)
+  |dvipdfmx|、|dvips|、|dviout|、|xdvi| %
   が指定できる。
+  \footnote{「上級者向け」の一覧にある |nodvidriver|
+    と |resetdvidriver| もドライバオプションの一種である。}%
   ただし、本パッケージの主要機能である
   「フォントマップの文書内での指定」
   がサポートされるのは\Strong{dvipdfmxのみ}である。
@@ -144,7 +147,8 @@
   今でもこの動作は維持されているが、
   2.0版以降はこの既定設定を利用することは\Strong{非推奨}%
   \footnote{プリセット指定オプションの有無により既定が変わる仕様は
-    好ましくないため。}%
+    好ましくないため。
+    2.1版以降では警告が出る。}%
   となり、プリセット不使用の場合は
   3つのオプションの何れかを指定することが推奨される。
 \item |otf|(既定)\Means
@@ -194,6 +198,12 @@
 
 \paragraph{上級者向けオプション}
 \begin{itemize}
+\item |nodvidriver|\Means
+  特殊なドライバオプションで、
+  ドライバ依存動作の無効化を明示的に指示する。
+\item |resetdvidriver|\Means
+  |nodvidriver| の否定。
+  \Note ドライバ指定は既定値である |dvipdfmx| に戻る。
 \item |relfont|\Means
   指定された和文フォントの英数字部分を({\pLaTeX}の標準機能である)
   \Strong{従属欧文フォント}として設定する。
@@ -281,7 +291,7 @@
   Unicode直接指定が有効である場合に、
   全角幅のグリフを優先させる。
   \Note 全角幅想定の文字が使える可能性が増えるという利点がある一方で、
-  半角幅想定の文字が使える可能性が減るという欠点もある。
+  半角幅想定の文字が使えなくなるという欠点もある。
 \item |nofullwidth|(既定)\Means
   |fullwidth| の否定。
 \item |legacycode=|\Meta{値}\Means
@@ -325,12 +335,12 @@
 \item |maybe-multiweight|\Means
   「|deluxe| オプション付きの\Pkg{japanese-otf}パッケージが読み込まれて
   いないにもかかわらず多ウェイト用のフォント設定命令が使われた」
-  際に出る警告を抑止する。%
-  \footnote{例えば
-    「単ウェイト・多ウェイト兼用を意図したフォント設定命令を
-    テンプレートに記述している」
-    「\Pkg{japanese-otf}以外でその和文TFMを流用している」
-    などの状況を想定している。}
+  場合に出る警告を抑止する。
+\item |nocheck-expert|\Means
+  「Unicode 直接指定と |expert| オプションが有効で、
+  かつ置換されていないウェイトが存在する」
+  場合に出る警告を抑止する。
+  \Note 警告抑止オプションについては\ref{sec:Suppress-Warnings}を参照。
 \end{itemize}
 
 %===========================================================
@@ -442,6 +452,17 @@
 
 \paragraph{上級者向け機能}
 \begin{itemize}
+\item |\pxchfonsetup{|\Meta{設定}|,…}|\Means
+  設定を変更する。
+  設定可能なパラメタは以下の通り。
+  \Note 真偽値をとるパラメタでは、値を省略した場合は |true|
+  と等価となる。
+  \Note 残念ながら、実装の都合のためパッケージ読込後に変更可能な
+  設定項目はかなり少ない。
+  \begin{itemize}
+  \item |jis2004|[|=|\Meta{真偽値}]\Means
+    オプションの (|no|)|jis2004| と同じ。
+  \end{itemize}
 \item |\usecmapforalphabet|\Means
   |usecmapforalphabet| オプションの設定に切り替える。
   (\ref{sec:Loading}節を参照。)
@@ -466,6 +487,21 @@
 \item |\usefontmapline{|\Meta{マップ行}|}|\Means
   dvipdfmxのマップ行を直接指定して、その読込を指示する。
   \Note pdf{\TeX}の |\pdfmapline| に相当する機能。
+\item |usefontmaplines| 環境\Means
+  複数のマップ行を一度に記述できる環境。
+  \footnote{|usefontmaplines| 環境の中では、
+    {\LaTeX}の特殊文字のうち |\| と空白だけが通常のの規則に従う。
+    改行は各マップ行の区切りの意味をもつ。
+    \texttt{\%} は行末までをコメントにするが、改行は維持される。
+    他の文字(|{| |}| も含む)はその文字自体と解釈される。
+    他の注意として、|\end{usefontmaplines}| は行頭に書く必要がある。}
+\begin{quote}\small\begin{alltt}
+\cs{begin}\{usefontmaplines\}
+\RMeta{マップ行}
+\RMeta{マップ行}
+……
+\cs{end}\{usefontmaplines\}
+\end{alltt}\end{quote}
 \item |\diruni|\Means
   現在の和文フォントを“Unicode直接入力”
   (フォントマップをUnicode直接指定にした上で
@@ -1636,5 +1672,67 @@
 \end{itemize}
 
 %===========================================================
+\section{警告抑止用のオプション・開発者用フラグ}
+\label{sec:Suppress-Warnings}
+
+本パッケージのオプション設定は極めて複雑なため、使用法によっては
+「動作が極めて解りにくい状態」
+や
+「ユーザ命令の範囲ではサポートされない状態」
+といった“奇妙な”状態に移行していまうことがある。
+一方で
+「そういう“奇妙な”設定を解った上で敢えて利用している」
+「本パッケージ以外の手段で生成したフォントマップ行を併用している」
+などの理由で、“奇妙な”設定が正当である可能性もある。
+このため、現状の方針としては
+「“奇妙な”状態になった場合は(エラーでなく
+\footnote{将来的に、警告抑止の手段が十分に周知された段階で、
+  エラーに移行することも考えられる。})
+\Strong{警告を出す}」
+ことにしている。
+
+しかし、正当に利用している人にとってはこの警告は煩わしいはずなので、
+特定の警告を抑止するための手段を用意する。
+警告抑止の方法は「オプション」と「開発者用フラグ」
+の2種類がある。
+
+\paragraph{開発者用フラグ}
+開発者用フラグ
+\footnote{開発者用の機能であるため、ここでは{\TeX}言語の知識を仮定する。}
+とは、例えば |\pxchfonNoCheckMultiweight| のように、
+本パッケージが指定する特定の制御綴のことである。
+制御綴が\Strong{定義済である}場合にフラグが有効であると判断する。
+従って、本パッケージの機能と連携するパッケージの開発者は、
+\begin{quote}\small\begin{verbatim}
+\let\pxchfonNoCheckMultiweight=t
+\end{verbatim}\end{quote}
+のようなコードを実行することで、不要な警告を抑止できる。
+\Note 定義済であれば意味は何でもよいが、上記コードのように
+「文字トークンの|t|」を使うことを推奨する。
+
+\paragraph{オプション・開発者用フラグの一覧}
+以下のものが用意されている。
+
+\begin{itemize}
+\item |maybe-multiweight| オプション/%
+  |\pxchfonNoCheckMultiweight| フラグ\Means
+  「|deluxe| オプション付きの\Pkg{japanese-otf}パッケージが読み込まれて
+  いないにもかかわらず多ウェイト用のフォント設定命令が使われた」
+  場合に出る警告を抑止する。
+  \Note 例えば
+  「単ウェイト・多ウェイト兼用を意図したフォント設定命令を
+  テンプレートに記述している」
+  「\Pkg{japanese-otf}以外でその和文TFMを流用している」
+  などの状況を想定している。
+  \Note 有効化した場合、たとえ\Pkg{japanese-otf}が読み込まれていなくても
+  \Pkg{japanese-otf}用のフォントマップ行を書き込む。
+\item |nocheck-expert| オプション/%
+  |\pxchfonNoCheckExpert| フラグ\Means
+  「Unicode 直接指定と |expert| オプションが有効で、
+  かつ置換されていないウェイトが存在する」
+  場合に出る警告を抑止する。
+\end{itemize}
+
+%===========================================================
 \end{document}
 %% EOF

Modified: trunk/Master/texmf-dist/doc/platex/pxchfon/sample-2000jis.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/platex/pxchfon/sample-2000jis.tex
===================================================================
--- trunk/Master/texmf-dist/doc/platex/pxchfon/sample-2000jis.tex	2024-08-23 20:58:08 UTC (rev 72089)
+++ trunk/Master/texmf-dist/doc/platex/pxchfon/sample-2000jis.tex	2024-08-23 20:58:28 UTC (rev 72090)
@@ -1,7 +1,8 @@
-% 文字コードはUTF-8 (platex -kanji=utf8)
-\documentclass[a6paper,papersize]{jsarticle}
-\usepackage[noembed,noprefer2004jis]{pxchfon} % no-embed
-%\usepackage[hiragino-pron,noprefer2004jis]{pxchfon} % embed Hiragino ProN
+% pLaTeX document; UTF-8 (platex -kanji=utf8)
+% This file is in public domain.
+\documentclass[a6paper,dvipdfmx,papersize,nojis2004]{jsarticle}
+\usepackage[ipaex]{pxchfon} % embed IPAex fonts
+%\usepackage[hiragino-pron]{pxchfon} % embed Hiragino ProN
 \begin{document}
 葛餅で蓬餅で、かつ煎餅!
 \end{document}

Modified: trunk/Master/texmf-dist/doc/platex/pxchfon/sample-2004jis.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/platex/pxchfon/sample-2004jis.tex
===================================================================
--- trunk/Master/texmf-dist/doc/platex/pxchfon/sample-2004jis.tex	2024-08-23 20:58:08 UTC (rev 72089)
+++ trunk/Master/texmf-dist/doc/platex/pxchfon/sample-2004jis.tex	2024-08-23 20:58:28 UTC (rev 72090)
@@ -1,7 +1,8 @@
-% 文字コードはUTF-8 (platex -kanji=utf8)
-\documentclass[a6paper,papersize]{jsarticle}
-\usepackage[noembed,prefer2004jis]{pxchfon} % no-embed
-%\usepackage[hiragino-pron,prefer2004jis]{pxchfon} % embed Hiragino ProN
+% pLaTeX document; UTF-8 (platex -kanji=utf8)
+% This file is in public domain.
+\documentclass[a6paper,dvipdfmx,papersize,jis2004]{jsarticle}
+\usepackage[ipaex]{pxchfon} % embed IPAex fonts
+%\usepackage[hiragino-pron]{pxchfon} % embed Hiragino ProN
 \begin{document}
 葛餅で蓬餅で、かつ煎餅!
 \end{document}

Modified: trunk/Master/texmf-dist/doc/platex/pxchfon/sample-pxchfon.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/platex/pxchfon/sample-pxchfon.tex
===================================================================
--- trunk/Master/texmf-dist/doc/platex/pxchfon/sample-pxchfon.tex	2024-08-23 20:58:08 UTC (rev 72089)
+++ trunk/Master/texmf-dist/doc/platex/pxchfon/sample-pxchfon.tex	2024-08-23 20:58:28 UTC (rev 72090)
@@ -1,6 +1,7 @@
-% 文字コードはUTF-8 (platex -kanji=utf8)
+% pLaTeX文書; UTF-8 (platex -kanji=utf8)
+% This file is in public domain.
 \documentclass[a4paper]{jsarticle}
-\usepackage{pxchfon}
+\usepackage[alphabet]{pxchfon}% 欧文にも適用
 \setminchofont[0]{hgrgy.ttc}  % HG行書体
 \setgothicfont[0]{hgrpp1.ttc} % HG創英角ポップ体
 \usepackage{otf}
@@ -12,7 +13,7 @@
 \begin{document}
 \title{pxchfon パッケージ}
 \author{ZR}
-\date{2009 年 3 月 29 日}
+\date{2024 年 8 月 8 日}
 \maketitle
 
 \section{はじめに}
@@ -36,20 +37,18 @@
 \item 一度インストールすると、それだけで任意の日本語フォントに
   適用できる。
   \begin{enumerate}
-  \item しかも和文のみを置き換える場合なら、インストールも簡単。
   \item 置き換えるフォントは、{\LaTeX} 文書内でファイル名で
     指定する。
+  \item とても簡単。
   \end{enumerate}
 \item ただし、等幅のフォントしか利用できない。
   \begin{enumerate}
   \item 欧文も等幅(半角)になってしまう。
-  \item しかもアクセント付文字・非英語文字(
-    {\fontfamily{cmr}\selectfont \'e, \ss} 等)が使えない。
-  \item 残念。
+  \item とても残念。
   \end{enumerate}
 \item dvipdfmx 専用。
   \begin{enumerate}
-  \item 非常に残念。
+  \item チョット残念。
   \end{enumerate}
 \end{enumerate}
 

Modified: trunk/Master/texmf-dist/tex/platex/pxchfon/pxchfon.sty
===================================================================
--- trunk/Master/texmf-dist/tex/platex/pxchfon/pxchfon.sty	2024-08-23 20:58:08 UTC (rev 72089)
+++ trunk/Master/texmf-dist/tex/platex/pxchfon/pxchfon.sty	2024-08-23 20:58:28 UTC (rev 72090)
@@ -1,7 +1,7 @@
 %%
 %% This is file 'pxchfon.sty'.
 %%
-%% Copyright (c) 2009-2023 Takayuki YATO (aka. "ZR")
+%% Copyright (c) 2009-2024 Takayuki YATO (aka. "ZR")
 %%   GitHub:   https://github.com/zr-tex8r
 %%   Twitter:  @zr_tex8r
 %%
@@ -10,7 +10,7 @@
 
 %% package declaration
 \NeedsTeXFormat{pLaTeX2e}
-\ProvidesPackage{pxchfon}[2023/08/28 v2.0]
+\ProvidesPackage{pxchfon}[2024/08/22 v2.2]
 \def\pxcz at pkgname{pxchfon}
 
 %--------------------------------------- general
@@ -28,7 +28,11 @@
 %% unique tokens
 \def\pxcz at end{\pxcz at end@}
 \def\pxcz at mt{\pxcz at mt@}
+\toksdef\pxcz at mk=9 % unexpandable
 
+%% \pxcz at letcs\CSa{<cs2>}
+\def\pxcz at letcs#1#2{%
+  \expandafter\let\expandafter#1\csname#2\endcsname}
 %% \pxcz at csletcs{<cs1>}{<cs2>}
 \def\pxcz at csletcs#1#2{%
   \expandafter\let\csname#1\expandafter\endcsname\csname#2\endcsname}
@@ -47,6 +51,19 @@
 \def\pxcz at onlypreamble@let#1{%
   \@onlypreamble#1\let#1}
 
+%% \pxcz at first@doc at hook
+% Invoked earlier than \pxcz at doc@hook.
+\pxcz at onlypreamble@let\pxcz at first@doc at hook\@empty
+\AtBeginDocument{\pxcz at first@doc at hook}
+
+%% \pxcz at new@gbool{<name>}
+\pxcz at onlypreamble@def\pxcz at new@gbool#1{%
+  \expandafter\pxcz at new@gbool at a\csname if#1\endcsname{#1}}
+\pxcz at onlypreamble@def\pxcz at new@gbool at a#1#2{%
+  \@namedef{#2true}{\global\let#1\iftrue}%
+  \@namedef{#2false}{\global\let#1\iffalse}%
+  \@nameuse{#2false}}\@gobbletwo\fi\fi
+
 %% \pxcz at csuse@or{<csname>}{<default>}
 \def\pxcz at csuse@or#1#2{%
   \expandafter\ifx\csname#1\endcsname\relax \expandafter\@firstoftwo
@@ -59,13 +76,22 @@
 \def\pxcz at lower@a#1\pxcz at end#2{%
   \lowercase{\def#2{#1}}}
 
-%% \pxcz at setkeys{<text>}{<error>}
-\pxcz at onlypreamble@def\pxcz at setkeys#1#2{%
-  \def\KV at errx##1{#2}%
-  \edef\pxcz at do{\noexpand\setkeys{pxchfon}{#1}}\pxcz at do
+%% \pxcz at setkeys{<kv-family>}{<text>}{<error>}
+\pxcz at onlypreamble@def\pxcz at setkeys#1#2#3{%
+  \let\KV at errx#3%
+  \edef\pxcz at do{\noexpand\setkeys{#1}{#2}}\pxcz at do
   \let\KV at errx\pxcz at org@KV at errx}
 \let\pxcz at org@KV at errx\KV at errx
 
+%% \pxcz at handle@mt at kvopt{<key>}{<value>}{<code>}
+\pxcz at onlypreamble@def\pxcz at handle@mt at kvopt#1#2#3{%
+  \ifx\pxcz at mt#2\pxcz at mt #3%
+  \else
+    \PackageError\pxcz at pkgname
+     {No value allowed for key '#1'}%
+     {\@ehc}%
+  \fi}
+
 %% \pxcz at handle@kvopt{<key>}{<cs-key>}{<value>}{<code>}
 %% \pxcz at handle@bool at kvopt{<key>}{<cs-key>}{<value>}
 \pxcz at onlypreamble@def\pxcz at handle@kvopt{%
@@ -74,10 +100,11 @@
   \pxcz at handle@kvopt at a{}{#1}{#2}{#3}{\pxcz at value}}
 \pxcz at onlypreamble@def\pxcz at handle@kvopt at a#1#2#3#4{%
   \@nameuse{pxcz@#3 at giventrue}%
-  \pxcz at csletcs{pxcz at value}{pxcz@#3#1#4}%
+  \pxcz at letcs\pxcz at value{pxcz@#3#1#4}%
   \ifx\pxcz at value\relax
     \PackageError\pxcz at pkgname
-     {Invalid value for option key '#2'\MessageBreak (#4)}%
+     {Invalid value for key '#2'\MessageBreak (#4)}%
+     {\@ehc}%
     \expandafter\@gobble
   \else \expandafter\@firstofone
   \fi}
@@ -97,8 +124,46 @@
 \def\pxcz at split@c#1\pxcz at mt#2\pxcz at end#3{%
   \def\pxcz at pre{#3}\def\pxcz at post{#1}}
 
+%% \pxcz at let@jchar at token\CS{<code>}
+\pxcz at onlypreamble@def\pxcz at let@jchar at token#1#2{%
+  \begingroup
+    \kansujichar1=#2\relax \kcatcode#2=18\relax
+    \xdef\pxcz at g@tmpa{\kansuji1}%
+  \endgroup
+  \let#1=\pxcz at g@tmpa}
+
+%% \pxcz at geta
+\pxcz at let@jchar at token\pxcz at geta{\jis"222E}
+
+%% \pxcz at Z\newrobustcmd*\CS...
+% On e-TeX engines, it simply does \newrobustcmd*;
+% otherwise it does \DeclareRobustCommand* with 'new' check.
+\pxcz at onlypreamble@def\pxcz at Z\newrobustcmd*#1{%
+  \pxcz at okfalse
+  \@ifdefinable{#1}{\pxcz at oktrue}%
+  \pxcz at cond\ifpxcz at ok\fi
+    {\DeclareRobustCommand*#1}{\providecommand*\pxcz at mt}%
+}
+
+%% \pxcz at PackageNoteNoLine
+\ifx\PackageNoteNoLine\@undefined
+  \let\pxcz at PackageNoteNoLine\PackageWarningNoLine
+\else
+  \let\pxcz at PackageNoteNoLine\PackageNoteNoLine
+\fi
+
 %--------------------------------------- environment check
 
+%%<+> \pxchfonNoCheckMultiweight
+% If defined, skips the check for using multi-weight settings
+% without loading japanese-otf package with 'deluxe'.
+%(keep unchanged)
+
+%%<+> \pxchfonNoCheckExpert
+% If defined, skips the check for using expert settings without
+% substituting all weights.
+%(keep unchanged)
+
 %% check for 'pxjafont' package
 \@ifpackageloaded{pxjafont}{%
   \PackageError\pxcz at pkgname
@@ -115,6 +180,18 @@
   \pxcz at do\kchardef{\pxcz at uptextrue}
   % only upTeX in Unicode is seen as upTeX
   \ifnum\ucs"3000="3000 \else \pxcz at uptexfalse \fi}
+%% \ifpxcz at etex
+\newif\ifpxcz at etex \pxcz at etexfalse
+\pxcz at do\eTeXversion{\pxcz at etextrue}
+%% \ifpxcz at etoolbox
+\newif\ifpxcz at etoolbox
+\ifpxcz at etex
+  \IfFileExists{etoolbox.sty}{%
+    \RequirePackage{etoolbox}[2011/01/03]% v2.1
+    \pxcz at etoolboxtrue
+    \let\pxcz at Z\@empty
+  }{}
+\fi
 
 %% \pxcz at JYn
 \edef\pxcz at JYn{%
@@ -128,13 +205,11 @@
   \pxcz at lite@modetrue}
 
 %% \ifpxcz at otf@loaded
-%% \ifpxcz at otf@deluxe
 %% \pxcz at otf@weight: otf weight mode
 \newif\ifpxcz at otf@loaded \pxcz at otf@loadedtrue
-\newif\ifpxcz at otf@deluxe \pxcz at otf@deluxefalse
 % watch out for priority...
 \@ifpackagewith{otf}{deluxe}{%
-  \pxcz at otf@deluxetrue \let\pxcz at otf@weight=d
+  \let\pxcz at otf@weight=d
 }{\@ifpackagewith{otf}{bold}{%
   \let\pxcz at otf@weight=b
 }{\@ifpackagewith{otf}{expert}{%
@@ -253,7 +328,7 @@
 \let\pxcz at alphabet\relax
 \newif\ifpxcz at otf \pxcz at otftrue
 \newif\ifpxcz at cmap@alpha
-\newif\ifpxcz at mmivjis
+\pxcz at new@gbool{pxcz at mmivjis}
 \newif\ifpxcz at everypage
 \newif\ifpxcz at oneweight
 \newif\ifpxcz at fullwidth
@@ -274,9 +349,14 @@
 \chardef\pxcz at glyphid\z@
 \newif\ifpxcz at autojfmsync
 
+%% \pxcz at invalid@opt{<key>}
+\pxcz at onlypreamble@def\pxcz at invalid@opt#1{%
+  \@unknownoptionerror}
+
 %% process options
 % drivers
 \DeclareOption{nodvidriver}{\pxcz at enabledfalse}
+\DeclareOption{resetdvidriver}{\pxcz at enabledtrue}
 \DeclareOption{dvips}{\pxcz at enabledfalse}
 \DeclareOption{dviout}{\pxcz at enabledfalse}
 \DeclareOption{xdvi}{\pxcz at enabledfalse}
@@ -353,7 +433,9 @@
 \DeclareOption{autojfmsync}{\pxcz at autojfmsynctrue}
 \DeclareOption{noautojfmsync}{\pxcz at autojfmsyncfalse}
 % maybe-multiweight
-\DeclareOption{maybe-multiweight}{\let\pxchfonMaybeMultiweight=t}
+\DeclareOption{maybe-multiweight}{\let\pxchfonNoCheckMultiweight=t}
+% nocheck-expert
+\DeclareOption{nocheck-expert}{\let\pxchfonNoCheckExpert=t}
 % use=<spec>
 \define at key{pxchfon}{use}{%
   \pxcz at okfalse
@@ -427,7 +509,7 @@
 \DeclareOption*{%
   \pxcz at parse@opt\CurrentOption
   \ifpxcz at ok\else
-    \pxcz at setkeys{\CurrentOption}{\@unknownoptionerror}%
+    \pxcz at setkeys{pxchfon}{\CurrentOption}\pxcz at invalid@opt
   \fi}
 
 %% \pxcz at use@list
@@ -475,7 +557,7 @@
 \ifpxcz at unicode@given\else
   \let\pxcz at unicode\pxcz at unicode@@false
   \ifnum\pxcz at pxufont@loaded>0
-    \PackageWarningNoLine\pxcz at pkgname
+    \pxcz at PackageNoteNoLine\pxcz at pkgname
      {Option 'unicode' is enabled, since the package\MessageBreak
       'pxufont' is already loaded}
     \let\pxcz at unicode\pxcz at unicode@@full
@@ -486,7 +568,13 @@
 %% apply default value for \pxcz at alphabet
 \if\pxcz at alphabet\relax
   \ifx\pxcz at main@preset\relax \ifx\pxcz at file@preset\relax
-    % TODO: warn
+    \PackageWarningNoLine\pxcz at pkgname
+     {No preset is given and options for alphabetic\MessageBreak
+      fonts ('alphabet'/'noalphabet'/'relfont') are\MessageBreak
+      omitted. Here 'alphabet' will be assumed, but\MessageBreak
+      such omission is now DEPRECATED and the behavior\MessageBreak
+      might be changed in future!!\MessageBreak
+      You must write the option 'alphabet' explicitly}
     \let\pxcz at alphabet=t
   \fi\fi
   \if\pxcz at alphabet\relax
@@ -530,32 +618,14 @@
   \let\pxcz at switch@font at xjistrue\pxcz at switch@font at xjisfalse
 \fi
 
-\begingroup \lccode`\@=`\_ \lowercase{%
-  \xdef\pxcz at get@dvipdfmx at version{%
-    \let\noexpand\pxcz at dvipdfmx@version\expandafter\noexpand
-    \csname c@@Kernel at sys@dvipdfmx at version@int\endcsname}}
-\endgroup
-\AtBeginDocument{%
-  \@tempswatrue
-  \ifnum\pxcz at unicode<\pxcz at unicode@@full\else
-    \pxcz at get@dvipdfmx at version
-    \ifx\pxcz at dvipdfmx@version\@undefined\else
-      \ifnum\pxcz at dvipdfmx@version<20170918
-        \@tempswafalse \fi\fi
-  \fi
-  \if at tempswa\else
-    \PackageError\pxcz at pkgname
-     {Option 'unicode' is not available, since\MessageBreak
-      your dvipdfmx is too old (v.\number\pxcz at dvipdfmx@version)}
-     {The option requires dvipdfmx version 20170918 or later.%
-      \MessageBreak\@ehc}
-  \fi}
-
 %--------------------------------------- preset-dependent setup
 
-%% variables
-\newif\ifpxcz at warn@unless at all@defined
-\newif\ifpxcz at warn@unless at all@embedded
+%% \pxcz at warn@unless at all@defined at for
+% The \do-list of names of problematic features.
+\pxcz at onlypreamble@let\pxcz at warn@unless at all@defined at for\@empty
+%% \pxcz at warn@unless at all@embedded at for
+% The \do-list of names of problematic features.
+\pxcz at onlypreamble@let\pxcz at warn@unless at all@embedded at for\@empty
 
 %% \pxcz at apply@opt at unicode
 % Forces the 'unicode' setup (unless a directunicode option was given).
@@ -566,7 +636,7 @@
   \fi}
 %% \pxcz at warn@unicode
 \pxcz at onlypreamble@def\pxcz at warn@unicode{%
-  \PackageWarningNoLine\pxcz at pkgname
+  \pxcz at PackageNoteNoLine\pxcz at pkgname
    {The option 'unicode' is enforced, because the\MessageBreak
     preset '\pxcz at main@preset' is selected.}}
 
@@ -586,7 +656,8 @@
 \pxcz at custom@apply at opt@unicode
 % No-embed is not supported under the 'unicode' setup
 \ifnum\pxcz at unicode=\pxcz at unicode@@full
-  \pxcz at warn@unless at all@embeddedtrue
+  \g at addto@macro\pxcz at warn@unless at all@embedded at for{%
+    \do{Direct Unicode spec ('unicode')}}
 \fi
 
 %% apply default for pxcz at legacycode@replace
@@ -661,10 +732,37 @@
   \fi
   \let\pxcz at expert=f
 \fi
-\if t\pxcz at expert
-  \pxcz at warn@unless at all@definedtrue
-\fi
+\g at addto@macro\pxcz at first@doc at hook{%
+  \if t\pxcz at expert \ifx\pxchfonNoCheckExpert\@undefined
+    \g at addto@macro\pxcz at warn@unless at all@defined at for{%
+      \do{Expert glyph shapes ('expert')}}%
+  \fi\fi}
 
+%--------------------------------------- '\pxchfonsetup'
+
+%% errors
+\pxcz at onlypreamble@def\pxcz at err@ivsky#1{%
+  \PackageError\pxcz at pkgname
+   {Unknown key: #1}%
+   {\@ehc}}
+
+%% 'jis2004=<bool>'
+\define at key{pxchfonS}{jis2004}[true]{%
+  \pxcz at handle@bool at kvopt{jis2004}{mmivjis}{#1}}
+%% 'maybe-multiweight'
+\define at key{pxchfonS}{maybe-multiweight}[]{%
+  \pxcz at handle@mt at kvopt{maybe-multiweight}{#1}{%
+    \global\let\pxchfonNoCheckMultiweight=t}}
+%% 'nocheck-expert'
+\define at key{pxchfonS}{nocheck-expert}[]{%
+  \pxcz at handle@mt at kvopt{nocheck-expert}{#1}{%
+    \global\let\pxchfonNoCheckExpert=t}}
+
+%%<*> \pxchfonsetup{<text>}
+\@onlypreamble\pxchfonsetup
+\pxcz at Z\newrobustcmd*\pxchfonsetup[1]{%
+  \pxcz at setkeys{pxchfonS}{#1}\pxcz at err@ivsky}
+
 %--------------------------------------- user interface
 
 %% variables
@@ -678,53 +776,60 @@
   tcml,tcmr,tcmb,tcgr,tcgb,tcgx,tcgu,tcmgr}
 
 %%<*> \setminchofont/\setgothicfont/etc.
-\newcommand*\setminchofont{\pxcz at setfont{mnl,mnr,mnb}}
-\newcommand*\setgothicfont{\pxcz at setfont{gtr,gtb,gtx,gtu}}
-\newcommand*\setlightminchofont{\pxcz at setfont@dx{mnl}}
-\newcommand*\setmediumminchofont{\pxcz at setfont@dx{mnr}}
-\newcommand*\setboldminchofont{\pxcz at setfont@dx{mnb}}
-\newcommand*\setmediumgothicfont{\pxcz at setfont@dx{gtr}}
-\newcommand*\setboldgothicfont{\pxcz at setfont@dx{gtb}}
-\newcommand*\setxboldgothicfont{\pxcz at setfont@dx{gtx}}
-\newcommand*\setoneweightgothicfont{\pxcz at setfont@dx{gtu}}
-\newcommand*\setmarugothicfont{\pxcz at setfont@dx{mgr}}
+% japanese
+\pxcz at Z\newrobustcmd*\setminchofont{\pxcz at setfont{mnl,mnr,mnb}}
+\pxcz at Z\newrobustcmd*\setgothicfont{\pxcz at setfont{gtr,gtb,gtx,gtu}}
+\pxcz at Z\newrobustcmd*\setlightminchofont{\pxcz at setdf{mnl}}
+\pxcz at Z\newrobustcmd*\setmediumminchofont{\pxcz at setdf{mnr}}
+\pxcz at Z\newrobustcmd*\setboldminchofont{\pxcz at setdf{mnb}}
+\pxcz at Z\newrobustcmd*\setmediumgothicfont{\pxcz at setdf{gtr}}
+\pxcz at Z\newrobustcmd*\setboldgothicfont{\pxcz at setdf{gtb}}
+\pxcz at Z\newrobustcmd*\setxboldgothicfont{\pxcz at setdf{gtx}}
+\pxcz at Z\newrobustcmd*\setoneweightgothicfont{\pxcz at setdf{gtu}}
+\pxcz at Z\newrobustcmd*\setmarugothicfont{\pxcz at setdf{mgr}}
+% korean
+\pxcz at Z\newrobustcmd*\setkoreanminchofont{%
+  \pxcz at setfont{koml,komr,komb}}
+\pxcz at Z\newrobustcmd*\setkoreangothicfont{%
+  \pxcz at setfont{kogr,kogb,kogx,kogu,komgr}}
+\pxcz at Z\newrobustcmd*\setkoreanlightminchofont{\pxcz at setdf{koml}}
+\pxcz at Z\newrobustcmd*\setkoreanmediumminchofont{\pxcz at setdf{komr}}
+\pxcz at Z\newrobustcmd*\setkoreanboldminchofont{\pxcz at setdf{komb}}
+\pxcz at Z\newrobustcmd*\setkoreanmediumgothicfont{\pxcz at setdf{kogr}}
+\pxcz at Z\newrobustcmd*\setkoreanboldgothicfont{\pxcz at setdf{kogb}}
+\pxcz at Z\newrobustcmd*\setkoreanxboldgothicfont{\pxcz at setdf{kogx}}
+\pxcz at Z\newrobustcmd*\setkoreanoneweightgothicfont{\pxcz at setdf{kogu}}
+\pxcz at Z\newrobustcmd*\setkoreanmarugothicfont{\pxcz at setdf{komgr}}
+% schinese
+\pxcz at Z\newrobustcmd*\setschineseminchofont{%
+  \pxcz at setfont{scml,scmr,scmb}}
+\pxcz at Z\newrobustcmd*\setschinesegothicfont{%
+  \pxcz at setfont{scgr,scgb,scgx,scgu,scmgr}}
+\pxcz at Z\newrobustcmd*\setschineselightminchofont{\pxcz at setdf{scml}}
+\pxcz at Z\newrobustcmd*\setschinesemediumminchofont{\pxcz at setdf{scmr}}
+\pxcz at Z\newrobustcmd*\setschineseboldminchofont{\pxcz at setdf{scmb}}
+\pxcz at Z\newrobustcmd*\setschinesemediumgothicfont{\pxcz at setdf{scgr}}
+\pxcz at Z\newrobustcmd*\setschineseboldgothicfont{\pxcz at setdf{scgb}}
+\pxcz at Z\newrobustcmd*\setschinesexboldgothicfont{\pxcz at setdf{scgx}}
+\pxcz at Z\newrobustcmd*\setschineseoneweightgothicfont{\pxcz at setdf{scgu}}
+\pxcz at Z\newrobustcmd*\setschinesemarugothicfont{\pxcz at setdf{scmgr}}
+% tchinese
+\pxcz at Z\newrobustcmd*\settchineseminchofont{%
+  \pxcz at setfont{tcml,tcmr,tcmb}}
+\pxcz at Z\newrobustcmd*\settchinesegothicfont{%
+  \pxcz at setfont{tcgr,tcgb,tcgx,tcgu,tcmgr}}
+\pxcz at Z\newrobustcmd*\settchineselightminchofont{\pxcz at setdf{tcml}}
+\pxcz at Z\newrobustcmd*\settchinesemediumminchofont{\pxcz at setdf{tcmr}}
+\pxcz at Z\newrobustcmd*\settchineseboldminchofont{\pxcz at setdf{tcmb}}
+\pxcz at Z\newrobustcmd*\settchinesemediumgothicfont{\pxcz at setdf{tcgr}}
+\pxcz at Z\newrobustcmd*\settchineseboldgothicfont{\pxcz at setdf{tcgb}}
+\pxcz at Z\newrobustcmd*\settchinesexboldgothicfont{\pxcz at setdf{tcgx}}
+\pxcz at Z\newrobustcmd*\settchineseoneweightgothicfont{\pxcz at setdf{tcgu}}
+\pxcz at Z\newrobustcmd*\settchinesemarugothicfont{\pxcz at setdf{tcmgr}}
 
-\newcommand*\setkoreanminchofont{\pxcz at setfont{koml,komr,komb}}
-\newcommand*\setkoreangothicfont{\pxcz at setfont{kogr,kogb,kogx,kogu,komgr}}
-\newcommand*\setkoreanlightminchofont{\pxcz at setfont@dx{koml}}
-\newcommand*\setkoreanmediumminchofont{\pxcz at setfont@dx{komr}}
-\newcommand*\setkoreanboldminchofont{\pxcz at setfont@dx{komb}}
-\newcommand*\setkoreanmediumgothicfont{\pxcz at setfont@dx{kogr}}
-\newcommand*\setkoreanboldgothicfont{\pxcz at setfont@dx{kogb}}
-\newcommand*\setkoreanxboldgothicfont{\pxcz at setfont@dx{kogx}}
-\newcommand*\setkoreanoneweightgothicfont{\pxcz at setfont@dx{kogu}}
-\newcommand*\setkoreanmarugothicfont{\pxcz at setfont@dx{komgr}}
-
-\newcommand*\setschineseminchofont{\pxcz at setfont{scml,scmr,scmb}}
-\newcommand*\setschinesegothicfont{\pxcz at setfont{scgr,scgb,scgx,scgu,scmgr}}
-\newcommand*\setschineselightminchofont{\pxcz at setfont@dx{scml}}
-\newcommand*\setschinesemediumminchofont{\pxcz at setfont@dx{scmr}}
-\newcommand*\setschineseboldminchofont{\pxcz at setfont@dx{scmb}}
-\newcommand*\setschinesemediumgothicfont{\pxcz at setfont@dx{scgr}}
-\newcommand*\setschineseboldgothicfont{\pxcz at setfont@dx{scgb}}
-\newcommand*\setschinesexboldgothicfont{\pxcz at setfont@dx{scgx}}
-\newcommand*\setschineseoneweightgothicfont{\pxcz at setfont@dx{scgu}}
-\newcommand*\setschinesemarugothicfont{\pxcz at setfont@dx{scmgr}}
-
-\newcommand*\settchineseminchofont{\pxcz at setfont{tcml,tcmr,tcmb}}
-\newcommand*\settchinesegothicfont{\pxcz at setfont{tcgr,tcgb,tcgx,tcgu,tcmgr}}
-\newcommand*\settchineselightminchofont{\pxcz at setfont@dx{tcml}}
-\newcommand*\settchinesemediumminchofont{\pxcz at setfont@dx{tcmr}}
-\newcommand*\settchineseboldminchofont{\pxcz at setfont@dx{tcmb}}
-\newcommand*\settchinesemediumgothicfont{\pxcz at setfont@dx{tcgr}}
-\newcommand*\settchineseboldgothicfont{\pxcz at setfont@dx{tcgb}}
-\newcommand*\settchinesexboldgothicfont{\pxcz at setfont@dx{tcgx}}
-\newcommand*\settchineseoneweightgothicfont{\pxcz at setfont@dx{tcgu}}
-\newcommand*\settchinesemarugothicfont{\pxcz at setfont@dx{tcmgr}}
-
 \pxcz at onlypreamble@def\pxcz at setfont#1{\@ifnextchar[%]
   {\pxcz at setfont@a{#1}}{\pxcz at setfont@a{#1}[0]}}
-\pxcz at onlypreamble@def\pxcz at setfont@dx{%
+\pxcz at onlypreamble@def\pxcz at setdf{%
   \pxcz at deluxe@usedtrue\pxcz at setfont}
 \pxcz at onlypreamble@def\pxcz at setfont@a#1[#2]#3{%
   \edef\pxcz at tmpa{#3}\pxcz at lower\pxcz at tmpa
@@ -742,14 +847,13 @@
 \@for\pxcz at x:=\pxcz at sym@list\do{%
   \@namedef{pxcz at FS/\pxcz at x}{}}
 
-%%<*> \maybemultiweight
-\newcommand*\maybemultiweight{%
-  \let\pxchfonMaybeMultiweight=t}
-
 % check for usage of multi-weight commands
-\ifx t\pxchfonMaybeMultiweight\else
-  \AtBeginDocument{%
-    \ifpxcz at deluxe@used\ifpxcz at otf@deluxe\else
+\g at addto@macro\pxcz at first@doc at hook{%
+  \ifx t\pxchfonMaybeMultiweight % for compatibility
+    \let\pxchfonNoCheckMultiweight=t%
+  \fi
+  \ifx\pxchfonNoCheckMultiweight\@undefined
+    \ifpxcz at deluxe@used\if d\pxcz at otf@weight\else
       \PackageWarningNoLine\pxcz at pkgname
        {Setting for multi-weight usage of japanese-otf\MessageBreak
         font set is employed, but 'deluxe' option\MessageBreak
@@ -756,8 +860,8 @@
         of japanese-otf is not enabled!\MessageBreak
         You should specify 'maybe-multiweight' option\MessageBreak
         if you really intend the present setting}
-    \fi\fi}
-\fi
+    \fi\fi
+  \fi}
 
 %--------------------------------------- fontmap internals
 
@@ -777,9 +881,9 @@
 \def\pxcz at cmap@hwuni{UniJIS-UCS2-HW-H}
 
 %%<*> \usecmapforalphabet/\nousecmapforalphabet
-\newcommand*\usecmapforalphabet{%
+\pxcz at Z\newrobustcmd*\usecmapforalphabet{%
   \global\pxcz at cmap@alphatrue}
-\newcommand*\nousecmapforalphabet{%
+\pxcz at Z\newrobustcmd*\nousecmapforalphabet{%
   \global\pxcz at cmap@alphafalse}
 
 %% \pxcz at NEF/<sym>
@@ -800,35 +904,49 @@
 %%<+> \JaFontReplacementFor{<sym>}
 \newcommand*\JaFontReplacementFor[1]{%
   \csname pxcz at FS/#1\endcsname}
+\@namedef{pxcz at FS/*}{\pxcz at empty}
 
 %%<+> \JaFontReplacementHook{<code>}
 \@onlypreamble\JaFontReplacementHook
-\newcommand*\JaFontReplacementHook{%
+\pxcz at Z\newrobustcmd*\JaFontReplacementHook{%
   \g at addto@macro\pxcz at user@hook}
 \let\pxcz at user@hook\@empty
 
 %%<+> \JaFontUserDefinedMap
 \@onlypreamble\JaFontUserDefinedMap
-\newcommand*\JaFontUserDefinedMap{%
+\pxcz at Z\newrobustcmd*\JaFontUserDefinedMap{%
   \g at addto@macro\pxcz at user@map}
-\let\pxcz at user@map\@empty
-\@namedef{pxcz at FS/*}{\pxcz at empty}
+\pxcz at onlypreamble@let\pxcz at user@map\@empty
 
-%%<+> \usefontmapline{<map-line>}
-\@onlypreamble\usefontmapline
-\newcommand*\usefontmapline[1]{%
-  \JaFontUserDefinedMap{\pxcz at addtospec@alt\pxcz at mapline{#1}}}
-
-%%<+> \usefontmapfile{<map-file>}
-\@onlypreamble\usefontmapfile
-\newcommand*\usefontmapfile[1]{%
-  \JaFontUserDefinedMap{\pxcz at addtospec@alt\pxcz at mapfile{#1}}}
-
 %% \pxcz at check@extra
 % Executed at the begin-document hook.
 \@onlypreamble\pxcz at check@extra
 \let\pxcz at check@extra\@empty
 
+%% \pxcz at addtospec@aux{<name>}{<text>}
+\pxcz at onlypreamble@def\pxcz at addtospec@aux#1#2{%
+  \xdef\pxcz at spec{\pxcz at spec\noexpand\special{pdf:#1 #2}}%
+}
+
+%%<*> \usefontmapline{<map-line>}
+\@onlypreamble\usefontmapline
+\pxcz at Z\newrobustcmd*\usefontmapline[1]{%
+  \JaFontUserDefinedMap{\pxcz at add@mapline{#1}}%
+}
+%%<*> \usefontmapfile{<map-file>}
+\@onlypreamble\usefontmapfile
+\pxcz at Z\newrobustcmd*\usefontmapfile[1]{%
+  \JaFontUserDefinedMap{\pxcz at add@mapfile{#1}}%
+}
+%% \pxcz at add@mapfile{<map-file>}
+\pxcz at onlypreamble@def\pxcz at add@mapfile{%
+  \pxcz at addtospec@aux{mapfile}%
+}
+%% \pxcz at add@mapline{<map-line>}
+\pxcz at onlypreamble@def\pxcz at add@mapline{%
+  \pxcz at addtospec@aux{mapline}%
+}
+
 %--------------------------------------- map entry handling
 
 %%<*> \setnewglyphcmapprefix{<str>}
@@ -835,7 +953,7 @@
 \def\pxcz at pfx@jis at dflt{2004-}
 \def\pxcz at pfx@jis at star{JISX0213-2004-}
 \@onlypreamble\setnewglyphcmapprefix
-\newcommand*\setnewglyphcmapprefix{%
+\pxcz at Z\newrobustcmd*\setnewglyphcmapprefix{%
   \@ifstar{\pxcz at set@pfx at jis\pxcz at pfx@jis at star}%
    {\pxcz at set@pfx at jis}}
 \def\pxcz at set@pfx at jis#1{%
@@ -887,18 +1005,6 @@
   \ifx\pxcz at font\@empty
   \else\ifx\pxcz at font\pxcz at noembed
   \else
-    \pxcz at inspect@font at tribe@a{?SourceHanSerif-}{.otf?}{sourcehan}%
-    \pxcz at inspect@font at tribe@a{?SourceHanSans-}{.otf?}{sourcehan}%
-    \pxcz at inspect@font at tribe@a{?:0:SourceHanSerif-}{.ttc?}{sourcehanC}%
-    \pxcz at inspect@font at tribe@a{?:0:SourceHanSans-}{.ttc?}{sourcehanC}%
-    \pxcz at inspect@font at tribe@a{?NotoSerifCJKjp-}{.otf?}{noto}%
-    \pxcz at inspect@font at tribe@a{?NotoSansCJKjp-}{.otf?}{noto}%
-    \pxcz at inspect@font at tribe@a{?:0:NotoSerifCJK-}{.ttc?}{notoC}%
-    \pxcz at inspect@font at tribe@a{?:0:NotoSansCJK-}{.ttc?}{notoC}%
-    \pxcz at inspect@font at tribe@a{?yumin}{.ttf?}{yumin}%
-    \pxcz at inspect@font at tribe@a{?YUMIN}{.TTF?}{yuminU}%
-    \pxcz at inspect@font at tribe@a{:YuGoth}{.ttc?}{yugoth}%
-    \pxcz at inspect@font at tribe@a{:YUGOTH}{.TTC?}{yugoth}%
     \pxcz at inspect@font at tribe@a{:moga}{.ttc?}{mogamobo}%
     \pxcz at inspect@font at tribe@a{:mobo}{.ttc?}{mogamobo}%
   \fi\fi
@@ -919,7 +1025,7 @@
 %% \pxcz at switch@font at for{<feature>}
 % Modifies \pxcz at font, assuming \pxcz at font@tribe is properly set.
 \pxcz at onlypreamble@def\pxcz at switch@font at for#1{%
-  \pxcz at csletcs{pxcz at tmpb}{pxcz at switch@font@@\pxcz at font@tribe @#1}%
+  \pxcz at letcs\pxcz at tmpb{pxcz at switch@font@@\pxcz at font@tribe @#1}%
   \ifx\pxcz at tmpb\relax\else
 %\typeout{#1:\pxcz at font-->\expandafter\pxcz at tmpb\pxcz at font}%
     \edef\pxcz at font{\expandafter\pxcz at tmpb\pxcz at font}%
@@ -1085,11 +1191,9 @@
   \fi\fi
   % output it
   \ifx\pxcz at font\pxcz at kill@mapping
-    \xdef\pxcz at spec{\pxcz at spec\noexpand\special{%
-      \pxcz at mapline{-#2}}}%
+    \pxcz at add@mapline{-#2}%
   \else\ifx\pxcz at font\@empty\else
-    \xdef\pxcz at spec{\pxcz at spec\noexpand\special{%
-      \pxcz at mapline{#2 \pxcz at cmap\space\pxcz at font\pxcz at mopts}}}%
+    \pxcz at add@mapline{#2 \pxcz at cmap\space\pxcz at font\pxcz at mopts}%
   \fi\fi}
 
 %% \pxcz at do@file at preset
@@ -1116,14 +1220,8 @@
   \ifpxcz at uptex \pxcz at use@mapfile at b{uptex-#1-#2}\fi
   \ifpxcz at otf \pxcz at use@mapfile at b{otf-#1-#2}\fi}
 \pxcz at onlypreamble@def\pxcz at use@mapfile at b#1{%
-  \pxcz at addtospec@alt\pxcz at mapfile{#1.map}}
+  \pxcz at add@mapfile{#1.map}}
 
-%% \pxcz at addtospec@alt
-\def\pxcz at addtospec@alt#1#2{%
-  \xdef\pxcz at spec{\pxcz at spec\noexpand\special{#1{#2}}}}
-\def\pxcz at mapfile#1{pdf:mapfile #1}
-\def\pxcz at mapline#1{pdf:mapline #1}
-
 %--------------------------------------- map entry definitions
 
 %% \pxcz at mapentry{<id>}{<text>}
@@ -1435,7 +1533,8 @@
   \else
     \ifnum\pxcz at unicode<\pxcz at unicode@@simple\else
       \pxcz at diruni@oktrue % 'unicode=UTF' does not need otf
-      \AtBeginDocument{% loading otf later causes inconsistency
+      \g at addto@macro\pxcz at first@doc at hook{%
+        % loading otf later causes inconsistency
         \@ifpackageloaded{otf}{\pxcz at diruni@okfalse}{}}%
     \fi
   \fi
@@ -1442,8 +1541,7 @@
 \fi
 
 %%<*> \diruni
-\newcommand*{\diruni}{\pxcz at diruni}
-\DeclareRobustCommand*{\pxcz at diruni}{%
+\pxcz at Z\newrobustcmd*\diruni{%
     \not at math@alphabet\diruni\relax
     \ifx\cy at encoding\pxcz at JYn % if in standard Japanese encoding
       \expandafter\let\csname UTF \endcsname\pxcz at du@UTF
@@ -1452,10 +1550,9 @@
 }
 
 %%<*> \textdiruni{<text>}
-\@ifdefinable{\textdiruni}{%
-  \DeclareRobustCommand*{\textdiruni}[1]{%
-    \relax\ifmmode\hbox\fi{\pxcz at diruni#1}%
-  }}
+\pxcz at Z\newrobustcmd*\textdiruni[1]{%
+  \relax\ifmmode\hbox\fi{\diruni#1}%
+}
 
 %% \pxcz at du@UTF
 \def\pxcz at du@UTF#1{%
@@ -1476,7 +1573,7 @@
     \ifcase\pxcz at unicode with 'unicode' option%
     \else pxchfon after 'otf' package%
     \fi .\MessageBreak\@ehc}}
-\AtBeginDocument{%
+\g at addto@macro\pxcz at first@doc at hook{%
   \ifpxcz at diruni@ok \let\pxcz at err@diruni\relax
   \else \let\pxcz at diruni\pxcz at err@diruni
   \fi}
@@ -1526,7 +1623,7 @@
 \fi
 \fi\fi\fi
 
-\AtBeginDocument{%
+\g at addto@macro\pxcz at first@doc at hook{%
   \def\pxcz at do#1#2#3{%
     \DeclareFontShape{#1}{#2}{#3}{diruni}{<->ssub*#2/#3/n}{}}%
   \@for\pxcz at tmpa:={\rmdefault,\sfdefault,\ttdefault}\do{%
@@ -1547,25 +1644,25 @@
 \fi                 %---- </diruni-ok>
 
 %--------------------------------------- 'glyphid'
+\ifnum\pxcz at glyphid>0 %---- <*glyphid>
 
-%% \pxcz at geta
-\chardef\pxcz at geta=\jis"222E\relax
+\ifnum\pxcz at glyphid=2 %---- <*glyphid-ok>
 
-\ifnum\pxcz at glyphid=2 %---- <*glyphid>
-
 %% check integrity
 \ifpxcz at otf@loaded\else
-  \AtBeginDocument{% loading otf later causes inconsistency
+  \g at addto@macro\pxcz at first@doc at hook{%
+    % loading otf later causes inconsistency
     \@ifpackageloaded{otf}{%
       \PackageWarningNoLine\pxcz at pkgname
        {The option 'glyphid' will not work. You must\MessageBreak
         load pxchfon after 'otf' package}%
-    \def\gid{\pxcz at gid@fb}}{}}
+      \def\pxcz at gid{\pxcz at gid@fb}%
+      \chardef\pxcz at glyphid=1
+    }{}}
 \fi
 
-%%<*> \gid{<number>}
-\newcommand*{\gid}{\pxcz at gid}
-\DeclareRobustCommand*{\pxcz at gid}[1]{%
+%% \pxcz at gid{<number>}
+\def\pxcz at gid#1{%
   \begingroup
     \kanjishape{dirgid}\selectfont
     \kchar#1\pxcz at gid@jfm at sync
@@ -1608,108 +1705,38 @@
 \pxcz at dg@decl at shape{gt}{bx}f{ssub*gt/m/dirgid}{}%
 \fi\fi\fi
 
-\fi                 %---- </glyphid>
+\fi                   %---- </glyphid-ok>
 
-\ifnum\pxcz at glyphid>0
-  %% \pxcz at gid@fb
-  \providecommand*{\gid}{\pxcz at gid@fb}
-  \DeclareRobustCommand*{\pxcz at gid@fb}[1]{%
-    \begingroup \kchar\pxcz at geta \endgroup}
+%%<*> \gid{<number>}
+\pxcz at Z\newrobustcmd*\gid{\pxcz at gid}
 
-  % redefinition in PDF-strings
-  \begingroup \kansujichar1=\pxcz at geta \kcatcode\pxcz at geta=18
-    \xdef\pxcz at hy@gid#1{\kansuji1}
-  \endgroup
-  \pxcz at hy@disable at commands{%
-    \let\gid\pxcz at hy@gid}
-\fi
+%% \pxcz at gid@fb
+\def\pxcz at gid@fb#1{%
+    \begingroup
+      \pxcz at geta
+    \endgroup}
+\providecommand*\pxcz at gid{\pxcz at gid@fb}
 
-%--------------------------------------- 'alphabet' option
-
-%% check for textcomp
-\newif\ifpxcz at textcomp
-\ifx\DeclareEncodingSubset\@undefined\else
-  \expandafter\ifx\csname T at TS1\endcsname\relax\else
-    \pxcz at textcomptrue
-\fi\fi
-
-%% \pxcz at afont@enc at list
-\def\pxcz at afont@enc at list{OT1,T1}
-\ifpxcz at textcomp \g at addto@macro\pxcz at afont@enc at list{,TS1}\fi
-%% \pxcz at decl@family{<fam>}
-\pxcz at onlypreamble@def\pxcz at decl@family#1{%
-  \ifpxcz at textcomp \DeclareEncodingSubset{TS1}{#1}{3}\fi
-  \@for\pxcz at x:=\pxcz at afont@enc at list\do{%
-    \DeclareFontFamily{\pxcz at x}{#1}{}}}
-%% \pxcz at decl@shape{<fam>}{<ser>}<sw>{<font>}
-\pxcz at onlypreamble@def\pxcz at decl@shape#1#2#3#4{%
-  \if s#3%
-    \@for\pxcz at x:=\pxcz at afont@enc at list\do{%
-      \DeclareFontShape{\pxcz at x}{#1}{#2}{n}{<->ssub*#4}{}}%
+% redefinition in PDF-strings
+\def\pxcz at hy@gid#1{%
+  \ifx\pxjahyperBadCharacter\@undefined
+    \pxcz at geta
   \else
-    \DeclareFontShape{OT1}{#1}{#2}{n}{<->#4-l5j}{}%
-    \DeclareFontShape {T1}{#1}{#2}{n}{<->#4-t1}{}%
-    \ifpxcz at textcomp
-      \DeclareFontShape{TS1}{#1}{#2}{n}{<->#4-ts1}{}%
-    \fi
+    \pxjahyperBadCharacter{GID+#1}%
   \fi
-  \@for\pxcz at x:=\pxcz at afont@enc at list\do{%
-    \DeclareFontShape{\pxcz at x}{#1}{#2}{it}{<->ssub*#1/#2/n}{}%
-    \DeclareFontShape{\pxcz at x}{#1}{#2}{sl}{<->ssub*#1/#2/n}{}}}
-
-\ifpxcz at alphafont   %---- <*alphabet>
-\ifpxcz at otf@deluxe  %---- <*otfdx> : otf with deluxe option
-  % define families cfjar & cfjas
-\pxcz at decl@family{cfjar}%
-\pxcz at decl@shape{cfjar}{l}n{cfjar-l}%
-\pxcz at decl@shape{cfjar}{m}n{cfjar-r}%
-\pxcz at decl@shape{cfjar}{bx}n{cfjar-b}%
-\pxcz at decl@family{cfjas}%
-\pxcz at decl@shape{cfjas}{m}n{cfjas-r}%
-\pxcz at decl@shape{cfjas}{bx}n{cfjas-b}%
-\pxcz at decl@shape{cfjas}{eb}n{cfjas-x}%
-\pxcz at decl@family{cfjam}%
-\pxcz at decl@shape{cfjam}{m}n{cfjam-r}%
-  % redefine \ltseries & \ebseries so they affect roman font
-\let\ltseries\relax \let\ebseries\relax
-\DeclareRobustCommand\ltseries{%
-  \not at math@alphabet\ltseries\relax
-  \fontseries\ltdefault\selectfont}%
-\DeclareRobustCommand\ebseries{%
-  \not at math@alphabet\ebseries\relax
-  \fontseries\ebdefault\selectfont}%
-\else               %---- <*!otfdx>
-\pxcz at decl@family{cfjar}%
-\pxcz at decl@shape{cfjar}{m}n{cfjar-r}%
-\pxcz at decl@shape{cfjar}{bx}s{cfjas/m/n}%
-\pxcz at decl@family{cfjas}%
-\pxcz at decl@shape{cfjas}{m}n{cfjas-r}%
-\pxcz at decl@shape{cfjas}{bx}s{cfjas/m/n}%
-\pxcz at onlypreamble@def\pxcz at err@dxotf#1{%
-  \PackageError\pxcz at pkgname
-   {Loaded before '#1' with 'deluxe'}%
-   {This package must be loaded after '#1' with 'deluxe' option
-    when using both.}}
-\g at addto@macro\pxcz at check@extra{%
-  \expandafter\let\expandafter\pxcz at x\csname pxcz at FS/mnr\endcsname
-  \ifx\pxcz at x\@empty\else
-    % if mnr is replaced but gtr is not then ...
-    \expandafter\ifx\csname pxcz at FS/gtr\endcsname\@empty
-      {\expandafter\let\csname pxcz at FS/gtr\endcsname\pxcz at x
-        \pxcz at Entry{gtr}{r-cfjas-r- at PXcjk0@}{unicode}{HWid}}%
-  \fi\fi
-  \@ifpackagewith{otf}{deluxe}{\pxcz at err@dxotf{otf}}{}%
 }
-\fi                 %---- </otfdx>
-\fi                 %---- </alphabet>
+  \pxcz at hy@disable at commands{%
+    \let\gid\pxcz at hy@gid}
 
-%--------------------------------------- begin-document hook
+\fi                   %---- </glyphid>
+%--------------------------------------- 'pxchfon0' submodule
+\ifpxcz at lite@mode\else
 
-%% variables
-\let\pxcz at afont@enc\relax
+%% load the submodule
+\input{pxchfon0.def}
 
-%% \pxcz at mgfamily@hook
-\def\pxcz at mgfamily@hook{\romanfamily{cfjam}}
+\fi
+%--------------------------------------- begin-document hook
 
 %% \pxcz at set@page at hook{<text>}
 \ifpxcz at old@hook at system %----
@@ -1740,37 +1767,14 @@
     \expandafter\ifx\csname pxcz at FS/\pxcz at x\endcsname\@empty
       \pxcz at okfalse \fi}}
 
-%% \pxcz at decl@relfont{<fam>}{<afam>}{<ser>,...}
-\pxcz at onlypreamble@def\pxcz at decl@relfont#1#2#3{%
-  \@for\pxcz at x:={#3}\do{%
-    \expandafter\ifx\csname\k at encoding/#1/\pxcz at x/n\endcsname\relax\else
-      \edef\pxcz at tmpa{\noexpand\DeclareRelationFont
-        {\k at encoding}{#1}{\pxcz at x}{}{\pxcz at afont@enc}{#2}{\pxcz at x}{}%
-      }\pxcz at tmpa
-    \fi}%
-  \PackageInfo\pxcz at pkgname
-   {Relation font set for \k at encoding/#1}}
-
-%% \pxcz at check@afont at enc
-\pxcz at onlypreamble@def\pxcz at check@afont at enc{%
-  \pxcz at oktrue % OT1 is always okay
-  \expandafter\ifx\csname\pxcz at afont@enc+cfjar\endcsname\relax
-    \pxcz at okfalse \fi
-  % if not okay, use OT1 instead
-  \ifpxcz at ok\else \def\pxcz at afont@enc{OT1}\fi}
-
-%% \pxcz at set@bfdefault at to@bx{<doc-ser>}
-\pxcz at onlypreamble@let\pxcz at set@bfdefault at to@bx\@gobble
-\ifx\DeclareFontSeriesDefault\@undefined\else
-  \def\pxcz at set@bfdefault at to@bx#1{%
-    \DeclareFontSeriesDefault[#1]{bf}{bx}}
-\fi
-
 %% the begin-document hook
 \pxcz at onlypreamble@def\pxcz at doc@hook{%
   \ifpxcz at otf
     \@ifpackageloaded{otf}{\pxcz at otftrue}{\pxcz at otffalse}%
     \@ifpackageloaded{utf}{\pxcz at utftrue}{\pxcz at utffalse}%
+    \ifx\pxchfonNoCheckMultiweight\@undefined\else
+      \pxcz at otftrue
+    \fi
   \fi
   \pxcz at user@hook
   \let\pxcz at use@do\pxcz at use@mapfile
@@ -1782,44 +1786,11 @@
     \pxcz at inspect@flavor at all
   \fi
   \if t\pxcz at alphabet % 'alphabet'
-    \pxcz at check@alldefined{mnl,mnr,mnb}\ifpxcz at ok
-      \renewcommand\rmdefault{cfjar}%
-      \pxcz at set@bfdefault at to@bx{rm}%
-    \fi
-    \pxcz at check@alldefined{gtr,gtb,gtx}\ifpxcz at ok
-      \renewcommand\sfdefault{cfjas}%
-      \pxcz at set@bfdefault at to@bx{sf}%
-    \fi
-    % attach hook to \mgfamily if mgr font is defined
-    \pxcz at check@alldefined{mgr}\ifpxcz at ok\ifpxcz at otf@deluxe
-      \begingroup
-        \def\pxcz at x##1{\toks@\expandafter{##1}%
-          \xdef##1{\noexpand\pxcz at mgfamily@hook\the\toks@}%
-        }\expandafter\pxcz at x\csname mgfamily \endcsname
-      \endgroup
-    \fi\fi
-    % decide alphabet font encoding
-    \edef\pxcz at afont@enc{\encodingdefault}%
-    \pxcz at check@afont at enc\ifpxcz at ok\else
-      \PackageWarningNoLine\pxcz at pkgname
-       {Default encoding is changed to 'OT1' because%
-        \MessageBreak'alphabet' option is in effect}%
-      \renewcommand\encodingdefault{OT1}%
-    \fi
-    \normalfont
+    \pxcz at setup@alphabet
     \pxcz at addtospec{ALPHA}%
   \fi
   \if r\pxcz at alphabet % 'relfont'
-    \edef\pxcz at afont@enc{\encodingdefault}%
-    \pxcz at check@afont at enc
-    \pxcz at check@alldefined{mnl,mnr,mnb}%
-    \ifpxcz at ok \pxcz at decl@relfont\mcdefault{cfjar}{m,bx,l}\fi
-    \pxcz at check@alldefined{gtr,gtb,gtx}%
-    \ifpxcz at ok \pxcz at decl@relfont\gtdefault{cfjas}{m,bx,eb}\fi
-    \pxcz at check@alldefined{mgr}%
-    \ifpxcz at ok\ifpxcz at otf@deluxe
-      \pxcz at decl@relfont\mgdefault{cfjam}{m}%
-    \fi\fi
+    \pxcz at setup@relfont
     \pxcz at addtospec{ALPHA}%
   \fi
   \ifpxcz at uptex\else
@@ -1843,24 +1814,34 @@
   \ifpxcz at utf \pxcz at addtospec{UTF}%
   \fi
   % warn if some weights are not substituted, and if necessaty
-  \ifpxcz at warn@unless at all@defined
-    \ifpxcz at otf@deluxe
+  \ifx\pxcz at warn@unless at all@defined at for\@empty\else
+    \if d\pxcz at otf@weight
       \pxcz at check@alldefined{mnl,mnr,mnb,gtr,gtb,gtx,mgr}%
     \else \pxcz at check@alldefined{mnr,mnb,gtr,gtb}%
     \fi
     \ifpxcz at ok\else
+      \def\do##1{\MessageBreak - ##1}%
       \PackageWarningNoLine\pxcz at pkgname
-       {Some font weights are not substituted.\MessageBreak
-        So some features of pxchfon might not work\MessageBreak
-        properly when applied to such weights}%
+       {There are some weights that font files are\MessageBreak
+        not specified for. It is possibly okay,\MessageBreak
+        but some features of pxchfon (listed below)\MessageBreak
+        might not work properly when applied to\MessageBreak
+        such weights.%
+        \pxcz at warn@unless at all@defined at for
+        \expandafter\@gobble}% gobble the period
     \fi
   \fi
   % warn if some weights are not embedded, and if necessaty
-  \ifpxcz at warn@unless at all@embedded \ifpxcz at noembed@used
+  \ifx\pxcz at warn@unless at all@embedded at for\@empty\else
+      \ifpxcz at noembed@used
+    \def\do##1{\MessageBreak - ##1}%
     \PackageWarningNoLine\pxcz at pkgname
      {Some font weights have no-embed setting.\MessageBreak
-      So some features of pxchfon might not work\MessageBreak
-      properly when applied to such weights}%
+      So some features of pxchfon (listed below)\MessageBreak
+      might not work properly when applied to\MessageBreak
+      such weights.%
+      \pxcz at warn@unless at all@embedded at for
+      \expandafter\@gobble}% gobble the period
   \fi\fi
   %
   \pxcz at check@extra
@@ -1868,7 +1849,7 @@
   \ifpxcz at enabled
     \pxcz at set@page at hook{\pxcz at spec}%
   \else\ifx\pxcz at spec\@empty\else
-    \PackageWarningNoLine\pxcz at pkgname
+    \pxcz at PackageNoteNoLine\pxcz at pkgname
      {Font mapping is disabled, since the driver in use\MessageBreak
       is not dvipdfmx}%
   \fi\fi
@@ -2090,7 +2071,7 @@
 \ifpxcz at autojfmsync %---- <*autojfmsync>
 % Makes \git/\CID/\UTF do automatically jfmsync
 \let\pxcz at gid@jfm at sync\pxcz at jfm@sync
-\AtBeginDocument{%
+\g at addto@macro\pxcz at first@doc at hook{%
   \ifx\put at character\@undefined\else
     \g at addto@macro\put at character{\pxcz at jfm@sync}%
   \fi

Modified: trunk/Master/texmf-dist/tex/platex/pxchfon/pxchfon0.def
===================================================================
--- trunk/Master/texmf-dist/tex/platex/pxchfon/pxchfon0.def	2024-08-23 20:58:08 UTC (rev 72089)
+++ trunk/Master/texmf-dist/tex/platex/pxchfon/pxchfon0.def	2024-08-23 20:58:28 UTC (rev 72090)
@@ -1,4 +1,235 @@
-% pxchfon0.def
-% This file does nothing; it exists for check for full installation.
-\relax
-% EOF
+%%
+%% This is file 'pxchfon0.def'.
+%%
+%% Copyright (c) 2009-2024 Takayuki YATO (aka. "ZR")
+%%   GitHub:   https://github.com/zr-tex8r
+%%   Twitter:  @zr_tex8r
+%%
+%% This package is distributed under the MIT License.
+%%
+
+%% package declaration
+\NeedsTeXFormat{pLaTeX2e}
+\ProvidesFile{pxchfon0.def}[2024/08/22 v2.2]
+\providecommand{\bxDebug}[1]{}
+
+%--------------------------------------- general
+
+%% variables
+\newif\ifpxcz at textcomp
+
+%--------------------------------------- 'alphabet' option
+\ifpxcz at alphafont
+
+%% check for textcomp
+\ifx\DeclareEncodingSubset\@undefined\else
+  \expandafter\ifx\csname T at TS1\endcsname\relax\else
+    \pxcz at textcomptrue
+\fi\fi
+
+%% \pxcz at afont@enc at list
+\def\pxcz at afont@enc at list{OT1,T1}
+\ifpxcz at textcomp \g at addto@macro\pxcz at afont@enc at list{,TS1}\fi
+%% \pxcz at decl@family{<fam>}
+\pxcz at onlypreamble@def\pxcz at decl@family#1{%
+  \ifpxcz at textcomp \DeclareEncodingSubset{TS1}{#1}{3}\fi
+  \@for\pxcz at x:=\pxcz at afont@enc at list\do{%
+    \DeclareFontFamily{\pxcz at x}{#1}{}}}
+%% \pxcz at decl@shape{<fam>}{<ser>}<sw>{<font>}
+\pxcz at onlypreamble@def\pxcz at decl@shape#1#2#3#4{%
+  \if s#3%
+    \@for\pxcz at x:=\pxcz at afont@enc at list\do{%
+      \DeclareFontShape{\pxcz at x}{#1}{#2}{n}{<->ssub*#4}{}}%
+  \else
+    \DeclareFontShape{OT1}{#1}{#2}{n}{<->#4-l5j}{}%
+    \DeclareFontShape {T1}{#1}{#2}{n}{<->#4-t1}{}%
+    \ifpxcz at textcomp
+      \DeclareFontShape{TS1}{#1}{#2}{n}{<->#4-ts1}{}%
+    \fi
+  \fi
+  \@for\pxcz at x:=\pxcz at afont@enc at list\do{%
+    \DeclareFontShape{\pxcz at x}{#1}{#2}{it}{<->ssub*#1/#2/n}{}%
+    \DeclareFontShape{\pxcz at x}{#1}{#2}{sl}{<->ssub*#1/#2/n}{}}}
+
+\if d\pxcz at otf@weight  %---- <*otfdx> : otf with deluxe option
+  % define families cfjar & cfjas
+\pxcz at decl@family{cfjar}%
+\pxcz at decl@shape{cfjar}{l}n{cfjar-l}%
+\pxcz at decl@shape{cfjar}{m}n{cfjar-r}%
+\pxcz at decl@shape{cfjar}{bx}n{cfjar-b}%
+\pxcz at decl@family{cfjas}%
+\pxcz at decl@shape{cfjas}{m}n{cfjas-r}%
+\pxcz at decl@shape{cfjas}{bx}n{cfjas-b}%
+\pxcz at decl@shape{cfjas}{eb}n{cfjas-x}%
+\pxcz at decl@family{cfjam}%
+\pxcz at decl@shape{cfjam}{m}n{cfjam-r}%
+  % redefine \ltseries & \ebseries so they affect roman font
+\let\ltseries\relax \let\ebseries\relax
+\DeclareRobustCommand\ltseries{%
+  \not at math@alphabet\ltseries\relax
+  \fontseries\ltdefault\selectfont}%
+\DeclareRobustCommand\ebseries{%
+  \not at math@alphabet\ebseries\relax
+  \fontseries\ebdefault\selectfont}%
+\else               %---- <*!otfdx>
+\pxcz at decl@family{cfjar}%
+\pxcz at decl@shape{cfjar}{m}n{cfjar-r}%
+\pxcz at decl@shape{cfjar}{bx}s{cfjas/m/n}%
+\pxcz at decl@family{cfjas}%
+\pxcz at decl@shape{cfjas}{m}n{cfjas-r}%
+\pxcz at decl@shape{cfjas}{bx}s{cfjas/m/n}%
+\pxcz at onlypreamble@def\pxcz at err@dxotf#1{%
+  \PackageError\pxcz at pkgname
+   {Loaded before '#1' with 'deluxe'}%
+   {This package must be loaded after '#1' with 'deluxe' option
+    when using both.}}
+\g at addto@macro\pxcz at check@extra{%
+  \expandafter\let\expandafter\pxcz at x\csname pxcz at FS/mnr\endcsname
+  \ifx\pxcz at x\@empty\else
+    % if mnr is replaced but gtr is not then ...
+    \expandafter\ifx\csname pxcz at FS/gtr\endcsname\@empty
+      {\expandafter\let\csname pxcz at FS/gtr\endcsname\pxcz at x
+        \pxcz at Entry{gtr}{r-cfjas-r- at PXcjk0@}{unicode}{HWid}}%
+  \fi\fi
+  \@ifpackagewith{otf}{deluxe}{\pxcz at err@dxotf{otf}}{}%
+}
+\fi                 %---- </otfdx>
+
+\fi
+%--------------------------------------- begin-document hook
+\ifpxcz at alphafont
+
+%% variables
+\let\pxcz at afont@enc\relax
+
+%% \pxcz at mgfamily@hook
+\def\pxcz at mgfamily@hook{\romanfamily{cfjam}}
+
+%% \pxcz at decl@relfont{<fam>}{<afam>}{<ser>,...}
+\pxcz at onlypreamble@def\pxcz at decl@relfont#1#2#3{%
+  \@for\pxcz at x:={#3}\do{%
+    \expandafter\ifx\csname\k at encoding/#1/\pxcz at x/n\endcsname\relax\else
+      \edef\pxcz at tmpa{\noexpand\DeclareRelationFont
+        {\k at encoding}{#1}{\pxcz at x}{}{\pxcz at afont@enc}{#2}{\pxcz at x}{}%
+      }\pxcz at tmpa
+    \fi}%
+  \PackageInfo\pxcz at pkgname
+   {Relation font set for \k at encoding/#1}}
+
+%% \pxcz at check@afont at enc
+\pxcz at onlypreamble@def\pxcz at check@afont at enc{%
+  \pxcz at oktrue % OT1 is always okay
+  \expandafter\ifx\csname\pxcz at afont@enc+cfjar\endcsname\relax
+    \pxcz at okfalse \fi
+  % if not okay, use OT1 instead
+  \ifpxcz at ok\else \def\pxcz at afont@enc{OT1}\fi}
+
+%% \pxcz at set@bfdefault at to@bx{<doc-ser>}
+\pxcz at onlypreamble@let\pxcz at set@bfdefault at to@bx\@gobble
+\ifx\DeclareFontSeriesDefault\@undefined\else
+  \def\pxcz at set@bfdefault at to@bx#1{%
+    \DeclareFontSeriesDefault[#1]{bf}{bx}}
+\fi
+
+%% \pxcz at setup@alphabet
+\pxcz at onlypreamble@def\pxcz at setup@alphabet{%
+  \pxcz at check@alldefined{mnl,mnr,mnb}\ifpxcz at ok
+    \renewcommand\rmdefault{cfjar}%
+    \pxcz at set@bfdefault at to@bx{rm}%
+  \fi
+  \pxcz at check@alldefined{gtr,gtb,gtx}\ifpxcz at ok
+    \renewcommand\sfdefault{cfjas}%
+    \pxcz at set@bfdefault at to@bx{sf}%
+  \fi
+  % attach hook to \mgfamily if mgr font is defined
+  \pxcz at check@alldefined{mgr}\ifpxcz at ok\if d\pxcz at otf@weight
+    \begingroup
+      \def\pxcz at x##1{\toks@\expandafter{##1}%
+        \xdef##1{\noexpand\pxcz at mgfamily@hook\the\toks@}%
+      }\expandafter\pxcz at x\csname mgfamily \endcsname
+    \endgroup
+  \fi\fi
+  % decide alphabet font encoding
+  \edef\pxcz at afont@enc{\encodingdefault}%
+  \pxcz at check@afont at enc\ifpxcz at ok\else
+    \PackageWarningNoLine\pxcz at pkgname
+     {Default encoding is changed to 'OT1' because%
+      \MessageBreak'alphabet' option is in effect}%
+    \renewcommand\encodingdefault{OT1}%
+  \fi
+  \normalfont
+}
+
+%% \pxcz at setup@relfont
+\pxcz at onlypreamble@def\pxcz at setup@relfont{%
+  \edef\pxcz at afont@enc{\encodingdefault}%
+  \pxcz at check@afont at enc
+  \pxcz at check@alldefined{mnl,mnr,mnb}%
+  \ifpxcz at ok \pxcz at decl@relfont\mcdefault{cfjar}{m,bx,l}\fi
+  \pxcz at check@alldefined{gtr,gtb,gtx}%
+  \ifpxcz at ok \pxcz at decl@relfont\gtdefault{cfjas}{m,bx,eb}\fi
+  \pxcz at check@alldefined{mgr}%
+  \ifpxcz at ok\if d\pxcz at otf@weight
+    \pxcz at decl@relfont\mgdefault{cfjam}{m}%
+  \fi\fi
+}
+
+\fi
+%--------------------------------------- 'usefontmaplines'
+
+%%<*> \begin{usefontmaplines}
+% <map-line>
+% ...
+% \end{usefontmaplines}
+\@onlypreamble\usefontmaplines
+\newenvironment{usefontmaplines}{%
+  \catcode`\{=12 \catcode`\}=12 \catcode`\&=12 \catcode`\#=12
+  \catcode`\^=12 \catcode`\~=12 \catcode`\%=12 \catcode13=12
+  \catcode32=10 \endlinechar=13
+  \let\pxcz at tmp@end\end \let\begin\relax \let\end\relax
+  \let\par\@empty \let\ \space \def\pxcz at tmp@end@{\end}%
+  \pxcz at maplines@a
+}{}
+\@onlypreamble\pxcz at maplines@a
+\long\def\pxcz at maplines@a#1{%
+  \def\pxcz at tmpa{#1}\pxcz at cond\ifx\pxcz at tmpa\pxcz at tmp@end@\fi{%
+    \catcode`\{=1 \catcode`\}=2
+    \pxcz at tmp@end
+  }{%else
+    \pxcz at maplines@b#1%
+  }%
+}
+\@onlypreamble\pxcz at maplines@b
+\begingroup \catcode13=12
+\long\gdef\pxcz at maplines@b#1^^M{%
+  \pxcz at maplines@line#1\pxcz at mk%
+  \pxcz at maplines@a%
+}%
+\endgroup
+\@onlypreamble\pxcz at maplines@line
+\long\def\pxcz at maplines@line#1\pxcz at mk{%
+  \edef\pxcz at tmpa{#1}%
+  \pxcz at split{\@percentchar}{\pxcz at tmpa}%
+  \ifx\pxcz at pre\relax\else \let\pxcz at tmpa\pxcz at pre \fi
+  \pxcz at split{\end}{\pxcz at tmpa}%
+  \ifx\pxcz at pre\relax
+    \pxcz at split{\space\pxcz at mk}{\pxcz at tmpa\pxcz at mk}%
+    \ifx\pxcz at pre\relax\else \let\pxcz at tmpa\pxcz at pre \fi
+    \ifx\pxcz at tmpa\@empty\else
+      \expandafter\usefontmapline\expandafter{\pxcz at tmpa}%
+    \fi
+  \else % '\end' found inside the line
+    \pxcz at maplines@err
+  \fi
+}
+\pxcz at onlypreamble@def\pxcz at maplines@err{%
+  \PackageError\pxcz at pkgname
+   {'\string\end{usefontmaplines}' must be put at the top\MessageBreak
+    of a line}%
+   {\@ehc}%
+  \def\pxcz at maplines@a{\pxcz at tmp@end{usefontmaplines}}%
+}
+
+%--------------------------------------- all done
+\endinput
+%% EOF



More information about the tex-live-commits mailing list.