summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/platex/pxchfon/pxchfon.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/platex/pxchfon/pxchfon.sty')
-rw-r--r--Master/texmf-dist/tex/platex/pxchfon/pxchfon.sty316
1 files changed, 245 insertions, 71 deletions
diff --git a/Master/texmf-dist/tex/platex/pxchfon/pxchfon.sty b/Master/texmf-dist/tex/platex/pxchfon/pxchfon.sty
index b3041e77703..3a60cf7701a 100644
--- a/Master/texmf-dist/tex/platex/pxchfon/pxchfon.sty
+++ b/Master/texmf-dist/tex/platex/pxchfon/pxchfon.sty
@@ -8,19 +8,25 @@
%% This package is distributed under the MIT License.
%%
-%%%% package declaration
+%% package declaration
\NeedsTeXFormat{pLaTeX2e}
-\ProvidesPackage{pxchfon}[2017/05/31 v1.0]
+\ProvidesPackage{pxchfon}[2017/06/19 v1.0a]
\def\pxcz@pkgname{pxchfon}
-%%%% definitions
+%% preparations
\def\pxcz@error{\PackageError\pxcz@pkgname}
\def\pxcz@warn{\PackageWarning\pxcz@pkgname}
\def\pxcz@info{\PackageInfo\pxcz@pkgname}
+
+%--------------------------------------- general
+
+%% variables
\newif\ifpxcz@ok
\newif\ifpxcz@utf
-%%%% check for 'pxjafont' package
+%--------------------------------------- environment check
+
+%% check for 'pxjafont' package
% if old version of pxjafont is loaded (probably this package is
% required from pxjafont), then I abort here with an error message
% and in addition cause pxjafont to abort immediately.
@@ -32,38 +38,85 @@
\let\pxjf@main@preset\relax % make pxjafont bombout
\endinput\fi}{}
-%%%% check for upTeX
+%% \ifpxcz@uptex
\newif\ifpxcz@uptex \pxcz@uptexfalse
\edef\pxcz@tmpa{\string\ucs}\edef\pxcz@tmpb{\meaning\ucs}
\ifx\pxcz@tmpa\pxcz@tmpb \pxcz@uptextrue \fi
-%%%% process options
+%% \ifpxcz@otf@deluxe
+\newif\ifpxcz@otf@deluxe \pxcz@otf@deluxefalse
+\@ifpackagewith{otf}{deluxe}{\pxcz@otf@deluxetrue}{}
+\@ifpackagewith{pxotf}{deluxe}{\pxcz@otf@deluxetrue}{}
+
+%% \ifpxcz@otf@multi
+\newif\ifpxcz@otf@multi \pxcz@otf@multifalse
+\@ifpackagewith{otf}{multi}{\pxcz@otf@multitrue}{}
+
+%--------------------------------------- handle options
+
+%% variables
+\newif\ifpxcz@enabled \pxcz@enabledtrue
\let\pxcz@alphabet=n
+\newif\ifpxcz@otf \pxcz@otftrue
+\newif\ifpxcz@cmap@alpha
+\newif\ifpxcz@mmivjis
+\newif\ifpxcz@everypage
+\newif\ifpxcz@oneweight
+\newif\ifpxcz@uniquify
+\let\pxcz@directunicode\relax
+\let\pxcz@main@preset\relax
+\let\pxcz@file@preset\relax
+\newif\ifpxcz@file@preset@tl
+\newif\ifpxcz@alpha
+\newif\ifpxcz@rel
+\newif\ifpxcz@dumpmap
+\newif\ifpxcz@dumpmap@tl
+
+%% process options
+% drivers
+\DeclareOption{nodvidriver}{\pxcz@enabledfalse}
+\DeclareOption{dvips}{\pxcz@enabledfalse}
+\DeclareOption{dviout}{\pxcz@enabledfalse}
+\DeclareOption{xdvi}{\pxcz@enabledfalse}
+\DeclareOption{dvipdfmx}{\pxcz@enabledtrue}
+% (no)alphabet / relfont
\DeclareOption{alphabet}{\let\pxcz@alphabet=t}
\DeclareOption{noalphabet}{\let\pxcz@alphabet=f}
\DeclareOption{relfont}{\let\pxcz@alphabet=r}
-\newif\ifpxcz@otf \pxcz@otftrue
+% (no)otf
\DeclareOption{otf}{\pxcz@otftrue}
\DeclareOption{nootf}{\pxcz@otffalse}
\DeclareOption{utf}{\pxcz@otftrue}
\DeclareOption{noutf}{\pxcz@otffalse}
-\newif\ifpxcz@cmap@alpha
+% (no)usecmapforalphabet
\DeclareOption{usecmapforalphabet}{\pxcz@cmap@alphatrue}
\DeclareOption{nousecmapforalphabet}{\pxcz@cmap@alphafalse}
-\newif\ifpxcz@mmivjis
+% (no)prefer2004jis / (no)jis2004
\DeclareOption{prefer2004jis}{\pxcz@mmivjistrue}
\DeclareOption{noprefer2004jis}{\pxcz@mmivjisfalse}
-\newif\ifpxcz@everypage
+\DeclareOption{jis2004}{\pxcz@mmivjistrue}
+\DeclareOption{nojis2004}{\pxcz@mmivjisfalse}
+% (no)everypage
\DeclareOption{everypage}{\pxcz@everypagetrue}
\DeclareOption{noeverypage}{\pxcz@everypagefalse}
-\newif\ifpxcz@oneweight
+% (no)oneweight
\DeclareOption{oneweight}{\pxcz@oneweighttrue}
\DeclareOption{nooneweight}{\pxcz@oneweightfalse}
-\newif\ifpxcz@uniquify
-\chardef\pxcz@directunicode=0
-\DeclareOption{directunicode*}{\chardef\pxcz@directunicode=2 }
-\DeclareOption{directunicode}{\chardef\pxcz@directunicode=1 }
-\DeclareOption{nodirectunicode}{\chardef\pxcz@directunicode=0 }
+% (no)directunicode / directunicode*
+\chardef\pxcz@directunicode@none=0
+\chardef\pxcz@directunicode@otf=1
+\chardef\pxcz@directunicode@all=2
+\chardef\pxcz@directunicode@full=3
+\let\pxcz@directunicode\pxcz@directunicode@none
+\DeclareOption{directunicode*}{\let\pxcz@directunicode\pxcz@directunicode@all}
+\DeclareOption{directunicode}{\let\pxcz@directunicode\pxcz@directunicode@otf}
+\DeclareOption{nodirectunicode}{\let\pxcz@directunicode\pxcz@directunicode@none}
+% (no)dumpmap
+\DeclareOption{dumpmap}{\pxcz@dumpmaptrue}
+\DeclareOption{nodumpmap}{\pxcz@dumpmapfalse}
+% (no)dumpmaptl
+\DeclareOption{dumpmaptl}{\pxcz@dumpmap@tltrue}
+\DeclareOption{nodumpmaptl}{\pxcz@dumpmap@tlfalse}
% preset spec options
\def\pxcz@all@main@preset{%
noembed,%
@@ -73,7 +126,7 @@
ms-hg,ipa-hg,ipaex-hg,moga-mobo,moga-mobo-ex,moga-maruberi,%
kozuka-pro,kozuka-pr6,kozuka-pr6n,hiragino-pro,hiragino-pron,%
hiragino-elcapitan-pro,hiragino-elcapitan-pron,%
- morisawa-pro,morisawa-pr6n,yu-win,yu-win10,yu-osx,%
+ morisawa-pro,morisawa-pr6n,yu-win,yu-win10,yu-win10+,yu-osx,%
sourcehan-otc,sourcehan,noto-otc,noto%
%(obsolete)
ipa-otf,ipa-otf-dx,kozuka4,kozuka6,kozuka6n,hiragino,%
@@ -81,7 +134,6 @@
ms-dx,ipa-ttf,ipa-ttf-dx,ipav2,ipav2-dx,ipa-dx,hiragino-dx,%
noEmbed,kozuka,hiragino-elcapitan,morisawa}
% But note, 'hiragino' != 'hiragino-pro'
-\let\pxcz@main@preset\relax
\def\pxcz@do#1{\DeclareOption{#1}{\def\pxcz@main@preset{#1}}}
\@for\pxcz@x:=\pxcz@all@main@preset\do{%
\expandafter\pxcz@do\expandafter{\pxcz@x}}
@@ -90,20 +142,21 @@
\def\pxcz@opt@@unicodeS{unicode*}
\DeclareOption*{%
\ifx\CurrentOption\pxcz@opt@@unicode
- \chardef\pxcz@directunicode=3
+ \let\pxcz@directunicode\pxcz@directunicode@full
\else\ifx\CurrentOption\pxcz@opt@@unicodeS
\pxcz@uniquifytrue
- \chardef\pxcz@directunicode=3
+ \let\pxcz@directunicode\pxcz@directunicode@full
\else
\pxcz@parse@opt\CurrentOption
\ifpxcz@ok\else \@unknownoptionerror \fi
\fi\fi}
-\let\pxcz@file@preset\relax
-\newif\ifpxcz@file@preset@tl
+\@onlypreamble\pxcz@parse@opt
\def\pxcz@parse@opt#1{%
\expandafter\pxcz@parse@opt@a#1\@nnil}
+\@onlypreamble\pxcz@parse@opt@a
\def\pxcz@parse@opt@a{%
\futurelet\pxcz@tok\pxcz@parse@opt@b}
+\@onlypreamble\pxcz@parse@opt@b
\def\pxcz@parse@opt@b{%
\pxcz@okfalse
\let\pxcz@tmpa\remove@to@nnil
@@ -112,21 +165,21 @@
\else\ifx*\pxcz@tok
\pxcz@file@preset@tlfalse \let\pxcz@tmpa\pxcz@parse@opt@c
\fi\fi \pxcz@tmpa}
+\@onlypreamble\pxcz@parse@opt@c
\def\pxcz@parse@opt@c#1#2\@nnil{%
\edef\pxcz@file@preset{#2}}
% dispatch
\ProcessOptions*
-% 'everypage' needs 'atbegshi' package
+%% 'everypage' needs 'atbegshi' package
\ifpxcz@everypage
\RequirePackage{atbegshi}
\fi
-%% \ifpxcz@alpha
+%% set 'pxcz@alpha'
\@tempswafalse
\if\pxcz@main@preset\relax
\if\pxcz@file@preset\relax \@tempswatrue \fi
\fi
-\newif\ifpxcz@alpha
\if t\pxcz@alphabet \pxcz@alphatrue
\else\if f\pxcz@alphabet \pxcz@alphafalse
\else\if r\pxcz@alphabet \pxcz@alphafalse
@@ -141,8 +194,7 @@
\pxcz@alphafalse}
\fi
-%% \ifpxcz@rel
-\newif\ifpxcz@rel
+%% set 'pxcz@rel'
\if r\pxcz@alphabet \pxcz@reltrue
\else \pxcz@relfalse
\fi
@@ -161,36 +213,36 @@
\else \pxcz@alphafontfalse
\fi\fi
-%% \ifpxcz@otf@deluxe
-\newif\ifpxcz@otf@deluxe \pxcz@otf@deluxefalse
-\@ifpackagewith{otf}{deluxe}{\pxcz@otf@deluxetrue}{}
-\@ifpackagewith{pxotf}{deluxe}{\pxcz@otf@deluxetrue}{}
-
-%% \ifpxcz@otf@multi
-\newif\ifpxcz@otf@multi \pxcz@otf@multifalse
-\@ifpackagewith{otf}{multi}{\pxcz@otf@multitrue}{}
-
-%%------------------ preset-triggered setup
+%--------------------------------------- preset-triggered setup
%% \pxcz@if@main@preset{<name>}{<code>}
+\@onlypreamble\pxcz@if@main@preset
\def\pxcz@if@main@preset#1{%
\edef\pxcz@tmpa{#1}%
\ifx\pxcz@main@preset\pxcz@tmpa \expandafter\@firstofone
\else \expandafter\@gobble
\fi}
%% setup
+\def\pxcz@preset@setup@sourcehan{%
+ \ifnum\pxcz@directunicode=\pxcz@directunicode@all \else
+ \let\pxcz@directunicode\pxcz@directunicode@full
+ \pxcz@uniquifyfalse
+ \fi}
\pxcz@if@main@preset{sourcehan}{%
- \chardef\pxcz@directunicode=3 \pxcz@uniquifyfalse}
+ \pxcz@preset@setup@sourcehan}
\pxcz@if@main@preset{sourcehan-otc}{%
- \chardef\pxcz@directunicode=3 \pxcz@uniquifyfalse}
+ \pxcz@preset@setup@sourcehan}
\pxcz@if@main@preset{noto}{%
- \chardef\pxcz@directunicode=3 \pxcz@uniquifyfalse}
+ \pxcz@preset@setup@sourcehan}
\pxcz@if@main@preset{noto-otc}{%
- \chardef\pxcz@directunicode=3 \pxcz@uniquifyfalse}
+ \pxcz@preset@setup@sourcehan}
+\pxcz@if@main@preset{yu-win10+}{%
+ \let\pxcz@directunicode\pxcz@directunicode@full
+ \pxcz@uniquifyfalse}
-%%------------------ user interface
+%--------------------------------------- user interface
-%%%%<*> \setminchofont/\setgothicfont/etc.
+%%<*> \setminchofont/\setgothicfont/etc.
\newcommand*\setminchofont{\pxcz@setfont{mnl,mnr,mnb}}
\newcommand*\setgothicfont{\pxcz@setfont{gtr,gtb,gtx,gtu}}
\newcommand*\setlightminchofont{\pxcz@setfont{mnl}}
@@ -207,8 +259,10 @@
\newcommand*\setschinesegothicfont{\pxcz@setfont{scg}}
\newcommand*\settchineseminchofont{\pxcz@setfont{tcm}}
\newcommand*\settchinesegothicfont{\pxcz@setfont{tcg}}
+\@onlypreamble\pxcz@setfont
\def\pxcz@setfont#1{\@ifnextchar[%]
{\pxcz@setfont@a{#1}}{\pxcz@setfont@a{#1}[]}}
+\@onlypreamble\pxcz@setfont@a
\def\pxcz@setfont@a#1[#2]#3{%
\@for\pxcz@x:={#1}\do{%
\ifx @#2@\@namedef{pxcz@FS/\pxcz@x}{#3}%
@@ -218,7 +272,7 @@
kom,kog,scm,scg,tcm,tcg%
}\do{\@namedef{pxcz@FS/\pxcz@x}{}}
-%%------------------ '\asUTF'
+%--------------------------------------- '\asUTF'
% NB. This feature is superseded by the \diruni command.
\ifpxcz@uptex
@@ -237,7 +291,7 @@
}
\fi
-%%------------------ fontmap internals
+%--------------------------------------- fontmap internals
%% \pxcz@noembed
% The value given to \set...font to mean 'no-embed'.
@@ -251,7 +305,7 @@
% CMap name for halfwidth fonts.
\def\pxcz@cmap@hwuni{UniJIS-UCS2-HW-H}
-%%%% <*> \usecmapforalphabet/\nousecmapforalphabet
+%%<*> \usecmapforalphabet/\nousecmapforalphabet
\def\usecmapforalphabet{%
\global\let\pxcz@cmap@uni\pxcz@cmap@hwuni}
\def\nousecmapforalphabet{%
@@ -280,33 +334,34 @@
\csname pxcz@FS/#1\endcsname}
%%<+> \JaFontReplacementHook{<code>}
+\@onlypreamble\JaFontReplacementHook
\newcommand*\JaFontReplacementHook{%
\g@addto@macro\pxcz@user@hook}
\let\pxcz@user@hook\@empty
-\@onlypreamble\JaFontReplacementHook
%%<+> \JaFontUserDefinedMap
+\@onlypreamble\JaFontUserDefinedMap
\newcommand*\JaFontUserDefinedMap{%
\g@addto@macro\pxcz@user@map}
\let\pxcz@user@map\@empty
\@namedef{pxcz@FS/*}{\pxcz@empty}
-\@onlypreamble\JaFontUserDefinedMap
%%<+> \usefontmapline{<map-line>}
+\@onlypreamble\usefontmapline
\newcommand*\usefontmapline[1]{%
\JaFontUserDefinedMap{\pxcz@addtospec@alt\pxcz@mapline{#1}}}
-\@onlypreamble\usefontmapline
%%<+> \usefontmapfile{<map-file>}
+\@onlypreamble\usefontmapfile
\newcommand*\usefontmapfile[1]{%
\JaFontUserDefinedMap{\pxcz@addtospec@alt\pxcz@mapfile{#1}}}
-\@onlypreamble\usefontmapfile
-%%------------------ map entry handling
+%--------------------------------------- map entry handling
%%<*> \setnewglyphcmapprefix{<str>}
\def\pxcz@pfx@jis@dflt{2004-}
\def\pxcz@pfx@jis@star{JISX0213-2004-}
+\@onlypreamble\setnewglyphcmapprefix
\newcommand*\setnewglyphcmapprefix{%
\@ifstar{\pxcz@set@pfx@jis\pxcz@pfx@jis@star}%
{\pxcz@set@pfx@jis}}
@@ -324,6 +379,7 @@
\let\pxcz@switch@realfont\relax
%% \pxcz@do@switch@realfont
+\@onlypreamble\pxcz@do@switch@realfont
\def\pxcz@do@switch@realfont{%
\edef\pxcz@reset@mmivjis{%
\ifpxcz@mmivjis \noexpand\pxcz@mmivjistrue
@@ -360,21 +416,34 @@
\def\pxcz@NC@otf@dif#1jp{%
#1\ifcase\pxcz@entry@type\or kr\or sc\fi}
+%% \pxcz@YW
+\def\pxcz@YW#1{%
+ \ifx#1/\expandafter\pxcz@YW@mc@dif
+ \else \expandafter\pxcz@YW@gt@dif
+ \fi}
+\def\pxcz@YW@gt@dif#1:{%
+ \ifnum\pxcz@entry@type=\tw@ :1:\else:0:\fi}
+\def\pxcz@YW@mc@dif#1.ttf{%
+ \ifnum\pxcz@entry@type=\tw@ \@nameuse{pxcz@YWG/#1}\else#1.ttf\fi}
+\@namedef{pxcz@YWG/yuminl}{:1:YuGothL.ttc}
+\@namedef{pxcz@YWG/yumin}{:1:YuGothR.ttc}
+\@namedef{pxcz@YWG/yumindb}{:1:YuGothM.ttc}
+
%% primary macros
\let\pxcz@unidirect\@empty
\let\pxcz@unidirectX\@empty
\let\pxcz@unidirect@wopt\@empty
\let\pxcz@unidirectX@wopt\@empty
\let\pxcz@unidirectX@lopt\@gobble
-\ifnum\pxcz@directunicode>\z@
+\ifnum\pxcz@directunicode<\pxcz@directunicode@otf\else
\def\pxcz@unidirect#1-#2-#3{\pxcz@cmap@directuni}
\def\pxcz@unidirect@wopt{ -w 1}
\fi
-\ifnum\pxcz@directunicode>\@ne
+\ifnum\pxcz@directunicode<\pxcz@directunicode@all\else
\let\pxcz@unidirectX\pxcz@unidirect
\let\pxcz@unidirectX@wopt\pxcz@unidirect@wopt
\fi
-\ifnum\pxcz@directunicode>\tw@
+\ifnum\pxcz@directunicode<\pxcz@directunicode@full\else
\def\pxcz@unidirectX@lopt#1{ -l #1}
\fi
%% secondary macros
@@ -392,7 +461,11 @@
\let\pxcz@entry@@fwid\pxcz@entry@@jpXX
\fi
+%% \pxcz@spec
+\let\pxcz@spec\@empty
+
%% \pxcz@addtospec{<id>}
+\@onlypreamble\pxcz@addtospec
\def\pxcz@addtospec#1{%
\bgroup \let\Entry\pxcz@Entry
\let\ \space \let\*\pxcz@pfx@jis
@@ -400,7 +473,9 @@
\let\@hwid\pxcz@entry@@hwid \let\@fwid\pxcz@entry@@fwid
\let\@jp\pxcz@entry@@jp \let\@jpXX\pxcz@entry@@jpXX
\@nameuse{pxcz@ME/#1}\egroup}
+\@onlypreamble\pxcz@Entry
\def\pxcz@Entry#1{%
+ \def\pxcz@entry@sym{#1}%
\expandafter\let\expandafter\FONT\csname pxcz@FS/#1\endcsname
\let\FONTo\FONT \let\FONTs\FONT
\ifx\FONT\pxcz@noembed
@@ -418,13 +493,28 @@
\fi\fi
\ifx\FONT\@empty \expandafter\@gobbletwo
\else \expandafter\pxcz@entry@a \fi}
+\@onlypreamble\pxcz@entry@a
\def\pxcz@entry@a#1#2{%
\chardef\pxcz@entry@type=#1\relax
- \xdef\pxcz@spec{%
- \pxcz@spec\noexpand\special{\pxcz@mapline{#2}}}}
-\let\pxcz@spec\@empty
+ \pxcz@check@entry \ifpxcz@ok
+ \xdef\pxcz@spec{%
+ \pxcz@spec\noexpand\special{\pxcz@mapline{#2}}}%
+ \fi}
+
+%% \pxcz@check@entry
+\@onlypreamble\pxcz@check@entry
+\def\pxcz@sym@@mgr{mgr}
+\def\pxcz@check@entry{%
+ \pxcz@oktrue
+ \ifnum\pxcz@entry@type=\@ne
+ \ifx\pxcz@entry@sym\pxcz@sym@@mgr
+ \expandafter\ifx\csname pxcz@FS/gtr\endcsname\relax\else
+ \pxcz@okfalse \fi
+ \fi
+ \fi}
%% \pxcz@do@file@preset
+\@onlypreamble\pxcz@do@file@preset
\def\pxcz@do@file@preset{%
\ifpxcz@file@preset@tl
\pxcz@do@file@preset@a{ptex-}%
@@ -436,6 +526,7 @@
\else
\pxcz@do@file@preset@a{}%
\fi}
+\@onlypreamble\pxcz@do@file@preset@a
\def\pxcz@do@file@preset@a#1{%
\pxcz@addtospec@alt\pxcz@mapfile{#1\pxcz@file@preset.map}}
@@ -445,14 +536,14 @@
\def\pxcz@mapfile#1{pdf:mapfile #1}
\def\pxcz@mapline#1{pdf:mapline #1}
-%%------------------ map entry definitions
+%--------------------------------------- map entry definitions
%% \pxcz@mapentry{<id>}{<text>}
\def\pxcz@mapentry#1{%
\expandafter\pxcz@mapentry@a\csname pxcz@ME/#1\endcsname}
\def\pxcz@mapentry@a#1{\@onlypreamble#1\def#1}
-%%%% map entries
+%% map entries
% \FONT: file name for the 2004JIS font
% \FONTo: file name for the 90JIS font
% \FONTs: \FONT if prefer2004jis, \FONTo otherwise
@@ -653,7 +744,7 @@
\pxcz@user@map
}
-%%------------------ '\diruni'
+%--------------------------------------- '\diruni'
%% variables
\newif\ifpxcz@diruni@ok
@@ -664,7 +755,7 @@
\@ifpackageloaded{otf}{% directunicode needs otf
\ifnum\pxcz@directunicode>\z@ \pxcz@diruni@oktrue \fi
}{%else
- \ifnum\pxcz@directunicode>\@ne
+ \ifnum\pxcz@directunicode<\pxcz@directunicode@all\else
\pxcz@diruni@oktrue % directunicode* does not need otf
\AtBeginDocument{% to laod otf later causes inconsistency
\@ifpackageloaded{otf}{\pxcz@diruni@okfalse}{}}%
@@ -799,7 +890,7 @@
\let\diruni\pxcz@err@diruni
\fi}
-%%------------------ 'alphabet' option
+%--------------------------------------- 'alphabet' option
%% \pxcz@decl@shape{<fam>}{<ser>}{<font>}
\@onlypreamble\pxcz@decl@shape
@@ -847,7 +938,7 @@
% if mnr is replaced but gtr is not then ...
\expandafter\ifx\csname pxcz@FS/gtr\endcsname\@empty
{\expandafter\let\csname pxcz@FS/gtr\endcsname\pxcz@x
- \pxcz@Entry{gtr}{r-cfjas-r-@PXcjk0@ \pxcz@cmap@uni\space \FONT}}%
+ \pxcz@Entry{gtr}1{r-cfjas-r-@PXcjk0@ \pxcz@cmap@uni\space \FONT}}%
\fi\fi
\@ifpackagewith{otf}{deluxe}{\pxcz@err@dxotf{otf}}{}%
\@ifpackagewith{pxotf}{deluxe}{\pxcz@err@dxotf{pxotf}}{}%
@@ -855,9 +946,10 @@
\fi %---- </otfdx>
\fi %---- </alphabet>
-%%------------------ begin-document hook
+%--------------------------------------- begin-document hook
-%%%% \pxcz@set@page@hook{<text>}
+%% \pxcz@set@page@hook{<text>}
+\@onlypreamble\pxcz@set@page@hook
\ifpxcz@everypage
\def\pxcz@set@page@hook#1{%
\AtBeginShipout{\setbox\AtBeginShipoutBox=\vbox{%
@@ -869,7 +961,8 @@
\global\setbox\@begindvibox\vbox{\yoko\unvbox\@begindvibox#1}}
\fi
-%%%% \AtBeginDocument
+%% the begin-document hook
+\@onlypreamble\pxcz@check@alldefined
\def\pxcz@check@alldefined#1{%
\pxcz@oktrue
\@for\pxcz@x:={#1}\do{%
@@ -919,10 +1012,23 @@
\fi
\pxcz@check@extra
\pxcz@addtospec{USR}%
- \pxcz@set@page@hook{\pxcz@spec}%
+ \ifpxcz@enabled
+ \pxcz@set@page@hook{\pxcz@spec}%
+ \else\ifx\pxcz@spec\@empty\else
+ \PackageWarningNoLine\pxcz@pkgname
+ {Font mapping is disabled, since the driver in use\MessageBreak
+ is not dvipdfmx}%
+ \fi\fi
+ \ifpxcz@dumpmap
+ \pxcz@do@dumpmap
+ \fi
+ \ifpxcz@dumpmap@tl
+ \pxcz@do@dumpmap@tl
+ \fi
}
%% \pxcz@decl@relfont
+\@onlypreamble\pxcz@decl@relfont
\def\pxcz@decl@relfont#1#2#3{%
\DeclareRelationFont{\k@encoding}{#1}{m}{}{OT1}{#2}{m}{}%
\DeclareRelationFont{\k@encoding}{#1}{bx}{}{OT1}{#2}{bx}{}%
@@ -932,24 +1038,88 @@
\pxcz@info{Relation font set for \k@encoding/#1}%
}
-%%------------------ preset japanese font mappings
+%--------------------------------------- dump font map
+% if some dumpmap is enabled...
+\ifnum 0\ifpxcz@dumpmap 1\fi
+ \ifpxcz@dumpmap@tl 1\fi >\z@
+
+%% variables
+\let\pxcz@dump@text\relax
+\let\pxcz@spec@save\relax
+\newwrite\pxcz@fout
+
+%% \pxcz@add@to@dump@text
+\def\pxcz@add@to@dump@text#1{%
+ \edef\pxcz@dump@text{\pxcz@dump@text#1}}
+
+%% \pxcz@dump@special{<string>}
+\@onlypreamble\pxcz@dump@special
+\def\pxcz@dump@special#1{%
+ \pxcz@dump@special@a#1\bxcz@end}
+\@onlypreamble\pxcz@dump@special@a
+\def\pxcz@dump@special@a#1 #2\bxcz@end{%
+ \@nameuse{pxcz@dump@special@#1}\@gobble{#2}}
+\@namedef{pxcz@dump@special@pdf:mapline}#1#2{%
+ \pxcz@add@to@dump@text{#2^^J}}
+
+%% \pxcz@dump@spec@to{<file-name>}
+\@onlypreamble\pxcz@dump@spec@to
+\def\pxcz@dump@spec@to#1{%
+ \def\pxcz@dump@text{\@percentchar\space#1^^J}%
+ \let\special\pxcz@dump@special
+ \pxcz@spec \let\special\relax
+ \pxcz@add@to@dump@text{\@percentchar\space EOF}%
+ \immediate\openout\pxcz@fout=#1\relax
+ \immediate\write\pxcz@fout{\pxcz@dump@text}%
+ \immediate\closeout\pxcz@fout}
+
+%% \pxcz@do@dumpmap
+\@onlypreamble\pxcz@do@dumpmap
+\def\pxcz@do@dumpmap{%
+ \begingroup
+ \pxcz@dump@spec@to{\jobname.map}%
+ \endgroup}
+
+%% \pxcz@do@dumpmap@tl
+\@onlypreamble\pxcz@do@dumpmap@tl
+\def\pxcz@do@dumpmap@tl{%
+ \begingroup
+ \let\pxcz@spec@save\pxcz@spec
+ \pxcz@do@dumpmap@tl@a{STD}{ptex-\jobname}%
+ \pxcz@do@dumpmap@tl@a{UPSTD}{uptex-\jobname}%
+ \pxcz@do@dumpmap@tl@a{OTF}{otf-\jobname}%
+ \pxcz@do@dumpmap@tl@a{UPOTF}{otf-up-\jobname}%
+ \global\let\pxcz@spec\pxcz@spec@save
+ \endgroup}
+\@onlypreamble\pxcz@do@dumpmap@tl@a
+\def\pxcz@do@dumpmap@tl@a#1#2{%
+ \global\let\pxcz@spec\@empty
+ \pxcz@addtospec{#1}%
+ \pxcz@dump@spec@to{#2.map}}
+
+\fi
+%--------------------------------------- preset japanese font mappings
%% \pxcz@declare@preset{<name>}{<text>}
+\@onlypreamble\pxcz@declare@preset
\def\pxcz@declare@preset#1{%
\expandafter\pxcz@decl@preset@a\csname pxcz@the@preset@#1\endcsname}
\def\pxcz@decl@preset@a#1{\@onlypreamble#1\def#1}
%% \pxcz@declare@preset@alias{<name1>}{<name2>}
+\@onlypreamble\pxcz@declare@preset@alias
\def\pxcz@declare@preset@alias#1#2{%
\expandafter\pxcz@decl@preset@alias@a\csname pxcz@the@preset@#1%
\expandafter\endcsname\csname pxcz@the@preset@#2\endcsname}
\def\pxcz@decl@preset@alias@a#1#2{\@onlypreamble#1\let#1#2}
%% \pxcz@declare@depre@preset
+\@onlypreamble\pxcz@declare@depre@preset
\def\pxcz@declare@depre@preset#1{%
\pxcz@declare@deprecated{#1}%
\pxcz@declare@preset{#1}}
%% \pxcz@declare@depre@preset@alias
+\@onlypreamble\pxcz@declare@depre@preset@alias
\def\pxcz@declare@depre@preset@alias#1{%
\pxcz@declare@deprecated{#1}%
\pxcz@declare@preset@alias{#1}}
@@ -980,7 +1150,7 @@
\fi
\csname pxcz@the@preset@#1\endcsname}
-%%%% definitions of main preset mappings
+%% definitions of main preset mappings
\pxcz@declare@preset{noembed}{%
\usecmapforalphabet
\pxcz@uniweight{Ryumin-Light}{GothicBBB-Medium}}
@@ -1071,6 +1241,10 @@
\pxcz@multiweight{yuminl.ttf}{yumin.ttf}%
{yumindb.ttf}{:0:YuGothR.ttc}{:0:YuGothB.ttc}%
{:0:YuGothB.ttc}{:0:YuGothM.ttc}{:0:YuGothM.ttc}}
+\pxcz@declare@preset{yu-win10+}{%
+ \pxcz@multiweight{\pxcz@YW/yuminl.ttf}{\pxcz@YW/yumin.ttf}%
+ {\pxcz@YW/yumindb.ttf}{\pxcz@YW:0:YuGothR.ttc}{\pxcz@YW:0:YuGothB.ttc}%
+ {\pxcz@YW:0:YuGothB.ttc}{\pxcz@YW:0:YuGothM.ttc}{\pxcz@YW:0:YuGothM.ttc}}
\pxcz@declare@preset{yu-osx}{%
\usecmapforalphabet
\pxcz@multiweight{YuMin-Medium.otf}{YuMin-Medium.otf}%
@@ -1147,11 +1321,11 @@
\pxcz@declare@preset@alias{hiragino-elcapitan}{hiragino-elcapitan-pro}
\pxcz@declare@preset@alias{morisawa}{morisawa-pro}
-%%%% ... and invokes the specified one!
+%% ... and invokes the specified one!
\if\pxcz@main@preset\relax\else
\pxcz@use@preset{\pxcz@main@preset}
\fi
-%%------------------ all done
+%--------------------------------------- all done
\endinput
%% EOF