OSDN Git Service

Target release date: 2019-11-17
[luatex-ja/luatexja.git] / src / addons / luatexja-fontspec.sty
index 695ff38..e32d20a 100644 (file)
@@ -3,25 +3,36 @@
 %
 
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{luatexja-fontspec}[2015/01/15 fontspec support of LuaTeX-ja]
+\ProvidesPackage{luatexja-fontspec}[2019/09/26 fontspec support of LuaTeX-ja]
 \RequirePackage{l3keys2e,luatexja}
 \ExplSyntaxOn
 
-\bool_new:N \ltj_fontspec_match
-\cs_set:Nn  \ltj_fontspec_pass_opts: {}
+\cs_if_exist:NF \Cjascale {
+  %% Default scale value for jfont.
+  \group_begin:
+  \fontsize{16}{16}\selectfont
+  \cs_gset:Npx \Cjascale { \fp_to_decimal:n {\zw / 16} }
+  \group_end:
+}
+
+\bool_new:N \__ltj_fontspec_match_bool
 \keys_define:nn { luatexja-fontspec }
   {
-    match .bool_set:N = \ltj_fontspec_match_bool,
+    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 = \PassOptionsToPackage{#1} {fontspec},
+      % 互換性のために残したオプション
+    scale .code:n = \gdef\Cjascale{#1},
+    unknown .code:n = \PassOptionsToPackage { \l_keys_key_tl } {fontspec},
   }
-\ProcessKeysOptions { luatexja-fontspec }
-\RequirePackage[\ltj_fontspec_pass_opts:]{fontspec}[2014/06/01]% v2.4
-\RequirePackage{luatexja-fontspec-24}
+\ProcessKeysOptions{ luatexja-fontspec }
+
+\RequirePackage{fontspec}[2019/03/15]% v2.7c
+\RequirePackage{luatexja-fontspec-27c} % v2.7c
 
 \ExplSyntaxOff
 %%%%%%%% Now we completely ignore kanjifont definition file.
-\@ltj@use@fdfalse
+\def\@ltj@use@fd{false}
 
 % We must redefine \try@load@fontshape to ignore kanjifont definitions at all.
 \def\try@load@fontshape{%
@@ -29,7 +40,7 @@
    \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}%
+    \@font@info{Trying loading font information for \f@encoding+\f@family}%
     \global\expandafter\let
        \csname\f@encoding+\f@family\endcsname\@empty
      \nfss@catcodes