ソースコードの管理場所
Revisão | dca36b60bd8d286443146fca072c791ab829ebae (tree) |
---|---|
Hora | 2016-01-01 21:28:30 |
Autor | Hironori Kitagawa <h_kitagawa2001@yaho...> |
Commiter | Hironori Kitagawa |
luatexja-preset: more l3keys2e
@@ -18,29 +18,25 @@ | ||
18 | 18 | \cs_new:Nn \ltjpreset_declare_option:nn { |
19 | 19 | \keys_define:nn { luatexja-preset }{ |
20 | 20 | #1 .code:n = #2, |
21 | - #1. value_forbidden:n = true | |
21 | + #1 .value_forbidden:n = true | |
22 | + } | |
23 | +} | |
24 | +\cs_new:Nn \ltjpreset_declare_bool_option:nn { | |
25 | + \bool_new:c { l_ltjpreset_#1_bool } | |
26 | + \bool_set_false:c { l_ltjpreset_#1_bool } | |
27 | + \keys_define:nn { luatexja-preset }{ | |
28 | + #1 .bool_set:c = { l_ltjpreset_#1_bool }, | |
29 | + #2 .bool_set_inverse:c = { l_ltjpreset_#1_bool }, | |
30 | + #1 .default:n = true, | |
31 | + #2 .default:n = true, | |
22 | 32 | } |
23 | 33 | } |
24 | 34 | |
25 | -\bool_new:N \l_ltjpreset_nfssonly_bool % nfssonly | |
26 | -\bool_set_false:N \l_ltjpreset_nfssonly_bool | |
27 | -\ltjpreset_declare_option:nn{nfssonly} {\bool_set_true:N \l_ltjpreset_nfssonly_bool} | |
28 | -\ltjpreset_declare_option:nn{fontspec} {\bool_set_false:N \l_ltjpreset_nfssonly_bool} | |
29 | - | |
30 | -\bool_new:N \l_ltjpreset_bold_bool % bold | |
31 | -\bool_set_false:N \l_ltjpreset_bold_bool | |
32 | -\ltjpreset_declare_option:nn{bold} {\bool_set_true:N \l_ltjpreset_bold_bool} | |
33 | -\ltjpreset_declare_option:nn{nobold}{\bool_set_false:N \l_ltjpreset_bold_bool} | |
34 | - | |
35 | -\bool_new:N \l_ltjpreset_expert_bool % expert | |
36 | -\bool_set_false:N \l_ltjpreset_expert_bool | |
37 | -\ltjpreset_declare_option:nn{expert} {\bool_set_true:N \l_ltjpreset_expert_bool} | |
38 | -\ltjpreset_declare_option:nn{noexpert}{\bool_set_false:N \l_ltjpreset_expert_bool} | |
39 | - | |
40 | -\int_new:N \l_ltjpreset_deluxe_int % deluxe | |
41 | -\int_set:Nn \l_ltjpreset_deluxe_int { 0 } | |
42 | -\ltjpreset_declare_option:nn{deluxe}{\int_set:Nn \l_ltjpreset_deluxe_int { 2 }} % 6 fonts | |
43 | -\ltjpreset_declare_option:nn{nodeluxe}{\int_set:Nn \l_ltjpreset_deluxe_int { 0 }} % 2 fonts | |
35 | +%%%%%%%% bool options | |
36 | +\ltjpreset_declare_bool_option:nn { nfssonly }{ fontspec } | |
37 | +\ltjpreset_declare_bool_option:nn { bold }{ nobold } | |
38 | +\ltjpreset_declare_bool_option:nn { expert }{ noexpert } | |
39 | +\ltjpreset_declare_bool_option:nn { deluxe }{ nodeluxe } | |
44 | 40 | |
45 | 41 | % JFM |
46 | 42 | \cs_set:Npn \ltjpreset_use_jfm: {ujis} % 使用する JFM |
@@ -80,6 +76,12 @@ | ||
80 | 76 | |
81 | 77 | %%%%%%%% プリセット達 |
82 | 78 | |
79 | +% カスタム指定 | |
80 | + \keys_define:nn { luatexja-preset }{ | |
81 | + custom .code:n = \ltjpreset_set_multi:n { #1 }, | |
82 | + custom .value_required:n = true | |
83 | +} | |
84 | + | |
83 | 85 | % 小塚 (Adobe) |
84 | 86 | %% Pro |
85 | 87 | \ltjpreset_declare_option:nn{kozuka-pro}{ |
@@ -362,7 +364,7 @@ | ||
362 | 364 | \DeclareKanjiFamily{JY3}{ltjpm}{}\DeclareKanjiFamily{JT3}{ltjpm}{} |
363 | 365 | \DeclareKanjiFamily{JY3}{ltjpg}{}\DeclareKanjiFamily{JT3}{ltjpg}{} |
364 | 366 | |
365 | -\int_compare:nTF { \l_ltjpreset_deluxe_int == 2 } { | |
367 | +\bool_if:NTF \l_ltjpreset_deluxe_bool { | |
366 | 368 | \bool_if:NT \l_ltjpreset_bold_bool { |
367 | 369 | \cs_set_eq:NN \ltjpreset_font_mc_bx: \ltjpreset_font_gt_bx: |
368 | 370 | } |
@@ -392,7 +394,7 @@ | ||
392 | 394 | \DeclareRobustCommand\rubyfamily { \kanjishape{rb}\selectfont } |
393 | 395 | } |
394 | 396 | |
395 | -\int_compare:nTF { \l_ltjpreset_deluxe_int == 2 } { | |
397 | +\bool_if:NTF \l_ltjpreset_deluxe_bool { | |
396 | 398 | \DeclareKanjiFamily{JY3}{ltjpmg}{}\DeclareKanjiFamily{JT3}{ltjpmg}{} |
397 | 399 | \ltj_preset_define_family:nnn {ltjpmg} {m} {\ltjpreset_font_mg:} |
398 | 400 | \ltj_preset_define_family:nnn {ltjpg} {eb} {\ltjpreset_font_gt_eb:} |
@@ -434,7 +436,7 @@ | ||
434 | 436 | } |
435 | 437 | |
436 | 438 | % (丸)ゴシック体の設定: bold option もここで |
437 | -\int_compare:nTF { \l_ltjpreset_deluxe_int == 2 } { | |
439 | +\bool_if:NTF \l_ltjpreset_deluxe_bool { | |
438 | 440 | %% mg |
439 | 441 | \newjfontfamily \mgfamily [ |
440 | 442 | BoldFont = \ltjpreset_font_mg:, |