diff options
Diffstat (limited to 'Master/texmf-dist/tex/platex/pxchfon/pxchfon.sty')
-rw-r--r-- | Master/texmf-dist/tex/platex/pxchfon/pxchfon.sty | 84 |
1 files changed, 70 insertions, 14 deletions
diff --git a/Master/texmf-dist/tex/platex/pxchfon/pxchfon.sty b/Master/texmf-dist/tex/platex/pxchfon/pxchfon.sty index c667ab8b883..0ac4b38ebbd 100644 --- a/Master/texmf-dist/tex/platex/pxchfon/pxchfon.sty +++ b/Master/texmf-dist/tex/platex/pxchfon/pxchfon.sty @@ -10,7 +10,7 @@ %% package declaration \NeedsTeXFormat{pLaTeX2e} -\ProvidesPackage{pxchfon}[2019/07/10 v1.5a] +\ProvidesPackage{pxchfon}[2019/10/07 v1.6] \def\pxcz@pkgname{pxchfon} %--------------------------------------- general @@ -113,6 +113,50 @@ \chardef\pxcz@pxufont@loaded=0 } +%--------------------------------------- custom presets + +%% \pxcz@custom@presets +\pxcz@onlypreamble@let\pxcz@custom@presets\@empty +%% \pxcz@custom@apply@opt@unicode +\pxcz@onlypreamble@let\pxcz@custom@apply@opt@unicode\@empty +%% freeze +\pxcz@onlypreamble@let\pxcz@custom\relax +\let\pxcz@uniweight\relax +\let\pxcz@multiweight\relax + +%% \pxcz@declare@oneweight@preset{<name>}{<m>}{<g>} +\pxcz@onlypreamble@def\pxcz@declare@oneweight@preset#1#2#3{% + \xdef\pxcz@custom@presets{\pxcz@custom@presets + \pxcz@custom{#1}{\pxcz@uniweight{#2}{#3}}}} +%% \pxcz@declare@multiweight@preset{<name>}{<1>}...{<8>} +\pxcz@onlypreamble@def\pxcz@declare@multiweight@preset#1#2#3#4#5#6#7#8#9{% + \xdef\pxcz@custom@presets{\pxcz@custom@presets + \pxcz@custom{#1}{\pxcz@multiweight{#2}{#3}{#4}{#5}{#6}{#7}{#8}{#9}}}} +%%<+> \pxchfonDeclareOneWeightPreset{<name>}{<m>}{<g>} +\@onlypreamble\pxchfonDeclareOneWeightPreset +\newcommand*\pxchfonDeclareOneWeightPreset[1]{% + \pxcz@declare@oneweight@preset{user:#1}} +%%<+> \pxchfonDeclareMultiWeightPreset{<name>}{<1>}...{<8>} +\@onlypreamble\pxchfonDeclareMultiWeightPreset +\newcommand*\pxchfonDeclareMultiWeightPreset[1]{% + \pxcz@declare@multiweight@preset{user:#1}} + +%% Load custom preset definitions +\IfFileExists{pxchfon-extras.def}{% + \PackageInfo\pxcz@pkgname + {Extra preset settings are loaded\@gobble}% + \input{pxchfon-extras.def}% +}{} +\IfFileExists{pxchfon.cfg}{% + \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 %% variables @@ -218,6 +262,7 @@ hiragino-elcapitan-pro,hiragino-elcapitan-pron,% morisawa-pro,morisawa-pr6n,yu-win,yu-win10,yu-win10+,yu-osx,% sourcehan-otc,sourcehan,sourcehan-jp,noto-otc,noto,noto-jp,% + haranoaji,% sourcehan-otc+,sourcehan+,noto-otc+,noto+,% %(alias) hiragino,noto-otf,% @@ -231,6 +276,8 @@ \expandafter\pxcz@do\expandafter{\pxcz@x}} \@for\pxcz@x:=\pxcz@all@abolished@preset\do{% \expandafter\pxcz@do\expandafter{\pxcz@x}} +\def\pxcz@custom#1#2{\pxcz@do{#1}} +\pxcz@custom@presets % others % The 'unicode' option means a Unicode-oriented mapping, and requires % dvipdfmx of version 20170627 or later. The 'unicode-fwid' is a variant. @@ -252,20 +299,17 @@ \pxcz@parse@opt\CurrentOption \ifpxcz@ok\else \@unknownoptionerror \fi}} \pxcz@onlypreamble@def\pxcz@parse@opt#1{% - \expandafter\pxcz@parse@opt@a#1\@nnil} -\pxcz@onlypreamble@def\pxcz@parse@opt@a{% - \futurelet\pxcz@tok\pxcz@parse@opt@b} -\pxcz@onlypreamble@def\pxcz@parse@opt@b{% \pxcz@okfalse - \let\pxcz@tmpa\remove@to@nnil - \ifx+\pxcz@tok - \pxcz@file@preset@tltrue \let\pxcz@tmpa\pxcz@parse@opt@c - \else\ifx*\pxcz@tok - \pxcz@file@preset@tlfalse \let\pxcz@tmpa\pxcz@parse@opt@c - \fi\fi \pxcz@tmpa} -\pxcz@onlypreamble@def\pxcz@parse@opt@c#1#2\@nnil{% - \pxcz@oktrue - \edef\pxcz@file@preset{#2}} + \pxcz@parse@opt@a{+}{#1}{\pxcz@file@preset@tltrue}% + \pxcz@parse@opt@a{*}{#1}{\pxcz@file@preset@tlfalse}% + \pxcz@parse@opt@a{tl:}{#1}{\pxcz@file@preset@tltrue}% + \pxcz@parse@opt@a{file:}{#1}{\pxcz@file@preset@tlfalse}} +\pxcz@onlypreamble@def\pxcz@parse@opt@a#1#2#3{% + \ifpxcz@ok\else + \pxcz@split{#1}{#2}\ifx\pxcz@pre\@empty + #3\let\pxcz@file@preset\pxcz@post \pxcz@oktrue + \fi + \fi} % dispatch \ProcessOptions* @@ -418,6 +462,7 @@ \pxcz@do{noto+}{\pxcz@apply@opt@unicodeP} \pxcz@do{noto-otc+}{\pxcz@apply@opt@unicodeP} \pxcz@do{yu-win10+}{\pxcz@apply@opt@unicodeP} +\pxcz@custom@apply@opt@unicode % No-embed is not supported under the 'unicode' setup \ifnum\pxcz@directunicode=\pxcz@directunicode@full \pxcz@warn@unless@all@embeddedtrue @@ -1841,6 +1886,10 @@ \pxcz@onlypreamble@def\pxcz@use@preset#1{% \csname pxcz@the@preset@#1\endcsname} +%% Redefine \pxcz@custom +\let\pxcz@custom\pxcz@declare@preset +\pxcz@custom@presets + %% definitions of main preset mappings \pxcz@declare@preset{noembed}{% \pxcz@uniweight{*}{*}} @@ -1975,6 +2024,13 @@ {NotoSansJP-Regular.otf}{NotoSansJP-Bold.otf}% {NotoSansJP-Black.otf}{NotoSansJP-Medium.otf}% {NotoSansJP-Medium.otf}} +\pxcz@declare@preset{haranoaji}{% + \usecmapforalphabet + \pxcz@multiweight{HaranoAjiMincho-Light.otf}% + {HaranoAjiMincho-Regular.otf}{HaranoAjiMincho-Bold.otf}% + {HaranoAjiGothic-Regular.otf}{HaranoAjiGothic-Bold.otf}% + {HaranoAjiGothic-Heavy.otf}{HaranoAjiGothic-Medium.otf}% + {HaranoAjiGothic-Medium.otf}} %(alias) \pxcz@declare@preset@alias{hiragino}{hiragino-pro} \pxcz@declare@preset@alias{noEmbed}{noembed} |