diff options
author | Karl Berry <karl@freefriends.org> | 2019-10-25 21:02:06 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-10-25 21:02:06 +0000 |
commit | 819440293cec3930d0029a4b0a6edbcf4ec1b4e7 (patch) | |
tree | 14e73e47d73fe12d71351a7c3f9768663739a8de /Master/texmf-dist/tex/platex | |
parent | fbe4cbb5fcf9a3c08edacde11d586b3b20443dba (diff) |
pxjahyper (25oct19)
git-svn-id: svn://tug.org/texlive/trunk@52531 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/platex')
-rw-r--r-- | Master/texmf-dist/tex/platex/pxjahyper/pxjahyper.sty | 124 |
1 files changed, 122 insertions, 2 deletions
diff --git a/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper.sty b/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper.sty index 68166215ecd..8a429bdad9c 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}[2019/06/20 v0.3e] +\ProvidesPackage{pxjahyper}[2019/10/25 v0.4] %% error messages \def\pxhy@pkgname{pxjahyper} @@ -30,6 +30,7 @@ %% globals \newif\ifpxhy@ptex \newif\ifpxhy@uptex +\newif\ifpxhy@etex \let\pxhy@jcode\@undefined \newif\ifpxhy@tounicode \newif\ifpxhy@zerox @@ -40,6 +41,8 @@ \let\pxhy@driver\@undefined \newif\ifpxhy@hy@unicode \newif\ifpxhy@jacommentline +\newif\ifpxhy@otfcid +\newif\ifpxhy@otfmacros %--------------------------------------- Package options @@ -82,6 +85,21 @@ \DeclareOption{nojacommentline}{% \pxhy@jacommentlinefalse } +\pxhy@otfcidtrue +\DeclareOption{otfcid}{% + \pxhy@otfcidtrue + \let\pxhy@otfcid@given=t +} +\DeclareOption{nootfcid}{% + \pxhy@otfcidfalse +} +\DeclareOption{otfmacros}{% + \pxhy@otfmacrostrue + \let\pxhy@otfcid@given=t +} +\DeclareOption{nootfmacros}{% + \pxhy@otfmacrosfalse +} \ExecuteOptions{% auto,tounicode,noout2uni,jacommentline% } @@ -125,11 +143,13 @@ \fi %% Check the engine. +\@onlypreamble\pxhy@check \def\pxhy@check#1#2{% \edef\pxhy@tmpa{\string#1}% \edef\pxhy@tmpb{\meaning#1}% \ifx\pxhy@tmpa\pxhy@tmpb #2\fi } +\pxhy@check\eTeXversion{\pxhy@etextrue} \pxhy@check\kanjiskip{\pxhy@ptextrue} \pxhy@check\forcecjktoken{\pxhy@uptextrue} \ifpxhy@ptex\else @@ -182,6 +202,15 @@ \pxhy@fatal{hyperref 'unicode' mode is not supported}{}% \expandafter\endinput \fi +% otfcid requires upTeX or out2uni. +\ifpxhy@uptex\else\ifpxhy@zerox\else + \pxhy@otfcidfalse + \ifx t\pxhy@otfcid@given + \PackageWarningNoLine\pxhy@pkgname + {Option 'otfcid' is invalid unless upTeX is used\MessageBreak + or 'out2uni' is specified} + \fi +\fi\fi \iffalse \typeout{% @@ -196,8 +225,14 @@ pxhy@driver = \the\pxhy@driver^^J% %--------------------------------------- Helpers -%% pxhy@end +%% packages +\ifpxhy@etex + \RequirePackage{etoolbox}[2011/01/03]%v2.1 +\fi + +%% unique tokens \def\pxhy@end{\pxhy@end@} +\let\pxhy@mk\indent % unexpandable %% \pxhy@out@special{<text>} \def\pxhy@out@special#1{% @@ -401,6 +436,91 @@ pxhy@driver = \the\pxhy@driver^^J% %Note: if out2uni is off then \Ux remains undefined. \fi\fi %</upTeX> +%--------------------------------------- Support for 'otfcid' +\ifpxhy@otfcid + +%% variables +\@onlypreamble\pxhy@otfcid@disabled +\let\pxhy@otfcid@disabled\relax + +%% preparation +\ifpxhy@etex + % check if bxjatoucs is available + \IfFileExists{bxjatoucs.sty}{% + \let\bxjatoucsCheckAvail=t + \RequirePackage{bxjatoucs}[] + \undef\bxjatoucsCheckAvail + }{} + \ifundef\bxjaCidToUcs{% + \def\pxhy@otfcid@disabled{% + package 'bxjatoucs' is unavailable% + }% + }{} +\else + \def\pxhy@otfcid@disabled{% + e-TeX extension is unavailable% + } +\fi +%% annihilate the ajmacros's own pdfstring process +\ifpxhy@otfmacros\ifx\pxhy@otfcid@disabled\relax + \let\ajRedefine@ajCommands\relax + \AtBeginDocument{\let\ajRedefine@ajCommands\relax} +\fi\fi + +%% \pxhy@CID{<cid>} +\def\pxhy@CID#1{% + \expandafter\expandafter\expandafter\pxhy@cid@aux + \bxjaCidToUcsHex{#1}\pxhy@mk{\detokenize{#1}}% +} +%% \pxhy@fast@CID{<cid>} +\def\pxhy@fast@CID#1{% + \expandafter\expandafter\expandafter\pxhy@cid@aux + \bxjaFastCidToUcsHex{#1}\pxhy@mk{\number#1}% +} +\def\pxhy@cid@aux#1\pxhy@mk#2{% + \ifnum"#1>\z@ + \pxhy@uchex{#1}% + \else + \@nameuse{CID+#2}% + \fi +} + +%% \pxhy@dispatch@otfcid +\@onlypreamble\pxhy@dispatch@otfcid +\def\pxhy@dispatch@otfcid{% + \pdfstringdefDisableCommands{% + \let\CID\pxhy@CID + }% + \ifpxhy@otfmacros + \ifx\ajSnowman\@undefined\else % ajmacros is loaded + \makeatletter + \InputIfFileExists{pxjahyper-ajm.def}{% + \PackageInfo\pxhy@pkgname + {Loaded 'pxjahyper-ajm.def'\@gobble}% + }{% + \PackageWarning\pxhy@pkgname + {File 'pxjahyper-ajm.def' not found\@gobble}% + }% + \makeatother + \fi + \fi +} + +%% begin-document hook +\AtBeginDocument{% + \@ifpackageloaded{otf}{% + \ifx\pxhy@otfcid@disabled\relax % available! + \pxhy@dispatch@otfcid + \else + \PackageWarningNoLine\pxhy@pkgname + {Option 'otfcid' is disabled, because\MessageBreak + \pxhy@otfcid@disabled}% + \pxhy@otfcidfalse + \fi + }{}% +} + +\fi %--------------------------------------- Redefine text commands for PD1 \ifnum\pxhy@driver=\pxhy@driver@dvipdfmx %<*dvipdfmx> |