real_char = true; w = utf.byte(w)
elseif type(w) == 'string' and utf.len(w)==2 and utf.sub(w,2) == '*' then
real_char = true; w = utf.byte(utf.sub(w,1,1))
real_char = true; w = utf.byte(w)
elseif type(w) == 'string' and utf.len(w)==2 and utf.sub(w,2) == '*' then
real_char = true; w = utf.byte(utf.sub(w,1,1))
if v.kern[j] then defjfm_res= nil; return end
end
for j,x in pairs(v.kern) do
if v.kern[j] then defjfm_res= nil; return end
end
for j,x in pairs(v.kern) do
update_jfm_cache = function (j,sz)
if metrics[j].size_cache[sz] then return end
local t = {}
update_jfm_cache = function (j,sz)
if metrics[j].size_cache[sz] then return end
local t = {}
t.chars = metrics[j].chars
t.char_type = mult_table(metrics[j].char_type, sz)
for i,v in pairs(t.char_type) do
t.chars = metrics[j].chars
t.char_type = mult_table(metrics[j].char_type, sz)
for i,v in pairs(t.char_type) do
((v.align=='right') and 1 or 0.5)
if type(i) == 'number' then -- char_type
for k,w in pairs(v.glue) do
local h = node_new(id_glue_spec)
((v.align=='right') and 1 or 0.5)
if type(i) == 'number' then -- char_type
for k,w in pairs(v.glue) do
local h = node_new(id_glue_spec)
v[k] = {true, h, (w[5] and w[5]/sz or 0), FROM_JFM + (w[4] and w[4]/sz or 0)}
setfield(h, 'width', w[1])
setfield(h, 'stretch', w[2])
v[k] = {true, h, (w[5] and w[5]/sz or 0), FROM_JFM + (w[4] and w[4]/sz or 0)}
setfield(h, 'width', w[1])
setfield(h, 'stretch', w[2])
end
for k,w in pairs(v.kern) do
local g = node_new(id_kern)
end
for k,w in pairs(v.kern) do
local g = node_new(id_kern)
setfield(g, 'kern', w[1])
setfield(g, 'subtype', 1)
set_attr(g, attr_icflag, FROM_JFM)
setfield(g, 'kern', w[1])
setfield(g, 'subtype', 1)
set_attr(g, attr_icflag, FROM_JFM)
function (arg, fmtable, char)
return 0
end)
function find_char_class(c,m)
function (arg, fmtable, char)
return 0
end)
function find_char_class(c,m)
luatexbase.call_callback("luatexja.find_char_class", 0, m, c)
end
luatexbase.call_callback("luatexja.find_char_class", 0, m, c)
end
local cstemp
local global_flag -- true if \globaljfont, false if \jfont
local function load_jfont_metric()
local cstemp
local global_flag -- true if \globaljfont, false if \jfont
local function load_jfont_metric()
ltjb.package_error('luatexja',
'no JFM specified',
'To load and define a Japanese font, a JFM must be specified.'..
"The JFM 'ujis' will be used for now.")
jfm_file_name='ujis'
end
ltjb.package_error('luatexja',
'no JFM specified',
'To load and define a Japanese font, a JFM must be specified.'..
"The JFM 'ujis' will be used for now.")
jfm_file_name='ujis'
end
defjfm_res.name = jfm_file_name
table.insert(metrics, defjfm_res)
return #metrics
defjfm_res.name = jfm_file_name
table.insert(metrics, defjfm_res)
return #metrics
global_flag = g and '\\global' or ''
tex.sprint(cat_lp, '\\expandafter\\font\\csname ' .. cstemp .. '\\endcsname')
end
global_flag = g and '\\global' or ''
tex.sprint(cat_lp, '\\expandafter\\font\\csname ' .. cstemp .. '\\endcsname')
end
luatexbase.create_callback("luatexja.define_jfont", "data", function (ft, fn) return ft end)
-- EXT
luatexbase.create_callback("luatexja.define_jfont", "data", function (ft, fn) return ft end)
-- EXT
- function jfontdefY() -- for horizontal font
- local j = load_jfont_metric()
+ local identifiers = fonts.hashes.identifiers
+ function jfontdefY(dir)
+ jfm_dir = dir
+ local j = load_jfont_metric(dir)
ltjb.package_error('luatexja',
"bad JFM `" .. jfm_file_name .. "'",
'The JFM file you specified is not valid JFM file.\n'..
'So defining Japanese font is cancelled.')
ltjb.package_error('luatexja',
"bad JFM `" .. jfm_file_name .. "'",
'The JFM file you specified is not valid JFM file.\n'..
'So defining Japanese font is cancelled.')
- local fmtable = { jfm = j, size = f.size, var = jfm_var,
- zw = sz.zw, zh = sz.zh,
+ local fmtable = { jfm = j, size = f.size, var = jfm_var,
+ zw = sz.zw, zh = sz.zh,
+ ascent = ad.ascender,
+ descent = ad.descender,
fmtable = luatexbase.call_callback("luatexja.define_jfont", fmtable, fn)
font_metric_table[fn]=fmtable
fmtable = luatexbase.call_callback("luatexja.define_jfont", fmtable, fn)
font_metric_table[fn]=fmtable
- tex.sprint(cat_lp, global_flag .. '\\protected\\expandafter\\def\\csname '
- .. cstemp .. '\\endcsname{\\ltj@curjfnt=' .. fn .. '\\relax}')
+ tex.sprint(cat_lp, global_flag .. '\\protected\\expandafter\\def\\csname '
+ .. cstemp .. '\\endcsname{\\ltj@cur'
+ .. (dir == 'yoko' and 'j' or 't') .. 'fnt=' .. fn .. '\\relax}')
basename = utf.sub(basename, 6)
end
local p = utf.find(basename, ":")
basename = utf.sub(basename, 6)
end
local p = utf.find(basename, ":")
- function font_callback(name, size, id, fallback)
- extract_metric(name)
- -- In the present imple., we don't remove "jfm=..." from name.
- return fallback(name, size, id)
- end
+ luatexbase.add_to_callback('luatexja.define_font',
+ function (res, name)
+ extract_metric(name)
+ end,
+ 'extract_jfm_name', 1)
Nkfam_list[enc][fam] = 'true '
end
function is_kfam(enc, fam)
Nkfam_list[enc][fam] = 'true '
end
function is_kfam(enc, fam)
.. (kfam_list[enc] and kfam_list[enc][fam] or 'false ')) end
function is_Nkfam(enc, fam)
.. (kfam_list[enc] and kfam_list[enc][fam] or 'false ')) end
function is_Nkfam(enc, fam)
.. (Nkfam_list[enc] and Nkfam_list[enc][fam] or 'false ')) end
local ffam_list, Nffam_list = {}, {}
.. (Nkfam_list[enc] and Nkfam_list[enc][fam] or 'false ')) end
local ffam_list, Nffam_list = {}, {}
Nffam_list[enc][fam] = 'true '
end
function is_ffam(enc, fam)
Nffam_list[enc][fam] = 'true '
end
function is_ffam(enc, fam)
.. (ffam_list[enc] and ffam_list[enc][fam] or 'false ')) end
function is_Nffam(enc, fam)
.. (ffam_list[enc] and ffam_list[enc][fam] or 'false ')) end
function is_Nffam(enc, fam)
.. (Nffam_list[enc] and Nffam_list[enc][fam] or 'false ')) end
end
------------------------------------------------------------------------
.. (Nffam_list[enc] and Nffam_list[enc][fam] or 'false ')) end
end
------------------------------------------------------------------------
-- ind: 新フォント, bfnt: 基底フォント
if b>e then b, e = e, b end
if b*e<=0 then
-- ind: 新フォント, bfnt: 基底フォント
if b>e then b, e = e, b end
if b*e<=0 then
'bad character range ([' .. b .. ',' .. e .. ']). ' ..
'I take the intersection with [0x80, 0x10ffff].')
b, e = math.max(0x80,b),math.min(ucs_out-1,e)
'bad character range ([' .. b .. ',' .. e .. ']). ' ..
'I take the intersection with [0x80, 0x10ffff].')
b, e = math.max(0x80,b),math.min(ucs_out-1,e)
local t = alt_font_table[bfnt]
for i,_ in pairs(t) do t[i]=nil; end
end
local t = alt_font_table[bfnt]
for i,_ in pairs(t) do t[i]=nil; end
end
-- ind: Alt font の enc/fam/ser/shape, bbase: 基底フォントの enc/fam/ser/shape
if b>e then b, e = e, b end
if b*e<=0 then
-- ind: Alt font の enc/fam/ser/shape, bbase: 基底フォントの enc/fam/ser/shape
if b>e then b, e = e, b end
if b*e<=0 then
'bad character range ([' .. b .. ',' .. e .. ']). ' ..
'I take the intersection with [0x80, 0x10ffff].')
b, e = math.max(0x80,b),math.min(ucs_out-1,e)
'bad character range ([' .. b .. ',' .. e .. ']). ' ..
'I take the intersection with [0x80, 0x10ffff].')
b, e = math.max(0x80,b),math.min(ucs_out-1,e)
for i,_ in pairs(t) do t[i]=nil end
end
t = alt_font_table_latex[bbase]
for i,_ in pairs(t) do t[i]=nil end
end
t = alt_font_table_latex[bbase]
local tx = font_metric_table[alt_font_base_num].chars
for i,v in pairs(tx) do
if v==class and afnt_chars[i] then t[i]=afnt_num end
local tx = font_metric_table[alt_font_base_num].chars
for i,v in pairs(tx) do
if v==class and afnt_chars[i] then t[i]=afnt_num end
if ac[j] then t[j]=afnt_num end
else -- -n (n>=1) means that the character class n,
if ac[j] then t[j]=afnt_num end
else -- -n (n>=1) means that the character class n,
- -- which is defined in the JFM
- pickup_alt_font_class(-j, afnt_num, ac)
+ -- which is defined in the JFM
+ pickup_alt_font_class(-j, afnt_num, ac)