diff options
Diffstat (limited to 'Master/texmf-dist/tex/platex/pxbase/pxbabel.sty')
-rw-r--r-- | Master/texmf-dist/tex/platex/pxbase/pxbabel.sty | 59 |
1 files changed, 51 insertions, 8 deletions
diff --git a/Master/texmf-dist/tex/platex/pxbase/pxbabel.sty b/Master/texmf-dist/tex/platex/pxbase/pxbabel.sty index 7c1f1fd3e34..3f0ab85d309 100644 --- a/Master/texmf-dist/tex/platex/pxbase/pxbabel.sty +++ b/Master/texmf-dist/tex/platex/pxbase/pxbabel.sty @@ -10,7 +10,7 @@ %% package declaration \NeedsTeXFormat{pLaTeX2e} -\ProvidesPackage{pxbabel}[2017/06/19 v1.1a PX Babel interface for CJK] +\ProvidesPackage{pxbabel}[2017/07/03 v1.1b PX Babel interface for CJK] \def\pxbb@pkgname{pxbabel} %--------------------------------------- general @@ -23,11 +23,6 @@ %% error messages \bxSetModuleName\pxbb@pkgname -\def\pxbb@eha{\MessageBreak I aborted loading it.} -\bxPreamble\def\pxbb@err@nobbl{% - \PackageError\pxbb@pkgname - {babel is not yet loaded, load aborted}% - {This package must be loaded after babel package.}} \bxPreamble\def\pxbb@warn@nocjk{% \PackageWarningNoLine\pxbb@pkgname {No multi-CJK support found, font switch disabled\MessageBreak @@ -35,7 +30,21 @@ \bxPreamble\def\pxbb@err@noldf#1{% \PackageError\pxbb@pkgname {Language definition file #1.ldf not found}% - {Maybe you misspelled the language option?}} + {Maybe you misspelled the language option?\MessageBreak\@ehc}} +\bxPreamble\def\pxbb@err@nomnl{% + \PackageError\pxbb@pkgname + {Main language is not specified}% + {Here 'japanese' is assumed.\MessageBreak\@ehc}} +\bxPreamble\def\pxbb@warn@jafam#1{% + \PackageWarningNoLine\pxbb@pkgname + {!!!!!!!!!!!!!!! IMPORTANT NOTICE !!!!!!!!!!!!!!!\MessageBreak + Default Japanese family names have been changed\MessageBreak + after this package was loaded. The functionality\MessageBreak + of the package may be corrupted!\MessageBreak + \if t#1% + (You must load 'otf' package before this package.)\MessageBreak + \fi + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!}} %--------------------------------------- Processing package options @@ -84,7 +93,12 @@ \DeclareOption{noprefer2004jis}{\pxbb@prefermmivjisfalse} \DeclareOption{jis2004}{\pxbb@prefermmivjistrue} \DeclareOption{nojis2004}{\pxbb@prefermmivjisfalse} +\newbool{pxbb@stdjaencoding} +\bxIfExpToEqualX{\mcdefault}{mc}{}{\pxbb@stdjaencodingtrue}% default +\DeclareOption{stdjaencoding}{\pxbb@stdjaencodingtrue} +\DeclareOption{nostdjaencoding}{\pxbb@stdjaencodingfalse} % (<lang_id>, +<lang_id>) +\bxPreamble\let\pxbb@last@lang\relax \bxForEachIn\pxbb@cjk@langid@list\do{% \DeclareOption{#1}{% \pxbb@set@lang@spec{#1}{#1}% @@ -138,6 +152,11 @@ % in lumped loading, main is the one specified last {\let\pxbb@main@lang\pxbb@last@lang}% }{} +% if main is unknown, complain +\ifx\pxbb@main@lang\relax + \pxbb@err@nomnl + \letcs\pxbb@main@lang{pxbb@langname/japanese} +\fi %% resolve the caption language setting \bxIfExpToEqual{\pxbb@caption@lang}{auto}{%then @@ -297,6 +316,11 @@ \pxbb@addtoextras@otf@a{cjkmulti}{\UTFM} \fi % pxbb@switchfont +%%<*> \pxUTFJ/\UTFJ +\let\pxUTFJ\UTF +\AtBeginDocument{% + \providecommand*\UTFJ{\pxUTFJ}} + \fi %----</otfmulti> \ifupTeX %----<*upTeX> @@ -319,6 +343,14 @@ \pxDeclareBasicCJKEncoding{J23}{J33}% UniCNS \pxDeclareBasicCJKFamily{J23}{!uptchrm-h}{!uptchgt-h}{*gt}{*gt} \pxDeclareBasicCJKFamily{J33}{!uptchrm-v}{!uptchgt-v}{*gt}{*gt} +\pxDeclareBasicCJKEncoding{J24}{J34}% UniJIS2004 +\pxDeclareBasicCJKFamily{J24}{!upjpnrm-h}{!upjpngt-h}{*gt}{*gt} +\pxDeclareBasicCJKFamily{J34}{!upjpnrm-v}{!upjpngt-v}{*gt}{*gt} +\begingroup \let\pxForceFontDeclaration=f +\bxForEachIn{J20,J30,J21,J31,J22,J32,J23,J33,J24,J34}\do{% + \pxDeclareExtraCJKFamily{#1}{\mcdefault}{*mc}{*mc}% + \pxDeclareExtraCJKFamily{#1}{\gtdefault}{*gt}{*gt}} +\endgroup \fi %--------------------------------------- add font switch to Babel \extras @@ -329,7 +361,8 @@ \bxForEachIn{J20,J24}\do{% all full japanese encodings \csdef{pxbb@is@fje/#1}{t}} \edef\pxbb@dflt@ja@enc{% default full japanese encoding - \ifbool{pxbb@prefermmivjis}{J24}{J20}} + \ifbool{pxbb@stdjaencoding}{\cy@encoding}{%else + \ifbool{pxbb@prefermmivjis}{J24}{J20}}} \def\pxbb@set@full@ja@enc{% \edef\pxbb@full@ja@enc{% \bxIfcsundefX{pxbb@is@fje/\cy@encoding}% @@ -368,6 +401,16 @@ \newcommand*\cjklanguagename[1]{% \@nameuse{pxbb@langname/#1}} +%--------------------------------------- integrity check + +%% check if \mcdefault is not changed +\let\pxbb@tunc@mcdefault\mcdefault +\AtBeginDocument{% + \bxIfExpToEqualX\pxbb@tunc@mcdefault\mcdefault{}{%else + \bxIfExpToEqualX\mcdefault{hmc}% + {\pxbb@warn@jafam{t}}% + {\pxbb@warn@jafam{f}}}} + %--------------------------------------- all done \endinput % |