texlive[72031] Master/texmf-dist: pxjahyper (14aug24)

commits+karl at tug.org commits+karl at tug.org
Wed Aug 14 21:47:54 CEST 2024


Revision: 72031
          https://tug.org/svn/texlive?view=revision&revision=72031
Author:   karl
Date:     2024-08-14 21:47:54 +0200 (Wed, 14 Aug 2024)
Log Message:
-----------
pxjahyper (14aug24)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/platex/pxjahyper/LICENSE
    trunk/Master/texmf-dist/doc/platex/pxjahyper/README-ja.md
    trunk/Master/texmf-dist/doc/platex/pxjahyper/README.md
    trunk/Master/texmf-dist/doc/platex/pxjahyper/pxjahyper.pdf
    trunk/Master/texmf-dist/doc/platex/pxjahyper/pxjahyper.tex
    trunk/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper-ajm.def
    trunk/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper-enc.sty
    trunk/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper-uni.def
    trunk/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper.sty

Modified: trunk/Master/texmf-dist/doc/platex/pxjahyper/LICENSE
===================================================================
--- trunk/Master/texmf-dist/doc/platex/pxjahyper/LICENSE	2024-08-14 19:47:44 UTC (rev 72030)
+++ trunk/Master/texmf-dist/doc/platex/pxjahyper/LICENSE	2024-08-14 19:47:54 UTC (rev 72031)
@@ -1,6 +1,6 @@
 The MIT License
 
-Copyright (c) 2012-2023 Takayuki YATO (aka. "ZR")
+Copyright (c) 2012-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/pxjahyper/README-ja.md
===================================================================
--- trunk/Master/texmf-dist/doc/platex/pxjahyper/README-ja.md	2024-08-14 19:47:44 UTC (rev 72030)
+++ trunk/Master/texmf-dist/doc/platex/pxjahyper/README-ja.md	2024-08-14 19:47:54 UTC (rev 72031)
@@ -73,6 +73,14 @@
 更新履歴
 --------
 
+  * Version 1.4  〈2024/08/14〉
+      - 設定キー `fallback-warn` を追加。
+      - 設定キー `fallback-cidm` を追加。
+      - `force-unicode` オプションを非推奨とし、警告を出す。
+      - 開発者用命令 `\pxjahyperBadCharacter` を追加。
+      - オプション `autodvidriver`、`fallback-geta`、`fallback-delete`
+        を非推奨にする。
+
   * Version 1.3  〈2023/03/01〉
       - “pTeX + hyperref unicode モード”を正式にサポートする。これに
         伴い、unicode モードに関する警告を削除。

Modified: trunk/Master/texmf-dist/doc/platex/pxjahyper/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/platex/pxjahyper/README.md	2024-08-14 19:47:44 UTC (rev 72030)
+++ trunk/Master/texmf-dist/doc/platex/pxjahyper/README.md	2024-08-14 19:47:54 UTC (rev 72031)
@@ -52,6 +52,7 @@
 Revision History
 ----------------
 
+  * Version 1.4  〈2024/08/14〉
   * Version 1.3  〈2023/03/01〉
   * Version 1.2a 〈2022/10/19〉
   * Version 1.2  〈2022/05/27〉

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

Modified: trunk/Master/texmf-dist/doc/platex/pxjahyper/pxjahyper.tex
===================================================================
--- trunk/Master/texmf-dist/doc/platex/pxjahyper/pxjahyper.tex	2024-08-14 19:47:44 UTC (rev 72030)
+++ trunk/Master/texmf-dist/doc/platex/pxjahyper/pxjahyper.tex	2024-08-14 19:47:54 UTC (rev 72031)
@@ -17,8 +17,8 @@
 \usepackage{shortvrb}
 \MakeShortVerb{\|}
 \usepackage[verb]{bxghost}
