texlive[59165] Master/texmf-dist: pxjahyper (11may21)

commits+karl at tug.org commits+karl at tug.org
Tue May 11 23:13:37 CEST 2021


Revision: 59165
          http://tug.org/svn/texlive?view=revision&revision=59165
Author:   karl
Date:     2021-05-11 23:13:37 +0200 (Tue, 11 May 2021)
Log Message:
-----------
pxjahyper (11may21)

Modified Paths:
--------------
    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.sty

Modified: trunk/Master/texmf-dist/doc/platex/pxjahyper/README-ja.md
===================================================================
--- trunk/Master/texmf-dist/doc/platex/pxjahyper/README-ja.md	2021-05-10 23:48:28 UTC (rev 59164)
+++ trunk/Master/texmf-dist/doc/platex/pxjahyper/README-ja.md	2021-05-11 21:13:37 UTC (rev 59165)
@@ -70,6 +70,16 @@
 更新履歴
 --------
 
+  * Version 0.9a 〈2021/05/11〉
+      - バグ修正。
+
+  * Version 0.9  〈2021/05/10〉
+      - パッケージオプションの整理:`(no)papersize`、`convbkmk`、
+        `(no)otfutf` を追加。
+      - out2uni のエスケープ出力で UTF-16 を正しく扱う。
+      - pLaTeX で tounicode 前提の動作をするときに、`\Ux` 等の Unicode
+        符号入力についてフォールバック(ゲタ文字出力)を行う。
+
   * Version 0.8  〈2021/05/05〉
       - japanese-otf パッケージに対する実行のタイミングをパッケージ読込
         の直後に変更した。

Modified: trunk/Master/texmf-dist/doc/platex/pxjahyper/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/platex/pxjahyper/README.md	2021-05-10 23:48:28 UTC (rev 59164)
+++ trunk/Master/texmf-dist/doc/platex/pxjahyper/README.md	2021-05-11 21:13:37 UTC (rev 59165)
@@ -52,6 +52,8 @@
 Revision History
 ----------------
 
+  * Version 0.9a 〈2021/05/11〉
+  * Version 0.9  〈2021/05/10〉
   * Version 0.8  〈2021/05/05〉
   * Version 0.7b 〈2021/02/26〉
   * Version 0.7a 〈2021/02/23〉

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	2021-05-10 23:48:28 UTC (rev 59164)
+++ trunk/Master/texmf-dist/doc/platex/pxjahyper/pxjahyper.tex	2021-05-11 21:13:37 UTC (rev 59165)
@@ -6,12 +6,13 @@
 \MakeShortVerb{\|}
 \usepackage{bxtexlogo}
 \bxtexlogoimport{*}
