OSDN Git Service

fix "bad argument #2 to '__index' (invalid option 'glyphmin')" error
authorHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Fri, 18 Sep 2015 21:11:14 +0000 (06:11 +0900)
committerHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Fri, 18 Sep 2015 21:11:14 +0000 (06:11 +0900)
src/ltj-jfont.lua

index 62b0e32..8f4f9fd 100644 (file)
@@ -678,7 +678,10 @@ do
 
    local sort = table.sort
    local function add_fl_table(dest, glyphs, unitable, asc_des, units)
-      local tg, glyphmin, glyphmax = glyphs.glyphs, glyphs.glyphmin or 0, glyphs.glyphmax
+      local tg, glyphmin, glyphmax = glyphs.glyphs, 0, glyphs.glyphmax
+      for _,v in pairs(fields(glyphs)) do
+        if v=='glyphmin' then glyphmin = glyphs.glyphmin; break end
+      end
       for i = glyphmin, glyphmax-1 do
         local gv = tg[i]
         if gv then