diff options
author | Karl Berry <karl@freefriends.org> | 2015-05-08 22:19:13 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2015-05-08 22:19:13 +0000 |
commit | 1237ed42ccc4325a0b9f71ed4bb3b455352c9ff1 (patch) | |
tree | a7b12dcf6372ccb1f12fefd64a482736a62ac248 /Master/texmf-dist/tex/platex | |
parent | 8b8a64fb0e397ee552ba6bd4115291d938dde1aa (diff) |
pxchfon (8may15)
git-svn-id: svn://tug.org/texlive/trunk@37282 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/platex')
-rw-r--r-- | Master/texmf-dist/tex/platex/pxchfon/pxchfon.sty | 213 |
1 files changed, 192 insertions, 21 deletions
diff --git a/Master/texmf-dist/tex/platex/pxchfon/pxchfon.sty b/Master/texmf-dist/tex/platex/pxchfon/pxchfon.sty index 0afbeae93e0..a0c1e8a6311 100644 --- a/Master/texmf-dist/tex/platex/pxchfon/pxchfon.sty +++ b/Master/texmf-dist/tex/platex/pxchfon/pxchfon.sty @@ -4,7 +4,7 @@ %%%% package declaration \NeedsTeXFormat{pLaTeX2e} -\ProvidesPackage{pxchfon}[2013/05/18 v0.7a] +\ProvidesPackage{pxchfon}[2015/05/07 v0.7e] \def\pxcz@pkgname{pxchfon} %%%% definitions @@ -61,9 +61,9 @@ %(uniweight) ms,ipa,ipaex,% %(multiweight) - ms-hg,ipa-hg,moga-mobo,moga-maruberi,% - kozuka-pro,kozuka-pr6,kozuka-pr6n,% - hiragino-pro,hiragino-pron,morisawa-pro,morisawa-pr6n,% + ms-hg,ipa-hg,ipaex-hg,moga-mobo,moga-maruberi,% + kozuka-pro,kozuka-pr6,kozuka-pr6n,hiragino-pro,hiragino-pron,% + morisawa-pro,morisawa-pr6n,yu-win,yu-osx,% %(obsolete) ipa-otf,ipa-otf-dx,kozuka4,kozuka6,kozuka6n,hiragino,% %(alias) @@ -72,6 +72,19 @@ \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}} +% file-preset handler +\DeclareOption*{% + \let\pxcz@x\relax + \expandafter\pxcz@popt\CurrentOption\@nnil + \ifx\pxcz@x\relax \@unknownoptionerror + \else \let\pxcz@file@preset\pxcz@x \fi} +\let\pxcz@file@preset\relax +\def\pxcz@popt{% + \futurelet\pxcz@tok\pxcz@popt@a} +\def\pxcz@popt@a{% + \ifx+\pxcz@tok \expandafter\pxcz@popt@b + \else \expandafter\remove@to@nnil \fi} +\def\pxcz@popt@b+#1\@nnil{\edef\pxcz@x{#1}} % dispatch \ProcessOptions* % 'everypage' needs 'atbegshi' package @@ -80,11 +93,15 @@ \fi %% \ifpxcz@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 -\else\if\pxcz@main@preset\relax \pxcz@alphatrue +\else\if@tempswa \pxcz@alphatrue \else \pxcz@alphafalse \fi\fi\fi\fi \ifpxcz@alpha @@ -120,6 +137,10 @@ \@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}{} + %%------------------ user interface %%%%<*> \setminchofont/\setgothicfont/etc. @@ -131,23 +152,82 @@ \newcommand*\setmediumgothicfont{\pxcz@setfont{gtr}} \newcommand*\setboldgothicfont{\pxcz@setfont{gtb}} \newcommand*\setxboldgothicfont{\pxcz@setfont{gtx}} -\newcommand*\setuniweightgothicfont{\pxcz@setfont{gtu}} +\newcommand*\setoneweightgothicfont{\pxcz@setfont{gtu}} \newcommand*\setmarugothicfont{\pxcz@setfont{mgr}} +\newcommand*\setkoreanminchofont{\pxcz@setfont{kom}} +\newcommand*\setkoreangothicfont{\pxcz@setfont{kog}} +\newcommand*\setschineseminchofont{\pxcz@setfont{scm}} +\newcommand*\setschinesegothicfont{\pxcz@setfont{scg}} +\newcommand*\settchineseminchofont{\pxcz@setfont{tcm}} +\newcommand*\settchinesegothicfont{\pxcz@setfont{tcg}} \def\pxcz@setfont#1{\@ifnextchar[%] {\pxcz@setfont@a{#1}}{\pxcz@setfont@a{#1}[]}} \def\pxcz@setfont@a#1[#2]#3{% \@for\pxcz@x:={#1}\do{% \ifx @#2@\@namedef{pxcz@FS/\pxcz@x}{#3}% \else\@namedef{pxcz@FS/\pxcz@x}{:#2:#3}\fi}} -\@for\pxcz@x:={mnl,mnr,mnb,gtr,gtb,gtx,gtu,mgr}\do - {\@namedef{pxcz@FS/\pxcz@x}{}} +\@for\pxcz@x:={% + mnl,mnr,mnb,gtr,gtb,gtx,gtu,mgr,% + kom,kog,scm,scg,tcm,tcg% +}\do{\@namedef{pxcz@FS/\pxcz@x}{}} + +%%------------------ '\asUTF' +% NB. This feature is superseded by the pxasutf package. +\ifpxcz@uptex + +%%<*> \asUTF{<jachar>} +\AtBeginDocument{% + \@ifpackageloaded{otf}{% + \providecommand*\asUTF{\pxcz@asutf@a}% + }{}% +} +\def\pxcz@asutf@a#1{% + \kchardef\pxcz@tmpa=`#1\relax + \expandafter\pxcz@asutf@b\meaning\pxcz@tmpa\relax +} +\def\pxcz@asutf@b#1"#2\relax{% + \UTF{#2}% +} + +\fi +%%------------------ fontmap internals + +%% \pxcz@noembed +% The value given to \set...font to mean 'no-embed'. +\def\pxcz@noembed{*} + +%% \pxcz@cmap@directuni +% CMap symbol for "direct unicode". +\def\pxcz@cmap@directuni{unicode} + +%% \pxcz@cmap@hwuni +% CMap name for halfwidth fonts. +\def\pxcz@cmap@hwuni{UniJIS-UCS2-HW-H} %%%% <*> \usecmapforalphabet/\nousecmapforalphabet -\def\usecmapforalphabet{\gdef\pxcz@unicmap{UniJIS-UCS2-HW-H}} -\def\nousecmapforalphabet{\gdef\pxcz@unicmap{unicode}} +\def\usecmapforalphabet{% + \global\let\pxcz@cmap@uni\pxcz@cmap@hwuni} +\def\nousecmapforalphabet{% + \global\let\pxcz@cmap@uni\pxcz@cmap@directuni} \ifpxcz@cmap@alpha \usecmapforalphabet \else \nousecmapforalphabet \fi +%% \pxcz@NEF/<sym> +\def\pxcz@do#1#2{% + \def\pxcz@tmpb{#2}% + \@for\pxcz@tmpa:=#1\do{% + \expandafter\let\csname pxcz@NEF/\pxcz@tmpa\endcsname\pxcz@tmpb + }% +} +\pxcz@do{mnl,mnr,mnb}{Ryumin-Light} +\pxcz@do{gtr,gtb,gtx,gtu,mgr}{GothicBBB-Medium} +\pxcz@do{kom}{HYSMyeongJoStd-Medium} +\pxcz@do{kog}{HYGoThic-Medium} +\pxcz@do{scm}{STSongStd-Light} +\pxcz@do{scg}{STHeiti-Regular} +\pxcz@do{tcm}{MSungStd-Light} +\pxcz@do{tcg}{MHei-Medium} + %%<+> \JaFontReplacementFor{<sym>} \newcommand*\JaFontReplacementFor[1]{% \csname pxcz@FS/#1\endcsname} @@ -156,12 +236,24 @@ \newcommand*\JaFontReplacementHook{% \g@addto@macro\pxcz@user@hook} \let\pxcz@user@hook\@empty +\@onlypreamble\JaFontReplacementHook %%<+> \JaFontUserDefinedMap \newcommand*\JaFontUserDefinedMap{% \g@addto@macro\pxcz@user@map} \let\pxcz@user@map\@empty \@namedef{pxcz@FS/*}{\pxcz@empty} +\@onlypreamble\JaFontUserDefinedMap + +%%<+> \usefontmapline{<map-line>} +\newcommand*\usefontmapline[1]{% + \JaFontUserDefinedMap{\pxcz@addtospec@alt\pxcz@mapline#1}} +\@onlypreamble\usefontmapline + +%%<+> \usefontmapfile{<map-file>} +\newcommand*\usefontmapfile[1]{% + \JaFontUserDefinedMap{\pxcz@addtospec@alt\pxcz@mapfile#1}} +\@onlypreamble\usefontmapfile %%------------------ map entry handling @@ -203,28 +295,55 @@ \let\pxcz@unidirect\@empty \let\pxcz@unidirect@wopt\@empty \ifpxcz@directunicode -\def\pxcz@unidirect#116-#2{unicode} +\def\pxcz@unidirect#116-#2{\pxcz@cmap@directuni} \def\pxcz@unidirect@wopt{ -w 1} \fi %% \pxcz@addtospec{<id>} \def\pxcz@addtospec#1{% \bgroup \let\Entry\pxcz@Entry - \let\ \space \let\UniCMap\pxcz@unicmap - \let\*\pxcz@pfx@jis \let\+\pxcz@unidirect - \let\w\pxcz@unidirect@wopt + \let\ \space \let\*\pxcz@pfx@jis \let\UniJIS\pxcz@pfx@unijis \@nameuse{pxcz@ME/#1}\egroup} \def\pxcz@Entry#1{% \expandafter\let\expandafter\FONT\csname pxcz@FS/#1\endcsname \let\FONTo\FONT \let\FONTs\FONT - \pxcz@switch@realfont + \ifx\FONT\pxcz@noembed + \let\UniCMap\pxcz@cmap@hwuni + \let\+\@empty \let\w\@empty + \edef\FONT{!\@nameuse{pxcz@NEF/#1}}% + \let\FONTo\FONT \let\FONTs\FONT + \else\ifx\FONT\@empty\else + \let\UniCMap\pxcz@cmap@uni + \let\+\pxcz@unidirect \let\w\pxcz@unidirect@wopt + \pxcz@switch@realfont + \fi\fi \ifx\FONT\@empty \expandafter\@gobble \else \expandafter\pxcz@entry@a \fi} \def\pxcz@entry@a#1{% - \xdef\pxcz@spec{\pxcz@spec\noexpand\special{\pxcz@line{#1}}}} + \xdef\pxcz@spec{% + \pxcz@spec\noexpand\special{\pxcz@mapline{#1}}}} \let\pxcz@spec\@empty -\def\pxcz@line#1{pdf:mapline #1} + +%% \pxcz@do@file@preset +\def\pxcz@do@file@preset{% + \ifpxcz@uptex \pxcz@do@file@preset@a{uptex-}% + \else \pxcz@do@file@preset@a{ptex-}% + \fi + \ifpxcz@otf + \ifpxcz@uptex \pxcz@do@file@preset@a{otf-up-}% + \else \pxcz@do@file@preset@a{otf-}% + \fi + \fi} + +\def\pxcz@do@file@preset@a#1{% + \pxcz@addtospec@alt\pxcz@mapfile{#1\pxcz@file@preset.map}} + +%% \pxcz@addtospec@alt +\def\pxcz@addtospec@alt#1#2{% + \xdef\pxcz@spec{\pxcz@spec\noexpand\special{#1{#2}}}} +\def\pxcz@mapfile#1{pdf:mapfile #1} +\def\pxcz@mapline#1{pdf:mapline #1} %%------------------ map entry definitions @@ -334,6 +453,31 @@ \Entry{mgr}{otf-ujmgrn-v \+UniJIS2004-UTF16-V \FONT\w}% \Entry{mgr}{hmgothrn-h H \FONT}% \Entry{mgr}{hmgothrn-v V \FONT}% +% +\Entry{kom}{otf-ukmr-h \+UniKS-UTF16-H \FONT}% +\Entry{kom}{otf-ukmr-v \+UniKS-UTF16-V \FONT\w}% +\Entry{kom}{otf-ckmr-h Identity-H \FONT/AK12}% +\Entry{kom}{otf-ckmr-v Identity-V \FONT/AK12}% +\Entry{kog}{otf-ukgr-h \+UniKS-UTF16-H \FONT}% +\Entry{kog}{otf-ukgr-v \+UniKS-UTF16-V \FONT\w}% +\Entry{kog}{otf-ckgr-h Identity-H \FONT/AK12}% +\Entry{kog}{otf-ckgr-v Identity-V \FONT/AK12}% +\Entry{scm}{otf-ucmr-h \+UniGB-UTF16-H \FONT}% +\Entry{scm}{otf-ucmr-v \+UniGB-UTF16-V \FONT\w}% +\Entry{scm}{otf-ccmr-h Identity-H \FONT/AG14}% +\Entry{scm}{otf-ccmr-v Identity-V \FONT/AG14}% +\Entry{scg}{otf-ucgr-h \+UniGB-UTF16-H \FONT}% +\Entry{scg}{otf-ucgr-v \+UniGB-UTF16-V \FONT\w}% +\Entry{scg}{otf-ccgr-h Identity-H \FONT/AG14}% +\Entry{scg}{otf-ccgr-v Identity-V \FONT/AG14}% +\Entry{tcm}{otf-utmr-h \+UniCNS-UTF16-H \FONT}% +\Entry{tcm}{otf-utmr-v \+UniCNS-UTF16-V \FONT\w}% +\Entry{tcm}{otf-ctmr-h Identity-H \FONT/AC14}% +\Entry{tcm}{otf-ctmr-v Identity-V \FONT/AC14}% +\Entry{tcg}{otf-utgr-h \+UniCNS-UTF16-H \FONT}% +\Entry{tcg}{otf-utgr-v \+UniCNS-UTF16-V \FONT\w}% +\Entry{tcg}{otf-ctgr-h Identity-H \FONT/AC14}% +\Entry{tcg}{otf-ctgr-v Identity-V \FONT/AC14}% } \pxcz@mapentry{UPSTD}{% \Entry{mnr}{uprml-h \UniJIS-UTF16-H \FONTs}% @@ -346,6 +490,19 @@ \Entry{mnr}{urmlv \UniJIS-UTF16-V \FONTs}% \Entry{gtu}{ugbm \UniJIS-UTF16-H \FONTs}% \Entry{gtu}{ugbmv \UniJIS-UTF16-V \FONTs}% +% +\Entry{kom}{uphysmjm-h UniKS-UTF16-H \FONT}% +\Entry{kom}{uphysmjm-v UniKS-UTF16-V \FONT}% +\Entry{kog}{uphygt-h UniKS-UTF16-H \FONT}% +\Entry{kog}{uphygt-v UniKS-UTF16-V \FONT}% +\Entry{scm}{upstsl-h UniGB-UTF16-H \FONT}% +\Entry{scm}{upstsl-v UniGB-UTF16-V \FONT}% +\Entry{scg}{upstht-h UniGB-UTF16-H \FONT}% +\Entry{scg}{upstht-v UniGB-UTF16-V \FONT}% +\Entry{tcm}{upmsl-h UniCNS-UTF16-H \FONT}% +\Entry{tcm}{upmsl-v UniCNS-UTF16-V \FONT}% +\Entry{tcg}{upmhm-h UniCNS-UTF16-H \FONT}% +\Entry{tcg}{upmhm-v UniCNS-UTF16-V \FONT}% } \pxcz@mapentry{UPOTF}{% \Entry{mnl}{uphminl-h \UniJIS-UTF16-H \FONTs}% @@ -442,7 +599,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@unicmap\space \FONT}}% + \pxcz@Entry{gtr}{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}}{}% @@ -472,6 +629,9 @@ \pxcz@okfalse \fi}} \AtBeginDocument{% \pxcz@user@hook + \ifx\pxcz@file@preset\relax\else + \pxcz@do@file@preset + \fi \ifpxcz@alpha \pxcz@check@alldefined{mnl,mnr,mnb}% \ifpxcz@ok \renewcommand\rmdefault{cfjar}\fi @@ -495,9 +655,8 @@ \@ifpackageloaded{utf}{\pxcz@utftrue}{\pxcz@utffalse}% \fi \ifpxcz@otf - \ifpxcz@uptex \pxcz@addtospec{UPOTF}% - \else \pxcz@addtospec{OTF}% - \fi + \ifpxcz@uptex \pxcz@addtospec{UPOTF}\fi + \pxcz@addtospec{OTF}% \fi \ifpxcz@utf \pxcz@addtospec{UTF}% \fi @@ -570,6 +729,9 @@ \pxcz@declare@preset{ipa-hg}{% \pxcz@multiweight{ipam.ttf}{ipam.ttf}{:0:hgrme.ttc}% {:0:hgrgm.ttc}{:0:hgrge.ttc}{:0:hgrsgu.ttc}{ipag.ttf}{hgrsmp.ttf}} +\pxcz@declare@preset{ipaex-hg}{% + \pxcz@multiweight{ipaexm.ttf}{ipaexm.ttf}{:0:hgrme.ttc}% + {:0:hgrgm.ttc}{:0:hgrge.ttc}{:0:hgrsgu.ttc}{ipaexg.ttf}{hgrsmp.ttf}} \pxcz@declare@preset{moga-mobo}{% \pxcz@enable@switch@realfont \pxcz@multiweight{\pxcz@MI mogam.ttc}{\pxcz@MI mogam.ttc}% @@ -617,6 +779,15 @@ {A-OTF-FutoMinA101Pr6N-Bold.otf}{A-OTF-GothicBBBPr6N-Medium.otf}% {A-OTF-FutoGoB101Pr6N-Bold}{A-OTF-MidashiGoPr6N-MB31.otf}% {A-OTF-GothicBBBPr6N-Medium.otf}{A-OTFJun101Pr6N-Light.otf}} +\pxcz@declare@preset{yu-win}{% + \pxcz@multiweight{yuminl.ttf}{yumin.ttf}% + {yumindb.ttf}{yugothic.ttf}{yugothib.ttf}% + {yugothib.ttf}{yugothic.ttf}{yugothic.ttf}} +\pxcz@declare@preset{yu-osx}{% + \usecmapforalphabet + \pxcz@multiweight{YuMin-Medium.otf}{YuMin-Medium.otf}% + {YuMin-Demibold.otf}{YuGo-Medium.otf}{YuGo-Bold.otf}% + {YuGo-Bold.otf}{YuGo-Medium.otf}{YuGo-Medium.otf}} %(obsolete) \pxcz@declare@preset{ipa-otf}{% \pxcz@uniweight{ipam.otf}{ipag.otf}} |