• R/O
  • HTTP
  • SSH
  • HTTPS

luatexja: Commit

ソースコードの管理場所


Commit MetaInfo

Revision96945f2d5533fdba9b18ec796b6c3838ef78fc23 (tree)
Time2019-03-26 20:45:30
AuthorHironori Kitagawa <h_kitagawa2001@yaho...>
CommiterHironori Kitagawa

Log Message

luatexja-preset: use bracketed fontname

Change Summary

Incremental Difference

--- a/src/addons/luatexja-preset.sty
+++ b/src/addons/luatexja-preset.sty
@@ -424,12 +424,31 @@
424424 }
425425 }
426426
427+%%%%%%%% フォント名を \l__ltjpreset_font_name: に格納
428+\clist_new:N \l__ltjpreset_extensions_clist
429+\clist_set:Nn \l__ltjpreset_extensions_clist {.otf,.ttf,.OTF,.TTF,.ttc,.TTC}
430+\prg_new_conditional:Nnn \__ltjpreset_if_detect_external:n {TF} {
431+ \clist_map_inline:Nn \l__ltjpreset_extensions_clist {
432+ \bool_set_false:N \l_tmpa_bool
433+ \tl_if_in:nnT {#1 <= end_of_string} {##1 <= end_of_string}
434+ { \bool_set_true:N \l_tmpa_bool \clist_map_break: }
435+ }
436+ \bool_if:NTF \l_tmpa_bool \prg_return_true: \prg_return_false:
437+}
438+\cs_new:Nn \__ltjpreset_wrap_fontname:n {
439+ \__ltjpreset_if_detect_external:nTF { #1 }
440+ { \cs_set:Nn \l__ltjpreset_font_name: { [#1] } }
441+ { \cs_set:Nn \l__ltjpreset_font_name: { "#1" } }
442+}
443+\cs_generate_variant:Nn \__ltjpreset_wrap_fontname:n { e }
444+
427445 %%%%%%%% 存在判定
428446 \cs_new:Nn \__ltjpreset_substitute:nnnn {
429447 \group_begin:
430448 \suppressfontnotfounderror=1
431449 \cs_if_exist:cT {ltjpreset_font_#1_#2:} {
432- \font \g__ltjpreset_font_test: = "\cs:w ltjpreset_font_#1_#2: \cs_end:"\relax
450+ \__ltjpreset_wrap_fontname:e { \cs:w ltjpreset_font_#1_#2: \cs_end: }
451+ \font \g__ltjpreset_font_test: = \l__preset_font_name:\relax
433452 \ifx \g__ltjpreset_font_test: \nullfont
434453 \msg_warning:nnxxxx { luatexja-preset }{ no-font }
435454 { \cs:w ltjpreset_font_#1_#2: \cs_end: }{ #1/#2 }
@@ -477,24 +496,25 @@
477496 ;-kern \tl_use:N \l__ltjpreset_kanji_shape_tl; #6 } {}
478497 }
479498 \cs_new:Nn \__ltjpreset_define_family:nnn {
499+ \__ltjpreset_wrap_fontname:e { #3 }
480500 \__ltjpreset_declare_font_shape:nnnnnnn { JY3 }
481501 { ltjp #1 \int_to_arabic:n { \g__ltjpreset_applycount_int }} { #2 } { n }
482- { "#3" : jfm=\tl_use:N \__ltjpreset_use_jfm_yoko_tl }
502+ { \l__ltjpreset_font_name: : jfm=\tl_use:N \__ltjpreset_use_jfm_yoko_tl }
483503 { script=hani \bool_if:NT \g__ltjpreset_expert_bool { ;+hkna } }
484504 { \Cjascale }
485505 \__ltjpreset_declare_font_shape:nnnnnnn { JT3 }
486506 { ltjp #1 \int_to_arabic:n { \g__ltjpreset_applycount_int }} { #2 } { n }
487- { "#3" : jfm=\tl_use:N \__ltjpreset_use_jfm_tate_tl }
507+ { \l__ltjpreset_font_name: : jfm=\tl_use:N \__ltjpreset_use_jfm_tate_tl }
488508 { script=hani \bool_if:NT \g__ltjpreset_expert_bool { ;+vkna } }
489509 { \Cjascale }
490510 \bool_if:NT \g__ltjpreset_expert_bool {
491511 \__ltjpreset_declare_font_shape:nnnnnnn { JY3 }
492512 { ltjp #1 \int_to_arabic:n { \g__ltjpreset_applycount_int }} { #2 } { rb }
493- { "#3" : jfm=\tl_use:N \__ltjpreset_use_jfm_yoko_tl } { script=kana; +ruby }
513+ { \l__ltjpreset_font_name: : jfm=\tl_use:N \__ltjpreset_use_jfm_yoko_tl } { script=kana; +ruby }
494514 { \Cjascale }
495515 \__ltjpreset_declare_font_shape:nnnnnnn { JT3 }
496516 { ltjp #1 \int_to_arabic:n { \g__ltjpreset_applycount_int }} { #2 } { rb }
497- { "#3" : jfm=\tl_use:N \__ltjpreset_use_jfm_tate_tl } { script=kana; +ruby }
517+ { \l__ltjpreset_font_name: : jfm=\tl_use:N \__ltjpreset_use_jfm_tate_tl } { script=kana; +ruby }
498518 { \Cjascale }
499519 }
500520 \cs_if_exist:NT \ltjpreset_define_family_hook_nfssonly:nnn
Show on old repository browser