OSDN Git Service

luatexja-preset: gt-m key does not work without deluxe option
[luatex-ja/luatexja.git] / src / ltj-jfont.lua
index 3889992..ad29ad4 100644 (file)
@@ -3,7 +3,7 @@
 --
 luatexbase.provides_module({
   name = 'luatexja.jfont',
-  date = '2018/02/18',
+  date = '2018/06/15',
   description = 'Loader for Japanese fonts',
 })
 
@@ -55,7 +55,9 @@ local function norm_val(a)
    end
 end
 
-function luatexja.jfont.define_jfm(t)
+local fastcopy=table.fastcopy
+function luatexja.jfont.define_jfm(to)
+   local t = fastcopy(to)
    local real_char -- Does current character class have the 'real' character?
    if t.dir~=jfm_dir then
       defjfm_res= nil; return
@@ -179,6 +181,8 @@ end
 
 local update_jfm_cache
 do
+   local floor = math.floor
+   local function myround(a) return floor(a+0.5) end
    local function mult_table(old,scale) -- modified from table.fastcopy
       if old then
         local new = { }
@@ -186,7 +190,7 @@ do
            if type(v) == "table" then
               new[k] = mult_table(v,scale)
            elseif type(v) == "number" then
-              new[k] = round(v*scale)
+              new[k] = myround(v*scale)
            else
               new[k] = v
            end
@@ -1186,3 +1190,4 @@ luatexja.jfont.metrics = metrics
 luatexja.jfont.font_metric_table = font_metric_table
 luatexja.jfont.find_char_class = find_char_class
 
+luatexja.jfont.update_jfm_cache = update_jfm_cache