ソースコードの管理場所
修订版 | 996dc91c8ce7f8adb2c4bb2b3c57427a47ff978a (tree) |
---|---|
时间 | 2014-10-30 18:54:55 |
作者 | Hironori Kitagawa <h_kitagawa2001@yaho...> |
Commiter | Hironori Kitagawa |
Bugfix of the previous commit.
@@ -745,14 +745,12 @@ do | ||
745 | 745 | local checksum = file.checksum |
746 | 746 | |
747 | 747 | local function prepare_extra_data_base(id) |
748 | - if not id or not id.resources then return end | |
748 | + if not id then return end | |
749 | 749 | local bname = file.nameonly(id.filename or '') |
750 | - print(bname, font_extra_basename[bname]) | |
751 | - if bname and not font_extra_basename[bname] then | |
750 | + if not font_extra_basename[bname] then | |
752 | 751 | -- if the cache is present, read it |
753 | 752 | local newsum = checksum(id.filename) -- MD5 checksum of the fontfile |
754 | 753 | local v = "extra_" .. string.lower(file.nameonly(id.filename)) |
755 | - print(v) | |
756 | 754 | local dat = ltjb.load_cache( |
757 | 755 | v, |
758 | 756 | function (t) return (t.version~=cache_ver) or (t.chksum~=newsum) end |
@@ -767,7 +765,7 @@ do | ||
767 | 765 | font_extra_basename[bname] = dat or {} |
768 | 766 | ltjb.save_cache( v, |
769 | 767 | { |
770 | - chksum = checksum(fname), | |
768 | + chksum = checksum(id.filename), | |
771 | 769 | version = cache_ver, |
772 | 770 | dat, |
773 | 771 | }) |
@@ -776,7 +774,7 @@ do | ||
776 | 774 | end |
777 | 775 | end |
778 | 776 | local function prepare_extra_data_font(id, res) |
779 | - if type(res)=='table' and res.filename then | |
777 | + if type(res)=='table' and res.shared then | |
780 | 778 | font_extra_info[id] = font_extra_basename[file.nameonly(res.filename)] |
781 | 779 | end |
782 | 780 | end |
@@ -784,8 +782,8 @@ do | ||
784 | 782 | 'luaotfload.patch_font', |
785 | 783 | function (tfmdata) |
786 | 784 | -- these function is executed one time per one fontfile |
787 | - local bname = prepare_extra_data_base(tfmdata) | |
788 | - if bname then supply_vkern_table(tfmdata, bname) end | |
785 | + local bname = prepare_extra_data_base(tfmdata) | |
786 | + if bname then supply_vkern_table(tfmdata, bname) end | |
789 | 787 | end, |
790 | 788 | 'ltj.prepare_extra_data', 1) |
791 | 789 | luatexbase.add_to_callback( |
@@ -336,7 +336,9 @@ local function font_callback(name, size, id, fallback) | ||
336 | 336 | return mk_rml(basename, size, id) |
337 | 337 | else |
338 | 338 | local tfmdata=fallback(name, size, id) |
339 | - luatexbase.call_callback ("luaotfload.patch_font", tfmdata, name) | |
339 | + if type (tfmdata) == "table" and tfmdata.shared then | |
340 | + luatexbase.call_callback("luaotfload.patch_font", tfmdata, name) | |
341 | + end | |
340 | 342 | return tfmdata |
341 | 343 | end |
342 | 344 | end |