OSDN Git Service

luatexja-fontspec: drop support of fontspec v2.3
[luatex-ja/luatexja.git] / src / addons / luatexja-fontspec.sty
index 51346d5..695ff38 100644 (file)
@@ -3,7 +3,7 @@
 %
 
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{luatexja-fontspec}[2014/06/19 fontspec support of LuaTeX-ja]
+\ProvidesPackage{luatexja-fontspec}[2015/01/15 fontspec support of LuaTeX-ja]
 \RequirePackage{l3keys2e,luatexja}
 \ExplSyntaxOn
 
 \cs_set:Nn  \ltj_fontspec_pass_opts: {}
 \keys_define:nn { luatexja-fontspec }
   {
-    match .bool_set:N = \ltj_fontspec_match,
+    match .bool_set:N = \ltj_fontspec_match_bool,
     match .default:n  = true,
-    pass .code:n = \cs_set:Nn \ltj_fontspec_pass_opts: {#1},
+    pass .code:n = \cs_set:Nn \ltj_fontspec_pass_opts: {#1},% 互換性
   }
 \ProcessKeysOptions { luatexja-fontspec }
-\RequirePackage[\ltj_fontspec_pass_opts:]{fontspec}[2011/09/13]
-\cs_if_exist:NTF \fontspec_update_featstr:n {
-  \RequirePackage{luatexja-fontspec-23}
-} {
-  \RequirePackage{luatexja-fontspec-24}
-}
+\RequirePackage[\ltj_fontspec_pass_opts:]{fontspec}[2014/06/01]% v2.4
+\RequirePackage{luatexja-fontspec-24}
+
+\ExplSyntaxOff
+%%%%%%%% Now we completely ignore kanjifont definition file.
+\@ltj@use@fdfalse
+
+% 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@\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}
 
 \endinput