From 9f5f371b6edfed9acecb0137104ce2e1bc796e60 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 4 May 2018 22:10:36 +0000 Subject: zxjafont (4may18) git-svn-id: svn://tug.org/texlive/trunk@47613 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/zxjafont/LICENSE | 8 +- Master/texmf-dist/doc/latex/zxjafont/README | 42 ----- Master/texmf-dist/doc/latex/zxjafont/README-ja | 52 ------ Master/texmf-dist/doc/latex/zxjafont/README-ja.md | 52 ++++++ Master/texmf-dist/doc/latex/zxjafont/README.md | 46 +++++ Master/texmf-dist/doc/latex/zxjafont/zxjafont.pdf | Bin 132386 -> 141797 bytes Master/texmf-dist/doc/latex/zxjafont/zxjafont.tex | 78 ++++++-- Master/texmf-dist/tex/latex/zxjafont/zxjafont.sty | 214 ++++++++++++++++------ 8 files changed, 312 insertions(+), 180 deletions(-) delete mode 100644 Master/texmf-dist/doc/latex/zxjafont/README delete mode 100644 Master/texmf-dist/doc/latex/zxjafont/README-ja create mode 100644 Master/texmf-dist/doc/latex/zxjafont/README-ja.md create mode 100644 Master/texmf-dist/doc/latex/zxjafont/README.md diff --git a/Master/texmf-dist/doc/latex/zxjafont/LICENSE b/Master/texmf-dist/doc/latex/zxjafont/LICENSE index e1a223a7575..fbe40a0146b 100644 --- a/Master/texmf-dist/doc/latex/zxjafont/LICENSE +++ b/Master/texmf-dist/doc/latex/zxjafont/LICENSE @@ -1,12 +1,6 @@ -$BK\%=%U%H%&%'%"$O(B MIT $B%i%$%;%s%9$N2<$GG[I[$5$l$^$9!#(B -$BCx:n8"$O:n(B ZR$B!K!W$KB0$7$^$9!#(B -$B$^$?K\%=%U%H%&%'%"$OL5J]>Z$G$9!#(B - -This software is distributed under the MIT License. - The MIT License -Copyright (c) 2015 Takayuki YATO (aka. "ZR") +Copyright (c) 2018 Takayuki YATO (aka. "ZR") Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/Master/texmf-dist/doc/latex/zxjafont/README b/Master/texmf-dist/doc/latex/zxjafont/README deleted file mode 100644 index 1c3f39ae61b..00000000000 --- a/Master/texmf-dist/doc/latex/zxjafont/README +++ /dev/null @@ -1,42 +0,0 @@ -ZXjafont Package -================ - -LaTeX: Set up Japanese font families for XeLaTeX - -Font selection using fontspec package is very flexible and powerful. -But users who are used to pLaTeX often feel the setting bothersome, -as there is no default working font setting (that involves Japanese -fonts) and they always must give one. This package prepares some -popular font settings as “presets” and allows users to use them -simply by referring to their name. - -### SYSTEM REQUIREMENTS - - - TeX format: XeLaTeX. - - Prerequisite packages: fontspec. - -### INSTALLATION - -Move the files as follows (in a system compliant to TDS 1.1): - - - `*.sty` → $TEXMF/tex/xelatex/zxjafont/ - -And rehash your TEXMF trees if necessary. - -### LICENSE - -This package is distributed under the MIT License. - -Revision History ----------------- - - * Version 0.3 [2015/05/08] - - Presets made more alike those of pxchfon. - * Version 0.2a [2013/01/28] - - Adjustment for new zxjatype. - * Version 0.2 [2009/12/22] - - First public version. - --------------------- -Takayuki YATO (aka. "ZR") -http://zrbabbler.sp.land.to/ diff --git a/Master/texmf-dist/doc/latex/zxjafont/README-ja b/Master/texmf-dist/doc/latex/zxjafont/README-ja deleted file mode 100644 index f30b4ea90f5..00000000000 --- a/Master/texmf-dist/doc/latex/zxjafont/README-ja +++ /dev/null @@ -1,52 +0,0 @@ -ZXjafont パッケージバンドル -=========================== - -LaTeX: 一般的な和文フォント設定のプリセット - -XeLaTeX + fontspec でのフォントファミリ名を直接指定する方式は「好きな -フォントを指定する」という点では、 pLaTeX よりも格段に使い易いが、日本語 -を扱うためには必ず何らかの設定を行う必要があり、これが煩わしく感じられる -場合もある。本パッケージでは、pLaTeX において一般的に行われている設定を -予め用意しておいて、簡単に呼び出せるようにしている。 - -### 前提環境 - - - TeX 処理系: XeLaTeX - - 前提パッケージ: fontspec - -### 本ソフトウェアの作者のサイト - - - En toi Pythmeni tes TeXnopoleos ~電脳世界の奥底にて~ - - - - 以下のページに一部機能の使用例を紹介した。 - 「ZXjafont パッケージ」 - - -### インストール - -TDS 1.1 に従ったシステムでは、各ファイルを次の場所に移動する。 - - - `*.sty` → $TEXMF/tex/xelatex/zxjafont/ - -W32TeX を C:\usr\local にインストールした場合は次のようになる。 - - - `*.sty` → C:\usr\local\share\texmf-local\tex\xelatex\zxjafont - -### ライセンス - -MIT ライセンス - -更新履歴 --------- - - * Version 0.3 [2015/05/08] - - プリセット設定を pxchfon のものに合わせた。 - * Version 0.2a [2013/01/28] - - 新版の zxjatype への対応。 - * Version 0.2 [2009/12/22] - - 最初の公開版。 - --------------------- -Takayuki YATO (aka. "ZR") -http://zrbabbler.sp.land.to/ diff --git a/Master/texmf-dist/doc/latex/zxjafont/README-ja.md b/Master/texmf-dist/doc/latex/zxjafont/README-ja.md new file mode 100644 index 00000000000..90c18214001 --- /dev/null +++ b/Master/texmf-dist/doc/latex/zxjafont/README-ja.md @@ -0,0 +1,52 @@ +ZXjafont パッケージバンドル +=========================== + +LaTeX: 一般的な和文フォント設定のプリセット + +XeLaTeX + fontspec でのフォントファミリ名を直接指定する方式は「好きな +フォントを指定する」という点では、 pLaTeX よりも格段に使い易いが、日本語 +を扱うためには必ず何らかの設定を行う必要があり、これが煩わしく感じられる +場合もある。本パッケージでは、pLaTeX において一般的に行われている設定を +予め用意しておいて、簡単に呼び出せるようにしている。 + +### 前提環境 + + * フォーマット: LaTeX + * エンジン: XeTeX + * 依存パッケージ: + - fontspec + +### インストール + +TDS 1.1 に従ったシステムでは、各ファイルを次の場所に移動する。 + + - `*.sty` → $TEXMF/tex/xelatex/zxjafont + +### ライセンス + +本パッケージは MIT ライセンスの下で配布される。 + + +zxjafont パッケージ ー 本体 +--------------------------- + +詳細についてはマニュアル `zxjafont.pdf` を参照されたい。 + + +更新履歴 +-------- + + * Version 0.4 〈2018/05/04〉 + - プリセット追加:`yu-win10`、`sourcehan(-jp)`、`noto(-jp)`、`ume`。 + - オプション追加:`90jis`、`jis2004`。 + - 非推奨のプリセットの使用を警告する。 + * Version 0.3 〈2015/05/08〉 + - プリセット設定を pxchfon のものに合わせた。 + * Version 0.2a 〈2013/01/28〉 + - 新版の zxjatype への対応。 + * Version 0.2 〈2009/12/22〉 + - 最初の公開版。 + +-------------------- +Takayuki YATO (aka. "ZR") +http://zrbabbler.sp.land.to/ diff --git a/Master/texmf-dist/doc/latex/zxjafont/README.md b/Master/texmf-dist/doc/latex/zxjafont/README.md new file mode 100644 index 00000000000..21855826288 --- /dev/null +++ b/Master/texmf-dist/doc/latex/zxjafont/README.md @@ -0,0 +1,46 @@ +ZXjafont Package +================ + +LaTeX: Set up Japanese font families for XeLaTeX + +Font selection using fontspec package is very flexible and powerful. +But users who are used to pLaTeX often feel the setting bothersome, +as there is no default working font setting (that involves Japanese +fonts) and they always must give one. This package prepares some +popular font settings as “presets” and allows users to use them +simply by referring to their name. + +### SYSTEM REQUIREMENTS + + - TeX format: XeLaTeX. + - Prerequisite packages: fontspec. + +### INSTALLATION + +Move the files as follows (in a system compliant to TDS 1.1): + + - `*.sty` → $TEXMF/tex/xelatex/zxjafont/ + +And rehash your TEXMF trees if necessary. + +### LICENSE + +This package is distributed under the MIT License. + +Revision History +---------------- + + * Version 0.4 〈2018/05/04〉 + - New preets: `yu-win10`, `sourcehan(-jp)`, `noto(-jp)`, `ume`. + - New options: `90jis`, `jis2004`. + - The use of deprecated presets is warned. + * Version 0.3 〈2015/05/08〉 + - Presets made more alike those of pxchfon. + * Version 0.2a 〈2013/01/28〉 + - Adjustment for new zxjatype. + * Version 0.2 〈2009/12/22〉 + - First public version. + +-------------------- +Takayuki YATO (aka. "ZR") +http://zrbabbler.sp.land.to/ diff --git a/Master/texmf-dist/doc/latex/zxjafont/zxjafont.pdf b/Master/texmf-dist/doc/latex/zxjafont/zxjafont.pdf index fdf3f4b1f46..f7bfbf3e426 100644 Binary files a/Master/texmf-dist/doc/latex/zxjafont/zxjafont.pdf and b/Master/texmf-dist/doc/latex/zxjafont/zxjafont.pdf differ diff --git a/Master/texmf-dist/doc/latex/zxjafont/zxjafont.tex b/Master/texmf-dist/doc/latex/zxjafont/zxjafont.tex index 35c9b5304cf..0183a071198 100644 --- a/Master/texmf-dist/doc/latex/zxjafont/zxjafont.tex +++ b/Master/texmf-dist/doc/latex/zxjafont/zxjafont.tex @@ -1,26 +1,28 @@ % 文字コードは UTF-8 % xelatex で組版する -\documentclass[a4paper]{bxjsarticle} -\usepackage{zxjatype} -\setjamainfont{IPAMincho} -\setjasansfont{IPAGothic} -\setjamonofont{IPAGothic} +\documentclass[xelatex,ja=standard,jafont=ipaex, + a4paper]{bxjsarticle} \xeCJKDeclareCharClass{CJK}{`■,`※} -\usepackage{metalogo} +\usepackage{color} +\definecolor{myblue}{rgb}{0,0,0.75} +\definecolor{mygreen}{rgb}{0,0.45,0} +\usepackage[colorlinks,hyperfootnotes=false]{hyperref} +\hypersetup{linkcolor=myblue,urlcolor=mygreen} +\usepackage{bxtexlogo} +\bxtexlogoimport{*} \usepackage{shortvrb} \MakeShortVerb{\|} -\newcommand{\PkgVersion}{0.3} +\newcommand{\PkgVersion}{0.4} +\newcommand{\PkgDate}{2018/05/04} \newcommand{\Pkg}[1]{\textsf{#1}} \newcommand{\Meta}[1]{$\langle$\mbox{}#1\mbox{}$\rangle$} \newcommand{\Note}{\par\noindent ※} \newcommand{\Means}{:\ } -\providecommand{\pTeX}{p\TeX} -\providecommand{\pLaTeX}{p\LaTeX} %----------------------------------------------------------- \begin{document} \title{\Pkg{zxjafont} パッケージ(v\PkgVersion)} \author{八登崇之\ (Takayuki YATO; aka.~``ZR'')} -\date{2015/05/08} +\date{v\PkgVersion\quad[\PkgDate]} \maketitle %=========================================================== @@ -61,10 +63,11 @@ ただし、\Pkg{zxjatype}パッケージでは和文と欧文を区別するので、 それと併用の場合は和文のみにフォント設定が適用される。 +%------------------- \subsection{メイン設定} 総称ファミリの設定 -(\Pkg{fontspec}の|\setmainfont|、|\setsansfont|、|\setmonofont|) +(\Pkg{fontspec}の |\setmainfont|、|\setsansfont|、|\setmonofont|) を行うもの。 \Note 「メイン設定」は\Pkg{pxchfon}パッケージにおける @@ -93,8 +96,8 @@ IPAexフォント。 \Note {\XeTeX}\>は「フォント非埋込のPDF生成」に対応していない。 \paragraph{多ウェイト用の設定} -明朝・ゴシック各々2ウェイトを用いる設定。% -\footnote{\Pkg{fontspec}では3ウェイト以上の設定ができない。)} +明朝・ゴシック各々2ウェイトを用いる設定 +\footnote{\Pkg{fontspec}では3ウェイト以上の設定ができない。)}。 セリフに明朝、サンセリフと等幅にゴシックを割り当て、 各々について通常(|\mdseries|)と太字(|\bfseries|) を個別に設定する。 @@ -120,22 +123,49 @@ IPAexフォント。 小塚フォント(Pr6n版)。 \item |hiragino-pro|\Means ヒラギノフォント基本6書体セット(Pro/Std版)。 -\item |morisawa-pro|\Means - モリサワフォント基本7書体(Pro版)。 \item |hiragino-pron|\Means ヒラギノフォント基本6書体セット(ProN/StdN版)。 +\item |morisawa-pro|\Means + モリサワフォント基本7書体(Pro版)。 \item |morisawa-pr6n|\Means モリサワフォント基本7書体(Pr6N版)。 \item |yu-win|\Means - 游書体(Windows搭載版)。 + 游書体(Windows~8.1搭載版)。 +\item |yu-win10|\Means + 游書体(Windows~10搭載版)。%TODO \item |yu-osx|\Means 游書体(Mac OS X搭載版)。 +\item |sourcehan|\Means + Source Han Serif(源ノ明朝)+ Source Han Sans(源ノ角ゴシック)、 + 非サブセット版%TODO + \footnote{つまり、地域別サブセットOTF版以外のもの。 + 後掲の |noto| も同じ。}。 +\item |noto|\Means + Noto Serif CJK + Noto Sans CJK、 + 非サブセット版。 +\end{itemize} + +\paragraph{ptex-fontmaps互換のオプション} + +\Pkg{ptex-fontmaps}のプリセット名を別名として用意した。 + +\begin{itemize} +\item |kozuka|\Means + |kozuka-pro| の別名。%TODO +\item |morisawa|\Means + |morisawa-pro| の別名。%TODO \end{itemize} +\Note なお、|hiragino-pro| と同義の\Pkg{ptex-fontmaps}の +プリセット名は |hiragino| であるが、本パッケージの |hiragino| は +旧版の非推奨の設定であり |hiragino-pro| とは異なる。 + \paragraph{旧版の設定} -v0.2a版以前で用意されていたメイン設定。 -現在の版でも使用は可能であるが非推奨である。 +v0.2a版以前で用意されていたメイン設定で、現在では非推奨である。 + +\Note これらは{\TeX} Live 2019のリリース時を目途にして +\strong{廃止予定}である。 \begin{itemize} \item |kozuka4|\Means @@ -152,6 +182,7 @@ v0.2a版以前で用意されていたメイン設定。 \item |moga-mobo|\Means |moga| の別名。※\Pkg{pxchfon}互換用。 \end{itemize} +%------------------- \subsection{サブ設定} \Pkg{fontspec}では使用するフォントを |\newfontfamily| 命令で @@ -202,7 +233,8 @@ Moboフォント(90/2000JIS字形)を使う設定。 と太字(|\bfseries|)の2つに制限している。 多くのOSでの扱いに合わせているようである。 -\subsection{他オプション} +%------------------- +\subsection{その他のオプション} \begin{itemize} \item |oneweight|\Means @@ -228,10 +260,18 @@ Moboフォント(90/2000JIS字形)を使う設定。 \Pkg{zxjatype}パッケージで指定されている場合はその値、 なければ1となる。 +\item |90jis|\Means +90JIS字形(2000JIS字形)の使用を指定する。 + +\item |jis2004|\Means +2004JIS字形の使用を指定する。 + \item |feature={|\Meta{属性リスト}|}|\Means このパッケージで指定されるフォント全体に通用する \Pkg{fontspec}の属性の指定。 \end{itemize} +%=========================================================== \end{document} +%% EOF diff --git a/Master/texmf-dist/tex/latex/zxjafont/zxjafont.sty b/Master/texmf-dist/tex/latex/zxjafont/zxjafont.sty index 271a3f2e043..d935bc8309c 100644 --- a/Master/texmf-dist/tex/latex/zxjafont/zxjafont.sty +++ b/Master/texmf-dist/tex/latex/zxjafont/zxjafont.sty @@ -1,82 +1,121 @@ -% -% zxjafont.sty -% -%%%% package declaration -\NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{zxjafont}[2015/05/08 v0.3] -\RequirePackage{ifxetex} -\RequireXeTeX +%% +%% This is file 'zxjafont.sty'. +%% +%% Copyright (c) 2018 Takayuki YATO (aka. "ZR") +%% GitHub: https://github.com/zr-tex8r +%% Twitter: @zr_tex8r +%% +%% This package is distributed under the MIT License. +%% -%%%% preparation +%% package declaration +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{zxjafont}[2018/05/03 v0.4-pre] \def\zxjf@pkgname{zxjafont} -\def\zxjf@error{\PackageError\zxjf@pkgname} -\def\zxjf@warn{\PackageInfo\zxjf@pkgname} + +%% preparation +\RequirePackage{ifxetex}\RequireXeTeX +\providecommand{\bxDebug}[1]{} + +%--------------------------------------- general + +%% packages \RequirePackage{fontspec} \RequirePackage{keyval} -\ifx\bxUseDebug\relax \let\zxjf@debug\@gobble -\else \def\zxjf@debug#1{\typeout{\zxjf@pkgname: #1}} -\fi +\RequirePackage{etoolbox} + +%% errors +\def\zxjf@err@ivval#1#2{% + \PackageError\zxjf@pkgname + {Invalid value '#2' for option #1}\@ehc} + +%--------------------------------------- handle options + +%% constants +\chardef\zxjf@cjkshape@@none=0 +\chardef\zxjf@cjkshape@@xc=1 % 90jis +\chardef\zxjf@cjkshape@@mmiv=2 % jis2004 + +%% variables +\let\zxjf@main@preset\relax +\let\zxjf@sub@preset\@empty +\newif\ifzxjf@prop +\newif\ifzxjf@oneweight +\let\zxjf@cjkshape\zxjf@cjkshape@@none +\let\zxjf@scale\relax +\let\zxjf@feat\@empty +\newif\ifzxjf@zxjatype -%%%% options handling %% \zxjf@main@preset \def\zxjf@all@main@preset{% ms,ipa,ipaex,% - ms-hg,ipa-hg,ipaex-hg,moga,moga-90,% + ms-hg,ipa-hg,ipaex-hg,moga,moga-90,ume,% kozuka-pro,kozuka-pr6,kozuka-pr6n,hiragino-pro,hiragino-pron,% - morisawa-pro,morisawa-pr6n,yu-win,yu-osx,% + morisawa-pro,morisawa-pr6n,yu-win,yu-win10,yu-osx,% + sourcehan,sourcehan-jp,noto,noto-jp,% kozuka4,kozuka6,kozuka6n,hiragino,% ms-dx,ipa-dx,hiragino-dx,moga-mobo} + +%% \zxjf@main@sub@preset \def\zxjf@all@sub@preset{% hg,hiraginomg-pro,hiraginomg-pron,mobo,mobo-90,maruberi,% hiraginomg} -\let\zxjf@main@preset\relax + +% preset options \def\zxjf@do#1{\DeclareOption{#1}{\def\zxjf@main@preset{#1}}} \@for\zxjf@x:=\zxjf@all@main@preset\do{% \expandafter\zxjf@do\expandafter{\zxjf@x}} -\let\zxjf@sub@preset\@empty \def\zxjf@do#1{\DeclareOption{#1}{\zxjf@add@sub@preset{#1}}} \@for\zxjf@x:=\zxjf@all@sub@preset\do{% \expandafter\zxjf@do\expandafter{\zxjf@x}} \def\zxjf@add@sub@preset#1{% \edef\zxjf@sub@preset{\zxjf@sub@preset#1,}} -% -\newif\ifzxjf@prop +% 'prop' \DeclareOption{prop}{\zxjf@proptrue} -\newif\ifzxjf@oneweight +% 'oneweight' \DeclareOption{oneweight}{\zxjf@oneweighttrue} -\define@key{zxjf}{scale}{\def\zxjf@scale{#1}} -% options using keyval -\let\zxjf@scale\relax -\define@key{zxjf}{scale}{\def\zxjf@scale{#1}} -\let\zxjf@feat\@empty -\define@key{zxjf}{feature}{\def\zxjf@feat{#1}} +% '90jis'/'jis2004' +\DeclareOption{90jis}{\let\zxjf@cjkshape\zxjf@cjkshape@@xc} +\DeclareOption{jis2004}{\let\zxjf@cjkshape\zxjf@cjkshape@@mmiv} + +%% options using keyval \DeclareOption*{\def\zxjf@nxt{\setkeys{zxjf}}% \expandafter\zxjf@nxt\expandafter{\CurrentOption}} -% dispatch +% 'scale=' +\define@key{zxjf}{scale}{\def\zxjf@scale{#1}} +% 'feature=' +\define@key{zxjf}{feature}{\def\zxjf@feat{#1}} + +%% dispatch \let\@org@use@ption\@use@ption \def\@use@ption{\csname ds@\CurrentOption \endcsname} \ProcessOptions* \let\@use@ption\@org@use@ption -% preset must be given + +%% preset must be given \ifx\zxjf@main@preset\relax - \zxjf@error{Preset name not specified} - {You must give one of the following names as option.\MessageBreak - \space\space\zxjf@all@main@preset} - \endinput\fi + \PackageError\zxjf@pkgname + {Preset name not specified} + {You must give one of the following names as option.\MessageBreak + \space\space\zxjf@all@main@preset} +\expandafter\endinput\fi\relax -%%%% detect bxjatype -\newif\ifzxjf@zxjatype +%% detect bxjatype \@ifpackageloaded{zxjatype}{\zxjf@zxjatypetrue}{} \AtBeginDocument{% - \ifzxjf@zxjatype\else\@ifpackageloaded{zxjatype}{% - \zxjf@error{zxjatype must be loaded before me}\@ehc - }\fi} + \unless\ifzxjf@zxjatype + \@ifpackageloaded{zxjatype}{% + \PackageError\zxjf@pkgname + {zxjatype must be loaded before me}\@ehc + }{}% + \fi} \ifzxjf@zxjatype\ifzxjf@prop - \zxjf@error{Option 'prop' cannot be used with zxjatype}\@ehc + \PackageError\zxjf@pkgname + {Option 'prop' cannot be used with zxjatype}\@ehc \zxjf@propfalse \fi\fi -%%%% decide scale factor +%% decide scale factor \ifx\zxjf@scale\relax % If zxjatype is used, try \JaFontScale, \zxjt@scale, % and \__zxjt_scale_tl. @@ -84,8 +123,7 @@ \ifdefined\JaFontScale \let\zxjf@scale\JaFontScale \else\ifdefined\zxjt@scale \let\zxjf@scale\zxjt@scale \else\ifcsname __zxjt_scale_tl\endcsname - \expandafter\let\expandafter\zxjf@scale - \csname __zxjt_scale_tl\endcsname + \letcs\zxjf@scale{__zxjt_scale_tl} \fi\fi\fi \fi \ifx\zxjf@scale\relax % still unknown @@ -98,11 +136,22 @@ \def\zxjf@scale{1}% \fi \fi + +%% resolve CJKshape +\edef\zxjf@feat{% + \ifcase\zxjf@cjkshape % none + \or CJKShape=JIS1990,% 90jis + \or CJKShape=JIS2004,% jis2004 + \fi + \zxjf@feat} + +%% \zxjf@xfeat +% All fontspec options including scale. \edef\zxjf@xfeat{Scale=\zxjf@scale,\zxjf@feat} -\zxjf@debug{scale=\zxjf@scale/feat={\zxjf@feat}/% +\bxDebug{zxjafont>>scale=\zxjf@scale/feat={\zxjf@feat}/% preset=\zxjf@main@preset/\zxjf@sub@preset} -%%-------- preset japanese font mappings +%--------------------------------------- font setup helpers %% \zxjf@setmainfont{}{}, etc. \ifzxjf@zxjatype @@ -110,8 +159,8 @@ \def\zxjf@setsansfont#1{\setjasansfont[\zxjf@xfeat,#1]} \def\zxjf@setmonofont#1{\setjamonofont[\zxjf@xfeat,#1]} \def\zxjf@newfamily#1#2#3{% - \expandafter\def\csname #1family\expandafter\endcsname\expandafter - {\csname a#1family\endcsname\CJKfamily{#1}}% + \csedef{#1family}{% + \expandonce{\csname a#1family\endcsname}\noexpand\CJKfamily{#1}}% \expandafter\newfontfamily\csname a#1family\endcsname[\zxjf@feat,#2]{#3}% \setjafamilyfont{#1}[\zxjf@xfeat,#2]{#3}} \else @@ -122,10 +171,13 @@ \expandafter\newfontfamily\csname #1family\endcsname[\zxjf@xfeat,#2]} \fi +%--------------------------------------- preset japanese font mappings + %% \zxjf@declare@preset{}{}, etc. \def\zxjf@declare@preset#1{% \expandafter\zxjf@decl@preset@a\csname zxjf@the@preset@#1\endcsname} \def\zxjf@decl@preset@a#1{\@onlypreamble#1\def#1} +\zxjf@declare@preset{}{} \@onlypreamble\zxjf@uniweight \def\zxjf@uniweight#1#2{% \zxjf@uniweight@opt{#1}{#2}{}} @@ -148,21 +200,25 @@ \zxjf@setsansfont{#6,BoldFont=#4}{#3}% \zxjf@setmonofont{#6,BoldFont=#4}{#3}% \fi} +%% \zxjf@declare@preset@with@prop{}{} +\def\zxjf@declare@preset@with@prop#1#2{% + \zxjf@declare@preset{#1}{#2{RawFeature=-palt;-kern}}% + \zxjf@declare@preset{#1/prop}{#2{RawFeature=+palt;+Wkern}}} %% \zxjf@declare@preset@alias{}{} \def\zxjf@declare@preset@alias#1#2{% - \expandafter\let\csname zxjf@the@preset@#1\expandafter\endcsname - \csname zxjf@the@preset@#2\endcsname} + \csletcs{zxjf@the@preset@#1}{zxjf@the@preset@#2}} +%% \zxjf@declare@preset@alias@with@prop{}{} +\def\zxjf@declare@preset@alias@with@prop#1#2{% + \zxjf@declare@preset@alias{#1}{#2}% + \zxjf@declare@preset@alias{#1/prop}{#2/prop}} %% \zxjf@use@preset{} \def\zxjf@use@preset#1{% - \ifzxjf@prop \zxjf@use@preset@a{#1/prop}% - \else \let\zxjf@nxt\relax \fi - \ifx\zxjf@nxt\relax \zxjf@use@preset@a{#1}\fi + \undef\zxjf@nxt + \ifzxjf@prop \letcs\zxjf@nxt{zxjf@the@preset@#1/prop}\fi + \unless\ifdefined\zxjf@nxt \letcs\zxjf@nxt{zxjf@the@preset@#1}\fi \zxjf@nxt} -\def\zxjf@use@preset@a#1{% - \expandafter\let\expandafter\zxjf@nxt - \csname zxjf@the@preset@#1\endcsname} %% definitions of main preset mappings \zxjf@declare@preset{ms}{% @@ -196,6 +252,9 @@ \zxjf@declare@preset{moga-90}{% \zxjf@multiweight{MogaEx90Mincho}{MogaEx90Mincho Bold}% {MogaEx90Gothic}{MogaEx90Gothic Bold}{MogaEx90Gothic}} +\zxjf@declare@preset{ume}{% + \zxjf@multiweight{Ume Mincho}{Ume Mincho}% + {Ume Gothic}{Ume Gothic O5}{Ume Gothic O5}} \zxjf@declare@preset{kozuka-pro}{% \zxjf@multiweight@opt{KozMinPro-Regular}{KozMinPro-Bold}% {KozGoPro-Regular}{KozGoPro-Bold}% @@ -260,6 +319,10 @@ \zxjf@multiweight@opt{YuMincho-Regular}{YuMincho-Demibold}% {YuGothic-Regular}{YuGothic-Bold}% {YuGothic-Regular}{RawFeature=+palt;+kern}} +\zxjf@declare@preset@with@prop{yu-win10}{% + \zxjf@multiweight@opt{YuMincho-Regular}{YuMincho-Demibold}% + {YuGothic-Regular}{YuGothic-Bold}% + {YuGothic-Medium}} \zxjf@declare@preset{yu-osx}{% \zxjf@multiweight@opt{YuMincho-Medium}{YuMincho-Demibold}% {YuGothic-Medium}{YuGothic-Bold}% @@ -268,6 +331,22 @@ \zxjf@multiweight@opt{YuMincho-Medium}{YuMincho-Demibold}% {YuGothic-Medium}{YuGothic-Bold}% {YuGothic-Medium}{RawFeature=+palt;+kern}} +\zxjf@declare@preset@with@prop{sourcehan}{% + \zxjf@multiweight@opt{SourceHanSerif-Regular}{SourceHanSerif-Bold}% + {SourceHanSans-Regular}{SourceHanSans-Bold}% + {SourceHanSans-Medium}} +\zxjf@declare@preset@with@prop{sourcehan-jp}{% + \zxjf@multiweight@opt{SourceHanSerifJP-Regular}{SourceHanSerifJP-Bold}% + {SourceHanSansJP-Regular}{SourceHanSansJP-Bold}% + {SourceHanSansJP-Medium}} +\zxjf@declare@preset@with@prop{noto}{% + \zxjf@multiweight@opt{NotoSerifCJKjp-Regular}{NotoSerifCJKjp-Bold}% + {NotoSansCJKjp-Regular}{NotoSansCJKjp-Bold}% + {NotoSansCJKjp-Medium}} +\zxjf@declare@preset@with@prop{noto-jp}{% + \zxjf@multiweight@opt{NotoSerifJP-Regular}{NotoSerifJP-Bold}% + {NotoSansJP-Regular}{NotoSansJP-Bold}% + {NotoSansJP-Medium}} %(obsolete) \zxjf@declare@preset{kozuka4}{% \zxjf@uniweight@opt{Kozuka Mincho Pro}{Kozuka Gothic Pro}% @@ -294,14 +373,18 @@ \zxjf@uniweight@opt{Hiragino Mincho Pro W3}{Hiragino Kaku Gothic Pro W6}% {RawFeature=+palt;+kern}} %(alias) +\zxjf@declare@preset@alias@with@prop{kozuka}{kozuka-pro} +\zxjf@declare@preset@alias@with@prop{morisawa}{morisawa-pro} +\zxjf@declare@preset@alias{moga-mobo}{moga} +%(alias-obsolete) \zxjf@declare@preset@alias{ms-dx}{ms-hg} \zxjf@declare@preset@alias{ms-dx/prop}{ms-hg/prop} \zxjf@declare@preset@alias{ipa-dx}{ipa-hg} \zxjf@declare@preset@alias{ipa-dx/prop}{ipa-hg/prop} \zxjf@declare@preset@alias{hiragino-dx}{hiragino-pro} \zxjf@declare@preset@alias{hiragino-dx/prop}{hiragino-pro/prop} -\zxjf@declare@preset@alias{moga-mobo}{moga} +%% definitions of sub preset mappings \zxjf@declare@preset{hg}{% \zxjf@newfamily{hgmc}{BoldFont=HGSMinchoE}{HGSMinchoB}% \zxjf@newfamily{hgpr}{}{HGSSoeiPresenceEB}% @@ -342,18 +425,29 @@ \zxjf@declare@preset{maruberi}{% \zxjf@newfamily{mmg}{}{MotoyaLMaru}} -%%%% ... and invokes the specified one! +%% warn for deprecated presets +\@for\zxjf@x:={% + kozuka4,kozuka6,kozuka6n,hiragino,ms-dx,ipa-dx,hiragino-dx% +}\do{% + \ifx\zxjf@x\zxjf@main@preset + \PackageWarningNoLine\zxjf@pkgname + {Old preset '\zxjf@x' is deprecated\MessageBreak + (see the manual for detail)}% + \fi} + +%% ... and invokes the specified one! \zxjf@use@preset{\zxjf@main@preset} \@for\zxjf@x:=\zxjf@sub@preset\do{\zxjf@use@preset\zxjf@x} -%%------ and some extras +%--------------------------------------- and some extras -\def\useeasyjapanesesettings{% +%%<*> \useeasyjapanesesettings +\newcommand*\useeasyjapanesesettings{% \XeTeXlinebreaklocale "ja"\relax \XeTeXlinebreakskip=0pt plus 1pt minus 0.1pt\relax \XeTeXlinebreakpenalty=0\relax } -%%------ all done +%--------------------------------------- all done \endinput %% EOF -- cgit v1.2.3