diff options
author | Karl Berry <karl@freefriends.org> | 2012-07-13 23:22:17 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-07-13 23:22:17 +0000 |
commit | 0b6eaa10b2f47abfb80d42492678e4d55c8b68ab (patch) | |
tree | 1b0ec704475b30933b8da1480cc2f394843e1603 /Master/texmf-dist/tex/luatex/luatexja/addons | |
parent | 989b3bffd78808e0b1f6c950c57ab99b94c02f81 (diff) |
luatexja (23jun12)
git-svn-id: svn://tug.org/texlive/trunk@27037 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/luatex/luatexja/addons')
3 files changed, 329 insertions, 49 deletions
diff --git a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-ajmacros.sty b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-ajmacros.sty index 0cd516ccfac..a4aa8339acc 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-ajmacros.sty +++ b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-ajmacros.sty @@ -4,9 +4,7 @@ % Original: % \ProvidesPackage{ajmacros}[2005/12/25 13:52 iNOUE Koich! <inoue@ma.ns.musashi-tech.ac.jp>] % -% Note 1: \aj半角 is renamed \ajHankaku -% Note 2: Comment out \ajQuote -% + %% Avoid multiple loading. \csname\if11luatexjaajmacrosLoaded\fi\endcsname @@ -70,7 +68,7 @@ \expandafter\let\csname ifltj@in@latex\expandafter\endcsname \csname iftrue\endcsname \NeedsTeXFormat{LaTeX2e} - \ProvidesPackage{luatexja-ajmacros}[2011/09/19 v0.1] + \ProvidesPackage{luatexja-ajmacros}[2012/05/08 v0.1a] \fi %</LaTeX> %%------------------ @@ -82,6 +80,7 @@ \ifltj@in@latex\else \def\@tw{\char"2} \def\@ifstar#1#2#3{\ifx*#3\expandafter#1\else#2{#3}\fi} + \long\def\@gobble#1{} \fi {% @@ -326,21 +325,21 @@ %2/3 9376 12892 9696 13212 % % -\def\@ajHankakudef#1{\ifx\@nil#1\else - \expandafter\xdef\csname ajHankaku@#1\endcsname{\noexpand\CID +\def\@aj半角def#1{\ifx\@nil#1\else + \expandafter\xdef\csname aj半角@#1\endcsname{\noexpand\CID {\noexpand\ifydir\number\@tempcnta\noexpand\else\number\@tempcntb\noexpand\fi}}% \advance\@tempcnta\@ne\advance\@tempcntb\@ne - \expandafter\@ajHankakudef\fi} + \expandafter\@aj半角def\fi} \@tempcnta326 \@tempcntb9084 -\@ajHankakudef 。「」、・ヲァィゥェォャュョッーアイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワン゛゜`ヰヱヮヵヶヴガギグゲゴザジズゼゾダヂヅデドバパビピブプベペボポ\@nil +\@aj半角def 。「」、・ヲァィゥェォャュョッーアイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワン゛゜`ヰヱヮヵヶヴガギグゲゴザジズゼゾダヂヅデドバパビピブプベペボポ\@nil \@tempcnta516 -\@ajHankakudef をぁぃぅぇぉゃゅょっあいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわんゐゑゎがぎぐげござじずぜぞだぢづでどばぱびぴぶぷべぺぼぽ\@nil -\gdef\ajHankaku#1{\aj@Hankaku#1\@nil} -\gdef\aj@Hankaku#1{\ifx\@nil#1\else - \expandafter\ifx\csname ajHankaku@#1\endcsname\relax - #1\else\csname ajHankaku@#1\endcsname\fi - \expandafter\aj@Hankaku\fi} +\@aj半角def をぁぃぅぇぉゃゅょっあいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわんゐゑゎがぎぐげござじずぜぞだぢづでどばぱびぴぶぷべぺぼぽ\@nil +\gdef\aj半角#1{\aj@半角#1\@nil} +\gdef\aj@半角#1{\ifx\@nil#1\else + \expandafter\ifx\csname aj半角@#1\endcsname\relax + #1\else\csname aj半角@#1\endcsname\fi + \expandafter\aj@半角\fi} % % \def\@ajligdef#1#2{\expandafter\xdef\csname ajLig\@ajmojifam#1\endcsname{\noexpand\CID{#2}}} @@ -798,38 +797,41 @@ \leaders\hbox{\CID{\@tempcnta}}\ifhmode\hskip\else\vskip\fi#1}} % % -%% \toks0{}\toks1{}\toks2{}\toks3{} -%% \def\ajQuotedef#1 #2 #3 #4 {\ifx*#1\else -%% \toks0\expandafter{\the\toks0 \or#1}% -%% \toks1\expandafter{\the\toks1 \or#2}% -%% \toks2\expandafter{\the\toks2 \or#3}% -%% \toks3\expandafter{\the\toks3 \or#4}% -%% \expandafter\ajQuotedef\fi} -%% \ajQuotedef -%% 670 671 12173 12174 -%% 672 673 7956 7957 -%% 674 675 7899 7900 -%% 676 677 7901 7902 -%% 678 679 7903 7904 -%% 680 681 7905 7906 -%% 682 683 7907 7908 -%% 684 685 7909 7910 -%% 686 687 7911 7912 -%% 688 689 7913 7914 -%% 690 691 7915 7916 -%% 7608 7609 7956 7957 -%% 12125 12126 12135 12136 -%% 12127 12128 12137 12138 -%% 12129 12130 12139 12140 -%% 12131 12132 12141 12142 -%% 12171 12172 12173 12174 -%% 16197 16198 16329 16330 -%% * * * * -%% \xdef\ajQuote#1#2{\noexpand\CID{\noexpand\ifydir\noexpand\ifcase#1\the\toks0 -%% \noexpand\fi\noexpand\else\noexpand\ifcase#1\the\toks2 -%% \noexpand\fi\noexpand\fi}#2\inhibitglue\noexpand\CID{\noexpand\ifydir\noexpand\ifcase#1\the\toks1 -%% \noexpand\fi\noexpand\else\noexpand\ifcase#1\the\toks3 -%% \noexpand\fi\noexpand\fi}} +\endlinechar=13 +\toks0{}\toks1{}\toks2{}\toks3{} +\def\ajQuotedef#1 #2 #3 #4 {\ifx*#1\else + \toks0\expandafter{\the\toks0 \or#1}% + \toks1\expandafter{\the\toks1 \or#2}% + \toks2\expandafter{\the\toks2 \or#3}% + \toks3\expandafter{\the\toks3 \or#4}% + \expandafter\ajQuotedef\fi} +\ajQuotedef +670 671 12173 12174 +672 673 7956 7957 +674 675 7899 7900 +676 677 7901 7902 +678 679 7903 7904 +680 681 7905 7906 +682 683 7907 7908 +684 685 7909 7910 +686 687 7911 7912 +688 689 7913 7914 +690 691 7915 7916 +7608 7609 7956 7957 +12125 12126 12135 12136 +12127 12128 12137 12138 +12129 12130 12139 12140 +12131 12132 12141 12142 +12171 12172 12173 12174 +16197 16198 16329 16330 +* * * * +\def\@removetop#1{\toks#1\expandafter\expandafter\expandafter{\expandafter\@gobble\the\toks#1}} +\@removetop0\@removetop1\@removetop2\@removetop3 +\xdef\ajQuote#1#2{\noexpand\CID{\noexpand\ifydir\noexpand\ifcase#1 \the\toks0 + \noexpand\fi\noexpand\else\noexpand\ifcase#1 \the\toks2 + \noexpand\fi\noexpand\fi}#2\inhibitglue\noexpand\CID{\noexpand\ifydir\noexpand\ifcase#1 \the\toks1 + \noexpand\fi\noexpand\else\noexpand\ifcase#1 \the\toks3 + \noexpand\fi\noexpand\fi}} } \ifltj@in@latex\else \ajRedefine@KundokuMacros diff --git a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-otf.sty b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-otf.sty index 048f6d25fa3..290f6b17aa0 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-otf.sty +++ b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-otf.sty @@ -64,15 +64,15 @@ \expandafter\let\csname ifltj@in@latex\expandafter\endcsname \csname iftrue\endcsname \NeedsTeXFormat{LaTeX2e} - \ProvidesPackage{luatexja-otf}[2012/4/20 v0.2] + \ProvidesPackage{luatexja-otf}[2012/04/20 v0.2] \fi %</LaTeX> % Load core module if not yet. \ifx\luatexjacoreLoaded\@undefined \ifltj@in@latex %<*LaTeX> - \RequirePackage{luatexja-core}[2012/04/20] + \RequirePackage{luatexja}[2012/04/20] \else %<*!LaTeX> - \input luatexja-core.sty % + \input luatexja.sty % \fi %</LaTeX> \fi diff --git a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-preset.sty b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-preset.sty new file mode 100644 index 00000000000..d4fd53bbfc9 --- /dev/null +++ b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-preset.sty @@ -0,0 +1,278 @@ +% luatexja-preset.sty +\ProvidesPackage{luatexja-preset} + [2012/05/18 v0.0] + +\RequirePackage{expl3} +\RequirePackage{luatexja-fontspec} +\ExplSyntaxOn + +%%%% message + + +\bool_new:N \l_ltjpreset_bold_bool % bold +\bool_set_false:N \l_ltjpreset_bold_bool +\DeclareOption{bold} {\bool_set_true:N \l_ltjpreset_bold_bool} +\DeclareOption{nobold}{\bool_set_false:N \l_ltjpreset_bold_bool} + +\bool_new:N \l_ltjpreset_expert_bool % expert +\bool_set_false:N \l_ltjpreset_expert_bool +\DeclareOption{expert} {\bool_set_true:N \l_ltjpreset_expert_bool} +\DeclareOption{noexpert}{\bool_set_false:N \l_ltjpreset_expert_bool} + +\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{nodeluxe}{\int_set:Nn \l_ltjpreset_deluxe_int { 0 }} % 2 fonts + +% scale +{ \fontsize{1024}{1024}\selectfont + \fp_set_from_dim:Nn \l_ltjpreset_scale_fp \zw + \fp_gdiv:Nn \l_ltjpreset_scale_fp {1024} +} +\msg_new:nnn { luatexja-preset }{ scale }{ + 日本語フォントは~\fp_use:N \l_ltjpreset_scale_fp~倍にスケーリングされます. +} +\msg_warning:nn { luatexja-preset }{ scale } + +% JFM +\cs_set:Npn \ltjpreset_use_jfm: {ujis} % 使用する JFM +%%% \DeclareOption{min}{\cs_set:Npn \ltjpreset_use_jfm: {min}} % min +%%% ↑jfm-min.lua が横組み・縦組み専用仮名に追いついていないので使用禁止 +\DeclareOption{jis}{\cs_set:Npn \ltjpreset_use_jfm: {jis}} % jis +\DeclareOption{ujis}{\cs_set:Npn \ltjpreset_use_jfm: {ujis}} % ujis + +% 漢字字形 +\tl_new:N \l_ltjpreset_kanji_shape_tl +\DeclareOption{90jis}{ \tl_set:Nn \l_ltjpreset_kanji_shape_tl { , RawFeature = +jp90 }} % 90jis +\DeclareOption{jis2004}{\tl_set:Nn \l_ltjpreset_kanji_shape_tl { , RawFeature = +jp04 }} % jis2004 + +% 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 + +\cs_new:Npn \ltjpreset_set_uni:nn #1#2 { + \ltjpreset_set_multi:n { #1, #1, #2, #2, #2, #2, #1 } +} +\cs_new:Npn \ltjpreset_set_multi:n #1 { + \clist_set:Nn \l_ltjpreset_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 + } + \bool_set_true:N \l_ltjpreset_office_bool +} + +% 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 + } +} + + +% ipa, ipaex, ms +\DeclareOption{ipa}{ + \ltjpreset_set_uni:nn { IPAMincho } { IPAGothic } +} +\DeclareOption{ipaex}{ + \ltjpreset_set_uni:nn { IPAExMincho } { IPAExGothic } +} +\DeclareOption{ms}{ + \ltjpreset_set_uni:nn { MS-Mincho } { MS-Gothic } +} + +% {ipa,ipaex,ms}-dx % Office 付属フォントを利用 +\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 } +} + + +% 非埋込 +\DeclareOption{noembed}{ + \ltjpreset_set_uni:nn { Ryumin-Light } { GothicBBB-Medium } + \bool_set_true:N \l_ltjpreset_noembed_bool +} + +\ExecuteOptions{noembed} +\ProcessOptions* + +%% KozMinPr6N の場合はjp04 feature がないので,nlck にする +\clist_if_in:NnT \l_ltjpreset_font_list { KozMinPr6N-Regular.otf } { + \tl_set:Nn \l_tmpa_tl {, RawFeature = +jp04} + \tl_if_eq:NNT \l_ltjpreset_kanji_shape_tl \l_tmpa_tl { + \tl_set:Nn \l_ltjpreset_kanji_shape_tl { , RawFeature = +nlck } + } +} + +%%%%%%%% main routine + +%%%% リストからの展開 +% 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 } + +% 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 } + +%% HG 系フォント + JIS2004/90JIS のときはフォント名を置換 +\bool_if:NT \l_ltjpreset_office_bool { + \tl_set:Nn \l_tmpa_tl {, RawFeature = +jp04} + \tl_if_eq:NNT \l_ltjpreset_kanji_shape_tl \l_tmpa_tl { + \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: + % HG ゴシックM のときはそうはいかないので 1 ウェイト時のゴシック体を使う + } + \tl_set:Nn \l_tmpa_tl {, RawFeature = +jp90} + \tl_if_eq:NNT \l_ltjpreset_kanji_shape_tl \l_tmpa_tl { + \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 } + } +} + +%%%% expert 用設定 +\tl_new:N \l_ltjpreset_add_features_tl + +\tl_set:Nx \l_ltjpreset_add_features_tl { + Scale = \fp_use:N \l_ltjpreset_scale_fp , + \tl_use:N \l_ltjpreset_kanji_shape_tl, + 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, } +} + +%%%% (丸)ゴシック体の設定: bold option もここで +\int_compare:nTF { \l_ltjpreset_deluxe_int == 2 } { + \newjfontfamily \mgfamily [ + \tl_use:N \l_ltjpreset_add_features_tl + \bool_if:NT \l_ltjpreset_noembed_bool { , NoEmbed } + ] { \ltjpreset_font_mg: } + \newjfontfamily \gtebfamily [ + \tl_use:N \l_ltjpreset_add_features_tl + \bool_if:NT \l_ltjpreset_noembed_bool { , NoEmbed } + ] { \ltjpreset_font_gt_eb: } + \bool_if:NT \l_ltjpreset_bold_bool { + \cs_set_eq:NN \ltjpreset_font_mc_bx: \ltjpreset_font_gt_bx: + } +}{ + \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_bx: \ltjpreset_font_gt_m: + \cs_set_eq:NN \ltjpreset_font_mc_bx: \ltjpreset_font_gt_m: +} + + +%%%% 実際の fontspec の呼びだし + +\defaultjfontfeatures{ Kerning=Off, \tl_use:N \l_ltjpreset_add_features_tl } + +\setmainjfont [ + BoldFont = \ltjpreset_font_mc_bx: + \bool_if:NT \l_ltjpreset_noembed_bool { , NoEmbed } +] { \ltjpreset_font_mc_m: } +\setsansjfont [ + BoldFont = \ltjpreset_font_gt_bx: + \bool_if:NT \l_ltjpreset_noembed_bool { , NoEmbed } +] { \ltjpreset_font_gt_m: } + +\ExplSyntaxOff +\endinput
\ No newline at end of file |