From 615ba84b2b4a17ee92e4a28762d0086389802d55 Mon Sep 17 00:00:00 2001 From: Marius Date: Sun, 15 May 2011 14:20:12 +0300 Subject: beta 2011.05.15 12:57 --- tex/context/base/char-cjk.lua | 21 ++++++++++++++-- tex/context/base/char-ini.lua | 11 +++++++++ tex/context/base/cont-new.mkii | 2 +- tex/context/base/cont-new.mkiv | 2 +- tex/context/base/context.mkii | 2 +- tex/context/base/context.mkiv | 2 +- tex/context/base/sort-ini.lua | 37 +++++++++++++++++----------- tex/context/base/status-files.pdf | Bin 23595 -> 23585 bytes tex/context/base/status-lua.pdf | Bin 154366 -> 154368 bytes tex/generic/context/luatex-fonts-merged.lua | 2 +- 10 files changed, 57 insertions(+), 22 deletions(-) (limited to 'tex') diff --git a/tex/context/base/char-cjk.lua b/tex/context/base/char-cjk.lua index 5dc20ff74..067371c64 100644 --- a/tex/context/base/char-cjk.lua +++ b/tex/context/base/char-cjk.lua @@ -226,13 +226,30 @@ local hangul_syllable_basetable = { linebreak = "h2", } +--~ local hangul_syllable_metatable = { +--~ __index = function(t,k) +--~ local u = t.unicodeslot +--~ if k == "fscode" then +--~ -- no need to cache this as we normally use fscodes +--~ return leadconsonant(u) +--~ elseif k == "shcode" then +--~ return { decomposed(u) } +--~ elseif k == "specials" then +--~ return { "char", decomposed(u) } +--~ elseif k == "description" then +--~ return description(u) +--~ else +--~ return hangul_syllable_basetable[k] +--~ end +--~ end +--~ } + local hangul_syllable_metatable = { __index = function(t,k) local u = t.unicodeslot if k == "fscode" then - -- no need to cache this as we normally use fscodes return leadconsonant(u) - elseif k == "shcode" then + elseif k == "decomposed" then return { decomposed(u) } elseif k == "specials" then return { "char", decomposed(u) } diff --git a/tex/context/base/char-ini.lua b/tex/context/base/char-ini.lua index 2244048c3..89f8336f8 100644 --- a/tex/context/base/char-ini.lua +++ b/tex/context/base/char-ini.lua @@ -723,6 +723,17 @@ setmetatableindex(ucchars, function(t,u) if u then local c = data[u] c = c and c setmetatableindex(shchars, function(t,u) if u then local c = data[u] c = c and c.shcode c = c and utfstring(c) or (type(u) == "number" and utfchar(u)) or u t[u] = c return c end end) setmetatableindex(fschars, function(t,u) if u then local c = data[u] c = c and c.fscode c = c and utfstring(c) or (type(u) == "number" and utfchar(u)) or u t[u] = c return c end end) +local decomposed = allocate() characters.decomposed = decomposed -- lazy table + +setmetatableindex(decomposed, function(t,u) -- either a table or false + if u then + local c = data[u] + local s = c and c.decomposed or false + t[u] = s + return s + end +end) + local specialchars = allocate() characters.specialchars = specialchars -- lazy table local descriptions = allocate() characters.descriptions = descriptions -- lazy table diff --git a/tex/context/base/cont-new.mkii b/tex/context/base/cont-new.mkii index bde0354a3..675bcfd42 100644 --- a/tex/context/base/cont-new.mkii +++ b/tex/context/base/cont-new.mkii @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2011.05.14 16:34} +\newcontextversion{2011.05.15 12:57} %D This file is loaded at runtime, thereby providing an %D excellent place for hacks, patches, extensions and new diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv index 32f2a86fa..f5906159c 100644 --- a/tex/context/base/cont-new.mkiv +++ b/tex/context/base/cont-new.mkiv @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2011.05.14 16:34} +\newcontextversion{2011.05.15 12:57} %D This file is loaded at runtime, thereby providing an %D excellent place for hacks, patches, extensions and new diff --git a/tex/context/base/context.mkii b/tex/context/base/context.mkii index 53a80364b..7acb889ad 100644 --- a/tex/context/base/context.mkii +++ b/tex/context/base/context.mkii @@ -20,7 +20,7 @@ %D your styles an modules. \edef\contextformat {\jobname} -\edef\contextversion{2011.05.14 16:34} +\edef\contextversion{2011.05.15 12:57} %D For those who want to use this: diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv index 37c91ee86..a37559c85 100644 --- a/tex/context/base/context.mkiv +++ b/tex/context/base/context.mkiv @@ -20,7 +20,7 @@ %D your styles an modules. \edef\contextformat {\jobname} -\edef\contextversion{2011.05.14 16:34} +\edef\contextversion{2011.05.15 12:57} %D For those who want to use this: diff --git a/tex/context/base/sort-ini.lua b/tex/context/base/sort-ini.lua index 12b5b49e0..7a91910ca 100644 --- a/tex/context/base/sort-ini.lua +++ b/tex/context/base/sort-ini.lua @@ -47,7 +47,7 @@ have language etc properties that then can be used.

