summaryrefslogtreecommitdiff
path: root/language
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-10-26 03:00:29 +0000
committerNorbert Preining <norbert@preining.info>2019-10-26 03:00:29 +0000
commit1548fb7616f0f4b1619d8e01a9daf1c1a6fce96e (patch)
treeb52d93a5f9f1108e5c55a1117c92ebd171b36f2c /language
parentc2d1af7de907333dbb44f6687de92751dce79ff8 (diff)
CTAN sync 201910260300
Diffstat (limited to 'language')
-rw-r--r--language/japanese/pxjahyper/README-ja.md5
-rw-r--r--language/japanese/pxjahyper/README.md1
-rw-r--r--language/japanese/pxjahyper/pxjahyper.pdfbin96162 -> 101012 bytes
-rw-r--r--language/japanese/pxjahyper/pxjahyper.sty124
-rw-r--r--language/japanese/pxjahyper/pxjahyper.tex13
5 files changed, 138 insertions, 5 deletions
diff --git a/language/japanese/pxjahyper/README-ja.md b/language/japanese/pxjahyper/README-ja.md
index dd70862687..a1a74ace8b 100644
--- a/language/japanese/pxjahyper/README-ja.md
+++ b/language/japanese/pxjahyper/README-ja.md
@@ -35,6 +35,11 @@ pxjahyper パッケージ ー 本体
更新履歴
--------
+ * Version 0.4 〈2019/10/25〉
+ - PDF 文字列中で `\CID` をサポート(`otfcid` オプション)
+ - (試験的) PDF 文字列中で japanese-otf の文字入力マクロをサポート
+ (`otfmacros` オプション)
+
* Version 0.3e 〈2019/06/20〉
- hyperref の `unicode` 指定が後から変更された場合はエラーを出す。
diff --git a/language/japanese/pxjahyper/README.md b/language/japanese/pxjahyper/README.md
index 60c28b0e99..6a86fc1349 100644
--- a/language/japanese/pxjahyper/README.md
+++ b/language/japanese/pxjahyper/README.md
@@ -36,6 +36,7 @@ Please refer to the manual `pxjahyper.pdf` (in Japanese) for detail.
Revision History
----------------
+ * Version 0.4 〈2019/10/25〉
* Version 0.3e 〈2019/06/20〉
* Version 0.3d 〈2018/07/15〉
* Version 0.3c 〈2018/01/25〉
diff --git a/language/japanese/pxjahyper/pxjahyper.pdf b/language/japanese/pxjahyper/pxjahyper.pdf
index 03ef941185..82948f375d 100644
--- a/language/japanese/pxjahyper/pxjahyper.pdf
+++ b/language/japanese/pxjahyper/pxjahyper.pdf
Binary files differ
diff --git a/language/japanese/pxjahyper/pxjahyper.sty b/language/japanese/pxjahyper/pxjahyper.sty
index 68166215ec..8a429bdad9 100644
--- a/language/japanese/pxjahyper/pxjahyper.sty
+++ b/language/japanese/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>
diff --git a/language/japanese/pxjahyper/pxjahyper.tex b/language/japanese/pxjahyper/pxjahyper.tex
index 41b1b1c7f5..e4633e8da3 100644
--- a/language/japanese/pxjahyper/pxjahyper.tex
+++ b/language/japanese/pxjahyper/pxjahyper.tex
@@ -3,8 +3,8 @@
\documentclass[a4paper]{jsarticle}
\usepackage{shortvrb}
\MakeShortVerb{\|}
-\newcommand{\PkgVersion}{0.3e}
-\newcommand{\PkgDate}{2019/06/20}
+\newcommand{\PkgVersion}{0.4}
+\newcommand{\PkgDate}{2019/10/25}
\newcommand{\Pkg}[1]{\textsf{#1}}
\newcommand{\Meta}[1]{$\langle$\mbox{}#1\mbox{}$\rangle$}
\newcommand{\Note}{\par\noindent ※}
@@ -64,6 +64,13 @@
{\upLaTeX} では使用不可。
\item |noout2uni|(既定)\Means
|out2uni| の否定。
+\item |otfcid|(既定)\Means
+ \Pkg{japanese-otf}パッケージの |\CID| をPDF文字列中で
+ 使えるようにする。
+ 具体的には、当該のAJ1のグリフに“対応”するUnicode文字が
+ あればそれを出力し、なければ(警告を出した上で)削除する。
+\item |nootfcid| \Means
+ |otfcid| の否定。
\item |bigcode|(既定)\Means
{\upTeX}でのToUnicode CMapとして既定のUTF8-UCSの代わりに\
UTF8-UTF16を用いる。
@@ -98,7 +105,7 @@ PDF文字列以外では |\Ux| は以前の定義(または未定義)に戻
符号値は16進数で指定する。
-なお、\Pkg{OTF}パッケージの |\UTF| 命令は、PDF文字列中では
+なお、\Pkg{japanese-otf}パッケージの |\UTF| 命令は、PDF文字列中では
out2uni用の出力を行うように設計されているが、
本パッケージを {\upLaTeX} で用いた場合は、
|\UTF| も(PDF文字列中では)|\Ux| と同じ動作