OSDN Git Service

updated documents
[luatex-ja/luatexja.git] / src / ltj-lotf_aux.lua
index ca829d7..bd3a602 100644 (file)
@@ -40,8 +40,7 @@ do
 local nulltable = {}
 local function get_cidinfo(id) -- table
   local t = getfont(id)
-  local a = t and (t.cidinfo or (t.resources and t.resources and t.resources.cidinfo)) or nulltable
-  return a
+  return (t and (t.resources and t.resources.cidinfo or t.cidinfo)) or nulltable
 end
 aux.get_cidinfo = get_cidinfo
 end
@@ -80,9 +79,10 @@ local dummy_vht, dummy_vorg = {}, {}
 setmetatable(dummy_vht, {__index = function () return 1 end } )
 setmetatable(dummy_vorg, {__index = function () return 0.88 end } )
 local function get_vmet_table(tfmdata, dest)
-   if (not tfmdata) or (not tfmdata.shared) then
+   if (not tfmdata) or (not tfmdata.shared) or (not tfmdata.shared.rawdata) then
      dest = dest or {}
      dest.vorigin, dest.vheight = dummy_vorg, dummy_vht
+     dest.ind_to_uni = {}
      return dest
    end
    local rawdata = tfmdata.shared.rawdata
@@ -102,8 +102,11 @@ local function get_vmet_table(tfmdata, dest)
        if v.vheight~=default_vheight then t_vheight[i] = v.vheight / units end
      end
    end
-   setmetatable(t_vheight, {__index = function () return default_vheight / units end } )
-   setmetatable(t_vorigin, {__index = function () return ascender / units end } )
+   local vhd, vod = default_vheight / units, ascender/units
+   t_vheight.default = vhd
+   t_vorigin.default = vod
+   setmetatable(t_vheight, {__index = function () return vhd end } )
+   setmetatable(t_vorigin, {__index = function () return vod end } )
    dest = dest or {}
    dest.ind_to_uni = t_ind_to_uni
    dest.vorigin = t_vorigin -- designed size = 1.0