-\newcommand{\PkgVersion}{1.3}
-\newcommand{\PkgDate}{2023/03/01}
+\newcommand{\PkgVersion}{1.4}
+\newcommand{\PkgDate}{2024/08/14}
 \newcommand{\Pkg}[1]{\textsf{#1}}
 \newcommand{\Meta}[1]{$\langle$\mbox{}#1\mbox{}$\rangle$}
 \newcommand{\Note}{\par\noindent ※}
@@ -37,7 +37,14 @@
 
 (u){\pLaTeX} + hyperref + dvipdfmxの組み合わせで
 日本語を含む\Strong{PDF文字列}%
-(“しおり”などの文書情報の文字列)
+(“しおり”などの文書情報の文字列
+\footnote{例えば、|\hypersetup|の|pdftitle|キーに指定する文字列は
+  「PDF文字列」の一種である。
+  また、|\section|命令の引数のテキストは
+  「{\TeX}で組版する版面出力」と「PDF文字列」
+  の両方に使われる。
+  後者のような箇所で「{\TeX}の版面出力」と「PDF文字列」を
+  別に指定したい場合は|\texorpdfstring|という命令が利用できる。})
 をもつPDF文書を作成する場合に必要となる機能を提供する。
 \begin{itemize}
 \item dvipdfmx用の「tounicode special」について、
@@ -69,6 +76,17 @@
 \usepackage[オプション,...]{pxjahyper}
 \end{verbatim}\end{quote}
 
+\paragraph{plautopatchとの関係}
+\Pkg{plautopatch}パッケージが事前に読み込まれている場合は、
+\Pkg{hyperref}が読み込まれるとその直後に自動的に\Pkg{pxjahyper}が
+オプション無しで読み込まれる。
+もし何らかのオプションを指定したい場合は、
+\Pkg{hyperref}の読込より前に|\PassOptionsToPackage|で
+オプションを指定する必要がある。
+\begin{quote}\small\begin{verbatim}
+\PassOptionsToPackage[nopapersize]{pxjahyper}
+\end{verbatim}\end{quote}
+
 \paragraph{使用可能なオプション}\mbox{}
 \begin{itemize}
 \item \Strong{設定キー記述}\Means
@@ -80,17 +98,24 @@
 \end{verbatim}\end{quote}
   と指定すると、表現不能文字を代替するゲタ文字が出力されなくなる。
 \item \Strong{ドライバオプション}\Means
-  |dvipdfmx|、|dvips|、および|nodvidriver|%
-  (ドライバ依存動作の無効化を明示的に指示、
-  現状ではほとんどの動作が無効になる)
-  が指定できる。
-  \Note 1.0版において|nodvidriver|の非推奨の別名の|none|は
-    \Strong{廃止}された。
-  %(0.5版から非推奨だった。)
-\item |resetdvidriver|(既定)\Means
-  ドライバオプションを\Pkg{hyperref}のドライバ指定から自動的に判定する。
-  \Note 1.1版において名前を|auto|から|resetdvidriver|に変更した。
-    旧名の|auto|は\Strong{非推奨}とする。
+  以下の値が指定できる。
+  \begin{itemize}
+  \item |dvipdfmx|
+  \item |dvips|
+  \item |resetdvidriver|(既定)\Means
+    \Pkg{hyperref}のドライバ指定から自動的に判定する。
+    \Note 1.1版において名前を|auto|から|resetdvidriver|に変更した。
+      旧名の|auto|%
+      \footnote{1.0版では|autodvidriver|としていたが、
+        この旧名も\Strong{非推奨}とする。}%
+      は\Strong{非推奨}とする。
+  \item |nodvidriver|\Means
+    ドライバ依存動作の無効化を明示的に指示する。
+    ほとんどの動作が無効になる。
+    \footnote{1.0版において|nodvidriver|の非推奨の別名の|none|は
+      \Strong{廃止}された。}
+    %(0.5版から非推奨だった。)
+  \end{itemize}
 \item |tounicode|(既定)\Means
   以下の2つの設定を行う。
   \begin{enumerate}
@@ -123,7 +148,8 @@
 
 \paragraph{上級者向けオプション}\mbox{}
 \begin{itemize}
-\item |otfmacros|(既定)\Means
+\item |otfmacros|(既定
+  \footnote{0.6版より既定を|otfmacros|に変更した。})\Means
   \Pkg{japanese-otf}付属の\Pkg{ajmacros}パッケージが提供する
   文字入力命令(|\ajMaru|、|\ajLig|等)をPDF文字列中で
   “可能な限り”使えるようにする。
@@ -131,7 +157,6 @@
   \Note |otfmacros|を有効にする場合は|otfcid|も有効にする必要がある。
 \item |nootfmacros|\Means
   |otfmacros|の否定。
-  \Note 0.6版より既定を|otfmacros|に変更した。
 \item |otfutf|(既定)\Means
   \Pkg{japanese-otf}パッケージの|\UTF|命令をPDF文字列中で
   使えるようにする。
@@ -151,17 +176,28 @@
   \Note 詳細は\ref{ssec:disablecmds}節を参照。
 \item |nodisablecmds|\Means
   |disablecmds|の否定。
-\item |bigcode|(既定)\Means
+\item |charcmds|(既定)\Means
+  {\LaTeX}標準の文字命令をPDF文字列中で使えるようにする。
+\item |nocharcmds|\Means
+  |charcmds|の否定。
+\item |bigcode|(既定
+  \footnote{0.3a版より既定を|bigcode|に変更した。})\Means
   {\upTeX}でのToUnicode CMapとしてUTF8-UTF16を用いる。
   %(当該のファイルが存在する必要がある。)
 \item |nobigcode|\Means
   |bigcode|の否定。
   {\upTeX}でのToUnicode CMapとしてUTF8-UCS2を用いる。
-  \Note 0.3a版より既定を|bigcode|に変更した。
-\item |force-unicode|\Means
+\item |jacommentline|(既定)\Means
+  \Pkg{hyperref}が出力する|.out|ファイルの先頭に日本語の文字を含む
+  コメント行を出力する。
+  \Note {\pTeX}系エンジンの「入力漢字コード自動判定」に対する対策。
+\item |jacommentline|\Means
+  |jacommentline|の否定。
+  \Note 不具合が発生したときのために無効化できるようにしている。
+\item |force-unicode|(1.4版で\Strong{非推奨})\Means
   このオプションは何もしない。
-  \Note {\pLaTeX}での“unicodeモード”が正式にサポートされたため
-  このオプションは不要になった。
+  \footnote{{\pLaTeX}での“unicodeモード”が正式にサポートされたため
+    このオプションは不要になった。}
 \end{itemize}
 
 %===========================================================
@@ -185,6 +221,9 @@
 \begin{itemize}
 \item |fallback=|\Meta{値}\Means
   PDF文字列中で表現不能な文字についての代替出力の方法を指定する。
+  \footnote{1.1版ではパッケージオプション
+    (|fallback-geta|/|fallback-delete|)
+    として提供していたが、この方式は\Strong{非推奨}とする。}
   \begin{itemize}
   \item |geta|(既定)\Means
     表現不能な文字をゲタ記号(〓)に置き換える。
@@ -193,6 +232,20 @@
   \end{itemize}
   \Note 以下、パッケージ動作の解説中で「ゲタ記号を出力」と
     ある場合は実際にはこの設定に従う。
+\item |fallback-warn=|\Meta{真偽値}%
+  \footnote{真偽値は|true|/|false|で指定する。}\Means
+  PDF文字列中の表現不能な文字について「ゲタ記号を出力」する際に
+  警告を出すか。
+  既定値は真。
+\item |fallback-cidm=|\Meta{真偽値}\Means
+  \Pkg{japanese-otf}パッケージのAJ1\Strong{以外}のCID入力命令
+  (|\CIDC|・|\CIDK|・|\CIDT|)
+  について、PDF文字列中で「ゲタ記号を出力」する動作に置き換えるか。
+  既定値は真。
+  \Note これらの命令をサポートするような(本パッケージとは別の)
+  何らかの機能を利用する場合には偽に設定する必要があるかもしれない。
+  \footnote{ただし、本パッケージによる再定義は“優先度を下げて”いる
+    ので、設定が不要である場合もある。}
 \end{itemize}
 
 %-------------------
@@ -218,14 +271,15 @@
   \begin{itemize}
   \item |out2uni|または|convbkmk|が有効の
   場合は、エスケープ表記(|\0xUUUU|)を出力する。
-  \item エンジンが{\upLaTeX}の場合、あるいは“unicodeモード”
+  \item エンジンが{\upLaTeX}の場合、
+  あるいは\Pkg{hyperref}の“unicodeモード”
   (\ref{sec:Unicode-mode}節)が有効の場合は、
   当該のUnicode文字自体を書いたのと同等になる。
   \item 上記以外で、{\TeX} Live 2022以降の{\pLaTeX}の場合
   \footnote{正確にいうと、|\Uchar|と|\ucs|プリミティブをもつ
     {\TLe-(u)\pTeX}エンジンである場合。}%
-  は、当該のUnicode文字に対応するJIS符号系の文字を書いたのと同等になる。
-  JIS符号系にない文字の場合は出力できないので警告を出しだ上で
+  は、当該のUnicode文字に“対応”するJIS符号系の文字を書いたのと同等になる。
+  “対応”する文字がない場合は出力できないので
   ゲタ記号を出力する。
   \end{itemize}
   \item どの条件にも当てはまらない場合は、|\Ux|は無効になる
@@ -249,7 +303,7 @@
     |\UTF|もゲタ記号になる。}%
   になる。
 \item それ以外の場合は、
-  常に(警告を出した上で)ゲタ記号を出力する。
+  常にゲタ記号を出力する。
 \end{itemize}
 
 \Note |\UTF|命令の多言語版、
@@ -266,7 +320,7 @@
 \begin{itemize}
 \item 当該のAJ1のグリフに“対応”する\textbf{単独の}Unicode文字が
   あればそれを出力し、なければ
-  (警告を出した上で)ゲタ記号を出力する。
+  ゲタ記号を出力する。
   \footnote{旧版では削除していたが、他の同様の場合と合わせるため
     1.0版よりゲタ記号を出力する仕様を変更した。}
   \Note 例えば、|\CID{8226}|(ローマ数字12)はUnicode文字の
@@ -275,14 +329,17 @@
   単独のUnicode文字がないので、ゲタ記号に置き換えられる。
 \item ただし|\Ux|命令(\ref{ssec:ux-command}節参照)が
   無効になる場合は、そもそもUnicode文字も出力できないため、
-  常に(警告を出した上で)ゲタ記号を出力する。
-  結局情報は欠落するが、それでも未定義動作(エラーになりえる)
+  常にゲタ記号を出力する。
+  結局情報は欠落するが、それでも未定義動作(エラーになる可能性もある)
   よりは好ましいであろう。
 \end{itemize}
 
+|\CID|命令の多言語版、
+すなわち|\CIDC|・|\CIDK|・|\CIDT|命令についてはサポートされないので、
+常にゲタ記号を出力する。
+
 \Note |otfcid|の利用には、エンジンの{\eTeX}拡張および
 \Pkg{etoolbox}と\Pkg{bxjatoucs}パッケージが必要。
-\Note |\CID|命令の多言語版はサポートされない。
 
 \paragraph{ajmacrosパッケージの命令}
 本パッケージで|otfmacros|オプションを有効にした場合は、

Modified: trunk/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper-ajm.def
===================================================================
--- trunk/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper-ajm.def	2024-08-14 19:47:44 UTC (rev 72030)
+++ trunk/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper-ajm.def	2024-08-14 19:47:54 UTC (rev 72031)
@@ -1,7 +1,7 @@
 %%
 %% This is file 'pxjahyper-ajm.def'.
 %% 
-%% Copyright (c) 2012-2023 Takayuki YATO (aka. "ZR")
+%% Copyright (c) 2012-2024 Takayuki YATO (aka. "ZR")
 %%   GitHub:   https://github.com/zr-tex8r
 %%   Twitter:  @zr_tex8r
 %%
@@ -11,7 +11,7 @@
 
 %% package declaration
 \NeedsTeXFormat{pLaTeX2e}
-\ProvidesFile{pxjahyper-ajm.def}[2023/03/01 v1.3]
+\ProvidesFile{pxjahyper-ajm.def}[2024/08/14 v1.4]
 
 %% avoid multiple loading
 \csname pxjahyperajmLoaded\endcsname

Modified: trunk/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper-enc.sty
===================================================================
--- trunk/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper-enc.sty	2024-08-14 19:47:44 UTC (rev 72030)
+++ trunk/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper-enc.sty	2024-08-14 19:47:54 UTC (rev 72031)
@@ -1,7 +1,7 @@
 %%
 %% This is file 'pxjahyper-enc.sty'.
 %%
-%% Copyright (c) 2012-2023 Takayuki YATO (aka. "ZR")
+%% Copyright (c) 2012-2024 Takayuki YATO (aka. "ZR")
 %%   GitHub:   https://github.com/zr-tex8r
 %%   Twitter:  @zr_tex8r
 %%
@@ -10,7 +10,7 @@
 
 %% package declaration
 \NeedsTeXFormat{pLaTeX2e}
-\ProvidesPackage{pxjahyper-enc}[2023/03/01 v1.3]
+\ProvidesPackage{pxjahyper-enc}[2024/08/14 v1.4]
 \def\pxhe at pkgname{pxjahyper-enc}
 \providecommand{\bxDebug}[1]{}
 

Modified: trunk/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper-uni.def
===================================================================
--- trunk/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper-uni.def	2024-08-14 19:47:44 UTC (rev 72030)
+++ trunk/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper-uni.def	2024-08-14 19:47:54 UTC (rev 72031)
@@ -1,7 +1,7 @@
 %%
 %% This is file 'pxjahyper-uni.def'.
 %% 
-%% Copyright (c) 2012-2023 Takayuki YATO (aka. "ZR")
+%% Copyright (c) 2012-2024 Takayuki YATO (aka. "ZR")
 %%   GitHub:   https://github.com/zr-tex8r
 %%   Twitter:  @zr_tex8r
 %%
@@ -10,7 +10,7 @@
 
 %% package declaration
 \NeedsTeXFormat{pLaTeX2e}
-\ProvidesFile{pxjahyper-uni.def}[2023/03/01 v1.3]
+\ProvidesFile{pxjahyper-uni.def}[2024/08/14 v1.4]
 \providecommand{\bxDebug}[1]{}
 
 %--------------------------------------- environment check

Modified: trunk/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper.sty
===================================================================
--- trunk/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper.sty	2024-08-14 19:47:44 UTC (rev 72030)
+++ trunk/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper.sty	2024-08-14 19:47:54 UTC (rev 72031)
@@ -1,7 +1,7 @@
 %%
 %% This is file 'pxjahyper.sty'.
 %%
-%% Copyright (c) 2012-2023 Takayuki YATO (aka. "ZR")
+%% Copyright (c) 2012-2024 Takayuki YATO (aka. "ZR")
 %%   GitHub:   https://github.com/zr-tex8r
 %%   Twitter:  @zr_tex8r
 %%
@@ -10,7 +10,7 @@
 
 %% package declaration
 \NeedsTeXFormat{pLaTeX2e}
-\ProvidesPackage{pxjahyper}[2023/03/01 v1.3]
+\ProvidesPackage{pxjahyper}[2024/08/14 v1.4]
 \def\pxhy at pkgname{pxjahyper}
 \providecommand{\bxDebug}[1]{}
 
@@ -51,9 +51,12 @@
 \newif\ifpxhy at otfmacros
 \newif\ifpxhy at Uchar@avail
 \newif\ifpxhy at ucs@avail
+\newif\ifpxhy at toucs@avail
 \let\pxhy at jsclasses@name\relax
 \newif\ifpxhy at jlreq@cls
 \newif\ifpxhy at fallback@geta
+\newif\ifpxhy at fallback@warn
+\newif\ifpxhy at fallback@cidm
 \newif\ifpxhy at extjis@map
 \newif\ifpxhy at extjis@use
 \newif\ifpxhy at ajhankaku@chars
@@ -91,7 +94,7 @@
 \DeclareOption{resetdvidriver}{%
   \let\pxhy at driver\@undefined
 }
-\DeclareOption{autodvidriver}{%
+\DeclareOption{autodvidriver}{% DEPRECATED
   \let\pxhy at driver\@undefined
 }
 \DeclareOption{auto}{% DEPRECATED
@@ -171,14 +174,15 @@
 \DeclareOption{nootfmacros}{%
   \pxhy at otfmacrosfalse
 }
-\DeclareOption{fallback-geta}{%
+\DeclareOption{fallback-geta}{% DEPRECATED
   \pxjahypersetup{fallback=geta}%
 }
-\DeclareOption{fallback-delete}{%
+\DeclareOption{fallback-delete}{% DEPRECATED
   \pxjahypersetup{fallback=delete}%
 }
-\DeclareOption{force-unicode}{%
-  \let\pxhy at force@unicode=t
+\DeclareOption{force-unicode}{% DEPRECATED
+  \PackageWarningNoLine\pxhy at pkgname
+   {'force-unicode' is DEPRECATED and ignored}%
 }
 \DeclareOption{disable-Ux}{% for debug
   \let\pxhy at disable@Ux=t
@@ -194,6 +198,16 @@
 }
 \let\pxhy at kv@fallback@@geta\pxhy at fallback@getatrue
 \let\pxhy at kv@fallback@@delete\pxhy at fallback@getafalse
+% 'fallback-warn=<bool>'
+\pxhy at fallback@warntrue
+\define at key{\pxhy at pkgname}{fallback-warn}[true]{%
+  \pxhy at handle@key{fallback-warn}{#1}{fallback at warn#1}%
+}
+% 'fallback-cidm=<bool>'
+\pxhy at fallback@cidmtrue
+\define at key{\pxhy at pkgname}{fallback-cidm}[true]{%
+  \pxhy at handle@key{fallback-cidm}{#1}{fallback at cidm#1}%
+}
 % 'extjis=<bool>'
 \pxhy at extjis@usetrue
 \define at key{\pxhy at pkgname}{extjis}[true]{%
@@ -289,6 +303,8 @@
 \pxhy at check\Uchar{\pxhy at Uchar@availtrue}
 %% pxhy at ucs@avail switch
 \pxhy at check\ucs{\pxhy at ucs@availtrue}
+%% pxhy at toucs@avail switch
+\pxhy at check\toucs{\pxhy at toucs@availtrue}
 
 %% pxhy at extjis@map switch
 % Note that 'tounicode' is necessary.
@@ -311,6 +327,8 @@
 \@ifl at t@r\fmtversion{2021/11/15}{%
   \chardef\pxhy at hook@system=2
 }{\@ifl at t@r\fmtversion{2020/02/02}{%
+  % NB. We need to support this intermediate version, because
+  % the hook order matters here.
   \chardef\pxhy at hook@system=1
 }{}}
 
@@ -328,13 +346,7 @@
   \pxhy at uniescapetrue
 \fi\fi
 
-% hyperref 'unicode' is allowed only on upLaTeX.
-\ifnum0\ifpxhy at hy@unicode\ifpxhy at uptex\else
-    \ifx t\pxhy at force@unicode\else1\fi\fi\fi>\z@
-%  \PackageWarningNoLine\pxhy at pkgname
-%   {The support for the hyperref 'unicode' mode\MessageBreak
-%    on the pTeX engine is currently experimental}%
-\fi
+% hyperref 'unicode' mode
 \ifpxhy at hy@unicode
   \pxhy at uniescapefalse
   %\pxhy at otfutftrue
@@ -429,8 +441,7 @@
 \fi
 
 %% \pxhy at geta : GETA MARK
-\pxhy at get@jchar{\jis"222E}
-\let\pxhy at geta\pxhy at jchar
+\pxhy at let@jchar at jc\pxhy at geta{222E}
 
 %% \pxhy at print@geta
 \def\pxhy at print@geta{%
@@ -472,6 +483,25 @@
   #1\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi
 }
 
+%% \pxhy at ifempty{<text>}{<true>}{<false>}
+\def\pxhy at ifempty#1{%
+  \pxhy at cond\ifx\pxhy at mt#1\pxhy at mt\fi
+}
+
+%% \pxhy at read@num{<text>}\CScont
+\def\pxhy at read@num#1{%
+  \expandafter\pxhy at read@num at a\number#1\pxhy at mk#1\pxhy at mk#1\pxhy at mk
+}
+\def\pxhy at read@num at a#1#2\pxhy at mk{%
+  \expandafter\pxhy at read@num at b\romannumeral\if-#1\else-\fi
+}
+\def\pxhy at read@num at b#1\pxhy at mk#2\pxhy at mk{%
+  \expandafter\pxhy at read@num at c\number\pxhy at ifempty{#1}{#2}{}\pxhy at mk
+}
+\def\pxhy at read@num at c#1\pxhy at mk#2{%
+  \pxhy at cond\ifnum#1<\z@\fi{#2{0}}{#2{#1}}%
+}
+
 %--------------------------------------- Helpers (e-TeX)
 \ifpxhy at etex
 
@@ -748,6 +778,47 @@
   \noexpand\pxhy at uchex@out{\pxhy at uc@REPL}%
 }
 
+%--------------------------------------- Unavailable characters
+
+%%<+> \pxjahyperBadCharacter{<label>}
+\newcommand*\pxjahyperBadCharacter[1]{%
+  \ifpxhy at fallback@warn
+    % issue a warning
+    \pxhy at bad@character at a{#1}%
+  \fi
+  \pxhy at print@geta
+}
+\def\pxhy at bad@character at a#1{%
+  % Here the control sequence with name <label> is supposed to be
+  % undefined. This token is intentionally left in the stream.
+  % Then this unknown token will be detected by the hyperref process
+  % and cause it to issue an warning
+  % "Token not allowed in a PDF string (... removing `\<label>'".
+  \expandafter\ifx\csname<#1>\endcsname\relax
+    \csname<#1>\endcsname
+  % If the token should be defined, it is replaced for safety.
+  \else \csname pxhy@<#1>\endcsname
+  \fi
+}
+
+%% \pxhy at fallback@num{<prefix>}<fast>{<number>}
+% Makes a bad character with label '<prefix><number>', after parsing
+% the given number input.
+\def\pxhy at fallback@num#1#2#3{%
+  \ifpxhy at fallback@warn
+    \if t#2%
+      \expandafter\pxhy at fallback@num at a\expandafter{\number#3}{#1}%
+    \else
+      \pxhy at read@num{#3}\pxhy at fallback@num at a{#1}%
+    \fi
+  \else
+    \pxjahyperBadCharacter{}%
+  \fi
+}
+\def\pxhy at fallback@num at a#1#2{%
+  \pxjahyperBadCharacter{#2#1}%
+}
+
 %--------------------------------------- Hooks to pdfstringdef
 
 %% variables
@@ -760,6 +831,7 @@
 \ifpxhy at hy@unicode              %<*unicode>
 
   %% \pxhy at Ux
+  % In hyperref "unicode" mode, \unichar is used.
   \def\pxhy at Ux{\pxhy at uchex}%
   \pxhy at utfXVIfalse
   \def\pxhy at uchex@out#1{%
@@ -770,6 +842,7 @@
   \ifpxhy at uptex
 
     %% \pxhy at Ux
+    % On upTeX with \Uchar, \Uchar is used.
     \def\pxhy at Ux{\pxhy at uchex}
     \pxhy at utfXVIfalse
     \def\pxhy at uchex@out#1{\Uchar"#1 }
@@ -777,6 +850,8 @@
   \else\ifpxhy at ucs@avail
 
     %% \pxhy at Ux
+    % On pTeX with \Uchar and \ucs, we convert the Unicode value to
+    % an internal-code value (using \ucs) and apply \Uchar to it.
     \def\pxhy at Ux{\pxhy at uchex}
     \pxhy at utfXVIfalse
     \def\pxhy at uchex@out#1{%
@@ -783,23 +858,23 @@
       \expandafter\pxhy at uchex@out at a\ucs"#1\pxhy at mk{#1}%
     }
     \chardef\pxhy at max@asc="7F
-    \def\pxhy at uchex@out at a#1\pxhy at mk#2{%
-      \ifnum#1<\z@
-        \ifnum"#2>\pxhy at max@asc
+    \def\pxhy at uchex@out at a#1\pxhy at mk#2{% #1:internal #2:Unicode
+      \ifnum#1<\z@ % not in internal (or JIS)
+        \ifnum"#2>\pxhy at max@asc % not ASCII
           \ifpxhy at extjis@use
+            % try special conversion
             \expandafter\pxhy at uchex@out at b\csname
                 pxhy at uc/\number"#2\endcsname{#2}%
           \else \pxhy at uchex@out at b\relax{#2}%
           \fi
-        \else \Uchar"#2
+        \else \Uchar"#2 % ASCII
         \fi
-      \else \Uchar#1
+      \else \Uchar#1 % in internal-code
       \fi
     }
-    \def\pxhy at uchex@out at b#1#2{%
-      \ifx#1\relax
-        \@nameuse{U+#2}%
-        \pxhy at print@geta
+    \def\pxhy at uchex@out at b#1#2{% #2:Unicode
+      \ifx#1\relax % not supported
+        \pxjahyperBadCharacter{U+#2}%
       \else #1%
       \fi
     }
@@ -808,6 +883,9 @@
 \else\ifpxhy at uptex              %<*upTeX>
 
   %% \pxhy at Ux
+  % On upTeX without \Uchar, we convert the Unicode value to a ja-char
+  % token using \pxhy at get@jchar, which is not fully expandable.
+  % So we need \pdfstringdefPostHook.
   \def\pxhy at Ux{\pxhy at uchex}%
   \pxhy at utfXVIfalse
 
@@ -912,7 +990,7 @@
 \fi
 
 %--------------------------------------- Fix for high-byte protection
-\ifpxhy at etex
+\ifpxhy at hy@unicode\else \ifpxhy at etex
 \begingroup
 % Check for high-byte protection.
 \catcode"EF=\active \catcode`\^=7
@@ -949,7 +1027,7 @@
 
 \fi
 \endgroup
-\fi
+\fi\fi
 %--------------------------------------- Support for 'otfutf'
 \ifpxhy at otfutf
 
@@ -960,8 +1038,7 @@
   \def\pxhy at UTF{\pxhy at uchex}
   \pxhy at utfXVIfalse
   \def\pxhy at uchex@out#1{%
-    \@nameuse{U+#1}% issue a warning
-    \pxhy at print@geta
+    \pxjahyperBadCharacter{U+#1}%
   }
 \else
   \let\pxhy at UTF\pxhy at Ux
@@ -999,26 +1076,22 @@
 
 %% \pxhy at CID{<cid>}
 \def\pxhy at CID#1{%
-  \expandafter\expandafter\expandafter\pxhy at cid@aux
-      \bxjaCidToUcsHex{#1}\pxhy at mk{\pxhy at xdetokenize{#1}}%
+  \pxhy at triexpandafter\pxhy at cid@aux\bxjaCidToUcsHex{#1}@f{#1}%
 }
 %% \pxhy at fast@CID{<cid>}
 \def\pxhy at fast@CID#1{%
-  \expandafter\expandafter\expandafter\pxhy at cid@aux
-      \bxjaFastCidToUcsHex{#1}\pxhy at mk{\number#1}%
+  \pxhy at triexpandafter\pxhy at cid@aux\bxjaFastCidToUcsHex{#1}@t{#1}%
 }
 \ifx\pxhy at Ux\@undefined
-  \def\pxhy at cid@aux#1\pxhy at mk#2{%
-    \@nameuse{CID+#2}% issue a warning
-    \pxhy at print@geta
+  \def\pxhy at cid@aux#1@#2#3{%
+    \pxhy at fallback@num{CID+}#2{#3}%
   }
 \else
-\def\pxhy at cid@aux#1\pxhy at mk#2{%
+\def\pxhy at cid@aux#1@#2#3{%
   \ifnum"#1>\z@
     \pxhy at Ux{#1}%
   \else
-    \@nameuse{CID+#2}%
-    \pxhy at print@geta
+    \pxhy at fallback@num{CID+}#2{#3}%
   \fi
 }
 \fi
@@ -1059,11 +1132,30 @@
   \fi
 }
 
+%% \pxhy at CIDC{<cid>} / \pxhy at CIDK{<cid>} / \pxhy at CIDT{<cid>}
+\def\pxhy at CIDC{\pxhy at fallback@num{CIDC+}f}
+\def\pxhy at CIDK{\pxhy at fallback@num{CIDK+}f}
+\def\pxhy at CIDT{\pxhy at fallback@num{CIDT+}f}
+
+%% \pxhy at dispatch@fallback at cidm
+\@onlypreamble\pxhy at dispatch@fallback at cidm
+\def\pxhy at dispatch@fallback at cidm{%
+  \global\let\pxhy at dispatch@fallback at cidm\relax
+  \ltx at GlobalPrependToMacro\pdfstringdefPreHook{%
+    \ifpxhy at fallback@cidm
+      \let\CIDC\pxhy at CIDC
+      \let\CIDK\pxhy at CIDK
+      \let\CIDT\pxhy at CIDT
+    \fi
+  }%
+}
+
 %% enable hooks
 \pxhy at hook@after at package{otf}{\pxhy at dispatch@otfcid}
 \ifpxhy at otfmacros
   \pxhy at hook@after at package{ajmacros}{\pxhy at dispatch@otfmacros}
 \fi
+\pxhy at hook@after at package{mlcid}{\pxhy at dispatch@fallback at cidm}
 
 \fi
 %--------------------------------------- Extended JIS mapping
@@ -1161,6 +1253,7 @@
 %%<+> \pxDeclarePdfTextCommand{\CS}{<jis>}{<ucs>}
 \@onlypreamble\pxDeclarePdfTextCommand
 \newcommand*\pxDeclarePdfTextCommand[3]{%
+  \pxhy at prepare@txtcmd#1%
   \pxhy at decl@pdf at tc{#2}{#3}%
    {\DeclareTextCommand{#1}{\pxhy at pdfenc}}%
    {\pxhy at revoke@pdf at tc{#1}}%
@@ -1169,6 +1262,7 @@
 %%<+> \pxDeclarePdfTextComposite{\CS}{<arg>}{<jis>}{<ucs>}
 \@onlypreamble\pxDeclarePdfTextComposite
 \newcommand*\pxDeclarePdfTextComposite[4]{%
+  \pxhy at prepare@txtcmd#1%
   \pxhy at decl@pdf at tc{#3}{#4}%
    {\DeclareTextCompositeCommand{#1}{\pxhy at pdfenc}{#2}}%
    {\pxhy at revoke@pdf at tcc{#1}{#2}}%
@@ -1202,8 +1296,8 @@
 %% \pxhy at decl@pdf at tc
 \@onlypreamble\pxhy at decl@pdf at tc
 \def\pxhy at decl@pdf at tc#1#2{%
-  \edef\pxhy at next{{#1}{\ifx\pxhy at mt#2\pxhy at mt FFFD\else#2\fi}}%
-  \expandafter\pxhy at get@body\pxhy at next
+  \edef\pxhy at next{{#1}{#2}}%
+  \uppercase\expandafter{\expandafter\pxhy at get@body\pxhy at next}%
   \ifx\pxhy at body\@undefined
     \let\pxhy at next\@secondoftwo
   \else
@@ -1217,21 +1311,60 @@
   #2{#1}%
 }
 
+%% \pxhy at prepare@txtcmd\CS
+% If \CS is defined and not an encoding-aware command,
+% let \[?\CS] be equivalent to \CS, so that doing
+% \DeclareTextCommand\CS... will keep the original meaning of \CS.
+\@onlypreamble\pxhy at prepare@txtcmd
+\def\pxhy at next#1#2\pxhy at end{%#1='\',#2='cmd'
+  \def\pxhy at prepare@txtcmd##1{%
+    \ifx##1\@undefined\else
+      \def\pxhy at tmpb{\pxhy at prepare@txtcmd at c##1}%
+      \expandafter\pxhy at prepare@txtcmd at a\meaning##1{}->#1 \pxhy at end
+    \fi
+  }%
+  \def\pxhy at prepare@txtcmd at a##1->#1##2 ##3\pxhy at end{%
+    \pxhy at prepare@txtcmd at b##2_{}-#2_\pxhy at end
+  }%
+  \def\pxhy at prepare@txtcmd at b##1-#2_##2\pxhy at end{%
+    % if not an encoding-aware command...
+    \ifx\pxhy at mt##2\pxhy at mt \pxhy at tmpb \fi
+  }%
+}\expandafter\pxhy at next\string\cmd\pxhy at end
+\def\pxhy at prepare@txtcmd at c#1{%
+  \expandafter\let\csname?\string#1\endcsname#1%
+}
+
 %% \pxhy at get@body{<jis>}{<ucs>}
 \@onlypreamble\pxhy at get@body
+\@onlypreamble\pxhy at get@body at a
+\def\pxhy at get@body#1#2{%
+  \edef\pxhy at next{%
+   {\ifx\pxhy at mt#1\pxhy at mt -1\else \jis"#1\fi}%
+   {\ifx\pxhy at mt#2\pxhy at mt
+      \ifx\pxhy at mt#1\pxhy at mt -1%
+      \else\ifpxhy at uptex \jis"#1%
+      \else\ifpxhy at toucs@avail \toucs\jis"#1%
+      \else -1\fi\fi\fi
+    \else \number"#2%
+    \fi}}%
+  \expandafter\pxhy at get@body at a\pxhy at next
+}
 \ifpxhy at uptex                   %<*upTeX>
-  \def\pxhy at get@body#1#2{%
-    \pxhy at get@jchar{\ucs"#2}%
+  \def\pxhy at get@body at a#1#2{%
+    \pxhy at get@jchar{\ifnum#2<\z@ "FFFD\else#2\fi}%
     \let\pxhy at body\pxhy at jchar
   }%
 \else\ifpxhy at hy@unicode         %<*unicode>
-  \def\pxhy at get@body#1#2{%
-    \def\pxhy at body{\unichar{"#2}}%
+  \def\pxhy at get@body at a#1#2{%
+    \edef\pxhy at body{%
+      \noexpand\unichar{\ifnum#2<\z@ "FFFD\else#2\fi}}%
   }%
 \else\ifpxhy at uniescape          %<*uniescape>
     \def\pxhy at get@body#1#2{%
       \ifx\pxhy at mt#1\pxhy at mt
-        \def\pxhy at body{\0x#2}%
+        \edef\pxhy at body{\noexpand\0x%
+          \ifx\pxhy at mt#2\pxhy at mt FFFD\else#2\fi}%
       \else
         \pxhy at get@jchar{\jis"#1}%
         \let\pxhy at body\pxhy at jchar
@@ -1239,14 +1372,14 @@
     }%
 \else                           %<*!>
   \chardef\pxhy at cc@jis at only=1
-    \def\pxhy at get@body#1#2{%
-      \ifx\pxhy at mt#1\pxhy at mt
-        \let\pxhy at body\@undefined
-      \else
-        \pxhy at get@jchar{\jis"#1}%
-        \let\pxhy at body\pxhy at jchar
-      \fi
-    }%
+  \def\pxhy at get@body at a#1#2{%
+    \ifnum#1<\z@
+      \let\pxhy at body\@undefined
+    \else
+      \pxhy at get@jchar{#1}%
+      \let\pxhy at body\pxhy at jchar
+    \fi
+  }%
 \fi\fi\fi                       %</>
 
 %%%%%%%%%%%%%%%%%%%% the definitions
@@ -1695,7 +1828,7 @@
   %% register to 'disable' list
   \ltx at GlobalPrependToMacro\pdfstringdefPreHook{\pxhy at disable@tc at commands}
 
-\else                           %<*!textcmd>
+\else                           %<*!charcmds>
 
 \@onlypreamble\pxDeclarePdfTextCommand
 \newcommand*\pxDeclarePdfTextCommand[3]{}
@@ -1702,7 +1835,7 @@
 \@onlypreamble\pxDeclarePdfTextComposite
 \newcommand*\pxDeclarePdfTextComposite[4]{}
 
-\fi                             %</textcmd>
+\fi                             %</charcmds>
 %--------------------------------------- Enable hyperref unicode
 \ifpxhy at hy@unicode
 



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