local xc = x.head
local xcs = tex.round(font.fonts[xc.font].size*0.5)
-- 句読点の最大補正幅
- local xcc = unicode.utf8.char(xc.char)
+ local xcc = utf.char(xc.char)
local cts = compute_total_stretched(p)
if (xcc == ',' or xcc == '、' or xcc == '.' or xcc == '。') and cts>=0 then
local ag = node.new(id_glue) -- additional glue
local list_color = 'blue!50!black' -- リスト表示の色
local attr_curjfnt = luatexbase.attributes['ltj@curjfnt']
- local ubyte = unicode.utf8.byte
- local uchar = unicode.utf8.char
+ local ubyte = utf.byte
+ local uchar = utf.char
local sort = table.sort
function list_ivs(s)
local c = ubyte(s)
local stderr = io.stderr
local function show_usage(s)
stderr:write('Error: ' .. s .. '\n');
- stderr:write('Usage: jfm-convert [-J|-U] <ptex_jfm>\n');
+ stderr:write('Usage: texlua jfm-convert [-J|-U] <ptex_jfm>\n');
stderr:write('-J: JIS mode, -U: UCS mode \n');
stderr:write(' * The output will be written to stdout.\n');
stderr:write(' * I do not read virtual fonts which corresponded to <ptex_jfm>.\n');
os.exit(1)
end
-require('unicode'); local uchar = unicode.utf8.char
kpse.set_program_name('luatex')
+require('lualibs'); local uchar = utf.char
jisx0208 = require('ltj-jisx0208.lua').table_jisx0208_uptex
local function pass_ucs(s)
return "'" .. uchar(s) .. "'"
end
local function jis_to_ucs(s)
- local a = jisx0208[s-0x2020]
+ local i = s - 0x2020
+ local a = jisx0208[math.floor(i/256)*94+(i%256)-94] or 0
return a and pass_ucs(a) or string.format('0x%X',s+0x200000)
end
-------- 引数解釈 --------
-require('unicode')
+
local filename
local mode
if not mode then
mode = jis_to_ucs
for i=1, #all_ctype do
- if not jisx0208[all_ctype[i]-0x2020] then
+ local i = all_ctype[i]-0x2020
+ if not jisx0208[math.floor(i/256)*94+(i%256)-94] then
mode = pass_ucs; break
end
end