X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=src%2Fltj-jfont.lua;h=16ba9d93a5b2cb3490e47dcfc3653e80f60be665;hb=c3e2159efa02485ded571ccb62b2bde80233150d;hp=d3572312b97cff7d874aa5b783fba93c2c22ceb5;hpb=ab23049deb6fb90ca689fdf4924b3783f08f8f2e;p=luatex-ja%2Fluatexja.git diff --git a/src/ltj-jfont.lua b/src/ltj-jfont.lua index d357231..16ba9d9 100644 --- a/src/ltj-jfont.lua +++ b/src/ltj-jfont.lua @@ -31,7 +31,6 @@ local id_glyph = node.id('glyph') local id_kern = node.id('kern') local cat_lp = luatexbase.catcodetables['latex-package'] local FROM_JFM = luatexja.icflag_table.FROM_JFM -local tokenlib = luatexja.token ------------------------------------------------------------------------ -- LOADING JFM ------------------------------------------------------------------------ @@ -368,18 +367,18 @@ do end -- define_font callback - local otfl_fdr = fonts.definers.read + local otfl_fdr local ltjr_font_callback = ltjr.font_callback function luatexja.font_callback(name, size, id) local new_name = is_def_jfont and extract_metric(name) or name is_def_jfont = false - --local res = otfl_fdr(new_name, size, id) local res = ltjr_font_callback(new_name, size, id, otfl_fdr) luatexbase.call_callback('luatexja.define_font', res, new_name, size, id) -- this callback processes variation selector, so we execute it always return res end luatexbase.create_callback('luatexja.define_font', 'simple', function (n) return n end) + otfl_fdr= luatexbase.remove_from_callback('define_font', 'luaotfload.define_font') luatexbase.add_to_callback('define_font',luatexja.font_callback,"luatexja.font_callback", 1) end @@ -782,8 +781,8 @@ do local checksum = file.checksum local function prepare_extra_data_base(id) - if not id then return end - local bname = file.nameonly(id.filename or '') + if (not id) or (not id.filename) then return end + local bname = file.nameonly(id.filename) if not font_extra_basename[bname] then -- if the cache is present, read it local newsum = checksum(id.filename) -- MD5 checksum of the fontfile @@ -810,7 +809,7 @@ do end end local function prepare_extra_data_font(id, res) - if type(res)=='table' and res.shared then + if type(res)=='table' and res.shared and res.filename then font_extra_info[id] = font_extra_basename[file.nameonly(res.filename)] end end