diff options
author | Karl Berry <karl@freefriends.org> | 2016-01-31 23:45:28 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-01-31 23:45:28 +0000 |
commit | 326c162a7ec8088d104101b4739c727d824ae5f7 (patch) | |
tree | b361de0cef7c47e209b56e053f1ec957a38526fb /Master/texmf-dist/tex/luatex/luatexja/addons | |
parent | a05d0c546c309991c96cf6aed49902bf5d60f66c (diff) |
luatexja (31jan16)
git-svn-id: svn://tug.org/texlive/trunk@39527 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/luatex/luatexja/addons')
3 files changed, 88 insertions, 70 deletions
diff --git a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-fontspec-24.sty b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-fontspec-24.sty index 691e53118ff..38ca8eedaca 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-fontspec-24.sty +++ b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-fontspec-24.sty @@ -3,22 +3,14 @@ % \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{luatexja-fontspec-24}[2015/06/28 fontspec support of LuaTeX-ja] +\ProvidesPackage{luatexja-fontspec-24}[2016/01/30 fontspec support of LuaTeX-ja] \RequirePackage{l3keys2e,luatexja} \ExplSyntaxOn %%%%%%%% Change Japanese font family by \rmfamily or not \cs_new:Npn \ltj_fontspec_match_cmd { \renewcommand\jttdefault{\gtdefault} - \DeclareRobustCommand\rmfamily - {\not@math@alphabet\rmfamily\mathrm - \romanfamily\rmdefault\kanjifamily\mcdefault\selectfont} - \DeclareRobustCommand\sffamily - {\not@math@alphabet\sffamily\mathsf - \romanfamily\sfdefault\kanjifamily\gtdefault\selectfont} - \DeclareRobustCommand\ttfamily - {\not@math@alphabet\ttfamily\mathtt - \romanfamily\ttdefault\kanjifamily\jttdefault\selectfont} + \@ltj@match@familytrue \DeclareDocumentCommand \setmonojfont { O{} m } { \ltj_fontspec_set_family:Nnn \jttdefault {##1}{##2} \normalfont @@ -180,6 +172,7 @@ \tl_set_eq:NN \l__fontspec_saved_fontname_tl \l_fontspec_fontname_tl \tl_set:Nn \g_fontspec_encoding_tl {#5} + \tl_set:Nn \l__fontspec_nfss_enc_tl {#5} \exp_args:Nx \clist_map_inline:nn {#4} { \tl_clear:N \l__fontspec_size_tl @@ -212,6 +205,7 @@ \cs_set_eq:NN \__ltj_orig_fontspec_set_family:Nnn \fontspec_set_family:Nnn \cs_set_eq:NN \__ltj_orig_fontspec_make_font_shapes:Nnnnn \__fontspec_make_font_shapes:Nnnnn \cs_set_eq:NN \__ltj_fontspec_orig_DeclareFontShape \DeclareFontShape + \cs_new:Nn \ltj_fontspec_make_font_shapes:Nnnnn { \group_begin: %% 基底フォント diff --git a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-preset.sty b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-preset.sty index 917ba786a5b..42528e2cc9f 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-preset.sty +++ b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-preset.sty @@ -1,43 +1,58 @@ % luatexja-preset.sty -\ProvidesPackage{luatexja-preset}[2015/06/28 Japanese font presets] +\ProvidesPackage{luatexja-preset}[2016/01/30 Japanese font presets] -\RequirePackage{expl3} +\RequirePackage{expl3,l3keys2e} \RequirePackage{luatexja} \ExplSyntaxOn -%%%% message -\bool_new:N \l_ltjpreset_nfssonly_bool % nfssonly -\bool_set_false:N \l_ltjpreset_nfssonly_bool -\DeclareOption{nfssonly} {\bool_set_true:N \l_ltjpreset_nfssonly_bool} -\DeclareOption{fontspec} {\bool_set_false:N \l_ltjpreset_nfssonly_bool} - -\bool_new:N \l_ltjpreset_bold_bool % bold -\bool_set_false:N \l_ltjpreset_bold_bool -\DeclareOption{bold} {\bool_set_true:N \l_ltjpreset_bold_bool} -\DeclareOption{nobold}{\bool_set_false:N \l_ltjpreset_bold_bool} +\fp_new:N \l_ltjpreset_scale_fp +\group_begin: +\fontsize{10}{10}\selectfont +\fp_gset:Nn \l_ltjpreset_scale_fp {\zw / 10} +\group_end: -\bool_new:N \l_ltjpreset_expert_bool % expert -\bool_set_false:N \l_ltjpreset_expert_bool -\DeclareOption{expert} {\bool_set_true:N \l_ltjpreset_expert_bool} -\DeclareOption{noexpert}{\bool_set_false:N \l_ltjpreset_expert_bool} +\keys_define:nn { luatexja-preset }{ + unknown .code:n = \PassOptionsToPackage { \l_keys_key_tl } { luatexja-fontspec }, + scale .fp_gset:N = \l_ltjpreset_scale_fp, + match .code: n = + \renewcommand\jttdefault{\gtdefault}\@ltj@match@familytrue + \PassOptionsToPackage { match } { luatexja-fontspec }, + match .value_forbidden:n = true +} +\cs_new:Nn \ltjpreset_declare_option:nn { + \keys_define:nn { luatexja-preset }{ + #1 .code:n = #2, + #1 .value_forbidden:n = true + } +} +\cs_new:Nn \ltjpreset_declare_bool_option:nn { + \bool_new:c { l_ltjpreset_#1_bool } + \bool_set_false:c { l_ltjpreset_#1_bool } + \keys_define:nn { luatexja-preset }{ + #1 .bool_set:c = { l_ltjpreset_#1_bool }, + #2 .bool_set_inverse:c = { l_ltjpreset_#1_bool }, + #1 .default:n = true, + #2 .default:n = true, + } +} -\int_new:N \l_ltjpreset_deluxe_int % deluxe -\int_set:Nn \l_ltjpreset_deluxe_int { 0 } -\DeclareOption{deluxe}{\int_set:Nn \l_ltjpreset_deluxe_int { 2 }} % 6 fonts -\DeclareOption{nodeluxe}{\int_set:Nn \l_ltjpreset_deluxe_int { 0 }} % 2 fonts +%%%%%%%% bool options +\ltjpreset_declare_bool_option:nn { nfssonly }{ fontspec } +\ltjpreset_declare_bool_option:nn { bold }{ nobold } +\ltjpreset_declare_bool_option:nn { expert }{ noexpert } +\ltjpreset_declare_bool_option:nn { deluxe }{ nodeluxe } -\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{luatexja-fontspec}} % JFM \cs_set:Npn \ltjpreset_use_jfm: {ujis} % 使用する JFM -%%% \DeclareOption{min}{\cs_set:Npn \ltjpreset_use_jfm: {min}} % min +%%% \ltjpreset_declare_option:nn{min}{\cs_set:Npn \ltjpreset_use_jfm: {min}} % min %%% ↑jfm-min.lua が横組み・縦組み専用仮名に追いついていないので使用禁止 -\DeclareOption{jis}{\cs_set:Npn \ltjpreset_use_jfm: {jis}} % jis -\DeclareOption{ujis}{\cs_set:Npn \ltjpreset_use_jfm: {ujis}} % ujis +\ltjpreset_declare_option:nn{jis}{\cs_set:Npn \ltjpreset_use_jfm: {jis}} % jis +\ltjpreset_declare_option:nn{ujis}{\cs_set:Npn \ltjpreset_use_jfm: {ujis}} % ujis % 漢字字形 \tl_new:N \l_ltjpreset_kanji_shape_tl -\DeclareOption{90jis}{ \tl_set:Nn \l_ltjpreset_kanji_shape_tl { , CJKShape=JIS1990 }} % 90jis -\DeclareOption{jis2004}{\tl_set:Nn \l_ltjpreset_kanji_shape_tl { , CJKShape=JIS2004 }} % jis2004 +\ltjpreset_declare_option:nn{90jis}{ \tl_set:Nn \l_ltjpreset_kanji_shape_tl { , CJKShape=JIS1990 }} % 90jis +\ltjpreset_declare_option:nn{jis2004}{\tl_set:Nn \l_ltjpreset_kanji_shape_tl { , CJKShape=JIS2004 }} % jis2004 % font preset \bool_new:N \l_ltjpreset_office_bool % MS Office の HG 系フォントを使っているか @@ -63,9 +78,17 @@ } +%%%%%%%% プリセット達 + +% カスタム指定 + \keys_define:nn { luatexja-preset }{ + custom .code:n = \ltjpreset_set_multi:n { #1 }, + custom .value_required:n = true +} + % 小塚 (Adobe) %% Pro -\DeclareOption{kozuka-pro}{ +\ltjpreset_declare_option:nn{kozuka-pro}{ \ltjpreset_set_multi:n { KozMinPro-Regular , % mc/m KozMinPro-Bold , % mc/bx @@ -77,7 +100,7 @@ } } %% Pr6 -\DeclareOption{kozuka-pr6}{ +\ltjpreset_declare_option:nn{kozuka-pr6}{ \ltjpreset_set_multi:n { KozMinProVI-Regular , % mc/m KozMinProVI-Bold , % mc/bx @@ -89,7 +112,7 @@ } } %% Pr6N -\DeclareOption{kozuka-pr6n}{ +\ltjpreset_declare_option:nn{kozuka-pr6n}{ \ltjpreset_set_multi:n { KozMinPr6N-Regular , % mc/m KozMinPr6N-Bold , % mc/bx @@ -102,7 +125,7 @@ } % ヒラギノ (OSX) -\DeclareOption{hiragino-pro}{ +\ltjpreset_declare_option:nn{hiragino-pro}{ \ltjpreset_set_multi:n { HiraMinPro-W3 , HiraMinPro-W6 , @@ -113,7 +136,7 @@ HiraMaruPro-W4 , } } -\DeclareOption{hiragino-pron}{ +\ltjpreset_declare_option:nn{hiragino-pron}{ \ltjpreset_set_multi:n { HiraMinProN-W3 , HiraMinProN-W6 , @@ -126,7 +149,7 @@ } % モリサワ -\DeclareOption{morisawa-pro}{ +\ltjpreset_declare_option:nn{morisawa-pro}{ \ltjpreset_set_multi:n { A-OTF-RyuminPro-Light.otf , A-OTF-FutoMinA101Pro-Bold.otf , % mc/m, mc/bx A-OTF-GothicBBBPro-Medium.otf , A-OTF-FutoGoB101Pro-Bold.otf , % gt/m, gt/bx (multiweight)) @@ -134,7 +157,7 @@ A-OTF-Jun101Pro-Light.otf % mg/m } } -\DeclareOption{morisawa-pr6n}{ +\ltjpreset_declare_option:nn{morisawa-pr6n}{ \ltjpreset_set_multi:n { A-OTF-RyuminPr6N-Light.otf , A-OTF-FutoMinA101Pr6N-Bold.otf , % mc/m, mc/bx A-OTF-GothicBBBPr6N-Medium.otf , A-OTF-FutoGoB101Pr6N-Bold.otf , % gt/m, gt/bx (multiweight)) @@ -144,7 +167,7 @@ } % 游明朝/游ゴシック (Win8.1) -\DeclareOption{yu-win}{ +\ltjpreset_declare_option:nn{yu-win}{ \ltjpreset_set_multi:n { YuMincho-Regular , YuMincho-Demibold , % mc/m, mc/bx YuGothic-Regular , YuGothic-Bold , % gt/m, gt/bx (multiweight)) @@ -155,7 +178,7 @@ % Yu fonts in OSX % according to http://support.apple.com/kb/HT5944 -\DeclareOption{yu-osx}{ +\ltjpreset_declare_option:nn{yu-osx}{ \ltjpreset_set_multi:n { YuMincho~Medium , YuMincho~Demibold , % mc/m, mc/bx YuGothic~Medium , YuGothic~Bold , % gt/m, gt/bx (multiweight)) @@ -165,7 +188,7 @@ } % moga-mobo -\DeclareOption{moga-mobo}{ +\ltjpreset_declare_option:nn{moga-mobo}{ \ltjpreset_set_multi:n { Moga90Mincho, Moga90Mincho~Bold , % mc/m, mc/bx Moga90Gothic, Moga90Gothic~Bold , % gt/m, gt/bx (multiweight)) @@ -176,37 +199,36 @@ % ipa, ipaex, ms -\DeclareOption{ipa}{ +\ltjpreset_declare_option:nn{ipa}{ \ltjpreset_set_uni:nn { IPAMincho } { IPAGothic } } -\DeclareOption{ipaex}{ +\ltjpreset_declare_option:nn{ipaex}{ \ltjpreset_set_uni:nn { IPAExMincho } { IPAExGothic } } -\DeclareOption{ms}{ +\ltjpreset_declare_option:nn{ms}{ \ltjpreset_set_uni:nn { MS-Mincho } { MS-Gothic } } % {ipa,ipaex,ms}-dx % Office 付属フォントを利用 -\DeclareOption{ipaex-hg}{ +\ltjpreset_declare_option:nn{ipaex-hg}{ \ltjpreset_set_office:nn { IPAExMincho } { IPAExGothic } } -\DeclareOption{ipa-hg}{ +\ltjpreset_declare_option:nn{ipa-hg}{ \ltjpreset_set_office:nn { IPAMincho } { IPAGothic } } -\DeclareOption{ms-hg}{ +\ltjpreset_declare_option:nn{ms-hg}{ \ltjpreset_set_office:nn { MS-Mincho } { MS-Gothic } } % 非埋込 -\DeclareOption{noembed}{ +\ltjpreset_declare_option:nn{noembed}{ \ltjpreset_set_uni:nn { Ryumin-Light } { GothicBBB-Medium } \bool_set_true:N \l_ltjpreset_noembed_bool } -\ExecuteOptions{ipaex} - -\ProcessOptions* +\keys_set:nn { luatexja-preset }{ ipaex } +\ProcessKeysOptions { luatexja-preset } %%%%%%%% main routine @@ -223,14 +245,22 @@ \bool_new:N \l_ltjpreset_shape_nlck_bool %% KozMinPr6N, HiraMinProN-W3 の場合はjp04 feature がないので,nlck にする \tl_set:Nn \l_tmpa_tl {, CJKShape=JIS2004 } -\tl_if_eq:NNT \l_ltjpreset_kanji_shape_tl \l_tmpa_tl { +\tl_if_eq:NNTF \l_ltjpreset_kanji_shape_tl \l_tmpa_tl { \clist_if_in:NnT \l_ltjpreset_font_list { KozMinPr6N-Regular } { \bool_set_true:N \l_ltjpreset_shape_nlck_bool } \clist_if_in:NnT \l_ltjpreset_font_list { HiraMinProN-W3 } { \bool_set_true:N \l_ltjpreset_shape_nlck_bool } \clist_if_in:NnT \l_ltjpreset_font_list { Moga90Mincho } - { \tl_remove_all:Nn \l_ltjpreset_font_list {90} }%%% これでいいのか? - + { + \tl_remove_all:Nn \l_ltjpreset_font_list {90} + \tl_clear:N \l_ltjpreset_kanji_shape_tl + } +}{ + \tl_set:Nn \l_tmpa_tl {, CJKShape=JIS1990 } + \tl_if_eq:NNT \l_ltjpreset_kanji_shape_tl \l_tmpa_tl { + \clist_if_in:NnT \l_ltjpreset_font_list { Moga90Mincho } + { \tl_clear:N \l_ltjpreset_kanji_shape_tl } + } } %%%% リストからの展開 @@ -305,12 +335,6 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%% nfss only \bool_if:NTF \l_ltjpreset_nfssonly_bool { - -\fp_new:N \l_ltjpreset_scale_fp -\group_begin: -\fontsize{10}{10}\selectfont -\fp_gset:Nn \l_ltjpreset_scale_fp {\zw / 10} -\group_end: \msg_new:nnn { luatexja-preset }{ scale }{ Japanese~fonts~will~be~scaled~by~\fp_use:N \l_ltjpreset_scale_fp. } @@ -344,7 +368,7 @@ \DeclareKanjiFamily{JY3}{ltjpm}{}\DeclareKanjiFamily{JT3}{ltjpm}{} \DeclareKanjiFamily{JY3}{ltjpg}{}\DeclareKanjiFamily{JT3}{ltjpg}{} -\int_compare:nTF { \l_ltjpreset_deluxe_int == 2 } { +\bool_if:NTF \l_ltjpreset_deluxe_bool { \bool_if:NT \l_ltjpreset_bold_bool { \cs_set_eq:NN \ltjpreset_font_mc_bx: \ltjpreset_font_gt_bx: } @@ -374,7 +398,7 @@ \DeclareRobustCommand\rubyfamily { \kanjishape{rb}\selectfont } } -\int_compare:nTF { \l_ltjpreset_deluxe_int == 2 } { +\bool_if:NTF \l_ltjpreset_deluxe_bool { \DeclareKanjiFamily{JY3}{ltjpmg}{}\DeclareKanjiFamily{JT3}{ltjpmg}{} \ltj_preset_define_family:nnn {ltjpmg} {m} {\ltjpreset_font_mg:} \ltj_preset_define_family:nnn {ltjpg} {eb} {\ltjpreset_font_gt_eb:} @@ -389,7 +413,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%% fontspec } { - +\PassOptionsToPackage { scale = \fp_use:N \l_ltjpreset_scale_fp } { luatexja-fontspec } \RequirePackage{luatexja-fontspec} % scale \msg_new:nnn { luatexja-preset }{ scale }{ @@ -416,7 +440,7 @@ } % (丸)ゴシック体の設定: bold option もここで -\int_compare:nTF { \l_ltjpreset_deluxe_int == 2 } { +\bool_if:NTF \l_ltjpreset_deluxe_bool { %% mg \newjfontfamily \mgfamily [ BoldFont = \ltjpreset_font_mg:, diff --git a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-ruby.sty b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-ruby.sty index f3ad648817c..6b5075f7ba6 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-ruby.sty +++ b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-ruby.sty @@ -4,7 +4,7 @@ % LaTeX only! \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{luatexja-ruby}[2015/05/09 v0.22] +\ProvidesPackage{luatexja-ruby}[2015/12/29 v0.23] \RequirePackage{luatexja} %%------------------ |