summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-06-22 21:23:02 +0000
committerKarl Berry <karl@freefriends.org>2019-06-22 21:23:02 +0000
commit3f444ab8318d583f7cadb0d135486a8b204b567c (patch)
tree5c50a3590cdcee7a6080bf09b1a355ceb0b482e2 /Master/texmf-dist/tex/luatex
parentaa7047f2124bed0dd8bf7be61b5d99517f233a1e (diff)
luatexko (22jun19)
git-svn-id: svn://tug.org/texlive/trunk@51424 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/luatex')
-rw-r--r--Master/texmf-dist/tex/luatex/luatexko/luatexko-normalize.lua77
-rw-r--r--Master/texmf-dist/tex/luatex/luatexko/luatexko-uhc2utf8.lua29
-rw-r--r--Master/texmf-dist/tex/luatex/luatexko/luatexko.lua181
-rw-r--r--Master/texmf-dist/tex/luatex/luatexko/luatexko.sty15
4 files changed, 198 insertions, 104 deletions
diff --git a/Master/texmf-dist/tex/luatex/luatexko/luatexko-normalize.lua b/Master/texmf-dist/tex/luatex/luatexko/luatexko-normalize.lua
index d1429026fbe..9213f4c3e1b 100644
--- a/Master/texmf-dist/tex/luatex/luatexko/luatexko-normalize.lua
+++ b/Master/texmf-dist/tex/luatex/luatexko/luatexko-normalize.lua
@@ -13,15 +13,22 @@
luatexbase.provides_module({
name = "luatexko-normalize",
- version = "2.2",
- date = "2019/06/07",
+ version = "2.3",
+ date = "2019/06/21",
author = "Dohyun Kim, Soojin Nam",
description = "Hangul normalization",
license = "LPPL v1.3+",
})
-luatexkonormalize = luatexkonormalize or {}
-local luatexkonormalize = luatexkonormalize
+luatexko = luatexko or {}
+luatexko.normalize = luatexko.normalize or {}
+local luatexkonormalize = luatexko.normalize
+
+local utf8codes = utf8.codes
+local utf8char = utf8.char
+local tableinsert = table.insert
+local tableappend = table.append
+local tableunpack = table.unpack
local chanjatohanja = {
[0xF900] = {0x8C48, 0xFE00},
@@ -422,7 +429,7 @@ local function is_jongsong (c)
end
local function jamo2syllable (t) -- table -> integer
- local cho, jung, jong = table.unpack(t)
+ local cho, jung, jong = tableunpack(t)
local s = (cho - 0x1100) * 21
s = (s + jung - 0x1161) * 28
if jong then
@@ -445,35 +452,35 @@ end
local function hanguldecompose (buffer)
local t = {}
- for _, c in utf8.codes(buffer) do
+ for _, c in utf8codes(buffer) do
if is_hangul(c) then
- table.append(t, syllable2jamo(c))
+ tableappend(t, syllable2jamo(c))
else
- table.insert(t, c)
+ tableinsert(t, c)
end
end
- return utf8.char(table.unpack(t))
+ return utf8char(tableunpack(t))
end
-- LV | LVT, T -> L, V, T+
local function flush_syllable_jong (t, s)
if #s == 2 then
- table.append(t, syllable2jamo( s[1] ))
- table.insert(t, s[2])
+ tableappend(t, syllable2jamo( s[1] ))
+ tableinsert(t, s[2])
else
- table.append(t, s)
+ tableappend(t, s)
end
return t, {}
end
local function compose_hanguldecompose (buffer) -- string -> table
local t, s = {}, {}
- for _, c in utf8.codes(buffer) do
+ for _, c in utf8codes(buffer) do
if #s == 1 and is_jongsong(c) then
- table.insert(s, c)
+ tableinsert(s, c)
else
t, s = flush_syllable_jong(t, s)
- table.insert(is_hangul(c) and s or t, c)
+ tableinsert(is_hangul(c) and s or t, c)
end
end
t = flush_syllable_jong(t, s)
@@ -483,9 +490,9 @@ end
-- L, V, [T & ^OT]? -> LV | LVT
local function flush_syllable (t, s)
if #s == 2 or #s == 3 and is_modern_jong( s[3] ) then
- table.insert(t, jamo2syllable(s))
+ tableinsert(t, jamo2syllable(s))
else
- table.append(t, s)
+ tableappend(t, s)
end
return t, {}
end
@@ -494,10 +501,10 @@ local function compose_modern_hangul (ot)
local t, s = {}, {}
for _, c in ipairs(ot) do
if #s == 1 and is_modern_jung(c) or #s >= 2 and is_jongsong(c) then
- table.insert(s, c)
+ tableinsert(s, c)
else
t, s = flush_syllable(t, s)
- table.insert(is_modern_cho(c) and s or t, c)
+ tableinsert(is_modern_cho(c) and s or t, c)
end
end
t = flush_syllable(t, s)
@@ -507,9 +514,9 @@ end
-- L, VF -> CL
local function flush_cjamocho (t, s)
if #s == 2 then
- table.insert(t, jamotocjamo.ccho[ s[1] ])
+ tableinsert(t, jamotocjamo.ccho[ s[1] ])
else
- table.append(t, s)
+ tableappend(t, s)
end
return t, {}
end
@@ -518,10 +525,10 @@ local function compose_jamo_chosong (ot)
local t, s = {}, {}
for _, c in ipairs(ot) do
if #s == 1 and c == 0x1160 then
- table.insert(s, c)
+ tableinsert(s, c)
else
t, s = flush_cjamocho(t, s)
- table.insert(jamotocjamo.ccho[c] and s or t, c)
+ tableinsert(jamotocjamo.ccho[c] and s or t, c)
end
end
t = flush_cjamocho(t, s)
@@ -531,9 +538,9 @@ end
-- LF, V, ^T -> CV, ^T
local function flush_cjamojung (t, s)
if #s == 2 then
- table.insert(t, jamotocjamo.cjung[ s[2] ])
+ tableinsert(t, jamotocjamo.cjung[ s[2] ])
else
- table.append(t, s)
+ tableappend(t, s)
end
return t, {}
end
@@ -542,10 +549,10 @@ local function compose_jamo_jungsong (ot)
local t, s = {}, {}
for _, c in ipairs(ot) do
if #s == 1 and jamotocjamo.cjung[c] or #s == 2 and is_jongsong(c) then
- table.insert(s, c)
+ tableinsert(s, c)
else
t, s = flush_cjamojung(t, s)
- table.insert(c == 0x115F and s or t, c)
+ tableinsert(c == 0x115F and s or t, c)
end
end
t = flush_cjamojung(t, s)
@@ -555,9 +562,9 @@ end
-- CHJ -> HJ, VS
local function flush_compat_hanja (t, s)
if #s == 1 then
- table.append(t, chanjatohanja[ s[1] ])
+ tableappend(t, chanjatohanja[ s[1] ])
else
- table.append(t, s)
+ tableappend(t, s)
end
return t, {}
end
@@ -566,10 +573,10 @@ local function compose_compat_hanja (ot)
local t, s = {}, {}
for _, c in ipairs(ot) do
if #s == 1 and c >= 0xFE00 and c <= 0xFE02 then
- table.insert(s, c)
+ tableinsert(s, c)
else
t, s = flush_compat_hanja(t, s)
- table.insert(chanjatohanja[c] and s or t, c)
+ tableinsert(chanjatohanja[c] and s or t, c)
end
end
t = flush_compat_hanja(t, s)
@@ -583,7 +590,7 @@ local function hangulcompose (buffer)
t = compose_jamo_jungsong(t)
t = compose_compat_hanja (t)
- return utf8.char(table.unpack(t))
+ return utf8char(tableunpack(t))
end
local loaded = false
@@ -592,7 +599,7 @@ local remove_from_callback = luatexbase.remove_from_callback
local function unload()
if loaded then
- remove_from_callback('process_input_buffer', 'luatexko-hangul-normalize')
+ remove_from_callback('process_input_buffer', 'luatexko.hangul_normalize')
loaded = false
end
end
@@ -600,14 +607,14 @@ luatexkonormalize.unload = unload
local function compose()
unload()
- add_to_callback('process_input_buffer', hangulcompose, 'luatexko-hangul-normalize')
+ add_to_callback('process_input_buffer', hangulcompose, 'luatexko.hangul_normalize')
loaded = true
end
luatexkonormalize.compose = compose
local function decompose()
unload()
- add_to_callback('process_input_buffer', hanguldecompose, 'luatexko-hangul-normalize')
+ add_to_callback('process_input_buffer', hanguldecompose, 'luatexko.hangul_normalize')
loaded = true
end
luatexkonormalize.decompose = decompose
diff --git a/Master/texmf-dist/tex/luatex/luatexko/luatexko-uhc2utf8.lua b/Master/texmf-dist/tex/luatex/luatexko/luatexko-uhc2utf8.lua
index 1757d5b7017..a26f6212383 100644
--- a/Master/texmf-dist/tex/luatex/luatexko/luatexko-uhc2utf8.lua
+++ b/Master/texmf-dist/tex/luatex/luatexko/luatexko-uhc2utf8.lua
@@ -13,15 +13,16 @@
luatexbase.provides_module({
name = "luatexko-uhc2utf8",
- version = "2.2",
- date = "2019/06/07",
+ version = "2.3",
+ date = "2019/06/21",
author = "Dohyun Kim, Soojin Nam",
description = "UHC (CP949) input encoding",
license = "LPPL v1.3+",
})
-luatexkouhc2utf8 = luatexkouhc2utf8 or {}
-local luatexkouhc2utf8 = luatexkouhc2utf8
+luatexko = luatexko or {}
+luatexko.uhc2utf8 = luatexko.uhc2utf8 or {}
+local luatexkouhc2utf8 = luatexko.uhc2utf8
local kpse_find_file = kpse.find_file
local add_to_callback = luatexbase.add_to_callback
@@ -64,12 +65,12 @@ local function uhc_to_utf8 (buffer)
end
local function startconvert ()
- add_to_callback('process_input_buffer', uhc_to_utf8, 'luatexko-uhctoutf8', 1)
+ add_to_callback('process_input_buffer', uhc_to_utf8, 'luatexko.uhctoutf8', 1)
end
luatexkouhc2utf8.startconvert = startconvert
local function stopconvert ()
- remove_from_callback('process_input_buffer', 'luatexko-uhctoutf8')
+ remove_from_callback('process_input_buffer', 'luatexko.uhctoutf8')
end
luatexkouhc2utf8.stopconvert = stopconvert
@@ -93,13 +94,13 @@ local function utf8_to_uhc (name)
if u >= 0xA1 and u <= 0xFFE6 then
local c = t_ucs2uhc[u]
if c then
- table.insert(t, c // 256)
- table.insert(t, c % 256)
+ t[#t + 1] = c // 256
+ t[#t + 1] = c % 256
else
- table.insert(t, u)
+ t[#t + 1] = u
end
else
- table.insert(t, u)
+ t[#t + 1] = u
end
end
return string.char(table.unpack(t))
@@ -113,15 +114,15 @@ local function uhc_find_file (file, ...)
end
local function start_uhc_filename ()
- add_to_callback('find_read_file', function(id, name) return uhc_find_file(name) end, 'luatexko-touhc-findreadfile')
- add_to_callback('find_image_file', uhc_find_file, 'luatexko-touhc-findimagefile')
+ add_to_callback('find_read_file', function(id, name) return uhc_find_file(name) end, 'luatexko.touhc_findreadfile')
+ add_to_callback('find_image_file', uhc_find_file, 'luatexko.touhc_findimagefile')
kpse.find_file = uhc_find_file
end
luatexkouhc2utf8.start_uhc_filename = start_uhc_filename
local function stop_uhc_filename ()
- remove_from_callback('find_read_file', 'luatexko-touhc-findreadfile')
- remove_from_callback('find_image_file', 'luatexko-touhc-findimagefile')
+ remove_from_callback('find_read_file', 'luatexko.touhc_findreadfile')
+ remove_from_callback('find_image_file', 'luatexko.touhc_findimagefile')
kpse.find_file = kpse_find_file
end
luatexkouhc2utf8.stop_uhc_filename = stop_uhc_filename
diff --git a/Master/texmf-dist/tex/luatex/luatexko/luatexko.lua b/Master/texmf-dist/tex/luatex/luatexko/luatexko.lua
index 17b43d5628a..5f6cd602e53 100644
--- a/Master/texmf-dist/tex/luatex/luatexko/luatexko.lua
+++ b/Master/texmf-dist/tex/luatex/luatexko/luatexko.lua
@@ -13,8 +13,8 @@
luatexbase.provides_module {
name = 'luatexko',
- date = '2019/06/07',
- version = '2.2',
+ date = '2019/06/21',
+ version = '2.3',
description = 'typesetting Korean with LuaTeX',
author = 'Dohyun Kim, Soojin Nam',
license = 'LPPL v1.3+',
@@ -61,17 +61,18 @@ local texsprint = tex.sprint
local stringformat = string.format
local tableconcat = table.concat
-local tableinsert = table.insert
local tableunpack = table.unpack
-local add_to_callback = luatexbase.add_to_callback
-local attributes = luatexbase.attributes
-local call_callback = luatexbase.call_callback
-local create_callback = luatexbase.create_callback
-local module_warning = luatexbase.module_warning
-local new_user_whatsit = luatexbase.new_user_whatsit
-local new_user_whatsit_id = luatexbase.new_user_whatsit_id
-local registernumber = luatexbase.registernumber
+local add_to_callback = luatexbase.add_to_callback
+local attributes = luatexbase.attributes
+local call_callback = luatexbase.call_callback
+local callback_descriptions = luatexbase.callback_descriptions
+local create_callback = luatexbase.create_callback
+local module_warning = luatexbase.module_warning
+local new_user_whatsit = luatexbase.new_user_whatsit
+local new_user_whatsit_id = luatexbase.new_user_whatsit_id
+local registernumber = luatexbase.registernumber
+local remove_from_callback = luatexbase.remove_from_callback
local function warning (...)
return module_warning("luatexko", stringformat(...))
@@ -98,6 +99,7 @@ local lua_number = 100
local lua_value = 108
local spaceskip = 13
local nohyphen = registernumber"l@nohyphenation" or -1 -- verbatim
+local langkor = registernumber"koreanlanguage" or 16383
local hangulfontattr = attributes.luatexkohangulfontattr
local hanjafontattr = attributes.luatexkohanjafontattr
@@ -152,7 +154,7 @@ local function is_cjk_combining (c)
or is_unicode_var_sel(c)
end
-local function is_noncjkletter (c)
+local function is_noncjk_char (c)
return c >= 0x30 and c <= 0x39
or c >= 0x41 and c <= 0x5A
or c >= 0x61 and c <= 0x7A
@@ -329,7 +331,7 @@ local function process_fonts (head)
local c = curr.char
- if is_unicode_var_sel(c) then
+ if is_cjk_combining(c) then
local p = getprev(curr)
if p.id == glyphid and curr.font ~= p.font then
hangul_space_skip(curr, p.font)
@@ -435,12 +437,12 @@ local charclass = setmetatable({
local SC_charclass = setmetatable({
[0xFF01] = 4, [0xFF1A] = 4, [0xFF1B] = 4, [0xFF1F] = 4,
-}, { __index = function(_,c) return charclass[c] end })
+}, { __index = charclass })
local vert_charclass = setmetatable({
[0xFF1A] = 5, -- 0xFE13
[0xFF1B] = 5, -- 0xFE14
-}, { __index = function(_,c) return charclass[c] end })
+}, { __index = charclass })
local function get_char_class (c, classic)
if classic == vert_classic then
@@ -467,7 +469,7 @@ local breakable_after = setmetatable({
[0xFF1E] = true, [0xFF5E] = true, [0xFF70] = true,
},{ __index = function (_,c)
return is_hangul_jamo(c) and not is_chosong(c)
- or is_noncjkletter(c)
+ or is_noncjk_char(c)
or is_hanja(c)
or is_cjk_combining(c)
or is_kana(c)
@@ -553,7 +555,7 @@ end
local function fontdata_opt_dim (fd, optname)
local dim = option_in_font(fd, optname)
if dim then
- local m, u = dim:match"(.+)(e[mx])%s*$"
+ local m, u = dim:match"^(.+)(e[mx])%s*$"
if m and u then
if u == "em" then
dim = m * fd.parameters.quad
@@ -700,7 +702,7 @@ end
-- interhangul & interlatincjk
-local function is_cjk (c)
+local function is_cjk_char (c)
return is_hangul_jamo(c)
or is_hanja(c)
or is_cjk_combining(c)
@@ -710,6 +712,32 @@ local function is_cjk (c)
or rawget(breakable_after, c) and c >= 0x2000
end
+local function is_cjk (n, c) -- node, char
+ if n and c then
+ if is_unicode_var_sel(c) then
+ local p = getprev(n)
+ if p and p.id == glyphid then
+ local pc = my_node_props(p).unicode or p.char or 0
+ return is_cjk_char(pc)
+ end
+ end
+ return is_cjk_char(c)
+ end
+end
+
+local function is_noncjk (n, c) -- node, char
+ if n and c then
+ if is_unicode_var_sel(c) then
+ local p = getprev(n)
+ if p and p.id == glyphid then
+ local pc = my_node_props(p).unicode or p.char or 0
+ return is_noncjk_char(pc)
+ end
+ end
+ return is_noncjk_char(c)
+ end
+end
+
local function do_interhangul_option (head, curr, pc, c, fontid, par)
local cc = (is_hangul(c) or is_chosong(c)) and 1 or 0
@@ -758,55 +786,63 @@ local function process_interhangul (head, par)
return head
end
-local function do_interlatincjk_option (head, curr, pc, pf, c, cf, par)
- local cc = is_cjk(c) and 1 or is_noncjkletter(c) and 2 or 0
- local brb = cc == 2 or breakable_before[c] -- numletter != br_before
-
- if brb and cc*pc == 2 and curr.lang ~= nohyphen then
- local fontid = cc == 1 and cf or pf
- local dim = get_font_opt_dimen(fontid, "interlatincjk")
- if dim then
- head = insert_glue_before(head, curr, par, true, brb, false, false, dim, fontid)
+local function do_interlatincjk_option (head, curr, pc, pf, pcl, c, cf, par)
+ local cc = is_cjk(curr, c) and 1 or is_noncjk(curr, c) and 2 or 0
+ local old = has_attribute(curr, classicattr)
+ local ccl = get_char_class(c, old)
+
+ if cc*pc == 2 and curr.lang ~= nohyphen then
+ local brb = cc == 2 or breakable_before[c] -- numletter != br_before
+ if brb then
+ local fid = cc == 1 and cf or pf
+ local dim = get_font_opt_dimen(fid, "interlatincjk")
+ if dim then
+ local ict = old and intercharclass[pcl][ccl] -- under classic env. only
+ if ict then
+ dim = get_font_opt_dimen(fid, "intercharacter") or 0
+ end
+ head = insert_glue_before(head, curr, par, true, brb, old, ict, dim, fid)
+ end
end
end
- return head, cc, cf
+ return head, cc, cf, ccl
end
local function process_interlatincjk (head, par)
- local curr, pc, pf = head, 0, 0
+ local curr, pc, pf, pcl = head, 0, 0, 0
while curr do
local id = curr.id
if id == glyphid then
local c = my_node_props(curr).unicode or curr.char
- head, pc, pf = do_interlatincjk_option(head, curr, pc, pf, c, curr.font, par)
+ head, pc, pf, pcl = do_interlatincjk_option(head, curr, pc, pf, pcl, c, curr.font, par)
pc = breakable_after[c] and pc or 0
elseif id == hlistid and has_attribute(curr, rubyattr) then
local c, cf = ruby_char_font(curr)
- head, pc, pf = do_interlatincjk_option(head, curr, pc, pf, c, cf, par)
+ head, pc, pf, pcl = do_interlatincjk_option(head, curr, pc, pf, pcl, c, cf, par)
elseif id == whatsitid and curr.mode == directmode then
local glyf, c = get_actualtext(curr)
if c and glyf then
- head, pc, pf = do_interlatincjk_option(head, curr, pc, pf, c, glyf.font, par)
+ head, pc, pf, pcl = do_interlatincjk_option(head, curr, pc, pf, pcl, c, glyf.font, par)
curr = goto_end_actualtext(curr)
end
elseif id == mathid then
if pc == 1 then
- head = do_interlatincjk_option(head, curr, pc, pf, 0x30, pf, par)
+ head = do_interlatincjk_option(head, curr, pc, pf, pcl, 0x30, pf, par)
end
- pc, curr = 2, end_of_math(curr)
+ pc, pcl, curr = 2, 0, end_of_math(curr)
elseif id == dirid then
if pc == 1 and curr.dir:sub(1,1) == "+" then
- head = do_interlatincjk_option(head, curr, pc, pf, 0x30, pf, par)
- pc = 0
+ head = do_interlatincjk_option(head, curr, pc, pf, pcl, 0x30, pf, par)
+ pc, pcl = 0, 0
end
elseif is_blocking_node(curr) then
- pc = 0
+ pc, pcl = 0
end
curr = getnext(curr)
end
@@ -836,7 +872,7 @@ local function process_remove_spaces (head)
vchar, vfont = ruby_char_font(v)
end
if vchar and vfont and option_in_font(vfont, opt_name) then
- ok = is_cjk(vchar)
+ ok = is_cjk(v, vchar)
end
break
@@ -845,7 +881,7 @@ local function process_remove_spaces (head)
end
if ok then
head = noderemove(head, curr)
- tableinsert(to_free, curr)
+ to_free[#to_free + 1] = curr
break
end
end
@@ -906,7 +942,7 @@ local josa_code = setmetatable({
return c ~= 0x1160 and 2
elseif is_jongsong(c) then
return c == 0x11AF and 1 or 3
- elseif is_noncjkletter(c) and c <= 0x7A
+ elseif is_noncjk_char(c) and c <= 0x7A
or c >= 0x2160 and c <= 0x217F -- roman
or c >= 0x2460 and c <= 0x24E9 -- ①
or c >= 0x314F and c <= 0x3163 or c >= 0x3187 and c <= 0x318E -- ㅏ
@@ -974,7 +1010,7 @@ local function process_josa (head)
curr.char = cc
else
head = noderemove(head, curr)
- tableinsert(tofree, curr)
+ tofree[#tofree + 1] = curr
end
end
unset_attribute(curr, autojosaattr)
@@ -1232,7 +1268,7 @@ local function pdfliteral_direct_actual (syllable)
if syllable then
local t = {}
for _,v in ipairs(syllable) do
- tableinsert(t, conv_tounicode(v))
+ t[#t + 1] = conv_tounicode(v)
end
data = stringformat("/Span<</ActualText<FEFF%s>>>BDC", tableconcat(t))
else
@@ -1284,7 +1320,7 @@ local function process_reorder_tonemarks (head)
if is_jungsong(u)
or is_jongsong(u)
or hangul_tonemark[u] then
- tableinsert(syllable, u)
+ syllable[#syllable + 1] = u
curr, uni = n, u
else
break
@@ -1471,7 +1507,7 @@ local function process_vertical_font (fontdata)
local tsb_tab = get_tsb_table(fontdata.filename, subfont)
if not tsb_tab then
warning("Vertical metrics table (vmtx) not found in the font\n"..
- "`%s'", fontdata.fontname)
+ "`%s'", fontdata.fullname)
return
end
@@ -1697,13 +1733,13 @@ local function process_patch_font (fontdata)
texset("global", "protrudechars", 2)
active_processes.protrusion = true
end
- if not active_processes[fontdata.fontname] and
+ if not active_processes[fontdata.fullname] and
option_in_font(fontdata, "compresspunctuations") then
warning("Both `compresspunctuations' and `protrusion' are\n"..
"enabled for the font `%s'.\n"..
"Beware that this could result in bad justifications.\n",
- fontdata.fontname)
- active_processes[fontdata.fontname] = true
+ fontdata.fullname)
+ active_processes[fontdata.fullname] = true
end
end
@@ -1766,8 +1802,57 @@ local function activate (name)
end
luatexko.activate = activate
+add_to_callback ("hyphenate",
+function(head)
+ local curr = head
+ while curr do
+ local id = curr.id
+ if id == glyphid then
+ if curr.subtype == 1 and
+ curr.lang ~= nohyphen and
+ is_cjk(curr, curr.char) then
+ curr.lang = langkor
+ end
+ elseif id == mathid then
+ curr = end_of_math(curr)
+ end
+ curr = getnext(curr)
+ end
+ lang.hyphenate(head)
+end,
+"luatexko.hyphenate.prevent_disc_nodes")
+
-- aux functions
+local function deactivate_all (str)
+ luatexko.deactivated = {}
+ for _, name in ipairs{ "hpack_filter",
+ "pre_linebreak_filter",
+ "vpack_filter",
+ "hyphenate",
+ "luaotfload.patch_font" } do
+ local t = {}
+ for i, v in ipairs( callback_descriptions(name) ) do
+ if v:find(str or "^luatexko%.") then
+ local ff, dd = remove_from_callback(name, v)
+ t[#t + 1] = { ff, dd, i }
+ end
+ end
+ luatexko.deactivated[name] = t
+ end
+end
+luatexko.deactivateall = deactivate_all
+
+local function reactivate_all ()
+ for name, v in pairs(luatexko.deactivated or {}) do
+ for _, vv in ipairs(v) do
+ add_to_callback(name, tableunpack(vv))
+ end
+ end
+ luatexko.deactivated = nil
+end
+luatexko.reactivateall = reactivate_all
+
local function current_has_hangul_chars (cnt)
texcount[cnt] = char_in_font(fontcurrent(), 0xAC00) and 1 or 0
end
@@ -1789,7 +1874,7 @@ local function get_charslots_of_gid (fd, gid)
local t = {}
for i, v in pairs(fd.characters) do
if v.index == gid then
- table.insert(t, i)
+ t[#t + 1] = i
end
end
return t
diff --git a/Master/texmf-dist/tex/luatex/luatexko/luatexko.sty b/Master/texmf-dist/tex/luatex/luatexko/luatexko.sty
index 8660fe8de54..dbe1be8411a 100644
--- a/Master/texmf-dist/tex/luatex/luatexko/luatexko.sty
+++ b/Master/texmf-dist/tex/luatex/luatexko/luatexko.sty
@@ -13,7 +13,7 @@
\ifdefined\luatexkohangulfontattr \endinput\fi
\ifdefined\selectfont
- \ProvidesPackage{luatexko}[2019/06/07 v2.2 typesetting Korean with LuaTeX]
+ \ProvidesPackage{luatexko}[2019/06/21 v2.3 typesetting Korean with LuaTeX]
\RequirePackage{luatexbase}
\RequirePackage{fontspec}
\else
@@ -22,6 +22,7 @@
\chardef\luatexkoatcatcode=\catcode`\@
\catcode`\@=11
\fi
+\newlanguage\koreanlanguage
\protected\def\pdfliteral{\pdfextension literal}
\newattribute\luatexkohangulfontattr
\newattribute\luatexkohanjafontattr
@@ -30,7 +31,7 @@
\newattribute\luatexkoclassicattr
\newattribute\luatexkodotemphattr
\newattribute\luatexkorubyattr \chardef\luatexkorubyalloc\allocationnumber
-\directlua{ require"luatexko.lua" }
+\directlua{ require"luatexko" }
% classic
\protected\def\typesetclassic{\luatexkoclassicattr\z@\parindent1em }
\protected\def\typesetvertical{\luatexkoclassicattr\@ne\parindent1em }
@@ -293,17 +294,17 @@
\directlua{require"luatexko-normalize"}%
\afterassignment\luatexkohangulnormalize\count@}
\def\luatexkohangulnormalize{%
- \ifcase\count@ \directlua{ luatexkonormalize.unload() }% 0: none
- \or \directlua{ luatexkonormalize.compose() }% 1: nfc
- \else \directlua{ luatexkonormalize.decompose() }% 2: nfd
+ \ifcase\count@ \directlua{ luatexko.normalize.unload() }% 0: none
+ \or \directlua{ luatexko.normalize.compose() }% 1: nfc
+ \else \directlua{ luatexko.normalize.decompose() }% 2: nfd
\fi }
% convert uhc to utf8
\def\luatexuhcinputencoding{%
\directlua{require"luatexko-uhc2utf8"}%
\afterassignment\luatexkouhcinputencoding\count@}
\def\luatexkouhcinputencoding{%
- \ifcase\count@ \directlua{ luatexkouhc2utf8.stopconvert() }%
- \else \directlua{ luatexkouhc2utf8.startconvert() }%
+ \ifcase\count@ \directlua{ luatexko.uhc2utf8.stopconvert() }%
+ \else \directlua{ luatexko.uhc2utf8.startconvert() }%
\fi}
% actualtext not provided
\protected\def\actualtext#1#{\luatexkoactualtext}