summaryrefslogtreecommitdiff
path: root/language/japanese/pxchfon/pxchfon.sty
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-11-22 03:00:38 +0000
committerNorbert Preining <norbert@preining.info>2019-11-22 03:00:38 +0000
commit28453b76f5307a4e4f018d469cdd8eb18e7d048b (patch)
treeef08916d859a7174cb62de39176ad83a030563fb /language/japanese/pxchfon/pxchfon.sty
parent6332f770ef657658c6e3068266d960d18d185036 (diff)
CTAN sync 201911220300
Diffstat (limited to 'language/japanese/pxchfon/pxchfon.sty')
-rw-r--r--language/japanese/pxchfon/pxchfon.sty53
1 files changed, 42 insertions, 11 deletions
diff --git a/language/japanese/pxchfon/pxchfon.sty b/language/japanese/pxchfon/pxchfon.sty
index 0ac4b38ebb..c501395cb6 100644
--- a/language/japanese/pxchfon/pxchfon.sty
+++ b/language/japanese/pxchfon/pxchfon.sty
@@ -10,7 +10,7 @@
%% package declaration
\NeedsTeXFormat{pLaTeX2e}
-\ProvidesPackage{pxchfon}[2019/10/07 v1.6]
+\ProvidesPackage{pxchfon}[2019/11/19 v1.7]
\def\pxcz@pkgname{pxchfon}
%--------------------------------------- general
@@ -86,6 +86,10 @@
\edef\pxcz@tmpa{\string\ucs}\edef\pxcz@tmpb{\meaning\ucs}
\ifx\pxcz@tmpa\pxcz@tmpb \pxcz@uptextrue \fi
+%% \pxcz@JYn
+\edef\pxcz@JYn{%
+ \ifpxcz@uptex JY2\else JY1\fi}
+
%% \ifpxcz@otf@deluxe
\newif\ifpxcz@otf@deluxe \pxcz@otf@deluxefalse
\@ifpackagewith{otf}{deluxe}{\pxcz@otf@deluxetrue}{}
@@ -124,38 +128,47 @@
\let\pxcz@uniweight\relax
\let\pxcz@multiweight\relax
-%% \pxcz@declare@oneweight@preset{<name>}{<m>}{<g>}
+%% \pxcz@check@avail@custom@presets
+\pxcz@onlypreamble@let\pxcz@check@avail@custom@presets\relax
+\AtEndOfPackage{%
+ \def\pxcz@check@avail@custom@presets#1#2#3{%
+ \PackageError\pxcz@pkgname
+ {Custom presets cannot be registered after\MessageBreak
+ loading pxchfon package}%
+ {\@eha}}}
+
+%% \pxcz@declare@oneweight@preset{<name>}{<f-mc>}{<f-gt>}
\pxcz@onlypreamble@def\pxcz@declare@oneweight@preset#1#2#3{%
+ \pxcz@check@avail@custom@presets
\xdef\pxcz@custom@presets{\pxcz@custom@presets
\pxcz@custom{#1}{\pxcz@uniweight{#2}{#3}}}}
-%% \pxcz@declare@multiweight@preset{<name>}{<1>}...{<8>}
+%% \pxcz@declare@multiweight@preset{<name>}{<f-1>}...{<f-8>}
\pxcz@onlypreamble@def\pxcz@declare@multiweight@preset#1#2#3#4#5#6#7#8#9{%
+ \pxcz@check@avail@custom@presets
\xdef\pxcz@custom@presets{\pxcz@custom@presets
\pxcz@custom{#1}{\pxcz@multiweight{#2}{#3}{#4}{#5}{#6}{#7}{#8}{#9}}}}
-%%<+> \pxchfonDeclareOneWeightPreset{<name>}{<m>}{<g>}
+%%<+> \pxchfonDeclareOneWeightPreset{<name>}{<f-mc>}{<f-gt>}
\@onlypreamble\pxchfonDeclareOneWeightPreset
\newcommand*\pxchfonDeclareOneWeightPreset[1]{%
\pxcz@declare@oneweight@preset{user:#1}}
-%%<+> \pxchfonDeclareMultiWeightPreset{<name>}{<1>}...{<8>}
+%%<+> \pxchfonDeclareMultiWeightPreset{<name>}{<f-1>}...{<f-8>}
\@onlypreamble\pxchfonDeclareMultiWeightPreset
\newcommand*\pxchfonDeclareMultiWeightPreset[1]{%
\pxcz@declare@multiweight@preset{user:#1}}
%% Load custom preset definitions
-\IfFileExists{pxchfon-extras.def}{%
+\IfFileExists{pxchfon-extras.def}{% PXchfon-extras
\PackageInfo\pxcz@pkgname
{Extra preset settings are loaded\@gobble}%
\input{pxchfon-extras.def}%
}{}
-\IfFileExists{pxchfon.cfg}{%
+\IfFileExists{pxchfon.cfg}{% of user
\PackageInfo\pxcz@pkgname
{Custom preset settings are loaded\@gobble}%
\begingroup
\makeatother\input{pxchfon.cfg}%
\endgroup
}{}
-\let\pxcz@declare@oneweight@preset\@undefined
-\let\pxcz@declare@multiweight@preset\@undefined
%--------------------------------------- handle options
@@ -1256,7 +1269,10 @@
%%<*> \diruni
\DeclareRobustCommand*{\diruni}{%
\not@math@alphabet\diruni\relax
- \fontshape{diruni}\selectfont
+ \ifx\cy@encoding\pxcz@JYn % if in standard Japanese encoding
+ \expandafter\let\csname UTF \endcsname\pxcz@du@UTF
+ \fontshape{diruni}\selectfont
+ \fi
}
%%<*> \textdiruni{<text>}
@@ -1264,6 +1280,17 @@
\relax\ifmmode\hbox\fi{\diruni#1}%
}
+%% \pxcz@du@UTF
+\def\pxcz@du@UTF#1{%
+ \kchar"#1\relax}
+
+%% redefinition in PDF-strings
+\providecommand*\pdfstringdefPreHook{}
+\g@addto@macro\pdfstringdefPreHook{%
+ \let\diruni\@empty
+ \let\textdiruni\@firstofone
+}
+
\ifpxcz@diruni@ok %---- <*diruni-ok>
%% \pxcz@otf@weight: otf weight mode
@@ -1365,6 +1392,10 @@
\kanjishape{dirgid}\selectfont
\kchar#1\relax
\endgroup}
+\def\pxcz@hy@gid#1{?}
+\g@addto@macro\pdfstringdefPreHook{%
+ \let\gid\pxcz@hy@gid
+}
%% \pxcz@dg@decl@shape{<fam>}{<ser>}<sw>{<tfmname>}
\pxcz@onlypreamble@def\pxcz@dg@decl@shape#1#2#3#4{%
@@ -2006,7 +2037,7 @@
% Noto Sans/Serif CJK, "OpenType/CFF Collection (OTC)"
\pxcz@declare@preset{noto-otc}{%
\pxcz@multiweight{:0:NotoSerifCJK-Light.ttc}%
- {:0:NotoSerifCJK-Regular.ttc}{:0:NotoSerifCJK-Bold.ttc}%
+ {:0:NotoSerifCJK-Regular.ttc}{:0:N8otoSerifCJK-Bold.ttc}%
{:0:NotoSansCJK-Regular.ttc}{:0:NotoSansCJK-Bold.ttc}%
{:0:NotoSansCJK-Black.ttc}{:0:NotoSansCJK-Medium.ttc}%
{:0:NotoSansCJK-Medium.ttc}}