local utf = unicode.utf8 local gsub, rep, sub, sort, concat = string.gsub, string.rep, string.sub, table.sort, table.concat local utfbyte, utfchar = utf.byte, utf.char -local utfcharacters = string.utfcharacters +local utfcharacters, utfvalues = string.utfcharacters, string.utfvalues local next, type, tonumber, rawget, rawset = next, type, tonumber, rawget, rawset local allocate = utilities.storage.allocate @@ -73,6 +73,8 @@ local shchars = characters.shchars local fscodes = characters.fscodes local fschars = characters.fschars +local decomposed = characters.decomposed + local variables = interfaces.variables local v_numbers = variables.numbers @@ -225,20 +227,25 @@ local function preparetables(data) end else -- we probably never enter this branch -- fschars returns a single char - s = fschars[k] - if s and s ~= k then - if trace_tests then - report_sorters(" 6 split: %s",s) - end - local ml = rawget(t,s) - if ml then - n = { } - nn = 0 - for i=1,#ml do - nn = nn + 1 - n[nn] = ml[i] - end - end +--~ s = fschars[k] +--~ if s and s ~= k then +--~ if trace_tests then +--~ report_sorters(" 6 split: %s",s) +--~ end +--~ local ml = rawget(t,s) +--~ if ml then +--~ n = { } +--~ nn = 0 +--~ for i=1,#ml do +--~ nn = nn + 1 +--~ n[nn] = ml[i] +--~ end +--~ end +--~ end + local b = utfbyte(k) + n = decomposed[b] or { b } + if trace_tests then + report_sorters(" 6 split: %s",utf.string(b)) end end if n then diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf index ffe3b9c23..f825d0ace 100644 Binary files a/tex/context/base/status-files.pdf and b/tex/context/base/status-files.pdf differ diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf index 201f19d0f..06d6da7d0 100644 Binary files a/tex/context/base/status-lua.pdf and b/tex/context/base/status-lua.pdf differ diff --git a/tex/generic/context/luatex-fonts-merged.lua b/tex/generic/context/luatex-fonts-merged.lua index 3cebee2e1..9c8a7e640 100644 --- a/tex/generic/context/luatex-fonts-merged.lua +++ b/tex/generic/context/luatex-fonts-merged.lua @@ -1,6 +1,6 @@ -- merged file : luatex-fonts-merged.lua -- parent file : luatex-fonts.lua --- merge date : 05/14/11 16:34:12 +-- merge date : 05/15/11 12:57:24 do -- begin closure to overcome local limits and interference -- cgit v1.2.3