OSDN Git Service

luatexja-preset: bugfix
authorHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Mon, 28 Jan 2019 01:11:31 +0000 (10:11 +0900)
committerHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Mon, 28 Jan 2019 01:11:31 +0000 (10:11 +0900)
src/addons/luatexja-preset.sty

index 14bd4c7..e3054d3 100644 (file)
 \cs_new:Nn \__ltjpreset_substitute:nnnn {
   \group_begin:
     \suppressfontnotfounderror=1
-    \font \g__ltjpreset_font_test: = "\cs:w ltjpreset_font_#1_#2: \cs_end:"\relax
-    \ifx \g__ltjpreset_font_test: \nullfont
-      \msg_warning:nnxxxx { luatexja-preset }{ no-font }
-        { \cs:w ltjpreset_font_#1_#2: \cs_end: }{ #1/#2 }
-        { \cs:w ltjpreset_font_#3_#4: \cs_end: }{ #3/#4 }
-      \cs_gset_eq:cc { ltjpreset_font_#1_#2: } { ltjpreset_font_#3_#4: }
-    \fi
+    \cs_if_exist:cT {ltjpreset_font_#1_#2:} {
+      \font \g__ltjpreset_font_test: = "\cs:w ltjpreset_font_#1_#2: \cs_end:"\relax
+      \ifx \g__ltjpreset_font_test: \nullfont
+        \msg_warning:nnxxxx { luatexja-preset }{ no-font }
+          { \cs:w ltjpreset_font_#1_#2: \cs_end: }{ #1/#2 }
+          { \cs:w ltjpreset_font_#3_#4: \cs_end: }{ #3/#4 }
+        \cs_gset_eq:cc { ltjpreset_font_#1_#2: } { ltjpreset_font_#3_#4: }
+      \fi
+    } { \cs_gset_eq:cc { ltjpreset_font_#1_#2: } { ltjpreset_font_#3_#4: } }
   \group_end:
 }