summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex/luatexko
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-05-01 21:54:46 +0000
committerKarl Berry <karl@freefriends.org>2017-05-01 21:54:46 +0000
commitc398bf73a46b2ebddb1e34047c56456ac11f03c5 (patch)
treedeb2908a6af4bf0b473cb8216f6dfaa0ed9764ab /Master/texmf-dist/tex/luatex/luatexko
parentf372f265ea1e6039d2bbd8d412c146cd5efc60da (diff)
luatexko (1may17)
git-svn-id: svn://tug.org/texlive/trunk@44141 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/luatex/luatexko')
-rw-r--r--Master/texmf-dist/tex/luatex/luatexko/luatexko.lua60
1 files changed, 33 insertions, 27 deletions
diff --git a/Master/texmf-dist/tex/luatex/luatexko/luatexko.lua b/Master/texmf-dist/tex/luatex/luatexko/luatexko.lua
index 48d70f5e809..2c229cedd13 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 = '2017/02/06',
- version = '1.16',
+ date = '2017/05/01',
+ version = '1.17',
description = 'Korean linebreaking and font-switching',
author = 'Dohyun Kim, Soojin Nam',
license = 'LPPL v1.3+',
@@ -217,6 +217,7 @@ local inhibitxspcode = setmetatable({
[0x00B0] = 1, -- °
[0x2032] = 1, -- ′
[0x2033] = 1, -- ″
+ [0x25CC] = 2, -- dotted circle
[0x3012] = 2, -- 〒
[0x301C] = 0, -- 〜
[0xFE14] = 1, -- ︔
@@ -1607,38 +1608,43 @@ end
-- reorder hangul tone marks
-----------------------------
local function reorderTM (head)
- local curr = d_nodetail(head)
+ local curr, todo = head, nil
while curr do
- if d_getid(curr) == glyphnode then
+ local nid = d_getid(curr)
+ if nid == glyphnode then
local uni = d_get_unicode_char(curr)
if uni == 0x302E or uni == 0x302F then
- local done = false
- local unichar = get_font_char(d_getfont(curr), uni)
- if unichar and unichar.width > 0 then
- local p = d_getprev(curr)
- while p and d_getid(p) == glyphnode do
- local pc = get_cjk_class(d_get_unicode_char(p))
- if pc == 9 then
- elseif pc == 7 or pc == 8 then
- head = d_remove_node(head,curr)
- d_setprev(curr, nil) -- prev might survive!
- head, curr = d_insert_before(head,p,curr)
- done = true
- break
- else
- break
- end
- p = d_getprev(p)
+ local tmgl = get_font_char(d_getfont(curr), uni)
+ local tmwidth = tmgl and tmgl.width or 0
+ if todo then
+ if tmwidth > 0 then
+ local tm = curr
+ head, curr = d_remove_node(head, curr)
+ d_setprev(tm, nil) -- prev might survive!
+ head = d_insert_before(head, todo, tm)
+ curr = d_getprev(curr)
+ end
+ elseif get_font_char(d_getfont(curr), 0x25CC) then
+ local u25CC = d_copy_node(curr)
+ d_setchar(u25CC, 0x25CC)
+ if tmwidth > 0 then
+ head, curr = d_insert_after(head, curr, u25CC)
+ else
+ head = d_insert_before(head, curr, u25CC)
end
end
- if not done and get_font_char(d_getfont(curr), 0x25CC) then
- local u_25CC = d_copy_node(curr)
- d_setchar(u_25CC, 0x25CC)
- d_insert_after(head, curr, u_25CC)
- end
+ todo = nil
+ elseif is_hangul(uni) or is_chosong(uni) or uni == 0x25CC then
+ todo = curr
+ elseif is_jungjongsong(uni) then
+ else
+ todo = nil
end
+ elseif nid == kernnode then
+ else
+ todo = nil
end
- curr = d_getprev(curr)
+ curr = d_getnext(curr)
end
return head
end