X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=src%2Fltj-otf.lua;h=71f974979e9c00d49eb0f853a990382dfee65e0f;hb=971b9e87b4659db7c5c816944126f9a3833f8088;hp=e9e8f1c45ece9fd2e6471ac5eef5c4da18febd21;hpb=880636d81e9819b31dec8a5f897bbfaf1732d18b;p=luatex-ja%2Fluatexja.git diff --git a/src/ltj-otf.lua b/src/ltj-otf.lua index e9e8f1c..71f9749 100644 --- a/src/ltj-otf.lua +++ b/src/ltj-otf.lua @@ -46,16 +46,19 @@ end function cid(key) local curjfnt = fonts.ids[tex.attribute[attr_curjfnt]] - if curjfnt.cidinfo.ordering ~= "Japan1" then + if curjfnt.cidinfo.ordering ~= "Japan1" and + curjfnt.cidinfo.ordering ~= "GB1" and + curjfnt.cidinfo.ordering ~= "CNS1" and + curjfnt.cidinfo.ordering ~= "Korea1" then ltjb.package_error('luatexja-otf', - 'Current Japanese font "'..curjfnt.psname..'" is not a CID-Keyed font (Adobe-Japan1)', + 'Current Japanese font (or other CJK font) "'..curjfnt.psname..'" is not a CID-Keyed font (Adobe-Japan1 etc.)', 'Select a CID-Keyed font using \jfont.') return end - local char = curjfnt.unicodes['Japan1.'..tostring(key)] + local char = curjfnt.unicodes[curjfnt.cidinfo.ordering..'.'..tostring(key)] if not char then ltjb.package_warning('luatexja-otf', - 'Current Japanese font "'..curjfnt.psname..'" does not include the specified CID character ('..tostring(key)..')', + 'Current Japanese font (or other CJK font) "'..curjfnt.psname..'" does not include the specified CID character ('..tostring(key)..')', 'Use a font including the specified CID character.') return end @@ -63,15 +66,14 @@ function cid(key) end function extract(head) - local p = head, v + local p = head + local v while p do if p.id==id_whatsit then if p.subtype==sid_user and p.user_id==30113 then local g = node_new(id_glyph) g.subtype = 0; g.char = p.value v = has_attr(p, attr_curjfnt); g.font = v - set_attr(g, attr_jchar_class, - ltjf_find_char_class(g.char, ltjf_font_metric_table[v])) set_attr(g, attr_curjfnt, v) v = has_attr(p, attr_yablshift) if v then @@ -110,7 +112,7 @@ local function cid_to_char(fmtable, fn) local fi = fonts.ids[fn] if fi.cidinfo and fi.cidinfo.ordering == "Japan1" then fmtable.cid_char_type = {} - for i, v in pairs(ltjf.metrics[fmtable.jfm].chars) do + for i, v in pairs(fmtable.size_cache.chars) do local j = string.match(i, "^AJ1%-([0-9]*)") if j then j = tonumber(fi.unicodes['Japan1.'..tostring(j)]) @@ -132,7 +134,7 @@ end local function cid_set_char_class(arg, fmtable, char) if arg~=0 then return arg - elseif fmtable.cid_char_type then + elseif fmtable.cid_char_type then return fmtable.cid_char_type[char] or 0 else return 0 end