summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tex/context/base/context-version.pdfbin4109 -> 4103 bytes
-rw-r--r--tex/context/base/spac-chr.lua56
-rw-r--r--tex/context/base/status-files.pdfbin24755 -> 24754 bytes
3 files changed, 45 insertions, 11 deletions
diff --git a/tex/context/base/context-version.pdf b/tex/context/base/context-version.pdf
index ceeaf90a4..b7288b53d 100644
--- a/tex/context/base/context-version.pdf
+++ b/tex/context/base/context-version.pdf
Binary files differ
diff --git a/tex/context/base/spac-chr.lua b/tex/context/base/spac-chr.lua
index 03c60d275..d59725edf 100644
--- a/tex/context/base/spac-chr.lua
+++ b/tex/context/base/spac-chr.lua
@@ -26,9 +26,9 @@ local insert_node_after = node.insert_after
local remove_node = nodes.remove -- ! nodes
local copy_node_list = node.copy_list
-local nodepool = nodes.pool
local tasks = nodes.tasks
+local nodepool = nodes.pool
local new_penalty = nodepool.penalty
local new_glue = nodepool.glue
@@ -43,6 +43,8 @@ local chardata = characters.data
local typesetters = typesetters
+local unicodeblocks = characters.blocks
+
local characters = typesetters.characters or { } -- can be predefined
typesetters.characters = characters
@@ -51,6 +53,8 @@ local fontparameters = fonthashes.parameters
local fontcharacters = fonthashes.characters
local fontquads = fonthashes.quads
+local setmetatableindex = table.setmetatableindex
+
local a_character = attributes.private("characters")
local a_alignstate = attributes.private("alignstate")
@@ -95,13 +99,6 @@ local function inject_nobreak_space(unicode,head,current,space,spacestretch,spac
return head, current
end
-local keepnbspbefore = {
- [0x094D] = true, -- category mn
- [0x0CCD] = true,
-}
-
-characters.keepnbspbefore = keepnbspbefore -- so we can extend
-
local function nbsp(head,current)
local para = fontparameters[current.font]
if current[a_alignstate] == 1 then -- flushright
@@ -129,18 +126,55 @@ function characters.replacenbspaces(head,nbspaces)
return head
end
+-- This initialization might move someplace else if we need more of it. The problem is that
+-- this module depends on fonts so we have an order problem.
+
+local nbsphash = { } setmetatableindex(nbsphash,function(t,k)
+ for i=unicodeblocks.devanagari.first,unicodeblocks.devanagari.last do nbsphash[i] = true end
+ for i=unicodeblocks.kannada .first,unicodeblocks.kannada .last do nbsphash[i] = true end
+ setmetatableindex(nbsphash,nil)
+ return nbsphash[k]
+end)
+
local methods = {
-- The next one uses an attribute assigned to the character but still we
-- don't have the 'local' value.
+ -- [0x00A0] = function(head,current) -- nbsp
+ -- local next = current.next
+ -- if next and next.id == glyph_code then
+ -- local char = next.char
+ -- if char >= 0x00900 and char <= 0x0097F then
+ -- return false -- devangari
+ -- end
+ -- if char >= 0x00C80 and char <= 0x00CFF then
+ -- return false -- kannada
+ -- end
+ -- end
+ -- local prev = current.prev
+ -- if prev and prev.id == glyph_code then
+ -- local char = prev.char
+ -- if char >= 0x00900 and char <= 0x0097F then
+ -- return false -- devangari
+ -- end
+ -- if char >= 0x00C80 and char <= 0x00CFF then
+ -- return false -- kannada
+ -- end
+ -- end
+ -- return nbsp(head,current)
+ -- end,
+
[0x00A0] = function(head,current) -- nbsp
local next = current.next
- if next and next.id == glyph_code and keepnbspbefore[next.char] then
+ if next and next.id == glyph_code and nbsphash[next.char] then
return false
- else
- return nbsp(head,current)
end
+ local prev = current.prev
+ if prev and prev.id == glyph_code and nbsphash[prev.char] then
+ return false -- kannada
+ end
+ return nbsp(head,current)
end,
[0x2000] = function(head,current) -- enquad
diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf
index a81b02912..0555d1048 100644
--- a/tex/context/base/status-files.pdf
+++ b/tex/context/base/status-files.pdf
Binary files differ