-\newcommand{\PkgVersion}{0.8}
-\newcommand{\PkgDate}{2021/05/05}
+\newcommand{\PkgVersion}{0.9a}
+\newcommand{\PkgDate}{2021/05/11}
 \newcommand{\Pkg}[1]{\textsf{#1}}
 \newcommand{\Meta}[1]{$\langle$\mbox{}#1\mbox{}$\rangle$}
 \newcommand{\Note}{\par\noindent ※}
 \newcommand{\Means}{:\quad}
+\providecommand{\Strong}[1]{\textsf{#1}}
 %-----------------------------------------------------------
 \begin{document}
 \title{\Pkg{pxjahyper} パッケージ}
@@ -30,7 +31,7 @@
   内部漢字コードに応じて適切なものを出力する。
 \item PDF文字列の中でLICR(|\"a| や |\textsection| 等の
   文字出力の命令)が正しく機能するようにする。
-  ただし、エンジンが {\pTeX} の場合は、out2uni を利用
+  ただし、エンジンが {\pTeX} の場合は、out2uni/convbkmk を利用
   する場合を除き、JIS~X~0208にない文字は出力できない
   (hyperrefの警告が出る)。
 \item {\TeX} の版面拡大機能が使われている
@@ -52,26 +53,38 @@
 
 使用可能なオプションは以下の通り。
 \begin{itemize}
+\item \Strong{ドライバオプション}\Means
+  |dvipdfmx|、|dvips|、および |nodvidriver|%
+  (ドライバ依存動作の無効化を明示的に指示、
+  現状ではほとんどの動作が無効になる)
+  が指定できる。
+  \Note 0.5版より、|nodvidriver| の別名の |none| は非推奨の扱いとする。
+\item |auto|(既定)\Means
+  ドライバオプションを\Pkg{hyperref}のドライバ指定から自動的に判定する。
 \item |tounicode|(既定)\Means
-  dvipdfmx用の「tounicode special」を出力する。
+  dvipdfmx用の「tounicode special」を発行し、
+  それを前提にした出力を行う。
 \item |notounicode|\Means
-  |tounicode| の否定。
+  dvipdfmx用の「tounicode special」を発行しない。
 \item |out2uni|\Means
-  out2uniフィルタ(角藤氏製作)を使うことを前提にした
-  出力を行う。
-  (|tounicode| が無効になる。)
-  {\upLaTeX} では使用不可。
-\item |noout2uni|(既定)\Means
-  |out2uni| の否定。
+  out2uniフィルタを使うことを前提にした出力を行う。
+\item |convbkmk|\Means
+  convbkmkフィルタを使うことを前提にした出力を行う。
+  \Note ドライバがdvipsの場合は既定で有効になる。
+\item |otfutf|(既定)\Means
+  \Pkg{japanese-otf}パッケージの |\UTF| 命令をPDF文字列中で
+  使えるようにする。
+  \Note 詳細は\ref{ssec:otf-package}節を参照。
+\item |nootfutf|\Means
+  |otfutf| の否定。
 \item |otfcid|(既定)\Means
-  \Pkg{japanese-otf}パッケージの |\CID| をPDF文字列中で
-  使えるようにする。
-  具体的には、当該のAJ1のグリフに“対応”するUnicode文字が
-  あればそれを出力し、なければ(警告を出した上で)削除する。
+  \Pkg{japanese-otf}パッケージの |\CID| 命令をPDF文字列中で
+  “可能な限り”使えるようにする。
+  \Note 詳細は\ref{ssec:otf-package}節を参照。
+  \Note |otfcid| の利用には、エンジンの{\eTeX}拡張および
+  \Pkg{etoolbox}と\Pkg{bxjatoucs}パッケージのインストールが必要。
 \item |nootfcid|\Means
   |otfcid| の否定。
-  \Note |otfcid| の利用には、エンジンの{\eTeX}拡張および
-  \Pkg{etoolbox}と\Pkg{bxjatoucs}パッケージインストールが必要。
 \item |disablecmds|(既定)\Means
   「PDF文字列中のテキスト装飾命令の無効化」を有効にする。
   \Note 詳細は\ref{ssec:disablecmds}節を参照。
@@ -81,14 +94,8 @@
   \Pkg{japanese-otf}付属の\Pkg{ajmacros}パッケージが提供する
   文字入力命令(|\ajMaru|、|\ajLig| 等)をPDF文字列中で
   “可能な限り”使えるようにする。
-  \Note Unicode文字で表現可能であればそれを出力し、
-  なければ代替表現を出力する。
-  \Note |otfmacros| を指定する場合は |otfcid| も有効にする必要がある。
-  \Note \Pkg{ajmacros}パッケージの多くの命令は“脆弱(fragile)”である。
-  そのため、節見出し(|\section| 等の引数)で |\ajMaru| 等の命令を
-  使いたい場合は、命令の前に |\protect| 付ける必要がある。
-  \footnote{ちなみに、引数がPDF文字列として解釈される場合には、
-    |\protect| は全く結果に影響しない。}
+  \Note 詳細は\ref{ssec:otf-package}節を参照。
+  \Note |otfmacros| を有効にする場合は |otfcid| も有効にする必要がある。
 \item |nootfmacros|\Means
   |otfmacros| の否定。
   \Note 0.6版より既定を |otfmacros| に変更した。
@@ -99,15 +106,13 @@
 \item |nobigcode|\Means
   |bigcode| の否定。
   \Note 0.3a版より既定を |bigcode| に変更した。
-\item |dvipdfmx|\Means
-  dvipdfmxを前提とした動作を行う。
-\item |nodvidriver|\Means
-  dvipdfmxを前提とした動作を抑止する。
-  \Note 現状では、この場合には本パッケージは実質的に何の動作も行わない。
-  \Note 0.5版より、|nodvidriver| の別名の |none| は非推奨の扱いとする。
-\item |auto|(既定)\Means
-  \Pkg{hyperref}のドライバがdvipdfmx用ならば |dvipdfmx|、
-  それ以外は |nodvidriver| の動作。
+\item |papersize|(既定)\Means
+  {\upTeX}でのToUnicode CMapとして既定のUTF8-UCSの代わりに\ 
+  UTF8-UTF16を用いる。
+  (当該のファイルが存在する必要がある。)
+\item |nopapersize|\Means
+  |bigcode| の否定。
+  \Note 0.3a版より既定を |bigcode| に変更した。
 \end{itemize}
 
 %===========================================================
@@ -118,6 +123,7 @@
 
 %-------------------
 \subsection{Unicode符号値による入力}
+\label{ssec:ux-command}
 
 PDF文字列入力中で、|\Ux| が以下の意味になる。
 PDF文字列以外では |\Ux| は以前の定義(または未定義)に戻る。
@@ -132,20 +138,93 @@
 こちらを使う方が無難かもしれない。}
 
 \begin{itemize}
-\item |\Ux{|Unicode符号値|}|\Means
+\item |\Ux{|Unicode符号値16進|}|\Means
   その符号値の文字を出力する。
+  具体的な動作は以下の通り:
+  \begin{itemize}
+  \item エンジンが{\upLaTeX}のときは、当該の文字自体を書いたのと
+  同等になる。
+  \item エンジンが{\pLaTeX}で |out2uni| または |convbkmk| が有効の
+  場合は、エスケープ表記(|\0xUUUU|)を出力する。
+  \end{itemize}
+  \item それ以外の場合は、|\Ux| は定義されない。
 \end{itemize}
 
-符号値は16進数で指定する。
+%-------------------
+\subsection{\Pkg{japanese-otf}パッケージの文字入力命令への対応}
+\label{ssec:otf-package}
 
-なお、\Pkg{japanese-otf}パッケージの |\UTF| 命令は、PDF文字列中では
-out2uni用の出力を行うように設計されているが、
-本パッケージを {\upLaTeX} で用いた場合は、
-|\UTF| も(PDF文字列中では)|\Ux| と同じ動作
-(つまりtounicode用の出力)になるように変更される。
+\paragraph{\textbackslash UTF命令}
+|\UTF| 命令は、PDF文字列中では
+out2uni用の出力を行うように設計されている。
+本パッケージで |otfutf| オプションを有効にした場合は、
+PDF文字列中の動作が以下のように変更される。
 
+\begin{itemize}
+\item |\Ux| 命令(\ref{ssec:ux-command}節参照)が有効の場合は、
+  |\Ux| と同じ動作になる。
+\item それ以外の場合
+  (エンジンが{\pLaTeX}でtounicodeを前提にする場合)は、
+  警告を出した上でゲタ記号を出力する。
+  \Note {\pLaTeX}ではtounicodeの機能でUnicode文字を出力できないため。
+\end{itemize}
+
+\Note |\UTF| 命令の多言語版、
+すなわち |\UTFC|・|\UTFK|・|\UTFM|・|\UTFT| 命令も |\UTF|
+と同じ扱いになる。
+
+\paragraph{\textbackslash CID命令}
+\Pkg{japanese-otf}パッケージの仕様では |\CID| 命令は、PDF文字列中では
+サポートされない(未定義動作となる)。
+本パッケージで |otfcid| オプションを有効にした場合は、
+PDF文字列中で |\CID| が“可能な限り”使えるようにする。
+具体的な仕様は以下の通り。
+
+\begin{itemize}
+\item 当該のAJ1のグリフに“対応”する\textbf{単独の}Unicode文字が
+  あればそれを出力し、なければ
+  (警告を出した上で)削除する。
+  \footnote{他の同様の場合と合わせてゲタ記号を出力するようにしたい。
+    1.0版において仕様を変更する予定。}
+\item ただし |\Ux| 命令(\ref{ssec:ux-command}節参照)が
+  無効になる場合は、そもそもUnicode文字も出力できないため、
+  常に(警告を出した上で)ゲタ記号を出力する。
+  結局情報は欠落するが、それでも未定義動作(エラーになりえる)
+  よりは好ましいであろう。
+\end{itemize}
+
+\Note |otfcid| の利用には、エンジンの{\eTeX}拡張および
+\Pkg{etoolbox}と\Pkg{bxjatoucs}パッケージのインストールが必要。
+\Note |\CID| 命令の多言語版はサポートされない。
+
+\paragraph{ajmacrosパッケージの命令}
+本パッケージで |otfmacros| オプションを有効にした場合は、
+\Pkg{japanese-otf}付属の\Pkg{ajmacros}パッケージが提供する
+文字入力命令(|\ajMaru|、|\ajLig| 等)をPDF文字列中で
+“可能な限り”使えるようにする。
+具体的な仕様は以下の通り。
+
+\begin{itemize}
+\item 現状では、|\Ux| 命令が有効になる場合のみが
+  サポートされる。
+  \Note それ以外の場合は |otfmacros| オプションは無効になる。
+\item Unicode文字で表現可能であればそれを出力し、
+  なければ代替表現を出力する。
+\item Unicode文字を出力する場合の仕様は |\CID| と同じ。
+  代替表現の場合は文字自体が出力されることもある。
+\end{itemize}
+
+\Note |otfmacros| を有効にする場合は |otfcid| も有効にする必要がある。
+(従って |otfcid| と同じ前提条件が課される。)
+|nootfcid| を指定した場合は |otfmacros| も無効になる。
+\Note \Pkg{ajmacros}パッケージの多くの命令は“脆弱(fragile)”である。
+そのため、節見出し(|\section| 等の引数)で |\ajMaru| 等の命令を
+使いたい場合は、命令の前に |\protect| 付ける必要がある。
+\footnote{ちなみに、引数がPDF文字列として解釈される場合には、
+  |\protect| は全く結果に影響しない。}
+
 %-------------------
-\subsection{PDF文字列用の文字命令の定義}
+\subsection{PDF文字列用の文字命令のユーザ定義}
 
 以下の命令が提供される。(プリアンブルでのみ使用可能。)
 
@@ -214,7 +293,4 @@
   |\textmg| |\mgfamily| |\ltseries| |\ebseries| |\propshape|
 \end{itemize}
 
-
-
-
 \end{document}

Modified: trunk/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper-ajm.def
===================================================================
--- trunk/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper-ajm.def	2021-05-10 23:48:28 UTC (rev 59164)
+++ trunk/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper-ajm.def	2021-05-11 21:13:37 UTC (rev 59165)
@@ -11,7 +11,7 @@
 
 %% package declaration
 \NeedsTeXFormat{pLaTeX2e}
-\ProvidesFile{pxjahyper-ajm.def}[2021/05/05 v0.8]
+\ProvidesFile{pxjahyper-ajm.def}[2021/05/11 v0.9a]
 
 %% avoid multiple loading
 \csname pxjahyperajmLoaded\endcsname
@@ -35,11 +35,6 @@
 %% \pxhy@ : the prefix
 \def\pxhy@{pxhy at aj@@}
 
-%% \pxhy at cond\ifXXX...\fi{<yes>}{<no>}
-\@gobbletwo\if\if \def\pxhy at cond#1\fi{%
-  #1\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi
-}
-
 %% \pxhy at cond@both\ifXXX...\fi\ifYYY...\fi{<yes>}{<no>}
 % Checks whether \ifXXX and \ifYYY both hold.
 \@gobbletwo\if\if\@gobbletwo\if\if \def\pxhy at cond@both#1\fi#2\fi{%

Modified: trunk/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper-enc.sty
===================================================================
--- trunk/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper-enc.sty	2021-05-10 23:48:28 UTC (rev 59164)
+++ trunk/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper-enc.sty	2021-05-11 21:13:37 UTC (rev 59165)
@@ -10,7 +10,7 @@
 
 %% package declaration
 \NeedsTeXFormat{pLaTeX2e}
-\ProvidesPackage{pxjahyper-enc}[2021/05/05 v0.8]
+\ProvidesPackage{pxjahyper-enc}[2021/05/11 v0.9a]
 \def\pxhe at pkgname{pxjahyper-enc}
 \providecommand{\bxDebug}[1]{}
 

Modified: trunk/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper.sty
===================================================================
--- trunk/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper.sty	2021-05-10 23:48:28 UTC (rev 59164)
+++ trunk/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper.sty	2021-05-11 21:13:37 UTC (rev 59165)
@@ -10,7 +10,7 @@
 
 %% package declaration
 \NeedsTeXFormat{pLaTeX2e}
-\ProvidesPackage{pxjahyper}[2021/05/05 v0.8]
+\ProvidesPackage{pxjahyper}[2021/05/11 v0.9a]
 \def\pxhy at pkgname{pxjahyper}
 \providecommand{\bxDebug}[1]{}
 
@@ -33,21 +33,25 @@
 \newif\ifpxhy at etoolbox
 \newif\ifpxhy at new@hook at system
 \newif\ifpxhy at tounicode
-\newif\ifpxhy at zerox
+\newif\ifpxhy at uniescape
 \newif\ifpxhy at bigcode
 \let\pxhy at bigcode@given\relax
 \newif\ifpxhy at papersize
+\newif\ifpxhy at textcmd
 \chardef\pxhy at driver@none=0
 \chardef\pxhy at driver@dvipdfmx=1
+\chardef\pxhy at driver@dvips=2
 \let\pxhy at driver\@undefined
 \newif\ifpxhy at hy@unicode
 \newif\ifpxhy at jacommentline
 \newif\ifpxhy at disablecmds
+\newif\ifpxhy at otfutf
 \newif\ifpxhy at otfcid
 \newif\ifpxhy at otfmacros
 
 %--------------------------------------- Package options
 
+%% DVI drivers
 \DeclareOption{dvipdfmx}{%
   \let\pxhy at driver\pxhy at driver@dvipdfmx
 }
@@ -54,14 +58,18 @@
 \DeclareOption{dvipdfm}{%
   \let\pxhy at driver\pxhy at driver@dvipdfmx
 }
+\DeclareOption{dvips}{%
+  \let\pxhy at driver\pxhy at driver@dvips
+}
 \DeclareOption{nodvidriver}{%
   \let\pxhy at driver\pxhy at driver@none
 }
+%% modes
 \DeclareOption{none}{%
-  \let\pxhy at driver\pxhy at driver@none
+  \let\pxhy at driver\pxhy at driver@none %FIXME
 }
 \DeclareOption{auto}{%
-  \let\pxhy at driver\@undefined
+  \let\pxhy at driver\@undefined %FIXME
 }
 \DeclareOption{tounicode}{%
   \pxhy at tounicodetrue
@@ -70,11 +78,20 @@
   \pxhy at tounicodefalse
 }
 \DeclareOption{out2uni}{%
-  \pxhy at zeroxtrue
+  \pxhy at uniescapetrue
 }
 \DeclareOption{noout2uni}{%
-  \pxhy at zeroxfalse
+  \pxhy at uniescapefalse
+  \let\pxhy at nouniescape@given=t
 }
+\DeclareOption{convbkmk}{%
+  \pxhy at uniescapetrue
+}
+\DeclareOption{noconvbkmk}{%
+  \pxhy at uniescapefalse
+  \let\pxhy at nouniescape@given=t
+}
+%% others
 \DeclareOption{papersize}{%
   \pxhy at papersizetrue
 }
@@ -101,10 +118,14 @@
 \DeclareOption{nodisablecmds}{%
   \pxhy at disablecmdsfalse
 }
-\pxhy at otfcidtrue
+\DeclareOption{otfutf}{%
+  \pxhy at otfutftrue
+}
+\DeclareOption{nootfutf}{%
+  \pxhy at otfutffalse
+}
 \DeclareOption{otfcid}{%
   \pxhy at otfcidtrue
-  \let\pxhy at otfcid@given=t
 }
 \DeclareOption{nootfcid}{%
   \pxhy at otfcidfalse
@@ -112,13 +133,17 @@
 \pxhy at otfmacrostrue
 \DeclareOption{otfmacros}{%
   \pxhy at otfmacrostrue
-  \let\pxhy at otfcid@given=t
+  \let\pxhy at otfmacros@given=t
 }
 \DeclareOption{nootfmacros}{%
   \pxhy at otfmacrosfalse
 }
+\DeclareOption{force-unicode}{%
+  \let\pxhy at force@unicode=t
+}
+%% dispatch
 \ExecuteOptions{%
-  auto,tounicode,noout2uni,jacommentline,disablecmds%
+  auto,tounicode,papersize,jacommentline,disablecmds,otfutf,otfcid%
 }
 \ProcessOptions*
 
@@ -152,12 +177,15 @@
 
 %% Check hyperref driver.
 \ifx\pxhy at driver\@undefined
+  \let\pxhy at driver\pxhy at driver@none
   \def\pxhy at tmpa{hdvipdfm}
   \ifx\Hy at driver\pxhy at tmpa
     \let\pxhy at driver\pxhy at driver@dvipdfmx
-  \else
-    \let\pxhy at driver\pxhy at driver@none
   \fi
+  \def\pxhy at tmpa{hdvips}
+  \ifx\Hy at driver\pxhy at tmpa
+    \let\pxhy at driver\pxhy at driver@dvips
+  \fi
 \fi
 
 %% Check the engine.
@@ -187,12 +215,6 @@
 \ifnum\jis"2121="3000 \else
   \pxhy at uptexfalse
 \fi
-% out2uni cannot be used with upTeX.
-\ifpxhy at uptex \ifpxhy at zerox
-  \PackageWarningNoLine\pxhy at pkgname
-   {out2uni is invalid in upTeX}
-  \pxhy at zeroxfalse
-\fi\fi
 % bigcode cannot be used without upTeX.
 \ifpxhy at bigcode \ifpxhy at uptex\else
   \pxhy at bigcodefalse
@@ -201,16 +223,24 @@
      {bigcode is invalid without upTeX}
   \fi
 \fi\fi
-% out2uni disables tounicode.
-\ifpxhy at zerox
-  \pxhy at tounicodefalse
-\fi
 %% pxhy at papersize switch
 \ifnum\pxhy at driver=\pxhy at driver@none
   \pxhy at papersizefalse
 \fi
+%% pxhy at textcmd switch
+\ifnum\pxhy at driver=\pxhy at driver@none
+  \pxhy at textcmdfalse
+\else
+  \pxhy at textcmdtrue
+\fi
+%% pxhy at uniescape switch
+\ifnum\pxhy at driver=\pxhy at driver@dvips \ifx t\pxhy at nouniescape@given\else
+  \pxhy at uniescapetrue
+\fi\fi
+
 % hyperref 'unicode' is allowed only on upLaTeX.
-\ifnum0\ifpxhy at hy@unicode\ifpxhy at uptex\else1\fi\fi>\z@
+\ifnum0\ifpxhy at hy@unicode\ifpxhy at uptex\else
+    \ifx t\pxhy at force@unicode\else1\fi\fi\fi>\z@
   \PackageError\pxhy at pkgname
    {The hyperref 'unicode' mode is not supported\MessageBreak
     on the pTeX engine}%
@@ -217,19 +247,33 @@
    {\pxhy at eh@fatal}%
   \expandafter\endinput
 \fi
-% otfmacros forces use of otfcid.
-\ifpxhy at otfmacros
-  \pxhy at otfcidtrue
+\ifpxhy at hy@unicode
+  \pxhy at uniescapefalse
+  \pxhy at otfutftrue
 \fi
-% otfcid requires upTeX or out2uni.
-\ifpxhy at uptex\else\ifpxhy at zerox\else
-  \pxhy at otfcidfalse
-  \ifx t\pxhy at otfcid@given
+% otfmacros requires upTeX or out2uni.
+\ifpxhy at uptex\else\ifpxhy at uniescape\else\ifpxhy at hy@unicode\else
+  \pxhy at otfmacrosfalse
+  \ifx t\pxhy at otfmacros@given
     \PackageWarningNoLine\pxhy at pkgname
-     {Option 'otfcid'/'otfmacros' is invalid\MessageBreak
+     {Option 'otfmacros' is invalid\MessageBreak
       unless upTeX is used or 'out2uni' is specified}
   \fi
+\fi\fi\fi
+% otfcid requrires otfutf.
+\ifpxhy at otfutf \else \ifpxhy at otfcid
+  \PackageInfo\pxhy at pkgname
+   {Option 'nootfcid' is assumed\MessageBreak
+    because 'nootfutf' is effective\@gobble}
+  \pxhy at otfcidfalse
 \fi\fi
+% otfmacros requrires otfcid.
+\ifpxhy at otfcid \else \ifpxhy at otfmacros
+  \PackageInfo\pxhy at pkgname
+   {Option 'nootfmacros' is assumed\MessageBreak
+    because 'nootfcid' is effective\@gobble}
+  \pxhy at otfmacrosfalse
+\fi\fi
 
 \bxDebug{****pxjahyper env^^J%
 pxhy at ptex = \ifpxhy at ptex true\else false\fi^^J%
@@ -239,9 +283,11 @@
 pxhy at new@hook at system = \ifpxhy at new@hook at system true\else false\fi^^J%
 ifpxhy at hy@unicode = \ifpxhy at hy@unicode true\else false\fi^^J%
 pxhy at bigcode = \ifpxhy at bigcode true\else false\fi^^J%
+pxhy at driver = \the\pxhy at driver^^J%
 pxhy at tounicode = \ifpxhy at tounicode true\else false\fi^^J%
-pxhy at zerox = \ifpxhy at zerox true\else false\fi^^J%
-pxhy at driver = \the\pxhy at driver^^J%
+pxhy at uniescape = \ifpxhy at uniescape true\else false\fi^^J%
+pxhy at papersize = \ifpxhy at papersize true\else false\fi^^J%
+pxhy at textcmd = \ifpxhy at textcmd true\else false\fi^^J%
 }
 
 %--------------------------------------- Helpers
@@ -282,6 +328,10 @@
   \let\pxhy at forcecjktoken\relax
 \fi
 
+%% \pxhy at geta : GETA MARK
+\pxhy at get@jchar{\jis"222E}
+\let\pxhy at geta\pxhy at jchar
+
 %% \pxhy at hook@after at package{<package-name>}{<code>}
 \@onlypreamble\pxhy at hook@after at package
 \def\pxhy at hook@after at package#1#2{%
@@ -296,6 +346,18 @@
   \fi
 }
 
+%% \pxhy at triexpandafter
+\def\pxhy at triexpandafter{%
+  \expandafter\expandafter\expandafter
+}
+
+%% \pxhy at cond\ifXXX<arg>\fi{<true>}{<false>}
+% Does the test "\ifXXX<arg>", with immediate exit from the
+% induced if-level.
+\@gobbletwo\if\if \def\pxhy at cond#1\fi{%
+  #1\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi
+}
+
 %--------------------------------------- Helpers (e-TeX)
 \ifpxhy at etex
 
@@ -365,85 +427,184 @@
 \fi
 
 \fi                             %</papersize>
-%--------------------------------------- Hooks to pdfstringdef
+%--------------------------------------- Code input processor
 
 %% constants
 \def\pxhy at uc@REPL{FFFD}
 \def\pxhy at uc@XNAC{FDD1} % not-a-char codepoint used as marker
 
-%% variables
-\let\pxhy at str\relax
+%% switch 'pxhy at utfXVI'
+% Whether or not to convert to UTF-16.
+\newif\ifpxhy at utfXVI
 
+%% Generate tables
+% - \pxhy at qh/XY -> Z ; \pxhy at hq/Z -> XY
+%   means XY (base-4) = Z (base-16)
+% - \pxhy at lhq/ZW -> XY
+%   ZW (base-16) - 1 = XY (base-4)
+% - \pxhy at hd/X
+%   uppercase of X if X is a (lower/uppercase) hexadecimal
+%   digit; otherwise undefined
+\def\pxhy at next#1#2#3#4#5{%
+  \@namedef{pxhy at qh/#1#2}{#3}%
+  \@namedef{pxhy at hq/#3}{#1#2}%
+  \@namedef{pxhy at lhq/#4#5}{#1#2}%
+}
+\@for\pxhy at tmpa:={%
+  00001,01102,02203,03304,10405,11506,12607,13708,%
+  20809,2190A,22A0B,23B0C,30C0D,31D0E,32E0F,33F10}\do{%
+  \expandafter\pxhy at next\pxhy at tmpa
+}
+\def\pxhy at next#1{%
+  \lowercase{\def\pxhy at tmpb{#1}}%
+  \@namedef{pxhy at hd/#1}{#1}%
+  \@namedef{pxhy at hd/\pxhy at tmpb}{#1}%
+}
+\@tfor\pxhy at tmpa:=0123456789ABCDEF\do{%
+  \expandafter\pxhy at next\pxhy at tmpa
+}
+
 %% \pxhy at burst-`>...
 \let\pxhy at burst\romannumeral
 
 %% \pxhy at uchex{<hex>}
-% The entity of the code-value input function. If the input
-% is a valid code value in hex then it passes the value to
-% \pxhy at uchex@res in 4-6 digits; otherwise passes FFFD to
-% \pxhy at uchex@res.
+% "Distills" the code-value input. If the input is a hex notation of
+% a valid code point of Unicode, then it passes the value to
+% \pxhy at uchex@out in zero-padded 4-6 digits; otherwise passes FFFD
+% to \pxhy at uchex@out.
+% Moreover, when the switch pxhy at utfXVI is true, then conversion into
+% UTF-16 is performed and each unit is passed to \pxhy at uchex@out
+% in zero-padded 4 digits.
 \def\pxhy at uchex#1{%
-  \expandafter\pxhy at uchex@a\pxhy at burst-`>#1\pxhy at mk
+  \pxhy at uchex@pre at a#1\relax{}\pxhy at mk\pxhy at end
 }
-\edef\pxhy at uchex@err{%
-  \noexpand\pxhy at uchex@res{\pxhy at uc@REPL}%
+\def\pxhy at uchex@pre at a{%
+  \expandafter\pxhy at uchex@pre at b\pxhy at burst-`>%
 }
-\def\pxhy at uchex@a#1#2\pxhy at mk{%
-  \ifnum2<"1#1
-    \expandafter\pxhy at uchex@b\romannumeral-"#1#2\pxhy at mk{#1#2}%
-  \else \pxhy at uchex@err
-  \fi
+\def\pxhy at uchex@pre at b#1#{%
+  \pxhy at cond \ifx\pxhy at mt#1\pxhy at mt \fi{%
+    \pxhy at uchex@bombout
+  }{%else
+    \pxhy at uchex@pre at c#1%
+  }%
 }
-\def\pxhy at uchex@b#1\pxhy at mk#2{%
-  \ifx\pxhy at mt#1\pxhy at mt
-    \ifnum"#2>"10FFFF
-      \pxhy at uchex@err
-    \else\ifnum"#2>"FFF
-      \pxhy at uchex@res{#2}%
-    \else
-      \pxhy at uchex@c#2"000\pxhy at end
-    \fi\fi
-  \else \pxhy at uchex@err
-  \fi
+\def\pxhy at uchex@pre at c#1{%
+  \pxhy at cond \ifx#1\relax \fi{%
+    \pxhy at uchex@pre at end
+  }{%else
+    \pxhy at triexpandafter\pxhy at uchex@pre at d
+        \csname pxhy at hd/\string#1\endcsname
+  }%
 }
-\def\pxhy at uchex@c#1#2#3#4#5#6\pxhy at end{%
-  \pxhy at uchex@d#1#2#3#4#5\pxhy at end
+\def\pxhy at uchex@pre at d#1{%
+  \pxhy at cond \ifx#1\relax \fi{%
+    \pxhy at uchex@bombout
+  }{%else
+    \pxhy at uchex@pre at e#1%
+  }%
 }
-\def\pxhy at uchex@d#1"#2\pxhy at end{%
-  \pxhy at uchex@res{#2#1}%
+\def\pxhy at uchex@pre at e#1#2\pxhy at mk#3\pxhy at end{%
+  \pxhy at cond \if 0#1\fi{%
+    \pxhy at cond \ifx\pxhy at mt#3\pxhy at mt \fi{%
+      \pxhy at uchex@pre at a#2\pxhy at mk#3\pxhy at end
+    }{%else
+      \pxhy at uchex@pre at a#2\pxhy at mk#3#1\pxhy at end
+    }%
+  }{%else
+    \pxhy at uchex@pre at a#2\pxhy at mk#3#1\pxhy at end
+  }%
 }
+\def\pxhy at uchex@pre at end#1\pxhy at mk#2\pxhy at end{%
+  \pxhy at cond \ifx\pxhy at mt#1\pxhy at mt \fi{%
+    \pxhy at uchex@sw{#2}%
+  }{%else
+    \pxhy at uchex@error
+  }%
+}
+\def\pxhy at uchex@bombout#1\pxhy at end{%
+  \pxhy at uchex@error
+}
 
-\ifpxhy at uptex                   %<*upTeX>
+\def\pxhy at uchex@sw#1{%
+  \pxhy at cond \ifnum"0#1>"10FFFF \fi{%
+    \pxhy at uchex@error
+  }{\pxhy at cond \ifnum"0#1>"FFFF \fi{%
+    \pxhy at cond \ifpxhy at utfXVI \fi{%
+      \pxhy at uchex@big#1"000000\pxhy at end
+    }{%else
+      \pxhy at uchex@out{#1}%
+    }%
+  }{%else
+    \pxhy at uchex@small#1"0000\pxhy at end
+  }}%
+}
+\def\pxhy at uchex@small#1#2#3#4#5#6\pxhy at end{%
+  \pxhy at uchex@small at a#1#2#3#4#5\pxhy at end
+}
+\def\pxhy at uchex@small at a#1"#2\pxhy at end{%
+  \pxhy at uchex@out{#2#1}%
+}
+\def\pxhy at uchex@big#1#2#3#4#5#6#7#8\pxhy at end{%
+  \pxhy at uchex@big at a#1#2#3#4#5#6#7\pxhy at end
+}
+\def\pxhy at uchex@big at a#1"#2\pxhy at end{%
+  \pxhy at uchex@big at b#2#1\pxhy at end
+}
+\def\pxhy at uchex@big at b#1#2#3#4{%
+  \pxhy at triexpandafter\pxhy at uchex@big at c
+      \csname pxhy at lhq/#1#2\pxhy at triexpandafter\endcsname
+      \csname pxhy at hq/#3\pxhy at triexpandafter\endcsname
+      \csname pxhy at hq/#4\endcsname
+}
+\def\pxhy at uchex@big at c#1#2#3#4#5#6{%
+  \pxhy at triexpandafter\pxhy at uchex@big at d
+      \csname pxhy at qh/2#1\pxhy at triexpandafter\endcsname
+      \csname pxhy at qh/#2#3\pxhy at triexpandafter\endcsname
+      \csname pxhy at qh/#4#5\pxhy at triexpandafter\endcsname
+      \csname pxhy at qh/3#6\endcsname
+}
+\def\pxhy at uchex@big at d#1#2#3#4#5\pxhy at end{%
+  \pxhy at uchex@out{D#1#2#3}%
+  \pxhy at uchex@out{D#4#5}%
+}
+\edef\pxhy at uchex@error{%
+  \noexpand\pxhy at uchex@out{\pxhy at uc@REPL}%
+}
 
-  %% \pxhy at marker: a not-a-char U+FDD1
-  \pxhy at get@jchar{\ucs"\pxhy at uc@XNAC}
-  \edef\pxhy at marker{\pxhy at jchar}
+%--------------------------------------- Hooks to pdfstringdef
 
-  %% Makes \Ux and \UTF be the code input command in PDF strings.
-  \pdfstringdefDisableCommands{%
-    \let\Ux\pxhy at uchex
-    \let\UTF\pxhy at uchex
-    \let\UTFM\pxhy at uchex
-    \let\UTFK\pxhy at uchex
-    \let\UTFC\pxhy at uchex
-    \let\UTFT\pxhy at uchex
+%% variables
+\let\pxhy at str\relax
+
+%% \pxhy at Ux
+% The definition of \Ux in PDF strings.
+\let\pxhy at Ux\@undefined
+
+\ifpxhy at hy@unicode              %<*unicode>
+
+  %% \pxhy at Ux
+  \def\pxhy at Ux{\pxhy at uchex}%
+  \pxhy at utfXVIfalse
+  \def\pxhy at uchex@out#1{%
+    \unichar{"#1}%
   }
 
-  \ifpxhy at hy@unicode            %<*unicode>
+\else\ifpxhy at uptex              %<*upTeX>
 
-    %% \pxhy at uchex@res
-    \def\pxhy at uchex@res#1{%
-      \unichar{"#1}%
-    }
+  %% \pxhy at Ux
+  \def\pxhy at Ux{\pxhy at uchex}%
+  \pxhy at utfXVIfalse
 
-  \else                       %<!*unicode>
+  %% \pxhy at marker: a not-a-char U+FDD1
+  \pxhy at get@jchar{\ucs"\pxhy at uc@XNAC}
+  \edef\pxhy at marker{\pxhy at jchar}
 
   %BEGIN-- in the following block #1 means the marker
   \def\pxhy at next#1{% #1=marker
-    %% \pxhy at uchex@res
+    %% \pxhy at uchex@out
     % Expands to a tag string which will later be converted to
     % a real character in the postprocess.
-    \def\pxhy at uchex@res##1{#1##1>}%
+    \def\pxhy at uchex@out##1{#1##1>}%
     %% \pxhy at posthook
     % The postprocess of this package. It is registered to
     % \pdfstringdefPostHook.
@@ -486,26 +647,62 @@
     \pxhy at next
   \endgroup
 
-  \fi                         %</unicode>
+\fi\fi                          %</>
 
-\else\ifpxhy at zerox              %<*!upTeX>
+\ifpxhy at uniescape               %<*uniescape>
 
-  %% \pxhy at uchex@res
-  % Expands to \0x form.
-  \def\pxhy at uchex@res#1{%
+  %% \pxhy at Ux
+  \def\pxhy at Ux{\pxhy at uchex}%
+  % \pxhy at uchex converts to UTF-16
+  \pxhy at utfXVItrue
+  \def\pxhy at uchex@out#1{%
+    % Expands to \0x form.
     \0x#1%
   }
 
-  %% Makes \Ux be the code input command in PDF strings.
-  % (If the otf package is loaded, then \UTF already does
-  % the same thing.)
+\fi                             %</uniescape>
+
+%% Makes \Ux be the code input command in PDF strings.
+\ifx\pxhy at Ux\@undefined\else
   \pdfstringdefDisableCommands{%
-    \let\Ux\pxhy at uchex
+    \let\Ux\pxhy at Ux
   }
+\fi
 
-  %Note: if out2uni is off then \Ux remains undefined.
-\fi\fi                          %</upTeX>
+%--------------------------------------- Support for 'otfutf'
+\ifpxhy at otfutf
 
+%% \pxhy at UTF
+% The definition of \UTF in PDF strings.
+\ifx\pxhy at Ux\@undefined
+  % Use a fallback definition.
+  \def\pxhy at UTF{\pxhy at uchex}
+  \pxhy at utfXVIfalse
+  \def\pxhy at uchex@out#1{%
+    \@nameuse{U+#1}% issue a warning
+    \pxhy at geta
+  }
+\else
+  \let\pxhy at UTF\pxhy at Ux
+\fi
+
+%% \pxhy at dispatch@otfutf
+\@onlypreamble\pxhy at dispatch@otfutf
+\def\pxhy at dispatch@otfutf{%
+  \global\let\pxhy at dispatch@otfutf\relax
+  \pdfstringdefDisableCommands{%
+    \let\UTF\pxhy at UTF
+    \let\UTFM\pxhy at UTF
+    \let\UTFK\pxhy at UTF
+    \let\UTFC\pxhy at UTF
+    \let\UTFT\pxhy at UTF
+  }
+}
+
+%% enable hooks
+\pxhy at hook@after at package{otf}{\pxhy at dispatch@otfutf}
+
+\fi
 %--------------------------------------- Support for 'otfcid'
 \ifpxhy at otfcid
 
@@ -551,13 +748,21 @@
   \expandafter\expandafter\expandafter\pxhy at cid@aux
       \bxjaFastCidToUcsHex{#1}\pxhy at mk{\number#1}%
 }
+\ifx\pxhy at Ux\@undefined
+  \def\pxhy at cid@aux#1\pxhy at mk#2{%
+    \@nameuse{CID+#2}% issue a warning
+    \pxhy at geta
+  }
+\else
 \def\pxhy at cid@aux#1\pxhy at mk#2{%
   \ifnum"#1>\z@
-    \pxhy at uchex{#1}%
+    \pxhy at Ux{#1}%
   \else
     \@nameuse{CID+#2}%
+    %\pxhy at geta %FIXME: future change
   \fi
 }
+\fi
 
 %% \pxhy at dispatch@otfcid
 \@onlypreamble\pxhy at dispatch@otfcid
@@ -609,7 +814,7 @@
   \ifpxhy at hy@unicode PU\else PD1\fi
 }
 
-\ifnum\pxhy at driver=\pxhy at driver@dvipdfmx %<*dvipdfmx>
+\ifpxhy at textcmd                 %<*textcmd>
 
 %%<+> \pxDeclarePdfTextCommand{\CS}{<jis>}{<ucs>}
 \@onlypreamble\pxDeclarePdfTextCommand
@@ -627,7 +832,7 @@
    {\pxhy at revoke@pdf at tcc{#1}{#2}}%
 }
 
-\else                           %<*!dvipdfmx>
+\else                           %<*!textcmd>
 
 \@onlypreamble\pxDeclarePdfTextCommand
 \newcommand*\pxDeclarePdfTextCommand[3]{}
@@ -634,7 +839,7 @@
 \@onlypreamble\pxDeclarePdfTextComposite
 \newcommand*\pxDeclarePdfTextComposite[4]{}
 
-\fi                             %</dvipdfmx>
+\fi                             %</textcmd>
 
 %% \pxhy at revoke@pdf at tc
 \@onlypreamble\pxhy at revoke@pdf at tc
@@ -685,7 +890,7 @@
     \let\pxhy at body\pxhy at jchar
   }%
 \else                           %<*!upTeX>
-  \ifpxhy at zerox
+  \ifpxhy at uniescape
     \def\pxhy at get@body#1#2{%
       \ifx\pxhy at end#1\pxhy at end
         \def\pxhy at body{\0x#2}%
@@ -1108,7 +1313,7 @@
 % ligatures, since otherwise hyperref leaves some garbage in
 % output pdf-strings when such ligatures appear.
 \ifpxhy at uptex\else
-  \ifpxhy at zerox\else
+  \ifpxhy at uniescape\else
     \DeclareTextCommand{\textendash}{PD1}{--}
     \DeclareTextCommand{\textquestiondown}{PD1}{}% empty
     \DeclareTextCommand{\textexclamdown}{PD1}{}% empty
@@ -1121,6 +1326,9 @@
 %--------------------------------------- Enable hyperref unicode
 \ifpxhy at hy@unicode
 
+%% check the current meaning
+\def\pxhy at tmpa#1{\@backslashchar 000#1}
+\ifx\HyPsd at Char\pxhy at tmpa
 \PackageInfo\pxhy at pkgname
  {The setup for hyperref 'unicode' is applied.\@gobbletwo}
 
@@ -1162,7 +1370,27 @@
     \IntCalcMod#1!256!!%
   }%
 %%%%END
+\fi
 
+\ifpxhy at uptex\else                      %<*pTeX>
+  \RequirePackage{bxjatoucs}[]
+  \def\HyPsd at Char#1{%
+    \ifnum`#1<128 %
+      \@backslashchar 000#1%
+    \else\ifnum`#1<256 %
+      \expandafter\HyPsd at CharTwoByte\number`#1!%
+    \else
+      \expandafter\HyPsd at CharTwoByte\number\pxhy at to@ucs{`#1}!%
+    \fi\fi
+  }%
+  \def\pxhy at to@ucs#1{"FFFD}
+  \ifnum\jis"2121="8140 % sjis
+    \let\pxhy at to@ucs\bxjaSjisToUcs
+  \else\ifnum\jis"2121="A1A1 % euc
+    \let\pxhy at to@ucs\bxjaEucToUcs
+  \fi\fi
+\fi                                     %</pTeX>
+
 %% disable the verification of bxjscls
 \let\jsCheckHyperrefUnicode\@empty
 



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