summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/back-exp.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2017-02-17 10:31:56 +0100
committerContext Git Mirror Bot <phg42.2a@gmail.com>2017-02-17 10:31:56 +0100
commitb14f992ef5f4e868c9959b174278c86516d60dbc (patch)
tree28587bb46c025ea7b0d27ba93f09c93dcf53c73a /tex/context/base/mkiv/back-exp.lua
parent95a1799032dc61dbca4a11e495be34b4397c8fec (diff)
downloadcontext-b14f992ef5f4e868c9959b174278c86516d60dbc.tar.gz
2017-02-17 10:23:00
Diffstat (limited to 'tex/context/base/mkiv/back-exp.lua')
-rw-r--r--tex/context/base/mkiv/back-exp.lua52
1 files changed, 28 insertions, 24 deletions
diff --git a/tex/context/base/mkiv/back-exp.lua b/tex/context/base/mkiv/back-exp.lua
index bd87075d0..da7ec202f 100644
--- a/tex/context/base/mkiv/back-exp.lua
+++ b/tex/context/base/mkiv/back-exp.lua
@@ -118,12 +118,16 @@ local getnext = nuts.getnext
local getsubtype = nuts.getsubtype
local getfont = nuts.getfont
local getdisc = nuts.getdisc
+local getcomponents = nuts.getcomponents
local getlist = nuts.getlist
local getid = nuts.getid
local getfield = nuts.getfield
local getattr = nuts.getattr
local setattr = nuts.setattr -- maybe use properties
local isglyph = nuts.isglyph
+local getkern = nuts.getkern
+local getwidth = nuts.getwidth
+
local traverse_id = nuts.traverse_id
local traverse_nodes = nuts.traverse
@@ -544,27 +548,6 @@ local function makebreaknode(attributes) -- maybe no fulltag
}
end
-local function ignorebreaks(di,element,n,fulltag)
- local data = di.data
- for i=1,#data do
- local d = data[i]
- if d.content == " " then
- d.content = ""
- end
- end
-end
-
-local function ignorespaces(di,element,n,fulltag)
- local data = di.data
- for i=1,#data do
- local d = data[i]
- local c = d.content
- if type(c) == "string" then
- d.content = lpegmatch(p_stripper,c)
- end
- end
-end
-
do
local fields = { "title", "subtitle", "author", "keywords" }
@@ -1719,6 +1702,27 @@ do
end
end
+ local function ignorebreaks(di,element,n,fulltag)
+ local data = di.data
+ for i=1,#data do
+ local d = data[i]
+ if d.content == " " then
+ d.content = ""
+ end
+ end
+ end
+
+ local function ignorespaces(di,element,n,fulltag)
+ local data = di.data
+ for i=1,#data do
+ local d = data[i]
+ local c = d.content
+ if type(c) == "string" then
+ d.content = lpegmatch(p_stripper,c)
+ end
+ end
+ end
+
extras.registerpages = ignorebreaks
extras.registerseparator = ignorespaces
@@ -2549,7 +2553,7 @@ local function collectresults(head,list,pat,pap) -- is last used (we also have c
-- report_export("skipping character: %C (no attribute)",n.char)
else
-- we could add tonunicodes for ligatures (todo)
- local components = getfield(n,"components")
+ local components = getcomponents(n)
if components and (not characterdata[c] or overloads[c]) then -- we loose data
collectresults(components,nil,at) -- this assumes that components have the same attribute as the glyph ... we should be more tolerant (see math)
else
@@ -2699,7 +2703,7 @@ local function collectresults(head,list,pat,pap) -- is last used (we also have c
else
local subtype = getsubtype(n)
if subtype == userskip_code then
- if getfield(n,"width") > threshold then
+ if getwidth(n) > threshold then
if last and not somespace[currentcontent[nofcurrentcontent]] then
local a = getattr(n,a_tagged) or pat
if a == last then
@@ -2807,7 +2811,7 @@ local function collectresults(head,list,pat,pap) -- is last used (we also have c
end
end
elseif id == kern_code then
- local kern = getfield(n,"kern")
+ local kern = getkern(n)
if kern > 0 then
local limit = threshold
if p and getid(p) == glyph_code then