X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=src%2Faddons%2Fluatexja-fontspec-24.sty;h=8a7e162892b558aec9bad3b6d5fb1514b89c6c1e;hb=ff90f703786657bb9e3424d03280e73d41982d04;hp=74805d54b092b755e6a8d040c208e42eaa173523;hpb=4b3dec5affbbb98cf59b3955ee16f7933098ac0c;p=luatex-ja%2Fluatexja.git diff --git a/src/addons/luatexja-fontspec-24.sty b/src/addons/luatexja-fontspec-24.sty index 74805d5..8a7e162 100644 --- a/src/addons/luatexja-fontspec-24.sty +++ b/src/addons/luatexja-fontspec-24.sty @@ -3,13 +3,12 @@ % \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{luatexja-fontspec-24}[2014/06/25 fontspec support of LuaTeX-ja] +\ProvidesPackage{luatexja-fontspec-24}[2015/01/15 fontspec support of LuaTeX-ja] \RequirePackage{l3keys2e,luatexja} \ExplSyntaxOn %%%%%%%% Change Japanese font family by \rmfamily or not -\bool_if:NTF \ltj_fontspec_match -{ +\cs_new:Npn \ltj_fontspec_match_cmd { \renewcommand\jttdefault{\gtdefault} \DeclareRobustCommand\rmfamily {\not@math@alphabet\rmfamily\mathrm @@ -21,12 +20,11 @@ {\not@math@alphabet\ttfamily\mathtt \romanfamily\ttdefault\kanjifamily\jttdefault\selectfont} \DeclareDocumentCommand \setmonojfont { O{} m } { - \ltj_fontspec_set_family:Nnn \jttdefault {#1}{#2} + \ltj_fontspec_set_family:Nnn \jttdefault {##1}{##2} \normalfont } -}{ } - +\bool_if:NT \ltj_fontspec_match_bool \ltj_fontspec_match_cmd %%%%%%%% Messages \msg_new:nnn {luatexja-fontspec} {addjfontfeatures-ignored} @@ -102,7 +100,7 @@ \fontspec_complete_fontname:Nn \l_ltj_fontspec_fontname_tate_tl {#1} } } -%% +%% \clist_new:N \l_ltj_fontspec_fontfeat_yoko_clist \clist_new:N \l_ltj_fontspec_fontfeat_tate_clist \tl_new:N \l_ltj_fontspec_fontname_tate_tl @@ -149,8 +147,8 @@ \__fontspec_update_featstr:n {-kern} } \clist_set:Nx \g__fontspec_default_fontopts_clist { - YokoFeatures = { JFM=ujis }, TateFeatures = { RawFeature=vrt2, JFM=ujisv }, - Scale=\fp_use:N \g_ltj_fontspec_scale_fp, Kerning=Off, + YokoFeatures = { JFM=ujis }, TateFeatures = { JFM=ujisv }, + Scale=\fp_use:N \g_ltj_fontspec_scale_fp, Kerning=Off, \g__ltj_fontspec_default_fontopts_clist } \prop_set_eq:NN \g__fontspec_fontopts_prop \g__ltj_fontspec_fontopts_prop @@ -261,9 +259,9 @@ } { \msg_warning:nnn {luatexja-fontspec} {altfont-ignored-by-rangeonly} { ##1 } } { - \__ltj_orig_fontspec_make_font_shapes:Nnnnn - { \l_ltj_fontspec_altname_tl } {#2} - {#3 _ alt \int_use:N \g_ltj_fontspec_altnumber_int } + \__ltj_orig_fontspec_make_font_shapes:Nnnnn + { \l_ltj_fontspec_altname_tl } {#2} + {#3 _ alt \int_use:N \g_ltj_fontspec_altnumber_int } {#4, \l_ltj_fontspec_altfont_leftover_clist } {#5} \DeclareAlternateKanjiFont @@ -359,67 +357,10 @@ } %%% CJKShape=JIS2004 -\__fontspec_define_feature_option:nnnnn{CJKShape}{JIS2004}{20}{5}{+jp04} - -\ExplSyntaxOff -%%%%%%%% Now we completely ignore kanjifont definition file. - -\DeclareRobustCommand\fontfamily[1]{% - \@notkfamfalse\@notffamfalse - \edef\tmp@item{'\luatexluaescapestring{#1}'}% - \edef\tmp@enc{'\luatexluaescapestring{\f@encoding}'}% - \ifcsname \k@encoding+#1\endcsname % if \k@encoding+#1 is already defined - \edef\k@family{#1}% - \else\@notkfamtrue\fi - \ifcsname \f@encoding+#1\endcsname - \edef\f@family{#1}% - \else % search font definition file... - \directlua{luatexja.jfont.is_ffam(\tmp@enc, \tmp@item)}% - \ifin@\edef\k@family{#1}\else% - \directlua{luatexja.jfont.is_Nffam(\tmp@enc, \tmp@item)}% - \ifin@\@notffamtrue\else% - % filename of font definition file is always lowercase - \edef\@temp{\lowercase{\noexpand\IfFileExists{\f@encoding#1.fd}}}% - \message{(I search font definition file)}% - \@temp{\@tempswztrue}{\@tempswzfalse}% - \if@tempswz - \directlua{luatexja.jfont.add_ffam_list(\tmp@enc, \tmp@item)}% - \edef\f@family{#1}% - \else - \directlua{luatexja.jfont.add_Nffam_list(\tmp@enc, \tmp@item)}% - \@notffamtrue% - \fi - \fi - \fi - \fi - \if@notkfam\if@notffam - {\ifcsname D@\k@encoding\endcsname\@nameuse{D@\k@encoding}\fi - \xdef\@@temp{\default@family}}\edef\k@family{\@@temp}% - {\ifcsname D@\f@encoding\endcsname\@nameuse{D@\f@encoding}\fi - \xdef\@@temp{\default@family}}\edef\f@family{\@@temp}% - \fi\fi -} - -% We must redefine \try@load@fontshape to ignore kanjifont definitions at all. -\def\try@load@fontshape{% - \expandafter - \ifx\csname \f@encoding+\f@family\endcsname\relax - \directlua{luatexja.jfont.is_kenc('\luatexluaescapestring{\f@encoding}')}% -\ifin@ % Japanese font: we don't search fd. - \@font@warning{We don't search kanjifont definition - \MessageBreak for \f@encoding/\f@family}% -\else % Alphabetic font - \@font@info{Try loading font information for \f@encoding+\f@family}% - \global\expandafter\let - \csname\f@encoding+\f@family\endcsname\@empty - \nfss@catcodes - \let\nfss@catcodes\relax - \edef\reserved@a{% - \lowercase{% - \noexpand\InputIfFileExists{\f@encoding\f@family.fd}}}% - \reserved@a\relax - {\@input@{\f@encoding\f@family.fd}}% -\fi - \fi} +\__fontspec_define_feature_option:nnnnn{CJKShape}{JIS2004}{20}{100}{+jp04} +%%% CharacterWidth={VerticalAlternateProportional, VerticalAlternateHalf} +\__fontspec_define_feature_option:nnnnn{CharacterWidth}{VerticalAlternateProportional}{22}{100}{+vpal} +\__fontspec_define_feature_option:nnnnn{CharacterWidth}{VerticalAlternateHalf}{22}{101}{+vhal} +\__fontspec_define_feature_option:nnnnn{Kerning}{Vertical} {}{}{+vkrn} \endinput