OSDN Git Service

ltj-jfont.lua: braced font specification
authorHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Sun, 8 Nov 2015 09:25:09 +0000 (18:25 +0900)
committerHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Sun, 8 Nov 2015 09:25:09 +0000 (18:25 +0900)
src/addons/luatexja-preset.sty
src/ltj-jfont.lua

index 9a8ee54..917ba78 100644 (file)
   } {}
   \DeclareFontShape{JT3}{#1}{#2}{n}{ <-> s*[\fp_use:N \l_ltjpreset_scale_fp] 
     {\bool_if:NT \l_ltjpreset_noembed_bool {psft:} "#3"
-    : jfm=ujisv ;-kern;\tl_use:N \l_ltjpreset_kanji_shape_tl
+    : jfm=ujisv ;-kern;\tl_use:N \l_ltjpreset_kanji_shape_tl;
     ; script=latn \bool_if:NT \l_ltjpreset_expert_bool { ;+vkna }}
   } {}
   \bool_if:NT \l_ltjpreset_expert_bool { 
index 3e4e0b1..7eb9763 100644 (file)
@@ -325,6 +325,8 @@ do
    -- extract jfm_file_name and jfm_var
    -- normalize position of 'jfm=' and 'jfmvar=' keys
    local function extract_metric(name)
+      local is_braced = name:match('^{(.*)}$')
+       name= is_braced or name
       jfm_file_name = ''; jfm_var = ''; jfm_ksp = true
       local tmp, index = name:sub(1, 5), 1
       if tmp == 'file:' or tmp == 'name:' or tmp == 'psft:' then
@@ -371,10 +373,11 @@ do
          if not name:match('vert') and not name:match('vrt2') then
             name = name .. ';vert;vrt2'
          end
+        print(name)
       else
         is_vert_enabled = nil
       end
-      return name
+      return is_braced and ('{' .. name .. '}') or name
    end
 
    -- define_font callback