diff options
author | Karl Berry <karl@freefriends.org> | 2018-09-30 21:24:35 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2018-09-30 21:24:35 +0000 |
commit | c322d486f6c0e00e12b18e89864114f99f5e7196 (patch) | |
tree | dd85c01165b42b3c4994a2186216f82c5f236c0f /Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-preset.sty | |
parent | 0e00fb64c271b0107e65fdf601df25e39f61b57f (diff) |
luatexja (30sep18)
git-svn-id: svn://tug.org/texlive/trunk@48793 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-preset.sty')
-rw-r--r-- | Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-preset.sty | 55 |
1 files changed, 35 insertions, 20 deletions
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 c3a121b8c26..b4681e91997 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-preset.sty +++ b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-preset.sty @@ -1,5 +1,5 @@ % luatexja-preset.sty -\ProvidesPackage{luatexja-preset}[2018/09/09 Japanese font presets] +\ProvidesPackage{luatexja-preset}[2018/09/30 Japanese font presets] \RequirePackage{expl3,l3keys2e} \RequirePackage{luatexja} @@ -109,7 +109,8 @@ \prop_put:Nnn \g_ltjpreset_font_prop { gt-u } {#1} \prop_put:Nnn \g_ltjpreset_font_prop { gt-d } {#1}, % gt-d, gt-u は隠し - gt .groups:n = { preset }, gt .value_required:n = true, + gt .groups:n = { preset }, gt .value_required:n = true, + gt-m .groups:n = { preset }, gt-m .value_required:n = true, } \cs_set:Nn \g_ltjpreset_tmp_cs:n { \keys_define:nn { luatexja-preset } { @@ -447,6 +448,8 @@ \cs_set_eq:NN \ltjpreset_check_deluxe_existence: \prg_do_nothing: } +\int_new:N \g_ltjpreset_applycount_int + \bool_if:NTF \g_ltjpreset_nfssonly_bool { %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%% nfss only @@ -460,46 +463,56 @@ \msg_warning:nnx { luatexja-preset }{ scale }{ \Cjascale } \cs_new:Nn \ltj_preset_declare_font_shape:nnnnnn { - \cs_if_exist:cT { #1/#2/#3/#4/10 } { \cs_undefine:c { #1/#2/#3/#4/10 } } \DeclareFontShape{#1}{#2}{#3}{#4}{ <-> s*[\Cjascale] { \bool_if:NT \g_ltjpreset_noembed_bool {psft:} #5 ;-kern \tl_use:N \l_ltjpreset_kanji_shape_tl; #6 } } {} } \cs_new:Nn \ltj_preset_define_family:nnn { - \ltj_preset_declare_font_shape:nnnnnn { JY3 } { #1 } { #2 } { n } + \ltj_preset_declare_font_shape:nnnnnn { JY3 } + { #1 \int_to_arabic:n { \g_ltjpreset_applycount_int }} { #2 } { n } { "#3" : jfm=\tl_use:N \ltjpreset_use_jfm_yoko_tl } { script=hani \bool_if:NT \g_ltjpreset_expert_bool { ;+hkna } } - \ltj_preset_declare_font_shape:nnnnnn { JT3 } { #1 } { #2 } { n } + \ltj_preset_declare_font_shape:nnnnnn { JT3 } + { #1 \int_to_arabic:n { \g_ltjpreset_applycount_int }} { #2 } { n } { "#3" : jfm=\tl_use:N \ltjpreset_use_jfm_tate_tl } { script=hani \bool_if:NT \g_ltjpreset_expert_bool { ;+vkna } } \bool_if:NT \g_ltjpreset_expert_bool { - \ltj_preset_declare_font_shape:nnnnnn { JY3 } { #1 } { #2 } { rb } + \ltj_preset_declare_font_shape:nnnnnn { JY3 } + { #1 \int_to_arabic:n { \g_ltjpreset_applycount_int }} { #2 } { rb } { "#3" : jfm=\tl_use:N \ltjpreset_use_jfm_yoko_tl } { script=kana; +ruby } - \ltj_preset_declare_font_shape:nnnnnn { JT3 } { #1 } { #2 } { rb } + \ltj_preset_declare_font_shape:nnnnnn { JT3 } + { #1 \int_to_arabic:n { \g_ltjpreset_applycount_int }} { #2 } { rb } { "#3" : jfm=\tl_use:N \ltjpreset_use_jfm_tate_tl } { script=kana; +ruby } } } - - \DeclareKanjiFamily{JY3}{ltjpm}{}\DeclareKanjiFamily{JT3}{ltjpm}{} - \DeclareKanjiFamily{JY3}{ltjpg}{}\DeclareKanjiFamily{JT3}{ltjpg}{} - \def\mcdefault{ltjpm}\def\gtdefault{ltjpg} - \SetSymbolFont{mincho}{normal}{JY3}{ltjpm}{m}{n} - \SetSymbolFont{mincho}{bold}{JY3}{ltjpm}{bx}{n} - \DeclareMathAlphabet{\mathgt}{JY3}{ltjpg}{m}{n} - \bool_if:NT \g_ltjpreset_expert_bool { - \DeclareRobustCommand\rubyfamily { \kanjishape{rb}\selectfont } - } - \bool_if:NT \g_ltjpreset_deluxe_bool { - \DeclareKanjiFamily{JY3}{ltjpmg}{}\DeclareKanjiFamily{JT3}{ltjpmg}{} \let\mgfamily\undefined \DeclareRobustCommand\mgfamily { - \not@math@alphabet\mgfamily\relax\kanjifamily{ltjpmg}\selectfont + \not@math@alphabet\mgfamily\relax + \kanjifamily{ltjpmg \int_to_arabic:n { \g_ltjpreset_applycount_int }}\selectfont } \DeclareTextFontCommand{\textmg}{\mgfamily} } + \bool_if:NT \g_ltjpreset_expert_bool { + \DeclareRobustCommand\rubyfamily { \kanjishape{rb}\selectfont } + } % \cs_new:Nn \ltjpreset_do_fontset: { \group_begin: + % ====== + \xdef\mcdefault{ltjpm \int_to_arabic:n { \g_ltjpreset_applycount_int }} + \xdef\gtdefault{ltjpg \int_to_arabic:n { \g_ltjpreset_applycount_int }} + \DeclareKanjiFamily{JY3}{\mcdefault}{} + \DeclareKanjiFamily{JT3}{\mcdefault}{} + \DeclareKanjiFamily{JY3}{\gtdefault}{} + \DeclareKanjiFamily{JT3}{\gtdefault}{} + \SetSymbolFont{mincho}{normal}{JY3}{\mcdefault}{m}{n} + \SetSymbolFont{mincho}{bold}{JY3}{\mcdefault}{bx}{n} + \DeclareMathAlphabet{\mathgt}{JY3}{\gtdefault}{m}{n} + \bool_if:NT \g_ltjpreset_deluxe_bool { + \DeclareKanjiFamily{JY3}{ltjpmg \int_to_arabic:n { \g_ltjpreset_applycount_int }}{} + \DeclareKanjiFamily{JT3}{ltjpmg \int_to_arabic:n { \g_ltjpreset_applycount_int }}{} + } + % ====== \tl_set:Nn \l_tmpa_tl {, CJKShape=JIS1990 } \tl_if_eq:NNT \l_ltjpreset_kanji_shape_tl \l_tmpa_tl { \tl_set:Nn \l_ltjpreset_kanji_shape_tl { ;+jp90 } @@ -601,7 +614,9 @@ } } + \cs_set:Npn \ltjapplypreset #1 { + \int_gincr:N \g_ltjpreset_applycount_int \keys_set_groups:nnn { luatexja-preset } { preset } { #1 } % \prop_map_inline:Nn \g_ltjpreset_font_prop {\typeout{ [##1] = "##2" } } \ltjpreset_extract_fonts: |