diff options
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 | 351 |
1 files changed, 214 insertions, 137 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 6a71e23d24f..d5c3d1a07bf 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}[2017/05/05 Japanese font presets] +\ProvidesPackage{luatexja-preset}[2017/07/30 Japanese font presets] \RequirePackage{expl3,l3keys2e} \RequirePackage{luatexja} @@ -58,22 +58,40 @@ % font preset \bool_new:N \l_ltjpreset_office_bool % MS Office の HG 系フォントを使っているか \bool_new:N \l_ltjpreset_noembed_bool % 非埋込か -\clist_new:N \l_ltjpreset_font_list + +\prop_new:N \l_ltjpreset_font_prop +\keys_define:nn { ltjpreset_set_font_list } { + mc .code:n = + \prop_put:Nnn \l_ltjpreset_font_prop { mc-l } {#1} + \prop_put:Nnn \l_ltjpreset_font_prop { mc-m } {#1} + \prop_put:Nnn \l_ltjpreset_font_prop { mc-bx } {#1}, + gt .code:n = + \prop_put:Nnn \l_ltjpreset_font_prop { gt-u } {#1} + \prop_put:Nnn \l_ltjpreset_font_prop { gt-m } {#1} + \prop_put:Nnn \l_ltjpreset_font_prop { gt-bx } {#1} + \prop_put:Nnn \l_ltjpreset_font_prop { gt-eb } {#1}, + unknown .code:n = + \prop_put:Non \l_ltjpreset_font_prop { \l_keys_key_tl } {#1} +} + + \cs_new:Npn \ltjpreset_set_uni:nn #1#2 { - \ltjpreset_set_multi:n { #1, #2, #2, #2, #2, #2, #2 } + \keys_set:nn { ltjpreset_set_font_list } { + mc = #1, gt = #2, mc-bx = #2, mg-m = #2, + } } \cs_new:Npn \ltjpreset_set_multi:n #1 { - \clist_set:Nn \l_ltjpreset_font_list { #1 } + \keys_set:nn { ltjpreset_set_font_list } { #1 } \bool_set_false:N \l_ltjpreset_office_bool \bool_set_false:N \l_ltjpreset_noembed_bool } \cs_new:Npn \ltjpreset_set_office:nn #1 #2{ \ltjpreset_set_multi:n { - #1, HGMinchoE , % mc/m, mc/bx - HGGothicM , HGGothicE , % gt/m, gt/bx (multiweight)) - #2 , HGSoeiKakugothicUB , % gt/m (uni), gt/eb - HGMaruGothicMPRO % mg/m + mc-m = #1, mc-bx = HGMinchoE , + gt-m = HGGothicM , gt-bx = HGGothicE , + gt-u = #2 , gt-eb = HGSoeiKakugothicUB , + mg-m = HGMaruGothicMPRO } \bool_set_true:N \l_ltjpreset_office_bool } @@ -93,98 +111,83 @@ %% Pro \ltjpreset_declare_option:nn{kozuka-pro}{ \ltjpreset_set_multi:n { - KozMinPro-Regular , % mc/m - KozMinPro-Bold , % mc/bx - KozGoPro-Regular , % gt/m (multi) - KozGoPro-Bold , % gt/bx - KozGoPro-Medium , % gt/m (uni) - KozGoPro-Heavy , % gt/eb - KozGoPro-Heavy % mg/m + mc-m = KozMinPro-Regular, mc-bx = KozMinPro-Bold, + gt-m = KozGoPro-Regular, gt-bx = KozGoPro-Bold, + gt-u = KozGoPro-Medium, gt-eb = KozGoPro-Heavy, + mg-m = KozGoPro-Heavy, mc-l = KozMinPro-Light, } } %% Pr6 \ltjpreset_declare_option:nn{kozuka-pr6}{ \ltjpreset_set_multi:n { - KozMinProVI-Regular , % mc/m - KozMinProVI-Bold , % mc/bx - KozGoProVI-Regular , % gt/m (multi) - KozGoProVI-Bold , % gt/bx - KozGoProVI-Medium , % gt/m (uni) - KozGoProVI-Heavy , % gt/eb - KozGoProVI-Heavy % mg/m + mc-m = KozMinProVI-Regular, mc-bx = KozMinProVI-Bold, + gt-m = KozGoProVI-Regular, gt-bx = KozGoProVI-Bold, + gt-u = KozGoProVI-Medium, gt-eb = KozGoProVI-Heavy, + mg-m = KozGoProVI-Heavy, mc-l = KozMinProVI-Light, } } %% Pr6N \ltjpreset_declare_option:nn{kozuka-pr6n}{ \ltjpreset_set_multi:n { - KozMinPr6N-Regular , % mc/m - KozMinPr6N-Bold , % mc/bx - KozGoPr6N-Regular , % gt/m (multi) - KozGoPr6N-Bold , % gt/bx - KozGoPr6N-Medium , % gt/m (uni) - KozGoPr6N-Heavy , % gt/eb - KozGoPr6N-Heavy % mg/m + mc-m = KozMinPr6N-Regular, mc-bx = KozMinPr6N-Bold, + gt-m = KozGoPr6N-Regular, gt-bx = KozGoPr6N-Bold, + gt-u = KozGoPr6N-Medium, gt-eb = KozGoPr6N-Heavy, + mg-m = KozGoPr6N-Heavy, mc-l = KozMinPr6N-Light, } } % ヒラギノ (OSX) \ltjpreset_declare_option:nn{hiragino-pro}{ \ltjpreset_set_multi:n { - HiraMinPro-W3 , - HiraMinPro-W6 , - HiraKakuPro-W3 , % gt/m (multi) - HiraKakuPro-W6 , - HiraKakuPro-W6 , % gt/m (uni) - HiraKakuStd-W8 , - HiraMaruPro-W4 , + mc-m = HiraMinPro-W3, mc-bx = HiraMinPro-W6, + gt-m = HiraKakuPro-W3, gt-bx = HiraKakuPro-W6, + gt-u = HiraKakuPro-W6, gt-eb = HiraKakuStd-W8, + mg-m = HiraMaruPro-W4, mc-l = HiraMinPro-W2, } } \ltjpreset_declare_option:nn{hiragino-pron}{ \ltjpreset_set_multi:n { - HiraMinProN-W3 , - HiraMinProN-W6 , - HiraKakuProN-W3 , % gt/m (multi) - HiraKakuProN-W6 , - HiraKakuProN-W6 , % gt/m (uni) - HiraKakuStdN-W8 , - HiraMaruProN-W4 , + mc-m = HiraMinProN-W3, mc-bx = HiraMinProN-W6, + gt-m = HiraKakuProN-W3, gt-bx = HiraKakuProN-W6, + gt-u = HiraKakuProN-W6, gt-eb = HiraKakuStdN-W8, + mg-m = HiraMaruProN-W4, mc-l = HiraMinProN-W2, } } % モリサワ \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)) - A-OTF-GothicBBBPro-Medium.otf , A-OTF-MidashiGoPro-MB31.otf , % gt/m (uni), gt/eb - A-OTF-Jun101Pro-Light.otf % mg/m + mc = A-OTF-RyuminPro-Light.otf, mc-bx = A-OTF-FutoMinA101Pro-Bold.otf, + gt-m = A-OTF-GothicBBBPro-Medium.otf , gt-bx = A-OTF-FutoGoB101Pro-Bold.otf, + gt-u = A-OTF-GothicBBBPro-Medium.otf , gt-eb = A-OTF-MidashiGoPro-MB31.otf, + mg-m = A-OTF-Jun101Pro-Light.otf, } } \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)) - A-OTF-GothicBBBPr6N-Medium.otf , A-OTF-MidashiGoPr6N-MB31.otf , % gt/m (uni), gt/eb - A-OTF-ShinMGoPr6N-Light.otf % mg/m + mc = A-OTF-RyuminPr6N-Light.otf, mc-bx = A-OTF-FutoMinA101Pr6N-Bold.otf, + gt-m = A-OTF-GothicBBBPr6N-Medium.otf , gt-bx = A-OTF-FutoGoB101Pr6N-Bold.otf, + gt-u = A-OTF-GothicBBBPr6N-Medium.otf , gt-eb = A-OTF-MidashiGoPr6N-MB31.otf, + mg-m = A-OTF-Jun101Pr6N-Light.otf, } } % 游明朝/游ゴシック (Win8.1) \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)) - YuGothic-Regular , YuGothic-Bold , % gt/m (uni), gt/eb - YuGothic-Bold % mg/m + mc-m = YuMincho-Regular, mc-bx = YuMincho-Demibold, + gt-m = YuGothic-Regular, gt-bx = YuGothic-Bold, + gt-u = YuGothic-Regular, gt-eb = YuGothic-Bold, + mg-m = YuGothic-Bold, mc-l = YuMincho-Light } } % Win10 \ltjpreset_declare_option:nn{yu-win10}{ \ltjpreset_set_multi:n { - YuMincho-Regular , YuMincho-Demibold , % mc/m, mc/bx - YuGothic-Regular , YuGothic-Bold , % gt/m, gt/bx (multiweight)) - YuGothic-Medium , YuGothic-Bold , % gt/m (uni), gt/eb - YuGothic-Bold % mg/m + mc-m = YuMincho-Regular, mc-bx = YuMincho-Demibold, + gt-m = YuGothic-Regular, gt-bx = YuGothic-Bold, + gt-u = YuGothic-Medium, gt-eb = YuGothic-Bold, + mg-m = YuGothic-Bold, mc-l = YuMincho-Light } } @@ -192,51 +195,88 @@ % according to http://support.apple.com/kb/HT5944 \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)) - YuGothic~Medium , YuGothic~Bold , % gt/m (uni), gt/eb - YuGothic~Bold % mg/m + mc = YuMincho~Medium, mc-bx = YuMincho~Demibold, + gt-m = YuGothic~Medium, gt-u = YuGothic~Medium, + gt-bx = YuGothic~Bold, gt-eb = YuGothic~Bold, + mg-m = YuGothic~Bold } } % 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)) - Moga90Gothic, Moga90Gothic~Bold, % gt/m (uni), gt/eb - Mobo90Gothic % mg/m + mc = Moga90Mincho, mc-bx = Moga90Mincho~Bold, + gt-m = Moga90Gothic, gt-bx = Moga90Gothic~Bold, + gt-u = Moga90Gothic, gt-eb = Moga90Gothic~Bold, + mg-m = Mobo90Gothic } } \ltjpreset_declare_option:nn{moga-mobo-ex}{ \ltjpreset_set_multi:n { - MogaEx90Mincho, MogaEx90Mincho~Bold , % mc/m, mc/bx - MogaEx90Gothic, MogaEx90Gothic~Bold, % gt/m, gt/bx (multiweight)) - MogaEx90Gothic, MogaEx90Gothic~Bold, % gt/m (uni), gt/eb - MoboEx90Gothic % mg/m + mc = MogaEx90Mincho, mc-bx = MogaEx90Mincho~Bold, + gt-m = MogaEx90Gothic, gt-bx = MogaEx90Gothic~Bold, + gt-u = MogaEx90Gothic, gt-eb = MogaEx90Gothic~Bold, + mg-m = MoboEx90Gothic } } % Ume fones \ltjpreset_declare_option:nn{ume}{ \ltjpreset_set_multi:n { - Ume~Mincho, Ume~Mincho, - Ume~Gothic, Ume~Gothic~O5, - Ume~Gothic~O5, Ume~Gothic~O5, - Ume~Gothic~O4 + mc = Ume~Mincho, + gt-m = Ume~Gothic, gt-bx = Ume~Gothic~O5, + gt-u = Ume~Gothic~O5, gt-eb = Ume~Gothic~O5, + mg-m = Ume~Gothic~O4 } } % Source Han {Serif,Sans} \ltjpreset_declare_option:nn{sourcehan}{ \ltjpreset_set_multi:n { - Source~Han~Serif~Regular, % mc/m - Source~Han~Serif~Bold, % mc/bx - Source~Han~Sans~Normal, % gt/m (multi) - Source~Han~Sans~Bold, % gt/bx - Source~Han~Sans~Medium, % gt/m (uni) - Source~Han~Sans~Heavy, % gt/eb - Source~Han~Sans~Heavy % mg/m + mc-m = Source~Han~Serif~Regular, + mc-bx = Source~Han~Serif~Bold, + gt-m = Source~Han~Sans~Regular, + gt-bx = Source~Han~Sans~Bold, + gt-u = Source~Han~Sans~Medium, + gt-eb = Source~Han~Sans~Heavy, + mg-m = Source~Han~Sans~Heavy, + mc-l = Source~Han~Serif~Light, + } +} +\ltjpreset_declare_option:nn{sourcehan-jp}{ + \ltjpreset_set_multi:n { + mc-m = Source~Han~Serif~JP~Regular, + mc-bx = Source~Han~Serif~JP~Bold, + gt-m = Source~Han~Sans~JP~Regular, + gt-bx = Source~Han~Sans~JP~Bold, + gt-u = Source~Han~Sans~JP~Medium, + gt-eb = Source~Han~Sans~JP~Heavy, + mg-m = Source~Han~Sans~JP~Heavy, + mc-l = Source~Han~Serif~JP~Light, + } +} +\ltjpreset_declare_option:nn{noto-otc}{ + \ltjpreset_set_multi:n { + mc-m = Noto~Serif~CJK~Regular, + mc-bx = Noto~Serif~CJK~Bold, + gt-m = Noto~Sans~CJK~Regular, + gt-bx = Noto~Sans~CJK~Bold, + gt-u = Noto~Sans~CJK~Medium, + gt-eb = Noto~Sans~CJK~Black, + mg-m = Noto~Sans~CJK~Black, + mc-l = Noto~Serif~CJK~Light, + } +} +\ltjpreset_declare_option:nn{noto-otf}{ + \ltjpreset_set_multi:n { + mc-m = Noto~Serif~CJK~JP~Regular, + mc-bx = Noto~Serif~CJK~JP~Bold, + gt-m = Noto~Sans~CJK~JP~Regular, + gt-bx = Noto~Sans~CJK~JP~Bold, + gt-u = Noto~Sans~CJK~JP~Medium, + gt-eb = Noto~Sans~CJK~JP~Black, + mg-m = Noto~Sans~CJK~JP~Black, + mc-l = Noto~Serif~CJK~JP~Light, } } @@ -289,56 +329,54 @@ %% KozMinPr6N, HiraMinProN-W3 の場合はjp04 feature がないので,nlck にする \tl_set:Nn \l_tmpa_tl {, CJKShape=JIS2004 } \tl_if_eq:NNTF \l_ltjpreset_kanji_shape_tl \l_tmpa_tl { - \clist_if_in:NnT \l_ltjpreset_font_list { KozMinPr6N-Regular } + \tl_set:Nx \l_tmpb_tl { \prop_item:Nn \l_ltjpreset_font_prop { mc-m } } + \tl_if_in:NnT \l_tmpb_tl { KozMinPr6N-Regular } { \bool_set_true:N \l_ltjpreset_shape_nlck_bool } - \clist_if_in:NnT \l_ltjpreset_font_list { HiraMinProN-W3 } + \tl_if_in:NnT \l_tmpb_tl { HiraMinProN-W3 } { \bool_set_true:N \l_ltjpreset_shape_nlck_bool } - \clist_if_in:NnT \l_ltjpreset_font_list { Moga90Mincho } + \tl_if_in:NnT \l_tmpb_tl { Moga90Mincho } { - \tl_remove_all:Nn \l_ltjpreset_font_list {90} + \prop_clear:N \l_tmpa_prop + \prop_map_inline:Nn \l_ltjpreset_font_prop { + \tl_set:Nn \l_tmpb_tl { #2 } + \tl_remove_all:Nn \l_tmpb_tl {90} + \prop_put:Nnx \l_tmpa_prop { #1 } { \tl_use:N \l_tmpb_tl } + } + \prop_set_eq:NN \l_ltjpreset_font_prop \l_tmpa_prop \tl_clear:N \l_ltjpreset_kanji_shape_tl } - \clist_if_in:NnT \l_ltjpreset_font_list { MogaEx90Mincho } + \tl_if_in:NnT \l_tmpb_tl { MogaEx90Mincho } { - \tl_remove_all:Nn \l_ltjpreset_font_list {90} + \prop_clear:N \l_tmpa_prop + \prop_map_inline:Nn \l_ltjpreset_font_prop { + \tl_set:Nn \l_tmpb_tl { #2 } + \tl_remove_all:Nn \l_tmpb_tl {90} + \prop_put:Nnx \l_tmpa_prop { #1 } { \tl_use:N \l_tmpb_tl } + } + \prop_set_eq:NN \l_ltjpreset_font_prop \l_tmpa_prop \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 } + \tl_set:Nx \l_tmpb_tl { \prop_item:Nn \l_ltjpreset_font_prop { mc-m } } + \tl_if_in:NnT \l_tmpb_tl { Moga90Mincho } + { \tl_clear:N \l_ltjpreset_kanji_shape_tl } } } %%%% リストからの展開 % mc/m -\clist_pop:NN \l_ltjpreset_font_list \l_tmpa_tl -\cs_set:Nx \ltjpreset_font_mc_m: { \tl_use:N \l_tmpa_tl } - -% mc/bx -\clist_pop:NN \l_ltjpreset_font_list \l_tmpa_tl -\cs_set:Nx \ltjpreset_font_mc_bx: { \tl_use:N \l_tmpa_tl } - -% gt/m -\clist_pop:NN \l_ltjpreset_font_list \l_tmpa_tl -\cs_set:Nx \ltjpreset_font_gt_m: { \tl_use:N \l_tmpa_tl } - -% gt/bx -\clist_pop:NN \l_ltjpreset_font_list \l_tmpa_tl -\cs_set:Nx \ltjpreset_font_gt_bx: { \tl_use:N \l_tmpa_tl } +\cs_set:Nx \ltjpreset_font_mc_l: { \prop_item:Nn \l_ltjpreset_font_prop { mc-l } } +\cs_set:Nx \ltjpreset_font_mc_m: { \prop_item:Nn \l_ltjpreset_font_prop { mc-m } } +\cs_set:Nx \ltjpreset_font_mc_bx: { \prop_item:Nn \l_ltjpreset_font_prop { mc-bx } } +\cs_set:Nx \ltjpreset_font_gt_m: { \prop_item:Nn \l_ltjpreset_font_prop { gt-m } } +\cs_set:Nx \ltjpreset_font_gt_u: { \prop_item:Nn \l_ltjpreset_font_prop { gt-u } } +\cs_set:Nx \ltjpreset_font_gt_bx: { \prop_item:Nn \l_ltjpreset_font_prop { gt-bx } } +\cs_set:Nx \ltjpreset_font_gt_eb: { \prop_item:Nn \l_ltjpreset_font_prop { gt-eb } } +\cs_set:Nx \ltjpreset_font_mg_m: { \prop_item:Nn \l_ltjpreset_font_prop { mg-m } } -% gt/m-uni -\clist_pop:NN \l_ltjpreset_font_list \l_tmpa_tl -\cs_set:Nx \ltjpreset_font_gt_n_uni: { \tl_use:N \l_tmpa_tl } - -% gt/eb -\clist_pop:NN \l_ltjpreset_font_list \l_tmpa_tl -\cs_set:Nx \ltjpreset_font_gt_eb: { \tl_use:N \l_tmpa_tl } - -% mg/m -\clist_pop:NN \l_ltjpreset_font_list \l_tmpa_tl -\cs_set:Nx \ltjpreset_font_mg: { \tl_use:N \l_tmpa_tl } +%\prop_show:N \l_ltjpreset_font_prop %% HG 系フォント + JIS2004/90JIS のときはフォント名を置換 \bool_if:NT \l_ltjpreset_office_bool { @@ -347,8 +385,8 @@ \cs_set:Nx \ltjpreset_font_mc_bx: { hgrme04.ttc } \cs_set:Nx \ltjpreset_font_gt_bx: { hgrge04.ttc } \cs_set:Nx \ltjpreset_font_gt_eb: { hgrsgu04.ttc } - \cs_set:Nx \ltjpreset_font_mg: { hgrsmp04.ttf } - \cs_set_eq:NN \ltjpreset_font_gt_m: \ltjpreset_font_gt_n_uni: + \cs_set:Nx \ltjpreset_font_mg_m: { hgrsmp04.ttf } + \cs_set_eq:NN \ltjpreset_font_gt_m: \ltjpreset_font_gt_u: % HG ゴシックM のときはそうはいかないので 1 ウェイト時のゴシック体を使う } \tl_set:Nn \l_tmpa_tl {, CJKShape=JIS1990 } @@ -356,10 +394,17 @@ \cs_set:Nx \ltjpreset_font_mc_bx: { hgrme.ttc } \cs_set:Nx \ltjpreset_font_gt_bx: { hgrge.ttc } \cs_set:Nx \ltjpreset_font_gt_eb: { hgrsgu.ttc } - \cs_set:Nx \ltjpreset_font_mg: { hgrsmp.ttf } + \cs_set:Nx \ltjpreset_font_mg_m: { hgrsmp.ttf } } } +% mc/l +\tl_set:Nx \l_tmpa_tl { \ltjpreset_font_mc_l: } +\tl_if_empty:NT \l_tmpa_tl {\tl_set:Nn \l_tmpa_tl {~}} +\cs_set:Nx \ltjpreset_font_mc_l: { + \tl_if_blank:nTF \l_tmpa_tl { \ltjpreset_font_mc_m: } {\tl_use:N \l_tmpa_tl } +} + %% 90JIS/JIS2004 字形指定のオプション \bool_if:NTF \l_ltjpreset_nfssonly_bool { \tl_set:Nn \l_tmpa_tl {, CJKShape=JIS1990 } @@ -380,6 +425,30 @@ } } + +%%%%%%%% 存在判定 +\cs_new:Nn \ltjpreset_substitute:nnnn { + \group_begin: + \suppressfontnotfounderror=1 + \font \l_ltjpreset_font_test: = "\cs:w ltjpreset_font_#1_#2: \cs_end:"\relax + \ifx \l_ltjpreset_font_test: \nullfont + \msg_warning:nnxxxx { luatexja-preset }{ no-font } + { \cs:w ltjpreset_font_#1_#2: \cs_end: }{ #1/#2 } + { \cs:w ltjpreset_font_#3_#4: \cs_end: }{ #3/#4 } + \cs_gset_eq:cc { ltjpreset_font_#1_#2: } { ltjpreset_font_#3_#4: } + \fi + \group_end: +} + +\msg_new:nnn { luatexja-preset }{ no-font }{ + Font~ #1~ (#2)~ is~ not~found.~ Hence~ I~ substitute~ #3~ (#4)~ for~ it. +} +\bool_if:NT \l_ltjpreset_deluxe_bool { + \ltjpreset_substitute:nnnn { gt } { eb } { gt } { bx } + \ltjpreset_substitute:nnnn { mg } { m } { gt } { bx } + \ltjpreset_substitute:nnnn { mc } { l } { mc } { m } +} + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%% nfss only \bool_if:NTF \l_ltjpreset_nfssonly_bool { @@ -392,23 +461,23 @@ \DeclareFontShape{JY3}{#1}{#2}{n}{ <-> s*[\fp_use:N \l_ltjpreset_scale_fp] {\bool_if:NT \l_ltjpreset_noembed_bool {psft:} "#3" : jfm=\tl_use:N \ltjpreset_use_jfm_yoko_tl ;-kern;\tl_use:N \l_ltjpreset_kanji_shape_tl - ; script=cjk \bool_if:NT \l_ltjpreset_expert_bool { ;+hkna }} + ; script=hani \bool_if:NT \l_ltjpreset_expert_bool { ;+hkna }} } {} \DeclareFontShape{JT3}{#1}{#2}{n}{ <-> s*[\fp_use:N \l_ltjpreset_scale_fp] {\bool_if:NT \l_ltjpreset_noembed_bool {psft:} "#3" : jfm=\tl_use:N \ltjpreset_use_jfm_tate_tl ;-kern;\tl_use:N \l_ltjpreset_kanji_shape_tl; - ; script=cjk \bool_if:NT \l_ltjpreset_expert_bool { ;+vkna }} + ; script=hani \bool_if:NT \l_ltjpreset_expert_bool { ;+vkna }} } {} \bool_if:NT \l_ltjpreset_expert_bool { \DeclareFontShape{JY3}{#1}{#2}{rb}{ <-> s*[\fp_use:N \l_ltjpreset_scale_fp] {\bool_if:NT \l_ltjpreset_noembed_bool {psft:} "#3" : jfm=\tl_use:N \ltjpreset_use_jfm_yoko_tl ;-kern;\tl_use:N \l_ltjpreset_kanji_shape_tl ;+ruby - ; script=kana } + ; script=kana} } {} \DeclareFontShape{JT3}{#1}{#2}{rb}{ <-> s*[\fp_use:N \l_ltjpreset_scale_fp] {\bool_if:NT \l_ltjpreset_noembed_bool {psft:} "#3" : jfm=\tl_use:N \ltjpreset_use_jfm_tate_tl ;-kern;\tl_use:N \l_ltjpreset_kanji_shape_tl ;+ruby - ; script=kana } + ; script=kana} } {} } } @@ -424,7 +493,7 @@ \bool_if:NTF \l_ltjpreset_bold_bool { \cs_set_eq:NN \ltjpreset_font_gt_m: \ltjpreset_font_gt_bx: }{ - \cs_set_eq:NN \ltjpreset_font_gt_m: \ltjpreset_font_gt_n_uni: + \cs_set_eq:NN \ltjpreset_font_gt_m: \ltjpreset_font_gt_u: } \cs_set_eq:NN \ltjpreset_font_gt_bx: \ltjpreset_font_gt_m: \cs_set_eq:NN \ltjpreset_font_mc_bx: \ltjpreset_font_gt_m: @@ -448,14 +517,17 @@ \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:} + \def\ltdefault{l} + \DeclareRobustCommand\ltseries { \not@math@alphabet\ltseries\relax\fontseries\ltdefault\selectfont } + \ltj_preset_define_family:nnn {ltjpm} {l} {\ltjpreset_font_mc_l:} \def\ebdefault{eb} - \DeclareRobustCommand\ebseries { \not@math@alphabet\ebseries\relaxfontseries\ebdefault\selectfont } - \DeclareRobustCommand\gtebfamily { \kanjifamily{ltjpg}\fontseries{eb}\selectfont } + \DeclareRobustCommand\ebseries { \not@math@alphabet\ebseries\relax\fontseries\ebdefault\selectfont } + \DeclareRobustCommand\gtebfamily { \kanjifamily{ltjpg}\fontseries{\ebdefault}\selectfont } \DeclareTextFontCommand{\textgteb}{\gtebfamily} + \ltj_preset_define_family:nnn {ltjpg} {eb} {\ltjpreset_font_gt_eb:} \DeclareRobustCommand\mgfamily { \not@math@alphabet\mgfamily\relax\kanjifamily{ltjpmg}\selectfont } \DeclareTextFontCommand{\textmg}{\mgfamily} + \ltj_preset_define_family:nnn {ltjpmg} {m} {\ltjpreset_font_mg_m:} } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -493,20 +565,19 @@ \bool_if:NTF \l_ltjpreset_deluxe_bool { %% mg \newjfontfamily \mgfamily [ - BoldFont = \ltjpreset_font_mg:, + BoldFont = \ltjpreset_font_mg_m:, \bool_if:NT \l_ltjpreset_noembed_bool { NoEmbed, } \tl_use:N \l_ltjpreset_add_features_tl - ] { \ltjpreset_font_mg: } + ] { \ltjpreset_font_mg_m: } \DeclareTextFontCommand{\textmg}{\mgfamily} %% gt/eb -%% 注意: ファミリは 'gteb'.シリーズは \mdseries のまま. -%% \bfseries を追加したほうが良い? - \newjfontfamily \gtebfamily [ - BoldFont = \ltjpreset_font_gt_eb:, - \bool_if:NT \l_ltjpreset_noembed_bool { NoEmbed, } - \tl_use:N \l_ltjpreset_add_features_tl - ] { \ltjpreset_font_gt_eb: } + \def\ebdefault{eb} + \DeclareRobustCommand\ebseries { \not@math@alphabet\ebseries\relax\fontseries\ebdefault\selectfont } + \DeclareRobustCommand\gtebfamily { \kanjifamily{\gtdefault}\fontseries{\ebdefault}\selectfont } \DeclareTextFontCommand{\textgteb}{\gtebfamily} +%% mc/l + \def\ltdefault{l} + \DeclareRobustCommand\ltseries { \not@math@alphabet\ltseries\relax\fontseries\ltdefault\selectfont } \bool_if:NT \l_ltjpreset_bold_bool { \cs_set_eq:NN \ltjpreset_font_mc_bx: \ltjpreset_font_gt_bx: } @@ -514,7 +585,7 @@ \bool_if:NTF \l_ltjpreset_bold_bool { \cs_set_eq:NN \ltjpreset_font_gt_m: \ltjpreset_font_gt_bx: }{ - \cs_set_eq:NN \ltjpreset_font_gt_m: \ltjpreset_font_gt_n_uni: + \cs_set_eq:NN \ltjpreset_font_gt_m: \ltjpreset_font_gt_u: } \cs_set_eq:NN \ltjpreset_font_gt_bx: \ltjpreset_font_gt_m: \cs_set_eq:NN \ltjpreset_font_mc_bx: \ltjpreset_font_gt_m: @@ -526,11 +597,17 @@ \addjfontfeature{ Kerning=Off } \setmainjfont [ + \bool_if:NT \l_ltjpreset_deluxe_bool { + FontFace={l}{n}{\ltjpreset_font_mc_l:}, + } BoldFont = \ltjpreset_font_mc_bx: \bool_if:NT \l_ltjpreset_noembed_bool { , NoEmbed }, \tl_use:N \l_ltjpreset_add_features_tl ] { \ltjpreset_font_mc_m: } \setsansjfont [ + \bool_if:NT \l_ltjpreset_deluxe_bool { + FontFace={eb}{n}{\ltjpreset_font_gt_eb:}, + } BoldFont = \ltjpreset_font_gt_bx: \bool_if:NT \l_ltjpreset_noembed_bool { , NoEmbed }, \tl_use:N \l_ltjpreset_add_features_tl |