local cidfont_data = {}
local cache_chars = {}
-local cache_ver = 8
+local cache_ver = 9
local identifiers = fonts.hashes.identifiers
local cid_reg, cid_order, cid_supp, cid_name
end},
["Adobe-KR"] = {"UniAKR-UTF32", 22896, 9,
function (i)
- -- ??
+ if i==3057 then
+ return 655360*2
+ elseif i==3058 then
+ return 655360*3
+ elseif i==12235 or i==12236 then
+ return 163840 -- 655360/4
+ end
end},
}
end
local function open_cmap_file(name, inc, cid_dec, mke)
- fh = io.open(kpse.find_file(name, 'cmap files'), "r")
- line = fh:read("*l")
- while line do
- if string.find(line, "%x+%s+begin...?char") then
- load_cid_char(cid_dec, mke)
- elseif string.find(line, "%x+%s+begin...?range") then
- load_cid_range(inc, cid_dec, mke)
- else
- line = fh:read("*l")
+ local fn = kpse.find_file(name, 'cmap files')
+ if fn then
+ fh = io.open(fn, "r")
+ line = fh:read("*l")
+ while line do
+ if string.find(line, "%x+%s+begin...?char") then
+ load_cid_char(cid_dec, mke)
+ elseif string.find(line, "%x+%s+begin...?range") then
+ load_cid_range(inc, cid_dec, mke)
+ else
+ line = fh:read("*l")
+ end
end
+ fh:close();
end
- fh:close();
end
local function increment(a) return a+1 end
-- 縦書用字形
tt, cidm = {}, {}
- local ttv = {}; k.shared.ltj_vert_table = ttv
+ local ttv = {}; k.ltj_vert_table = ttv
for i = 0,kx[2] do cidm[i] = -1 end
open_cmap_file(kx[1] .. "-V", increment, tonumber, entry)
for i,v in pairs(tt) do
- ttv[i] = cidmo[v.index]
+ ttv[i] = cidmo[v.index] -- "unicode" of vertical variant
end
-- tounicode エントリ
local getfont = node.direct.getfont
local getchar = node.direct.getchar
local setchar = node.direct.setchar
+ local font_getfont = font.getfont
cidf_vert_processor = {
function (head, fnum)
- local fontdata = identifiers[fnum]
+ local fontdata = font_getfont(fnum)
if head and luatexja.jfont.font_metric_table[fnum].vert_activated then
- local vt = fontdata.shared.ltj_vert_table
+ local vt = fontdata.ltj_vert_table
local nh = is_node(head) and to_direct(head) or head
for n in traverse_id(id_glyph, head) do
if getfont(n)==fnum then
if name:sub(1,1)=="{" and name:sub(-1)=="}" then name = name:sub(2,-2) end
local p = name:find(":") or 0
if name:sub(1, p-1) == 'psft' then
- local s = "Adobe-Japan1-6"
+ local s = "Adobe-Japan1-7"
local basename = name:sub(p+1)
local p = basename:find(":")
local q = basename:find("/[BI][BI]?")
return mk_rml(basename, size, id)
else
local tfmdata=fallback(name, size, id)
- if type (tfmdata) == "table" and tfmdata.shared then
+ if type (tfmdata) == "table" and tfmdata.encodingbytes == 2 then
luatexbase.call_callback("luaotfload.patch_font", tfmdata, name)
end
return tfmdata