From 26313b1db1b3d4f64ae1a9f29aefd4d9a0eb59e3 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 13 May 2022 21:35:58 +0000 Subject: pxjahyper (13may22) git-svn-id: svn://tug.org/texlive/trunk@63290 c570f23f-e606-0410-a88d-b1316a301751 --- .../tex/platex/pxjahyper/pxjahyper-ajm.def | 2 +- .../tex/platex/pxjahyper/pxjahyper-enc.sty | 2 +- .../tex/platex/pxjahyper/pxjahyper-uni.def | 2 +- .../texmf-dist/tex/platex/pxjahyper/pxjahyper.sty | 156 +++++++++++++++------ 4 files changed, 118 insertions(+), 44 deletions(-) (limited to 'Master/texmf-dist/tex/platex') diff --git a/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper-ajm.def b/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper-ajm.def index e5173ef493b..20eb4d32d83 100644 --- a/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper-ajm.def +++ b/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper-ajm.def @@ -11,7 +11,7 @@ %% package declaration \NeedsTeXFormat{pLaTeX2e} -\ProvidesFile{pxjahyper-ajm.def}[2022/04/15 v1.0a] +\ProvidesFile{pxjahyper-ajm.def}[2022/05/10 v1.1] %% avoid multiple loading \csname pxjahyperajmLoaded\endcsname diff --git a/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper-enc.sty b/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper-enc.sty index 9fc18f26ab0..4106e541d02 100644 --- a/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper-enc.sty +++ b/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper-enc.sty @@ -10,7 +10,7 @@ %% package declaration \NeedsTeXFormat{pLaTeX2e} -\ProvidesPackage{pxjahyper-enc}[2022/04/15 v1.0a] +\ProvidesPackage{pxjahyper-enc}[2022/05/10 v1.1] \def\pxhe@pkgname{pxjahyper-enc} \providecommand{\bxDebug}[1]{} diff --git a/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper-uni.def b/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper-uni.def index 69f21405ff2..cc068deb4f2 100644 --- a/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper-uni.def +++ b/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper-uni.def @@ -10,7 +10,7 @@ %% package declaration \NeedsTeXFormat{pLaTeX2e} -\ProvidesFile{pxjahyper-uni.def}[2022/04/15 v1.0a] +\ProvidesFile{pxjahyper-uni.def}[2022/05/10 v1.1] \providecommand{\bxDebug}[1]{} %--------------------------------------- environment check diff --git a/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper.sty b/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper.sty index 9cf9d4cacf2..772be814d49 100644 --- a/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper.sty +++ b/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper.sty @@ -10,7 +10,7 @@ %% package declaration \NeedsTeXFormat{pLaTeX2e} -\ProvidesPackage{pxjahyper}[2022/04/15 v1.0a] +\ProvidesPackage{pxjahyper}[2022/05/10 v1.1] \def\pxhy@pkgname{pxjahyper} \providecommand{\bxDebug}[1]{} @@ -37,7 +37,7 @@ \newif\ifpxhy@bigcode \let\pxhy@bigcode@given\relax \newif\ifpxhy@papersize -\newif\ifpxhy@textcmd +\newif\ifpxhy@charcmds \chardef\pxhy@driver@none=0 \chardef\pxhy@driver@dvipdfmx=1 \chardef\pxhy@driver@dvips=2 @@ -48,8 +48,11 @@ \newif\ifpxhy@otfutf \newif\ifpxhy@otfcid \newif\ifpxhy@otfmacros +\newif\ifpxhy@Uchar@avail +\newif\ifpxhy@ucs@avail \let\pxhy@jsclasses@name\relax \newif\ifpxhy@jlreq@cls +\newif\ifpxhy@fallback@geta %--------------------------------------- Package options @@ -66,13 +69,16 @@ \DeclareOption{nodvidriver}{% \let\pxhy@driver\pxhy@driver@none } +\DeclareOption{resetdvidriver}{% + \let\pxhy@driver\@undefined +} \DeclareOption{autodvidriver}{% \let\pxhy@driver\@undefined } -%% modes -\DeclareOption{auto}{% - \let\pxhy@driver\@undefined %FIXME +\DeclareOption{auto}{% DEPRECATED + \let\pxhy@driver\@undefined } +%% operation modes \DeclareOption{tounicode}{% \pxhy@tounicodetrue } @@ -100,6 +106,12 @@ \DeclareOption{nopapersize}{% \pxhy@papersizefalse } +\DeclareOption{charcmds}{% + \pxhy@charcmdstrue +} +\DeclareOption{nocharcmds}{% + \pxhy@charcmdsfalse +} \pxhy@bigcodetrue \DeclareOption{bigcode}{% \pxhy@bigcodetrue @@ -140,12 +152,22 @@ \DeclareOption{nootfmacros}{% \pxhy@otfmacrosfalse } +\DeclareOption{fallback-geta}{% + \pxhy@fallback@getatrue +} +\DeclareOption{fallback-delete}{% + \pxhy@fallback@getafalse +} \DeclareOption{force-unicode}{% \let\pxhy@force@unicode=t } +\DeclareOption{disable-Ux}{% for debug + \let\pxhy@disable@Ux=t +} %% dispatch \ExecuteOptions{% - auto,tounicode,papersize,jacommentline,disablecmds,otfutf,otfcid% + resetdvidriver,tounicode,papersize,charcmds,jacommentline,% + disablecmds,otfutf,otfcid,fallback-geta% } \ProcessOptions* @@ -188,6 +210,10 @@ \ifx\Hy@driver\pxhy@tmpa \let\pxhy@driver\pxhy@driver@dvips \fi + \ifnum\pxhy@driver=\pxhy@driver@none \ifx\Hy@driver\@undefined\else + \PackageWarningNoLine\pxhy@pkgname + {Unknown hyperref driver: \Hy@driver} + \fi\fi \fi %% Check the engine. @@ -220,6 +246,11 @@ \expandafter\endinput \fi +%% pxhy@Uchar@avail switch +\pxhy@check\Uchar{\pxhy@Uchar@availtrue} +%% pxhy@ucs@avail switch +\pxhy@check\ucs{\pxhy@ucs@availtrue} + %% Check the document class. % jlreq \ifpxhy@etex @@ -247,16 +278,6 @@ {bigcode is invalid without upTeX} \fi \fi\fi -%% pxhy@papersize switch -\ifnum\pxhy@driver=\pxhy@driver@none - \pxhy@papersizefalse -\fi -%% pxhy@textcmd switch -\ifnum\pxhy@driver=\pxhy@driver@none - \pxhy@textcmdfalse -\else - \pxhy@textcmdtrue -\fi %% pxhy@uniescape switch \ifnum\pxhy@driver=\pxhy@driver@dvips \ifx t\pxhy@nouniescape@given\else \pxhy@uniescapetrue @@ -271,17 +292,8 @@ \fi \ifpxhy@hy@unicode \pxhy@uniescapefalse - \pxhy@otfutftrue + %\pxhy@otfutftrue \fi -% otfmacros requires upTeX or out2uni. -\ifpxhy@uptex\else\ifpxhy@uniescape\else\ifpxhy@hy@unicode\else - \pxhy@otfmacrosfalse - \ifx t\pxhy@otfmacros@given - \PackageWarningNoLine\pxhy@pkgname - {Option 'otfmacros' is invalid\MessageBreak - unless upTeX is used or 'out2uni' is specified} - \fi -\fi\fi\fi % otfcid requrires otfutf. \ifpxhy@otfutf \else \ifpxhy@otfcid \PackageInfo\pxhy@pkgname @@ -297,19 +309,31 @@ \pxhy@otfmacrosfalse \fi\fi +%% in nodvidriver mode +\ifnum\pxhy@driver=\pxhy@driver@none + \pxhy@papersizefalse + \pxhy@charcmdsfalse +\fi + \bxDebug{****pxjahyper env^^J% pxhy@ptex = \ifpxhy@ptex true\else false\fi^^J% pxhy@uptex = \ifpxhy@uptex true\else false\fi^^J% pxhy@etex = \ifpxhy@etex true\else false\fi^^J% pxhy@etoolbox = \ifpxhy@etoolbox true\else false\fi^^J% pxhy@hook@system = \the\pxhy@hook@system^^J% -ifpxhy@hy@unicode = \ifpxhy@hy@unicode true\else false\fi^^J% -pxhy@bigcode = \ifpxhy@bigcode true\else false\fi^^J% -pxhy@driver = \the\pxhy@driver^^J% pxhy@tounicode = \ifpxhy@tounicode true\else false\fi^^J% pxhy@uniescape = \ifpxhy@uniescape true\else false\fi^^J% +pxhy@bigcode = \ifpxhy@bigcode true\else false\fi^^J% pxhy@papersize = \ifpxhy@papersize true\else false\fi^^J% -pxhy@textcmd = \ifpxhy@textcmd true\else false\fi^^J% +pxhy@charcmds = \ifpxhy@charcmds true\else false\fi^^J% +pxhy@driver = \the\pxhy@driver^^J% +ifpxhy@hy@unicode = \ifpxhy@hy@unicode true\else false\fi^^J% +pxhy@jacommentline = \ifpxhy@jacommentline true\else false\fi^^J% +pxhy@disablecmds = \ifpxhy@disablecmds true\else false\fi^^J% +pxhy@otfutf = \ifpxhy@otfutf true\else false\fi^^J% +pxhy@otfcid = \ifpxhy@otfcid true\else false\fi^^J% +pxhy@otfmacros = \ifpxhy@otfmacros true\else false\fi^^J% +pxhy@fallback@geta = \ifpxhy@fallback@geta true\else false\fi^^J% } %--------------------------------------- Helpers @@ -363,6 +387,13 @@ pxhy@textcmd = \ifpxhy@textcmd true\else false\fi^^J% \pxhy@get@jchar{\jis"222E} \let\pxhy@geta\pxhy@jchar +%% \pxhy@print@geta +\ifpxhy@fallback@geta + \def\pxhy@print@geta{\pxhy@geta} +\else + \let\pxhy@print@geta\@empty +\fi + %% \pxhy@hook@after@package{}{} \@onlypreamble\pxhy@hook@after@package \def\pxhy@hook@after@package#1#2{% @@ -418,6 +449,12 @@ pxhy@textcmd = \ifpxhy@textcmd true\else false\fi^^J% \def\pxhy@if@opt@a#1@[@#2#3\pxhy@mk{#2} \def\pxhy@if@opt@b#1#2]{#1{#2}} +%% \pxhy@xdetokenize{} +\let\pxhy@xdetokenize\detokenize +\pxhy@check\expanded{% + \def\pxhy@xdetokenize#1{\detokenize\expandafter{\expanded{#1}}}% +} + \fi %--------------------------------------- Load bxjatoucs @@ -428,7 +465,7 @@ pxhy@textcmd = \ifpxhy@textcmd true\else false\fi^^J% \let\pxhy@bxjatoucs@failure\relax %% \pxhy@try@load@bxjatoucs -% Tries to load bxjatoucs. If it failed, then it sets the reason +% Tries to load bxjatoucs. If that fails, then it sets the reason % message to \pxhy@bxjatoucs@failure. \@onlypreamble\pxhy@try@load@bxjatoucs \def\pxhy@try@load@bxjatoucs{% @@ -487,7 +524,7 @@ pxhy@textcmd = \ifpxhy@textcmd true\else false\fi^^J% % When the magnification is in effect (i.e. \mag<>1000), hyperref % emits a papersize special with wrong value. (dvipdfmx interprets -% the lengths in the special as 'true' length.) So here a papersize +% the lengths in the special as 'true' lengths.) So here a papersize % special with adjusted values will be output. \ifnum\mag=1000 \else \expandafter\ifx\csname ifHy@setpagesize\expandafter\endcsname @@ -677,6 +714,31 @@ pxhy@textcmd = \ifpxhy@textcmd true\else false\fi^^J% \unichar{"#1}% } +\else\ifpxhy@Uchar@avail %<*Uchar> + \ifpxhy@uptex + + %% \pxhy@Ux + \def\pxhy@Ux{\pxhy@uchex} + \pxhy@utfXVIfalse + \def\pxhy@uchex@out#1{\Uchar"#1 } + + \else\ifpxhy@ucs@avail + + %% \pxhy@Ux + \def\pxhy@Ux{\pxhy@uchex} + \pxhy@utfXVIfalse + \def\pxhy@uchex@out#1{% + \expandafter\pxhy@uchex@out@a\ucs"#1\pxhy@mk{#1}% + } + \def\pxhy@uchex@out@a#1\pxhy@mk#2{% + \ifnum#1<\z@ + \@nameuse{U+#2}% + \pxhy@print@geta + \else \Uchar#1 + \fi + } + + \fi\fi \else\ifpxhy@uptex %<*upTeX> %% \pxhy@Ux @@ -723,6 +785,11 @@ pxhy@textcmd = \ifpxhy@textcmd true\else false\fi^^J% \expandafter\pxhy@next\pxhy@marker %END-- +\fi\fi\fi % + +\AtEndOfPackage{% +\ifx\pxhy@posthook\@undefined\else + \bxDebug{add to \string\pdfstringdefPostHook}% % Add \pxhy@posthook to \pdfstringdefPostHook. \begingroup \toks@\expandafter{\pdfstringdefPostHook{#1}} @@ -734,11 +801,12 @@ pxhy@textcmd = \ifpxhy@textcmd true\else false\fi^^J% }% \pxhy@next \endgroup - -\fi\fi % +\fi +} \ifpxhy@uniescape %<*uniescape> + \let\pxhy@posthook\@undefined %% \pxhy@Ux \def\pxhy@Ux{\pxhy@uchex}% % \pxhy@uchex converts to UTF-16 @@ -750,6 +818,12 @@ pxhy@textcmd = \ifpxhy@textcmd true\else false\fi^^J% \fi % +%% 'disable-Ux' (for debug) +\ifx t\pxhy@disable@Ux + \let\pxhy@Ux\@undefined + \let\pxhy@posthook\@undefined +\fi + %% Makes \Ux be the code input command in PDF strings. \ifx\pxhy@Ux\@undefined\else \pdfstringdefDisableCommands{% @@ -782,7 +856,7 @@ pxhy@textcmd = \ifpxhy@textcmd true\else false\fi^^J% \pxhy@utfXVIfalse \def\pxhy@uchex@out#1{% \@nameuse{U+#1}% issue a warning - \pxhy@geta + \pxhy@print@geta } \else \let\pxhy@UTF\pxhy@Ux @@ -821,7 +895,7 @@ pxhy@textcmd = \ifpxhy@textcmd true\else false\fi^^J% %% \pxhy@CID{} \def\pxhy@CID#1{% \expandafter\expandafter\expandafter\pxhy@cid@aux - \bxjaCidToUcsHex{#1}\pxhy@mk{\detokenize{#1}}% + \bxjaCidToUcsHex{#1}\pxhy@mk{\pxhy@xdetokenize{#1}}% } %% \pxhy@fast@CID{} \def\pxhy@fast@CID#1{% @@ -831,7 +905,7 @@ pxhy@textcmd = \ifpxhy@textcmd true\else false\fi^^J% \ifx\pxhy@Ux\@undefined \def\pxhy@cid@aux#1\pxhy@mk#2{% \@nameuse{CID+#2}% issue a warning - \pxhy@geta + \pxhy@print@geta } \else \def\pxhy@cid@aux#1\pxhy@mk#2{% @@ -839,7 +913,7 @@ pxhy@textcmd = \ifpxhy@textcmd true\else false\fi^^J% \pxhy@Ux{#1}% \else \@nameuse{CID+#2}% - \pxhy@geta + \pxhy@print@geta \fi } \fi @@ -894,7 +968,7 @@ pxhy@textcmd = \ifpxhy@textcmd true\else false\fi^^J% \ifpxhy@hy@unicode PU\else PD1\fi } -\ifpxhy@textcmd %<*textcmd> +\ifpxhy@charcmds %<*charcmds> %%<+> \pxDeclarePdfTextCommand{\CS}{}{} \@onlypreamble\pxDeclarePdfTextCommand @@ -1395,7 +1469,7 @@ pxhy@textcmd = \ifpxhy@textcmd true\else false\fi^^J% \fi % %%%%%%%%%%%%%%%%%%%% done -\ifpxhy@textcmd %<*textcmd> +\ifpxhy@charcmds %<*charcmds> %% \pxhy@disable@tc@commands \def\pxhy@disable@tc@commands{% @@ -1446,7 +1520,7 @@ pxhy@textcmd = \ifpxhy@textcmd true\else false\fi^^J% %--------------------------------------- 'jacommentline' \ifpxhy@jacommentline -% The 'jacomemntline' feature outputs at the top of the +% The 'jacommentline' feature outputs at the top of the % hyperref outline file (*.out) a comment line including % some Japanese characters. -- cgit v1.2.3