diff options
author | Marius <mariausol@gmail.com> | 2013-11-15 00:40:13 +0200 |
---|---|---|
committer | Marius <mariausol@gmail.com> | 2013-11-15 00:40:13 +0200 |
commit | d9a614d85581895050fdff04b62ae5def0c1fe5b (patch) | |
tree | 1b3e6358e3a6f1e7ac5dce14e0e6f8b915f900ef /tex/context/base/scrp-cjk.lua | |
parent | 094807a0a621382e9192ca884ae8c05583d7d2d3 (diff) | |
download | context-d9a614d85581895050fdff04b62ae5def0c1fe5b.tar.gz |
beta 2013.11.14 23:22
Diffstat (limited to 'tex/context/base/scrp-cjk.lua')
-rw-r--r-- | tex/context/base/scrp-cjk.lua | 45 |
1 files changed, 9 insertions, 36 deletions
diff --git a/tex/context/base/scrp-cjk.lua b/tex/context/base/scrp-cjk.lua index 0ceaf4bd2..4f10ceddb 100644 --- a/tex/context/base/scrp-cjk.lua +++ b/tex/context/base/scrp-cjk.lua @@ -494,48 +494,20 @@ scripts.installmethod { }, } --- function scripts.decomposehangul(head) --- local current = head --- local done = false --- while current do --- local id = current.id --- if id == glyph_code then -- local index = unicode - 0xAC00 if index >= 0 and index < 19 * 21 * 28 then ... end --- local lead_consonant, medial_vowel, tail_consonant = decomposed(current.char) --- if lead_consonant then --- if not tail_consonant then --- tail_consonant = 0x11A7 --- end --- current.char = lead_consonant --- local m = copy_node(current) --- local t = copy_node(current) --- m.char = medial_vowel --- t.char = tail_consonant --- insert_node_after(head,current,m) --- insert_node_after(head,current,t) --- done = true --- current = t --- end --- end --- current = current.next --- end --- return head, done --- end - function scripts.decomposehangul(head) local done = false for current in traverse_id(glyph_code,head) do local lead_consonant, medial_vowel, tail_consonant = decomposed(current.char) if lead_consonant then - if not tail_consonant then - tail_consonant = 0x11A7 - end - current.char = tail_consonant - local l = copy_node(current) + current.char = lead_consonant local m = copy_node(current) - l.char = lead_consonant m.char = medial_vowel - head, current = insert_node_before(head,current,m) - head, current = insert_node_before(head,current,l) + head, current = insert_node_after(head,current,m) + if tail_consonant then + local t = copy_node(current) + t.char" = tail_consonant + head, current = insert_node_after(head,current,t) + end done = true end end @@ -551,10 +523,11 @@ registerotffeature { name = "decomposehangul", description = "decompose hangul", processors = { - -- position = 1, + position = 1, node = scripts.decomposehangul, } } + -- Chinese: hanzi local chinese_0 = { |