if pathtmp then path = (path and path .. ';' or '') .. pathtmp end
if os.type~='windows' then path = string.gsub(path, ':', ';') end
- path = string.split(path, ';')
+ path = table.unique(string.split(path, ';'))
local cache_dir = '/luatexja'
local find_file = kpse.find_file
do
local cstemp
+ local global_flag -- true if \globaljfont, false if \jfont
local function load_jfont_metric()
if jfm_file_name=='' then
ltjb.package_error('luatexja',
function jfontdefX(g)
local t = token.get_next()
cstemp=token.csname_name(t)
- if g then luatexja.is_global = '\\global' else luatexja.is_global = '' end
+ global_flag = g and '\\global' or ''
tex.sprint(cat_lp, '\\expandafter\\font\\csname ' .. cstemp .. '\\endcsname')
end
"bad JFM `" .. jfm_file_name .. "'",
'The JFM file you specified is not valid JFM file.\n'..
'So defining Japanese font is cancelled.')
- tex.sprint(cat_lp, luatexja.is_global .. '\\expandafter\\let\\csname ' ..cstemp
+ tex.sprint(cat_lp, global_flag .. '\\expandafter\\let\\csname ' ..cstemp
.. '\\endcsname=\\relax')
return
end
fmtable = luatexbase.call_callback("luatexja.define_jfont", fmtable, fn)
font_metric_table[fn]=fmtable
- tex.sprint(cat_lp, luatexja.is_global .. '\\protected\\expandafter\\def\\csname '
+ tex.sprint(cat_lp, global_flag .. '\\protected\\expandafter\\def\\csname '
.. cstemp .. '\\endcsname{\\ltj@curjfnt=' .. fn .. '\\relax}')
end
end