diff options
author | Karl Berry <karl@freefriends.org> | 2019-03-28 21:00:09 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-03-28 21:00:09 +0000 |
commit | 99b8cf268e524f7a1d38f44886cfb1c410612ec2 (patch) | |
tree | 608a8fe7c80bd448bbdc4641e93f24ef8c301177 /Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-preset.sty | |
parent | 7f136489a7ab1eaaadaaba538e2305d9b3e67065 (diff) |
luatexja (28mar19)
git-svn-id: svn://tug.org/texlive/trunk@50631 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 | 39 |
1 files changed, 33 insertions, 6 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 4b81aed1bd3..2eb38c83842 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}[2019/02/25 Japanese font presets] +\ProvidesPackage{luatexja-preset}[2019/03/26 Japanese font presets] \RequirePackage{expl3,l3keys2e} \RequirePackage{luatexja} @@ -192,6 +192,13 @@ } % モリサワ +\ltjpreset_declare_preset:nx{bizud}{ + mc = BIZ-UDMinchoM.ttc, + gt-d = BIZ-UDGothicR.ttc, gt-bx = BIZ-UDGothicB.ttc, + gt-u = BIZ-UDGothicR.ttc, gt-eb = BIZ-UDGothicB.ttc, + mg-m = BIZ-UDGothicB.ttc, + __custom = false, __office = false, __noembed = false, +} \ltjpreset_declare_preset:nx{morisawa-pro}{ mc = A-OTF-RyuminPro-Light.otf, mc-bx = A-OTF-FutoMinA101Pro-Bold.otf, gt-d = A-OTF-GothicBBBPro-Medium.otf , gt-bx = A-OTF-FutoGoB101Pro-Bold.otf, @@ -417,12 +424,31 @@ } } +%%%%%%%% フォント名を \l__ltjpreset_font_name: に格納 +\clist_new:N \l__ltjpreset_extensions_clist +\clist_set:Nn \l__ltjpreset_extensions_clist {.otf,.ttf,.OTF,.TTF,.ttc,.TTC} +\prg_new_conditional:Nnn \__ltjpreset_if_detect_external:n {TF} { + \clist_map_inline:Nn \l__ltjpreset_extensions_clist { + \bool_set_false:N \l_tmpa_bool + \tl_if_in:nnT {#1 <= end_of_string} {##1 <= end_of_string} + { \bool_set_true:N \l_tmpa_bool \clist_map_break: } + } + \bool_if:NTF \l_tmpa_bool \prg_return_true: \prg_return_false: +} +\cs_new:Nn \__ltjpreset_wrap_fontname:n { + \__ltjpreset_if_detect_external:nTF { #1 } + { \cs_set:Nn \l__ltjpreset_font_name: { [#1] } } + { \cs_set:Nn \l__ltjpreset_font_name: { "#1" } } +} +\cs_generate_variant:Nn \__ltjpreset_wrap_fontname:n { e } + %%%%%%%% 存在判定 \cs_new:Nn \__ltjpreset_substitute:nnnn { \group_begin: \suppressfontnotfounderror=1 \cs_if_exist:cT {ltjpreset_font_#1_#2:} { - \font \g__ltjpreset_font_test: = "\cs:w ltjpreset_font_#1_#2: \cs_end:"\relax + \__ltjpreset_wrap_fontname:e { \cs:w ltjpreset_font_#1_#2: \cs_end: } + \font \g__ltjpreset_font_test: = \l__preset_font_name:\relax \ifx \g__ltjpreset_font_test: \nullfont \msg_warning:nnxxxx { luatexja-preset }{ no-font } { \cs:w ltjpreset_font_#1_#2: \cs_end: }{ #1/#2 } @@ -470,24 +496,25 @@ ;-kern \tl_use:N \l__ltjpreset_kanji_shape_tl; #6 } {} } \cs_new:Nn \__ltjpreset_define_family:nnn { + \__ltjpreset_wrap_fontname:e { #3 } \__ltjpreset_declare_font_shape:nnnnnnn { JY3 } { ltjp #1 \int_to_arabic:n { \g__ltjpreset_applycount_int }} { #2 } { n } - { "#3" : jfm=\tl_use:N \__ltjpreset_use_jfm_yoko_tl } + { \l__ltjpreset_font_name: : jfm=\tl_use:N \__ltjpreset_use_jfm_yoko_tl } { script=hani \bool_if:NT \g__ltjpreset_expert_bool { ;+hkna } } { \Cjascale } \__ltjpreset_declare_font_shape:nnnnnnn { JT3 } { ltjp #1 \int_to_arabic:n { \g__ltjpreset_applycount_int }} { #2 } { n } - { "#3" : jfm=\tl_use:N \__ltjpreset_use_jfm_tate_tl } + { \l__ltjpreset_font_name: : jfm=\tl_use:N \__ltjpreset_use_jfm_tate_tl } { script=hani \bool_if:NT \g__ltjpreset_expert_bool { ;+vkna } } { \Cjascale } \bool_if:NT \g__ltjpreset_expert_bool { \__ltjpreset_declare_font_shape:nnnnnnn { JY3 } { ltjp #1 \int_to_arabic:n { \g__ltjpreset_applycount_int }} { #2 } { rb } - { "#3" : jfm=\tl_use:N \__ltjpreset_use_jfm_yoko_tl } { script=kana; +ruby } + { \l__ltjpreset_font_name: : jfm=\tl_use:N \__ltjpreset_use_jfm_yoko_tl } { script=kana; +ruby } { \Cjascale } \__ltjpreset_declare_font_shape:nnnnnnn { JT3 } { ltjp #1 \int_to_arabic:n { \g__ltjpreset_applycount_int }} { #2 } { rb } - { "#3" : jfm=\tl_use:N \__ltjpreset_use_jfm_tate_tl } { script=kana; +ruby } + { \l__ltjpreset_font_name: : jfm=\tl_use:N \__ltjpreset_use_jfm_tate_tl } { script=kana; +ruby } { \Cjascale } } \cs_if_exist:NT \ltjpreset_define_family_hook_nfssonly:nnn |