X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=src%2Faddons%2Fluatexja-preset.sty;h=ed93e25ee66bd52be99e35e3344e18f8fa61bb68;hb=c021eb16496d60822067a4eab35e2c1137edffd0;hp=d3b32e0419aa9203a112851a7be127a101023a2b;hpb=73343de9284f0ce0fca54d08e257cd0d57202cd3;p=luatex-ja%2Fluatexja.git diff --git a/src/addons/luatexja-preset.sty b/src/addons/luatexja-preset.sty index d3b32e0..ed93e25 100644 --- a/src/addons/luatexja-preset.sty +++ b/src/addons/luatexja-preset.sty @@ -1,6 +1,5 @@ % luatexja-preset.sty -\ProvidesPackage{luatexja-preset}[2013/05/25 Japanese font presets] -%% Sync with PXchfon 0.6a +\ProvidesPackage{luatexja-preset}[2014/12/03 Japanese font presets] \RequirePackage{expl3} \RequirePackage{luatexja-fontspec} @@ -20,7 +19,7 @@ \int_new:N \l_ltjpreset_deluxe_int % expert \int_set:Nn \l_ltjpreset_deluxe_int { 0 } -\DeclareOption{deluxe}{\int_set:Nn \l_ltjpreset_deluxe_int { 2 }} % 7 fonts +\DeclareOption{deluxe}{\int_set:Nn \l_ltjpreset_deluxe_int { 2 }} % 6 fonts \DeclareOption{nodeluxe}{\int_set:Nn \l_ltjpreset_deluxe_int { 0 }} % 2 fonts % scale @@ -64,122 +63,70 @@ \bool_set_true:N \l_ltjpreset_office_bool } -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%% OBSOLETE -% kozuka -\DeclareOption{kozuka4}{ - \ltjpreset_set_multi:n { - KozMinPro-Regular.otf , KozMinPro-Bold.otf, % mc/m, mc/bx - KozGoPro-Regular.otf , KozGoPro-Bold.otf, % gt/m, gt/bx (multiweight)) - KozGoPro-Medium.otf , KozGoPro-Heavy.otf, % gt/m (uni), gt/eb - KozGoPro-Heavy.otf % mg/m - } -} -\DeclareOption{kozuka6}{ - \ltjpreset_set_multi:n { - KozMinProVI-Regular.otf , KozMinProVI-Bold.otf, % mc/m, mc/bx - KozGoProVI-Regular.otf , KozGoProVI-Bold.otf, % gt/m, gt/bx (multiweight)) - KozGoProVI-Medium.otf , KozGoProVI-Heavy.otf, % gt/m (uni), gt/eb - KozGoProVI-Heavy.otf % mg/m - } -} -\DeclareOption{kozuka6n}{ - \ltjpreset_set_multi:n { - KozMinPr6N-Regular.otf , KozMinPr6N-Bold.otf, % mc/m, mc/bx - KozGoPr6N-Regular.otf , KozGoPr6N-Bold.otf, % gt/m, gt/bx (multiweight)) - KozGoPr6N-Medium.otf , KozGoPr6N-Heavy.otf, % gt/m (uni), gt/eb - KozGoPr6N-Heavy.otf % mg/m - } -} - -% hiragino -\DeclareOption{hiragino}{ - \ltjpreset_set_multi:n { - HiraMinPro-W3.otf , HiraMinPro-W6.otf, % mc/m, mc/bx - HiraKakuPro-W3.otf , HiraKakuPro-W6.otf, % gt/m, gt/bx (multiweight)) - HiraKakuPro-W3.otf , HiraKakuStd-W8.otf, % gt/m (uni), gt/eb - HiraMaruPro-W4.otf % mg/m - } -} -\DeclareOption{hiraginon}{ - \ltjpreset_set_multi:n { - HiraMinProN-W3.otf , HiraMinProN-W6.otf, % mc/m, mc/bx - HiraKakuProN-W3.otf , HiraKakuProN-W6.otf, % gt/m, gt/bx (multiweight)) - HiraKakuProN-W3.otf , HiraKakuStdN-W8.otf, % gt/m (uni), gt/eb - HiraMaruProN-W4.otf % mg/m - } -} - -% morisawa? -\DeclareOption{morisawa4}{ - \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 - } -} -\DeclareOption{morisawa6n}{ - \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-Jun101Pr6N-Light.otf % mg/m - } -} - -\DeclareOption{ipaex-dx}{\ltjpreset_set_office:nn { IPAExMincho } { IPAExGothic }} -\DeclareOption{ipa-dx} {\ltjpreset_set_office:nn { IPAMincho } { IPAGothic }} -\DeclareOption{ms-dx} {\ltjpreset_set_office:nn { MS-Mincho } { MS-Gothic }} -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% kozuka +% 小塚 (Adobe) +%% Pro \DeclareOption{kozuka-pro}{ \ltjpreset_set_multi:n { - KozMinPro-Regular.otf , KozMinPro-Bold.otf, % mc/m, mc/bx - KozGoPro-Regular.otf , KozGoPro-Bold.otf, % gt/m, gt/bx (multiweight)) - KozGoPro-Medium.otf , KozGoPro-Heavy.otf, % gt/m (uni), gt/eb - KozGoPro-Heavy.otf % mg/m + 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 } } +%% Pr6 \DeclareOption{kozuka-pr6}{ \ltjpreset_set_multi:n { - KozMinProVI-Regular.otf , KozMinProVI-Bold.otf, % mc/m, mc/bx - KozGoProVI-Regular.otf , KozGoProVI-Bold.otf, % gt/m, gt/bx (multiweight)) - KozGoProVI-Medium.otf , KozGoProVI-Heavy.otf, % gt/m (uni), gt/eb - KozGoProVI-Heavy.otf % mg/m + 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 } } +%% Pr6N \DeclareOption{kozuka-pr6n}{ \ltjpreset_set_multi:n { - KozMinPr6N-Regular.otf , KozMinPr6N-Bold.otf, % mc/m, mc/bx - KozGoPr6N-Regular.otf , KozGoPr6N-Bold.otf, % gt/m, gt/bx (multiweight)) - KozGoPr6N-Medium.otf , KozGoPr6N-Heavy.otf, % gt/m (uni), gt/eb - KozGoPr6N-Heavy.otf % mg/m + 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 } } -% hiragino +% ヒラギノ (OSX) \DeclareOption{hiragino-pro}{ \ltjpreset_set_multi:n { - HiraMinPro-W3.otf , HiraMinPro-W6.otf, % mc/m, mc/bx - HiraKakuPro-W3.otf , HiraKakuPro-W6.otf, % gt/m, gt/bx (multiweight)) - HiraKakuPro-W6.otf , HiraKakuStd-W8.otf, % gt/m (uni), gt/eb - HiraMaruPro-W4.otf % mg/m + Hiragino~Mincho~Pro~W3 , + Hiragino~Mincho~Pro~W6 , + Hiragino~Kaku~Gothic~Pro~W3 , % gt/m (multi) + Hiragino~Kaku~Gothic~Pro~W6 , + Hiragino~Kaku~Gothic~Pro~W6 , % gt/m (uni) + Hiragino~Kaku~Gothic~Std~W8 , + Hiragino~Maru~Gothic~Pro~W4 , } } \DeclareOption{hiragino-pron}{ \ltjpreset_set_multi:n { - HiraMinProN-W3.otf , HiraMinProN-W6.otf, % mc/m, mc/bx - HiraKakuProN-W3.otf , HiraKakuProN-W6.otf, % gt/m, gt/bx (multiweight)) - HiraKakuProN-W6.otf , HiraKakuStdN-W8.otf, % gt/m (uni), gt/eb - HiraMaruProN-W4.otf % mg/m + Hiragino~Mincho~ProN~W3 , + Hiragino~Mincho~ProN~W6 , + Hiragino~Kaku~Gothic~ProN~W3 , % gt/m (multi) + Hiragino~Kaku~Gothic~ProN~W6 , + Hiragino~Kaku~Gothic~ProN~W6 , % gt/m (uni) + Hiragino~Kaku~Gothic~StdN~W8 , + Hiragino~Maru~Gothic~ProN~W4 , } } -% morisawa +% モリサワ \DeclareOption{morisawa-pro}{ \ltjpreset_set_multi:n { A-OTF-RyuminPro-Light.otf , A-OTF-FutoMinA101Pro-Bold.otf , % mc/m, mc/bx @@ -193,10 +140,30 @@ 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-Jun101Pr6N-Light.otf % mg/m + A-OTF-ShinMGoPr6N-Light.otf % mg/m } } +% 游明朝/游ゴシック (Win8.1) +\DeclareOption{yu-win}{ + \ltjpreset_set_multi:n { + YuMincho-Regular , YuMincho-Demibold , % mc/m, mc/bx + YuGothic-Regular , YuGothic-Bold , % gt/m, gt/bx (multiweight)) + YuGothic-Bold , YuGothic-Bold , % gt/m (uni), gt/eb + YuGothic-Bold % mg/m + } +} + +% Yu fonts in OSX +% according to http://support.apple.com/kb/HT5944 +\DeclareOption{yu-osx}{ + \ltjpreset_set_multi:n { + YuMincho~Medium , YuMincho~Demibold , % mc/m, mc/bx + YuGothic~Medium , YuGothic~Bold , % gt/m, gt/bx (multiweight)) + YuGothic~Bold , YuGothic~Bold , % gt/m (uni), gt/eb + YuGothic~Bold % mg/m + } +} % ipa, ipaex, ms \DeclareOption{ipa}{ @@ -227,11 +194,27 @@ \bool_set_true:N \l_ltjpreset_noembed_bool } -\ExecuteOptions{noembed} +\ExecuteOptions{ipaex} + +% match +\DeclareOption{match} { + \bool_if:NF \ltj_fontspec_match_bool { + \ltj_fontspec_match_cmd + \bool_set_true:N \ltj_fontspec_match_bool + } +} \ProcessOptions* %% KozMinPr6N の場合はjp04 feature がないので,nlck にする -\clist_if_in:NnT \l_ltjpreset_font_list { KozMinPr6N-Regular.otf } { +\clist_if_in:NnT \l_ltjpreset_font_list { KozMinPr6N-Regular } { + \tl_set:Nn \l_tmpa_tl {, CJKShape=JIS2004 } + \tl_if_eq:NNT \l_ltjpreset_kanji_shape_tl \l_tmpa_tl { + \tl_set:Nn \l_ltjpreset_kanji_shape_tl { , CJKShape=NLC } + } +} + +%% HiraMinProN の場合はjp04 feature がない??ので,nlck にする +\clist_if_in:NnT \l_ltjpreset_font_list { Hiragino~Mincho~ProN~W3 } { \tl_set:Nn \l_tmpa_tl {, CJKShape=JIS2004 } \tl_if_eq:NNT \l_ltjpreset_kanji_shape_tl \l_tmpa_tl { \tl_set:Nn \l_ltjpreset_kanji_shape_tl { , CJKShape=NLC } @@ -289,31 +272,42 @@ } } -%%%% expert 用設定 +% expert 用設定 \tl_new:N \l_ltjpreset_add_features_tl \tl_set:Nx \l_ltjpreset_add_features_tl { \tl_use:N \l_ltjpreset_kanji_shape_tl, - JFM = \ltjpreset_use_jfm: + YokoFeatures = { JFM = \ltjpreset_use_jfm: }, } \bool_if:NT \l_ltjpreset_expert_bool { - \cs_set:Npn \rubyfamily { \addfontfeatures { Style = Ruby} } - \tl_put_left:Nn \l_ltjpreset_add_features_tl { Style = HorizontalKana, } + \cs_set:Npn \rubyfamily { \addjfontfeatures { Style = Ruby} } + \tl_put_left:Nn \l_ltjpreset_add_features_tl { + YokoFeatures = {Style = HorizontalKana}, + TateFeatures = {Style = VerticalKana}, + } } -%%%% (丸)ゴシック体の設定: bold option もここで +% (丸)ゴシック体の設定: bold option もここで \int_compare:nTF { \l_ltjpreset_deluxe_int == 2 } { - \newjfontfamily \mgfamily [ +%% mg + \newjfontfamily \mgfamily [ + BoldFont = \ltjpreset_font_mg:, \tl_use:N \l_ltjpreset_add_features_tl \bool_if:NT \l_ltjpreset_noembed_bool { , NoEmbed }, \tl_use:N \l_ltjpreset_add_features_tl ] { \ltjpreset_font_mg: } + \DeclareTextFontCommand{\textmg}{\mgfamily} +%% gt/eb +%% 注意: ファミリは 'gteb'.シリーズは \mdseries のまま. +%% \bfseries を追加したほうが良い? \newjfontfamily \gtebfamily [ + BoldFont = \ltjpreset_font_gt_eb:, \tl_use:N \l_ltjpreset_add_features_tl \bool_if:NT \l_ltjpreset_noembed_bool { , NoEmbed }, \tl_use:N \l_ltjpreset_add_features_tl ] { \ltjpreset_font_gt_eb: } + \DeclareTextFontCommand{\textgteb}{\gtebfamily} \bool_if:NT \l_ltjpreset_bold_bool { \cs_set_eq:NN \ltjpreset_font_mc_bx: \ltjpreset_font_gt_bx: } @@ -328,9 +322,9 @@ } -%%%% 実際の fontspec の呼びだし +% 実際の fontspec の呼びだし -\defaultjfontfeatures{ Kerning=Off } +\addjfontfeature{ Kerning=Off } \setmainjfont [ BoldFont = \ltjpreset_font_mc_bx: @@ -344,4 +338,4 @@ ] { \ltjpreset_font_gt_m: } \ExplSyntaxOff -\endinput \ No newline at end of file +\endinput