summaryrefslogtreecommitdiff
path: root/tex
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2010-03-18 14:42:00 +0100
committerHans Hagen <pragma@wxs.nl>2010-03-18 14:42:00 +0100
commit66a814af45f6ebe7ff0210238b2b9eba7dd3a499 (patch)
treec227b9351820db8c6084b82777c60b4367c80dd8 /tex
parentf8583123d8e264910387d015f4d6576551fe0ee4 (diff)
downloadcontext-66a814af45f6ebe7ff0210238b2b9eba7dd3a499.tar.gz
beta 2010.03.18 14:42
Diffstat (limited to 'tex')
-rw-r--r--tex/context/base/buff-ini.mkiv3
-rw-r--r--tex/context/base/buff-ver.mkiv82
-rw-r--r--tex/context/base/cont-fil.tex3
-rw-r--r--tex/context/base/cont-new.tex2
-rw-r--r--tex/context/base/context.tex2
-rw-r--r--tex/context/base/font-ctx.lua6
-rw-r--r--tex/context/base/font-gds.lua33
-rw-r--r--tex/context/base/font-otn.lua106
-rw-r--r--tex/context/base/font-tfm.lua20
-rw-r--r--tex/context/base/grph-inc.lua22
-rw-r--r--tex/context/base/l-file.lua4
-rw-r--r--tex/context/base/lang-alt.tex91
-rw-r--r--tex/context/base/lpdf-ano.lua73
-rw-r--r--tex/context/base/lpdf-wid.lua12
-rw-r--r--tex/context/base/luat-lua.lua3
-rw-r--r--tex/context/base/m-barcodes.mkiv96
-rw-r--r--tex/context/base/m-pstricks.lua73
-rw-r--r--tex/context/base/m-pstricks.mkii (renamed from tex/context/base/m-pstric.tex)9
-rw-r--r--tex/context/base/m-pstricks.mkiv66
-rw-r--r--tex/context/base/m-pstricks.tex16
-rw-r--r--tex/context/base/m-timing.tex26
-rw-r--r--tex/context/base/math-lan.mkiv8
-rw-r--r--tex/context/base/math-vfu.lua166
-rw-r--r--tex/context/base/mlib-pps.lua15
-rw-r--r--tex/context/base/mult-ini.lua25
-rw-r--r--tex/context/base/mult-sys.tex2
-rw-r--r--tex/context/base/node-aux.lua56
-rw-r--r--tex/context/base/node-ini.lua2
-rw-r--r--tex/context/base/node-ini.mkiv1
-rw-r--r--tex/context/base/node-res.lua42
-rw-r--r--tex/context/base/node-rul.lua41
-rw-r--r--tex/context/base/node-ser.lua2
-rw-r--r--tex/context/base/node-tra.lua7
-rw-r--r--tex/context/base/pack-rul.lua14
-rw-r--r--tex/context/base/page-app.mkiv10
-rw-r--r--tex/context/base/page-lin.lua160
-rw-r--r--tex/context/base/page-lin.mkiv103
-rw-r--r--tex/context/base/spac-ver.lua15
-rw-r--r--tex/context/base/spac-ver.mkiv4
-rw-r--r--tex/context/base/spec-dpm.mkii3
-rw-r--r--tex/context/base/spec-dpx.mkii3
-rw-r--r--tex/context/base/spec-fdf.mkii108
-rw-r--r--tex/context/base/spec-tpd.mkii2
-rw-r--r--tex/context/base/spec-tst.mkii102
-rw-r--r--tex/context/base/strc-itm.mkiv2
-rw-r--r--tex/context/base/strc-lst.mkiv3
-rw-r--r--tex/context/base/strc-ref.lua60
-rw-r--r--tex/context/base/strc-ref.mkiv8
-rw-r--r--tex/context/base/trac-inf.lua2
-rw-r--r--tex/context/base/trac-tim.lua6
-rw-r--r--tex/context/fonts/fonts177
-rw-r--r--tex/context/patterns/lang-lt.rme11
-rw-r--r--tex/context/patterns/lang-tk.hyp8
-rw-r--r--tex/context/patterns/lang-tk.pat2492
-rw-r--r--tex/context/patterns/lang-tk.rme16
-rw-r--r--tex/generic/context/luatex-fonts-merged.lua180
56 files changed, 3816 insertions, 788 deletions
diff --git a/tex/context/base/buff-ini.mkiv b/tex/context/base/buff-ini.mkiv
index dea7b0a49..c27c77b18 100644
--- a/tex/context/base/buff-ini.mkiv
+++ b/tex/context/base/buff-ini.mkiv
@@ -169,6 +169,9 @@
\def\definebuffer
{\dodoubleempty\dodefinebuffer}
+
+\def\thebuffernumber#1%
+ {\csname\??bu#1\c!number\endcsname}
\unexpanded\def\getbuffer
{\dodoubleempty\dogetbuffer}
diff --git a/tex/context/base/buff-ver.mkiv b/tex/context/base/buff-ver.mkiv
index 928f26057..d39a9b824 100644
--- a/tex/context/base/buff-ver.mkiv
+++ b/tex/context/base/buff-ver.mkiv
@@ -17,9 +17,9 @@
\unprotect
-\ifx\startlinenumbering\undefined \let\startlinenumbering\relax \fi
-\ifx\stoplinenumbering \undefined \let\stoplinenumbering\relax \fi
-\ifx\setuplinenumbering\undefined \def\setuplinenumbering[#1]{} \fi
+\ifdefined\startlinenumbering\else \let\startlinenumbering \relax \fi
+\ifdefined\stoplinenumbering \else \let\stoplinenumbering \relax \fi
+\ifdefined\setuplinenumbering\else \def\setuplinenumbering[#1]{} \fi
% D \macros
% D {iflinepar}
@@ -640,13 +640,12 @@
\def\dotypefileverbatim
{\doinitializeverbatim
- \ctxlua{buffers.typefile("\readfilename","\typingparameter\c!strip")}}
+ \beginofverbatimlines
+ \ctxlua{buffers.typefile("\readfilename","\typingparameter\c!strip")}%
+ \endofverbatimlines}
\def\dotypefilelinesverbatim#1#2%
- {#1%
- \doinitializeverbatim
- \ctxlua{buffers.typefile("\readfilename","\typingparameter\c!strip")}%
- #2}
+ {#1\dotypefileverbatim#2}
\unexpanded\def\dotypeblockverbatim#1#2%
{\dowithbuffer{_typing_}{#1}{#2}
@@ -688,7 +687,7 @@
%D ...
%D \stopcode
%D
-%D \startcode[continue]
+%D \startcode[start=continue]
%D ...
%D ...
%D \stopcode
@@ -746,7 +745,7 @@
%D
%D The definitions default to the standard typing values.
-\def\presettyping[#1][#2]%
+\def\presettyping[#1][#2]% brrr also use parent here
{\copyparameters[\??tp#1][\??tp][\c!color,\c!style]%
\getparameters [\??tp#1][#2]}
@@ -853,34 +852,57 @@
\dodotypefile[\v!file][]{#3}%
\fi\fi}
+% \def\dosetuptypelinenumbering#1% fuzzy
+% {\ifcsname\currenttypingclass\currenttyping\c!start\endcsname \else
+% \setuptyping[\currenttyping][\c!start=1,\c!stop=,\c!step=1,\c!nlines=]%
+% \fi
+% \setuptyping[\currenttyping][#1]%
+% \doifelse{\typingparameter\c!numbering}\v!file
+% {% kind of special: filters lines !
+% \setuplinenumbering[\c!method=\v!file]%
+% \donetrue}
+% {\doifelse{\typingparameter\c!numbering}\v!line
+% {% \setuplinenumbering defaults start/step to 1/1, so we need
+% \doifinsetelse\v!continue{#1,\typingparameter\c!start}
+% {\scratchcounter0\typingparameter\c!n
+% \setxtypingparameter\c!start{\ifnum\scratchcounter=0 1\else\number\scratchcounter\fi}}%
+% {\doifnothing{\typingparameter\c!start}{\settypingparameter\c!start{1}}}%
+% \doifnothing{\typingparameter\c!step}{\settypingparameter\c!step{1}}%
+% \setuplinenumbering
+% [\c!method=\v!type,
+% \c!start=\typingparameter\c!start,
+% \c!stop=\typingparameter\c!stop,
+% \c!step=\typingparameter\c!step]%
+% \donetrue}
+% {\donefalse}}%
+% \ifdone
+% \def\beginofverbatimlines{\startlinenumbering}%
+% \def\endofverbatimlines {\stoplinenumbering\setxtypingparameter\c!n{\number\linenumber}}%
+% \fi}
+
\def\dosetuptypelinenumbering#1% fuzzy
- {\ifcsname\currenttypingclass\currenttyping\c!start\endcsname \else
- \setuptyping[\currenttyping][\c!start=1,\c!stop=,\c!step=1,\c!nlines=]%
- \fi
- \setuptyping[\currenttyping][#1]%
+ {%\ifcsname\currenttypingclass\currenttyping\c!start\endcsname \else
+ % \setuptyping[\currenttyping][\c!start=1,\c!stop=,\c!step=1,\c!continue=\v!no,\c!nlines=]%
+ %\fi
+ \doifassignmentelse{#1}{\setuptyping[\currenttyping][#1]}\donothing
\doifelse{\typingparameter\c!numbering}\v!file
{% kind of special: filters lines !
- \setuplinenumbering[\c!method=\v!file]%
+ \setuplinenumbering[\currenttyping][\c!method=\v!file]%
\donetrue}
{\doifelse{\typingparameter\c!numbering}\v!line
- {% \setuplinenumbering defaults start/step to 1/1, so we need
- \doifinsetelse\v!continue{#1,\typingparameter\c!start}
- {\scratchcounter0\typingparameter\c!n
- \setxtypingparameter\c!start{\ifnum\scratchcounter=0 1\else\number\scratchcounter\fi}}%
- {\doifnothing{\typingparameter\c!start}{\settypingparameter\c!start{1}}}%
- \doifnothing{\typingparameter\c!step}{\settypingparameter\c!step{1}}%
- \setuplinenumbering
- [\c!method=\v!type,
- \c!start=\typingparameter\c!start,
- \c!stop=\typingparameter\c!stop,
- \c!step=\typingparameter\c!step]%
+ {\doifinset\v!continue{#1}{\setuptyping[\currenttyping][\c!continue=\v!yes]}% fails: \settypingparameter\c!continue{\v!yes}
\donetrue}
{\donefalse}}%
\ifdone
- \ifx\startlinenumbering\undefined \let\startlinenumbering\relax \fi
- \ifx\stoplinenumbering \undefined \let\stoplinenumbering \relax \fi
- \def\beginofverbatimlines{\startlinenumbering}%
- \def\endofverbatimlines {\stoplinenumbering\setxtypingparameter\c!n{\number\linenumber}}%
+ \edef\beginofverbatimlines{\noexpand\startlinenumbering
+ [\currenttyping]%
+ [\c!continue=\typingparameter\c!continue,
+ \c!method=\v!type,
+ \c!start=\typingparameter\c!start,
+ \c!stop=\typingparameter\c!stop, % ?
+ \c!step=\typingparameter\c!step]%
+ }%
+ \def\endofverbatimlines{\stoplinenumbering}%
\fi}
\def\reporttypingerror#1% temp hack
diff --git a/tex/context/base/cont-fil.tex b/tex/context/base/cont-fil.tex
index 28b6b6f55..b295872ca 100644
--- a/tex/context/base/cont-fil.tex
+++ b/tex/context/base/cont-fil.tex
@@ -20,7 +20,8 @@
\definefilesynonym [eenheid] [units]
\definefilesynonym [einheit] [units]
-\definefilesynonym [pstricks] [pstric]
+\definefilesynonym [pstric] [pstricks]
+\definefilesynonym [pstrick] [pstricks]
\definefilesynonym [finance] [financ]
diff --git a/tex/context/base/cont-new.tex b/tex/context/base/cont-new.tex
index e080d3904..6008b6aa6 100644
--- a/tex/context/base/cont-new.tex
+++ b/tex/context/base/cont-new.tex
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2010.03.12 19:49}
+\newcontextversion{2010.03.18 14:42}
%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.tex b/tex/context/base/context.tex
index c70f20b8e..7590f0d8e 100644
--- a/tex/context/base/context.tex
+++ b/tex/context/base/context.tex
@@ -20,7 +20,7 @@
%D your styles an modules.
\edef\contextformat {\jobname}
-\edef\contextversion{2010.03.12 19:49}
+\edef\contextversion{2010.03.18 14:42}
%D For those who want to use this:
diff --git a/tex/context/base/font-ctx.lua b/tex/context/base/font-ctx.lua
index e37c0ea76..419bd25e0 100644
--- a/tex/context/base/font-ctx.lua
+++ b/tex/context/base/font-ctx.lua
@@ -410,17 +410,17 @@ end)
local calculate_scale = fonts.tfm.calculate_scale
function fonts.tfm.calculate_scale(tfmtable, scaledpoints, relativeid)
- local scaledpoints, delta = calculate_scale(tfmtable, scaledpoints, relativeid)
+ local scaledpoints, delta, units = calculate_scale(tfmtable, scaledpoints, relativeid)
if enable_auto_r_scale and relativeid then -- for the moment this is rather context specific
local relativedata = fontdata[relativeid]
local id_x_height = relativedata and relativedata.parameters and relativedata.parameters.x_height
local tf_x_height = id_x_height and tfmtable.parameters and tfmtable.parameters.x_height * delta
if tf_x_height then
scaledpoints = (id_x_height/tf_x_height) * scaledpoints
- delta = scaledpoints/(tfmtable.units or 1000)
+ delta = scaledpoints/units
end
end
- return scaledpoints, delta
+ return scaledpoints, delta, units
end
--~ table.insert(readers.sequence,1,'vtf')
diff --git a/tex/context/base/font-gds.lua b/tex/context/base/font-gds.lua
index 2a6d9f8e4..0013cb2ff 100644
--- a/tex/context/base/font-gds.lua
+++ b/tex/context/base/font-gds.lua
@@ -9,6 +9,8 @@ if not modules then modules = { } end modules ['font-gds'] = {
local type, next = type, next
local gmatch = string.gmatch
+local trace_goodies = false trackers.register("fonts.goodies", function(v) trace_goodies = v end)
+
-- goodies=name,colorscheme=,featureset=
--
-- goodies=auto
@@ -36,6 +38,13 @@ local function getgoodies(filename) -- maybe a merge is better
data[filename] = false -- signal for not found
else
goodies = dofile(fullname) or false
+ if not goodies then
+ logs.report("fonts", "goodie file '%s' is invalid",fullname)
+ return nil
+ elseif trace_goodies then
+ logs.report("fonts", "goodie file '%s' is loaded",fullname)
+ end
+ goodies.name = goodies.name or "no name"
for name, fnc in next, list do
fnc(goodies)
end
@@ -93,14 +102,30 @@ local function flattened(t,tt)
return tt
end
+fonts.flattened_features = flattened
+
+function fonts.goodies.prepare_features(goodies,name,set)
+ if set then
+ local ff = fonts.flattened_features(set)
+ local fullname = goodies.name .. "::" .. name
+ local n, s = preset_context(fullname,"",ff)
+ goodies.featuresets[name] = s -- set
+ if trace_goodies then
+ logs.report("fonts", "feature set '%s' gets number %s and name '%s'",name,n,fullname)
+ end
+ return n
+ end
+end
+
local function initialize(goodies,tfmdata)
local featuresets = goodies.featuresets
local goodiesname = goodies.name
if featuresets then
- for name,set in next, featuresets do
- local ff = flattened(set)
- local n, s = preset_context(goodiesname .. "::" .. name,"",ff)
- featuresets[name] = s -- set
+ if trace_goodies then
+ logs.report("fonts", "checking featuresets in '%s'",goodies.name)
+ end
+ for name, set in next, featuresets do
+ fonts.goodies.prepare_features(goodies,name,set)
end
end
end
diff --git a/tex/context/base/font-otn.lua b/tex/context/base/font-otn.lua
index 16ecc2d48..dcec234b1 100644
--- a/tex/context/base/font-otn.lua
+++ b/tex/context/base/font-otn.lua
@@ -1881,7 +1881,7 @@ function fonts.methods.node.otf.features(head,font,attr)
local ra = rl [attr] if ra == nil then ra = { } rl [attr] = ra end -- attr can be false
-- sequences always > 1 so no need for optimization
for s=1,#sequences do
- local pardir, txtdir = 0, { }
+ local pardir, txtdir = 0, { }
local success = false
local sequence = sequences[s]
local r = ra[s] -- cache
@@ -1907,12 +1907,10 @@ function fonts.methods.node.otf.features(head,font,attr)
-- only first attribute match check, so we assume simple fina's
-- default can become a font feature itself
if l[language] then
---~ valid, what = true, language
valid, what = s_e or a_e, language
-- elseif l[default] then
-- valid, what = true, default
elseif l[wildcard] then
---~ valid, what = true, wildcard
valid, what = s_e or a_e, wildcard
end
if valid then
@@ -1988,19 +1986,15 @@ function fonts.methods.node.otf.features(head,font,attr)
if not lookupcache then
report_missing_cache(typ,lookupname)
else
---~ print(typ,lookupname,lookupcache,table.serialize(lookupcache))
while start do
local id = start.id
if id == glyph then
---~ if start.font == font and start.subtype<256 and (not attr or has_attribute(start,0,attr)) and (not attribute or has_attribute(start,state,attribute)) then
if start.font == font and start.subtype<256 and has_attribute(start,0,attr) and (not attribute or has_attribute(start,state,attribute)) then
local lookupmatch = lookupcache[start.char]
if lookupmatch then
-- sequence kan weg
local ok
---~ print("!!!")
start, ok = handler(start,r[4],lookupname,lookupmatch,sequence,featuredata,1)
---~ texio.write_nl(tostring(lookupname),tostring(lookupmatch),tostring(ok))
if ok then
success = true
end
@@ -2025,25 +2019,6 @@ function fonts.methods.node.otf.features(head,font,attr)
-- start = start.next
-- end
elseif id == whatsit then
---~ if subtype == 7 then
---~ local dir = start.dir
---~ if dir == "+TRT" then
---~ rlmode = -1
---~ elseif dir == "+TLT" then
---~ rlmode = 1
---~ else
---~ rlmode = 0
---~ end
---~ elseif subtype == 6 then
---~ local dir = start.dir
---~ if dir == "TRT" then
---~ rlmode = -1
---~ elseif dir == "TLT" then
---~ rlmode = 1
---~ else
---~ rlmode = 0
---~ end
---~ end
local subtype = start.subtype
if subtype == 7 then
local dir = start.dir
@@ -2129,59 +2104,40 @@ function fonts.methods.node.otf.features(head,font,attr)
-- end
elseif id == whatsit then
local subtype = start.subtype
---~ if subtype == 7 then
---~ local dir = start.dir
---~ if dir == "+TRT" then
---~ rlmode = -1
---~ elseif dir == "+TLT" then
---~ rlmode = 1
---~ else
---~ rlmode = 0
---~ end
---~ elseif subtype == 6 then
---~ local dir = start.dir
---~ if dir == "TRT" then
---~ rlmode = -1
---~ elseif dir == "TLT" then
---~ rlmode = 1
---~ else
---~ rlmode = 0
---~ end
---~ end
- local subtype = start.subtype
- if subtype == 7 then
- local dir = start.dir
- if dir == "+TRT" or dir == "+TLT" then
- insert(txtdir,dir)
- elseif dir == "-TRT" or dir == "-TLT" then
- remove(txtdir)
- end
- local d = txtdir[#txtdir]
- if d == "+TRT" then
- rlmode = -1
- elseif d == "+TLT" then
- rlmode = 1
- else
- rlmode = pardir
- end
- if trace_directions then
- logs.report("fonts","directions after textdir %s: pardir=%s, txtdir=%s:%s, rlmode=%s",dir,pardir,#txtdir,txtdir[#txtdir] or "unset",rlmode)
- end
- elseif subtype == 6 then
- local dir = start.dir
- if dir == "TRT" then
- pardir = -1
- elseif dir == "TLT" then
- pardir = 1
- else
- pardir = 0
- end
+ local subtype = start.subtype
+ if subtype == 7 then
+ local dir = start.dir
+ if dir == "+TRT" or dir == "+TLT" then
+ insert(txtdir,dir)
+ elseif dir == "-TRT" or dir == "-TLT" then
+ remove(txtdir)
+ end
+ local d = txtdir[#txtdir]
+ if d == "+TRT" then
+ rlmode = -1
+ elseif d == "+TLT" then
+ rlmode = 1
+ else
rlmode = pardir
- --~ txtdir = { }
+ end
if trace_directions then
- logs.report("fonts","directions after pardir %s: pardir=%s, txtdir=%s:%s, rlmode=%s",dir,pardir,#txtdir,txtdir[#txtdir] or "unset",rlmode)
+ logs.report("fonts","directions after textdir %s: pardir=%s, txtdir=%s:%s, rlmode=%s",dir,pardir,#txtdir,txtdir[#txtdir] or "unset",rlmode)
end
+ elseif subtype == 6 then
+ local dir = start.dir
+ if dir == "TRT" then
+ pardir = -1
+ elseif dir == "TLT" then
+ pardir = 1
+ else
+ pardir = 0
end
+ rlmode = pardir
+ --~ txtdir = { }
+ if trace_directions then
+ logs.report("fonts","directions after pardir %s: pardir=%s, txtdir=%s:%s, rlmode=%s",dir,pardir,#txtdir,txtdir[#txtdir] or "unset",rlmode)
+ end
+ end
start = start.next
else
start = start.next
diff --git a/tex/context/base/font-tfm.lua b/tex/context/base/font-tfm.lua
index aa8739800..ea1b409e6 100644
--- a/tex/context/base/font-tfm.lua
+++ b/tex/context/base/font-tfm.lua
@@ -205,29 +205,21 @@ local charactercache = { }
-- a virtual font has italic correction make sure to set the
-- has_italic flag. Some more flags will be added in the future.
-
function tfm.calculate_scale(tfmtable, scaledpoints, relativeid)
if scaledpoints < 0 then
scaledpoints = (- scaledpoints/1000) * tfmtable.designsize -- already in sp
end
- local delta = scaledpoints/(tfmtable.units or 1000) -- brr, some open type fonts have 2048
- return scaledpoints, delta
+ local units = tfmtable.units or 1000
+ local delta = scaledpoints/units -- brr, some open type fonts have 2048
+ return scaledpoints, delta, units
end
function tfm.do_scale(tfmtable, scaledpoints, relativeid)
-- tfm.prepare_base_kerns(tfmtable) -- optimalization
- local scaledpoints, delta = tfm.calculate_scale(tfmtable, scaledpoints, relativeid)
- if enable_auto_r_scale and relativeid then -- for the moment this is rather context specific
- local relativedata = fontdata[relativeid]
- local id_x_height = relativedata and relativedata.parameters and relativedata.parameters.x_height
- local tf_x_height = id_x_height and tfmtable.parameters and tfmtable.parameters.x_height * delta
- if tf_x_height then
- scaledpoints = (id_x_height/tf_x_height) * scaledpoints
- delta = scaledpoints/(tfmtable.units or 1000)
- end
- end
+ local t = { } -- the new table
+ local scaledpoints, delta, units = tfm.calculate_scale(tfmtable, scaledpoints, relativeid)
+ t.units_per_em = units or 1000
local hdelta, vdelta = delta, delta
- local t = { }
-- unicoded unique descriptions shared cidinfo characters changed parameters indices
for k,v in next, tfmtable do
if type(v) == "table" then
diff --git a/tex/context/base/grph-inc.lua b/tex/context/base/grph-inc.lua
index 574bece89..a91bd1d71 100644
--- a/tex/context/base/grph-inc.lua
+++ b/tex/context/base/grph-inc.lua
@@ -36,7 +36,7 @@ run TeX code from within Lua. Some more functionality will move to Lua.
]]--
local format, lower, find, match, gsub, gmatch = string.format, string.lower, string.find, string.match, string.gsub, string.gmatch
-local texsprint, texbox, texwd, texht, texdp = tex.sprint, tex.box, tex.wd, tex.ht, tex.dp
+local texsprint, texbox = tex.sprint, tex.box
local contains = table.contains
local concat = table.concat
@@ -670,8 +670,9 @@ function figures.done(data)
figures.n = figures.n + 1
data = data or figures.current()
local dr, du, ds, nr = data.request, data.used, data.status, figures.boxnumber
- ds.width = texwd[nr]
- ds.height = texht[nr]
+ local box = tex.box[nr]
+ ds.width = box.width
+ ds.height = box.height
ds.xscale = ds.width /(du.width or 1)
ds.yscale = ds.height/(du.height or 1)
return data
@@ -680,10 +681,11 @@ end
function figures.dummy(data)
data = data or figures.current()
local dr, du, ds, nr = data.request, data.used, data.status, figures.boxnumber
- texbox[nr] = node.new("hlist")
- texwd [nr] = du.width or figures.defaultwidth
- texht [nr] = du.height or figures.defaultheight
- texdp [nr] = du.depth or figures.defaultdepth
+ local box = node.new("hlist")
+ box.width = du.width or figures.defaultwidth
+ box.height = du.height or figures.defaultheight
+ box.depth = du.depth or figures.defaultdepth
+ texbox[nr] = box
end
-- -- -- generic -- -- --
@@ -757,9 +759,9 @@ function figures.includers.generic(data)
if figure then
local nr = figures.boxnumber
-- it looks like we have a leak in attributes here .. todo
- texbox[nr] = node.hpack(img.node(figure))
- -- texbox[nr] = img.node(figure) -- img.write(figure) -- assigning img.node directly no longer valid
- texwd[nr], texht[nr], texdp[nr] = figure.width, figure.height, 0 -- new, hm, tricky, we need to do that in tex (yet)
+ local box = node.hpack(img.node(figure)) -- img.node(figure) not longer valid
+ box.width, box.height, box.depth = figure.width, figure.height, 0 -- new, hm, tricky, we need to do that in tex (yet)
+ texbox[nr] = box
ds.objectnumber = figure.objnum
texsprint(ctxcatcodes,"\\relocateexternalfigure")
end
diff --git a/tex/context/base/l-file.lua b/tex/context/base/l-file.lua
index be0e3d016..6f5f5d00e 100644
--- a/tex/context/base/l-file.lua
+++ b/tex/context/base/l-file.lua
@@ -19,7 +19,9 @@ function file.removesuffix(filename)
end
function file.addsuffix(filename, suffix)
- if not find(filename,"%.[%a%d]+$") then
+ if not suffix or suffix == "" then
+ return filename
+ elseif not find(filename,"%.[%a%d]+$") then
return filename .. "." .. suffix
else
return filename
diff --git a/tex/context/base/lang-alt.tex b/tex/context/base/lang-alt.tex
index e45748ead..f65acbda3 100644
--- a/tex/context/base/lang-alt.tex
+++ b/tex/context/base/lang-alt.tex
@@ -23,6 +23,8 @@
% Azeri/Azerbaijani, Chuvash, Turkish, Turkmen
% Kazakh, Kazar, Kireghiz, Noghay, Talar
% Buryat, Kalmuck, Khalkha
+%
+% Turkmen translation by Nazar Annagurban <nazartm at gmail.com> 18. March 2010
\unprotect
@@ -38,54 +40,113 @@
\c!leftquotation=\upperleftdoublesixquote,
\c!rightquotation=\upperrightdoubleninequote,
\c!date={\v!year,\ ,\v!month,\ ,\v!day}]
+
+\installlanguage
+ [\s!tk]
+ [\c!spacing=\v!broad,
+ \c!leftsentence=---,
+ \c!rightsentence=---,
+ \c!leftsubsentence=---,
+ \c!rightsubsentence=---,
+ \c!leftquote=\upperleftsinglesixquote,
+ \c!rightquote=\upperrightsingleninequote,
+ \c!leftquotation=\upperleftdoublesixquote,
+ \c!rightquotation=\upperrightdoubleninequote,
+ \c!date={\v!year,\ ,\v!month,\ ,\v!day}
+ \s!patterns=\s!tk,
+ \s!lefthyphenmin=1,
+ \s!righthyphenmin=2]
\installlanguage [turkish] [\s!tr]
+\installlanguage [turkmen] [\s!tk]
\setupheadtext [\s!tr] [\v!content=Fihrist]
+\setupheadtext [\s!tk] [\v!content=Mazmuny]
\setupheadtext [\s!tr] [\v!tables=Tablolar]
+\setupheadtext [\s!tk] [\v!tables=Tablisalar]
\setupheadtext [\s!tr] [\v!figures=\Scedilla ekiller]
+\setupheadtext [\s!tk] [\v!figures=Suratlar]
\setupheadtext [\s!tr] [\v!graphics=Grafikler]
+\setupheadtext [\s!tk] [\v!graphics=Grafikler]
\setupheadtext [\s!tr] [\v!intermezzi=...]
+\setupheadtext [\s!tk] [\v!intermezzi=Arakesmeler]
\setupheadtext [\s!tr] [\v!index=\Idotaccent ndex]
+\setupheadtext [\s!tk] [\v!index=Indeks]
\setupheadtext [\s!tr] [\v!abbreviations=K\dotlessi saltmalar]
+\setupheadtext [\s!tk] [\v!abbreviations=Gysgaltmalar]
\setupheadtext [\s!tr] [\v!logos=Logolar]
+\setupheadtext [\s!tk] [\v!logos=Logolar]
\setupheadtext [\s!tr] [\v!units=Birimler]
+\setupheadtext [\s!tk] [\v!units=Birlikler]
\setuplabeltext [\s!tr] [\v!table=Tablo ]
+\setuplabeltext [\s!tk] [\v!table=Tablisa]
\setuplabeltext [\s!tr] [\v!figure=\Scedilla ekil ]
+\setuplabeltext [\s!tk] [\v!figure=Surat]
\setuplabeltext [\s!tr] [\v!intermezzo=... ]
-\setuplabeltext [\s!tr] [\v!graphic=Grafik ]
+\setuplabeltext [\s!tk] [\v!intermezzo=Arakesme]
+\setuplabeltext [\s!tr] [\v!graphic=Grafik]
+\setuplabeltext [\s!tk] [\v!graphic=Grafik]
\setuplabeltext [\s!tr] [\v!chapter=]
+\setuplabeltext [\s!tk] [\v!chapter=Bap]
\setuplabeltext [\s!tr] [\v!section=]
+\setuplabeltext [\s!tk] [\v!section=]
\setuplabeltext [\s!tr] [\v!subsection=]
+\setuplabeltext [\s!tk] [\v!subsection=]
\setuplabeltext [\s!tr] [\v!subsubsection=]
\setuplabeltext [\s!tr] [\v!subsubsubsection=]
+\setuplabeltext [\s!tk] [\v!subsubsubsection=]
\setuplabeltext [\s!tr] [\v!appendix=]
+\setuplabeltext [\s!tk] [\v!appendix=Go\scedilla ma\ccedilla a]
\setuplabeltext [\s!tr] [\v!part=Cilt ]
+\setuplabeltext [\s!tk] [\v!part=B\odiaeresis l\udiaeresis m]
\setuplabeltext [\s!tr] [\v!line=sat\dotlessi r ]
+\setuplabeltext [\s!tk] [\v!line=setir]
\setuplabeltext [\s!tr] [\v!lines=sat\dotlessi rlar ]
+\setuplabeltext [\s!tk] [\v!lines=setirler]
-\setuplabeltext [\s!tr] [\v!january=ocak]
+\setuplabeltext [\s!tk] [\v!january=\yacute anwar]
+\setuplabeltext [\s!tk] [\v!february=fewral]
+\setuplabeltext [\s!tk] [\v!march=mart]
+\setuplabeltext [\s!tk] [\v!april=aprel]
+\setuplabeltext [\s!tk] [\v!may=ma\yacute]
+\setuplabeltext [\s!tk] [\v!june=i\yacute un]
+\setuplabeltext [\s!tk] [\v!july=i\yacute ul]
+\setuplabeltext [\s!tk] [\v!august=awgust]
+\setuplabeltext [\s!tk] [\v!september=sent\yacute abr]
+\setuplabeltext [\s!tk] [\v!october=okt\yacute abr]
+\setuplabeltext [\s!tk] [\v!november=no\yacute abr]
+\setuplabeltext [\s!tk] [\v!december=dekabr]
+
+\setuplabeltext [\s!tr] [\v!january=ocak]
\setuplabeltext [\s!tr] [\v!february=\Scedilla ubat]
-\setuplabeltext [\s!tr] [\v!march=mart]
-\setuplabeltext [\s!tr] [\v!april=nisan]
-\setuplabeltext [\s!tr] [\v!may=may\dotlessi s]
-\setuplabeltext [\s!tr] [\v!june=haziran]
-\setuplabeltext [\s!tr] [\v!july=temmuz]
-\setuplabeltext [\s!tr] [\v!august=a\gbreve ustos]
-\setuplabeltext [\s!tr] [\v!september=eyl\udiaeresis l]
-\setuplabeltext [\s!tr] [\v!october=ekim]
+\setuplabeltext [\s!tr] [\v!march=mart]
+\setuplabeltext [\s!tr] [\v!april=nisan]
+\setuplabeltext [\s!tr] [\v!may=may\dotlessi s]
+\setuplabeltext [\s!tr] [\v!june=haziran]
+\setuplabeltext [\s!tr] [\v!july=temmuz]
+\setuplabeltext [\s!tr] [\v!august=a\gbreve ustos]
+\setuplabeltext [\s!tr] [\v!september=eyl\udiaeresis l]
+\setuplabeltext [\s!tr] [\v!october=ekim]
\setuplabeltext [\s!tr] [\v!november=kas\dotlessi m]
\setuplabeltext [\s!tr] [\v!december=aral\dotlessi k]
-\setuplabeltext [\s!tr] [\v!sunday=pazar]
-\setuplabeltext [\s!tr] [\v!monday=pazartesi]
-\setuplabeltext [\s!tr] [\v!tuesday=sal\dotlessi]
-\setuplabeltext [\s!tr] [\v!wednesday=\ccedilla ar\scedilla amba]
+\setuplabeltext [\s!tr] [\v!sunday=pazar]
+\setuplabeltext [\s!tr] [\v!monday=pazartesi]
+\setuplabeltext [\s!tr] [\v!tuesday=sal\dotlessi]
+\setuplabeltext [\s!tr] [\v!wednesday=\ccedilla ar\scedilla amba]
\setuplabeltext [\s!tr] [\v!thursday=per\scedilla embe]
-\setuplabeltext [\s!tr] [\v!friday=cuma]
+\setuplabeltext [\s!tr] [\v!friday=cuma]
\setuplabeltext [\s!tr] [\v!saturday=cumartesi]
+\setuplabeltext [\s!tk] [\v!sunday=dyn\ccedilla\ g\udiaeresis n]
+\setuplabeltext [\s!tk] [\v!monday=birinji g\udiaeresis n]
+\setuplabeltext [\s!tk] [\v!tuesday=ikinji g\udiaeresis n]
+\setuplabeltext [\s!tk] [\v!wednesday=\udiaeresis\ccedilla\udiaeresis nji]
+\setuplabeltext [\s!tk] [\v!thursday=d\odiaeresis rd\udiaeresis nji g\udiaeresis n]
+\setuplabeltext [\s!tk] [\v!friday=b\adiaeresis\scedilla inji g\udiaeresis n]
+\setuplabeltext [\s!tk] [\v!saturday=altynjy g\udiaeresis n]
+
%D \ShowAllLanguageValues [\s!tr] [turkish] {Turkish} {delight} % turks fruit
\protect \endinput
diff --git a/tex/context/base/lpdf-ano.lua b/tex/context/base/lpdf-ano.lua
index 6e4bdb814..e9e67e163 100644
--- a/tex/context/base/lpdf-ano.lua
+++ b/tex/context/base/lpdf-ano.lua
@@ -70,6 +70,8 @@ end
lpdf.pagedest = pagedest
+local defaultdestination = pdfarray { 0, pdfconstant("Fit") }
+
local function link(url,filename,destination,page,actions)
if filename and filename ~= "" then
if file.basename(filename) == tex.jobname then
@@ -92,9 +94,9 @@ local function link(url,filename,destination,page,actions)
}
elseif filename and filename ~= "" then
return pdfdictionary {
- S = pdf_gotor,
+ S = pdf_gotor, -- can also be pdf_launch
F = filename,
- D = destination and destination ~= "" and destination,
+ D = (destination and destination ~= "" and destination), -- or defaultdestination,
NewWindow = (actions.newwindow and true) or nil,
}
elseif destination and destination ~= "" then
@@ -270,12 +272,13 @@ runners["inner with arguments"] = function(var,actions)
end
runners["outer"] = function(var,actions)
- return link(nil,var.f,nil,nil,actions) -- var.o ?
+ local file, url = jobreferences.checkedfileorurl(var.outer,var.outer)
+ return link(url,file,var.arguments,nil,actions)
end
runners["outer with inner"] = function(var,actions)
- -- todo: resolve url/file name
- return link(nil,var.f,var.inner,var.r,actions)
+ local file = jobreferences.checkedfile(var.f)
+ return link(nil,file,var.inner,var.r,actions)
end
runners["special outer with operation"] = function(var,actions)
@@ -335,10 +338,7 @@ specials.i = specials.internal
function specials.page(var,actions) -- better resolve in strc-ref
local file = var.f
if file then
- local f = jobreferences.files.data[file]
- if f then
- file = f[1] or file
- end
+ file = jobreferences.checkedfile(file)
return link(nil,file,nil,p or var.operation,actions)
else
local p = jobreferences.pages[var.operation]
@@ -368,62 +368,23 @@ function specials.order(var,actions) -- jobreferences.specials !
end
end
-function specials.url(var,actions) -- better resolve in strc-ref
- local url = var.operation
- if url then
- local u = jobreferences.urls.data[url]
- if u then
- local u, f = u[1], u[2]
- if f and f ~= "" then
- url = u .. "/" .. f
- else
- url = u
- end
- end
- end
+function specials.url(var,actions)
+ local url = jobreferences.checkedurl(var.operation)
return link(url,nil,var.arguments,nil,actions)
end
-function specials.file(var,actions) -- better resolve in strc-ref
- local file = var.operation
- if file then
- local f = jobreferences.files.data[file]
- if f then
- file = f[1] or file
- end
- end
+function specials.file(var,actions)
+ local file = jobreferences.checkedfile(var.operation)
return link(nil,file,var.arguments,nil,actions)
end
-function specials.fileorurl(var,actions) -- better resolve in strc-ref
- local whatever, url, file = var.operation, nil, nil
- if whatever then
- local w = jobreferences.files.data[whatever]
- if w then
- file = w[1]
- else
- w = jobreferences.urls.data[whatever]
- if w then
- local u, f = w[1], w[2]
- if f and f ~= "" then
- url = u .. "/" .. f
- else
- url = u
- end
- end
- end
- end
+function specials.fileorurl(var,actions)
+ local file, url = jobreferences.checkedfileorurl(var.operation,var.operation)
return link(url,file,var.arguments,nil,actions)
end
-function specials.program(var,content) -- better resolve in strc-ref
- local program = var.operation
- if program then
- local p = jobreferences.programs[program]
- if p then
- program = p[1]
- end
- end
+function specials.program(var,content)
+ local program = jobreferences.checkedprogram(var.operation)
return lpdf.launch(program,var.arguments)
end
diff --git a/tex/context/base/lpdf-wid.lua b/tex/context/base/lpdf-wid.lua
index 44d0c5154..40a81e7d4 100644
--- a/tex/context/base/lpdf-wid.lua
+++ b/tex/context/base/lpdf-wid.lua
@@ -31,6 +31,8 @@ local pdfimmediateobj = pdf.immediateobj
local pdfannotation = nodes.pdfannotation
+local hpack_node, write_node = node.hpack, node.write
+
-- symbols
local presets = { } -- xforms
@@ -133,10 +135,10 @@ function codeinjections.registercomment(specification)
Parent = pdfreference(nd),
}
d.Popup = pdfreference(nc)
- texbox["commentboxone"] = node.hpack(pdfannotation(0,0,0,d(),nd))
- texbox["commentboxtwo"] = node.hpack(pdfannotation(specification.width,specification.height,0,c(),nc))
+ texbox["commentboxone"] = hpack_node(pdfannotation(0,0,0,d(),nd)) -- current dir
+ texbox["commentboxtwo"] = hpack_node(pdfannotation(specification.width,specification.height,0,c(),nc)) -- current dir
else
- texbox["commentboxone"] = node.hpack(pdfannotation(0,0,0,d()))
+ texbox["commentboxone"] = hpack_node(pdfannotation(0,0,0,d())) -- current dir
texbox["commentboxtwo"] = nil
end
end
@@ -209,7 +211,7 @@ function codeinjections.attachfile(specification)
local width = specification.width or 0
local height = specification.height or 0
local depth = specification.depth or 0
- node.write(pdfannotation(width,height,depth,d()))
+ write_node(pdfannotation(width,height,depth,d()))
end
function codeinjections.attachmentid(filename)
@@ -266,7 +268,7 @@ local function insertrenderingwindow(label,width,height,specification)
AA = actions,
}
local r = pdfreserveobj("annot")
- node.write(pdfannotation(width,height,0,d(),r)) -- save ref
+ write_node(pdfannotation(width,height,0,d(),r)) -- save ref
return pdfreference(r)
end
diff --git a/tex/context/base/luat-lua.lua b/tex/context/base/luat-lua.lua
index c4844396e..b964bf8e8 100644
--- a/tex/context/base/luat-lua.lua
+++ b/tex/context/base/luat-lua.lua
@@ -38,5 +38,6 @@ end end
--~ tex.sprint(string.format("more pi: %s %s %s\\par",...))
--~ end)
--~ tex.sprint(string.format("\\setbox0=\\hbox{%s}",math.pi*n))
---~ lua.flush(tex.wd[0],tex.ht[0],tex.dp[0])
+--~ local box = tex.box[0]
+--~ lua.flush(box.width,box.height,box.depth)
--~ end
diff --git a/tex/context/base/m-barcodes.mkiv b/tex/context/base/m-barcodes.mkiv
new file mode 100644
index 000000000..1c352dd54
--- /dev/null
+++ b/tex/context/base/m-barcodes.mkiv
@@ -0,0 +1,96 @@
+%D \module
+%D [ file=m-pstricks,
+%D version=2010.03.14,
+%D title=\CONTEXT\ Extra Modules,
+%D subtitle=Barcodes,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright=PRAGMA]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+% \startTEXpage
+% \startPSTRICKS
+% \pspicture(-4mm,-1mm)(38mm,26mm)
+% \psbarcode{9781860742712}{includetext guardwhitespace}{ean13}%
+% \endpspicture
+% \stopPSTRICKS
+% \stopTEXpage
+
+% 978-94-90688-01-1
+%
+% 978 = ean isbn identifier (979 also)
+% 94 = country code
+% 90688 = publisher code
+% 01 = title 1
+% 1 = checksum
+
+\usemodule[pstricks]
+
+\usePSTRICKSmodule[pst-barcode]
+
+\startluacode
+plugins.barcodes = { }
+
+function plugins.barcodes.strip(original)
+ local code = string.gsub(original,"%-","")
+ local t = { string.byte(code,1,#code) }
+ if #t >= 12 then
+ local s = 0
+ for i=1,11,2 do
+ s = s + (t[i]-48)
+ end
+ for i=2,12,2 do
+ s = s + 3 * (t[i]-48)
+ end
+ local m = s % 10
+ local c = (m > 0 and (10 - m)) or 0
+ if #t == 13 then
+ local e = ((c == t[13] - 48) and "correct") or "wrong"
+ logs.report("isbn code","code=%s, sum=%s, checksum=%s, modulo=%s, status=%s",original,s,m,c,e)
+ else
+ logs.report("isbn code","code=%s, sum=%s, checksum=%s, modulo=%s",original,s,m,c)
+ code= code .. c
+ end
+ end
+ tex.sprint(code)
+end
+\stopluacode
+
+\startsetups barcode:isbn
+ \scale
+ [width=5cm]
+ {
+ \normalexpanded { \noexpand \setPSTRICKS {
+ \noexpand \pspicture(-4mm,-1mm)(38mm,26mm)
+ \noexpand \psbarcode {
+ \ctxlua{plugins.barcodes.strip("\getvariable{barcode}{code}")}
+ } {
+ includetext guardwhitespace
+ } {
+ ean13
+ }
+ \noexpand \endpspicture
+ }
+ \noexpand \processPSTRICKS }
+ }
+\stopsetups
+
+\def\barcode[#1]%
+ {\bgroup
+ \setvariables[barcode][type=isbn,#1]%
+ \directsetup{barcode:\getvariable{barcode}{type}}%
+ \egroup}
+
+% \usemodule[barcodes]
+%
+% \starttext
+% \startTEXpage
+% \barcode[type=isbn,code=978-94-90688-01-1]
+% \stopTEXpage
+% \stoptext
+
+\endinput
+
diff --git a/tex/context/base/m-pstricks.lua b/tex/context/base/m-pstricks.lua
new file mode 100644
index 000000000..35cae93f6
--- /dev/null
+++ b/tex/context/base/m-pstricks.lua
@@ -0,0 +1,73 @@
+if not modules then modules = { } end modules ['m-pstricks'] = {
+ version = 1.001,
+ comment = "companion to m-pstricks.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- The following will be done when I need ps tricks figures
+-- in large quantities:
+--
+-- + hash graphics and only process them once
+-- + save md5 checksums in tuc file
+--
+-- It's no big deal but has a low priority.
+
+local format, lower, concat, gmatch = string.format, string.lower, table.concat, string.gmatch
+local variables = interfaces.variables
+
+plugins = plugins or { }
+plugins.pstricks = plugins.pstricks or { }
+
+local template = [[
+\starttext
+ \pushcatcodetable
+ \setcatcodetable\texcatcodes
+ \usemodule[pstric]
+ %s
+ \popcatcodetable
+ \startTEXpage
+ \hbox\bgroup
+ \ignorespaces
+ %s
+ \removeunwantedspaces
+ \egroup
+ \obeydepth %% temp hack as we need to figure this out
+ \stopTEXpage
+\stoptext
+]]
+
+local modules = { }
+local graphics = 0
+
+function plugins.pstricks.usemodule(names)
+ for name in gmatch(names,"([^%s,]+)") do
+ modules[#modules+1] = format([[\readfile{%s}{}{}]],name)
+ end
+end
+
+function plugins.pstricks.process(n)
+ graphics = graphics + 1
+ local name = string.format("%s-pstricks-%04i",tex.jobname,graphics)
+ local data = buffers.collect("def-"..n)
+ local tmpfile = name .. ".tmp"
+ local epsfile = name .. ".ps"
+ local pdffile = name .. ".pdf"
+ local modules = concat(modules,"\n")
+ os.remove(epsfile)
+ os.remove(pdffile)
+ io.savedata(tmpfile,format(template,modules,data))
+ os.execute(format("mtxrun --script texexec %s --once --dvips",tmpfile))
+ if lfs.isfile(epsfile) then
+ os.execute(format("ps2pdf %s %s",epsfile,pdffile))
+ -- todo: direct call but not now
+ if lfs.isfile(pdffile) then
+ context.externalfigure( { pdffile }, { object = variables.no } )
+ else
+ logs.report("plugins","pstricks run failed, no pdf file")
+ end
+ else
+ logs.report("plugins","pstricks run failed, no ps file")
+ end
+end
diff --git a/tex/context/base/m-pstric.tex b/tex/context/base/m-pstricks.mkii
index f4be08dbd..384812ecc 100644
--- a/tex/context/base/m-pstric.tex
+++ b/tex/context/base/m-pstricks.mkii
@@ -44,6 +44,12 @@
\catcode`\|=\oldbarcode
+\def\loadpstricksmodule[#1]%
+ {\chardef\oldbarcode\the\catcode`\|
+ \catcode`\|=12
+ \readfile{#1}{}{}%
+ \catcode`\|=\oldbarcode}
+
%D The next piece of code is for John Culleton who suggested to
%D handle \PSTRICKS\ in a similar fashion as \METAPOST, i.e.\
%D using a child process. For the moment there is no support
@@ -111,6 +117,7 @@
\long\def\dostartPSTRICKS[#1]#2\stopPSTRICKS
{\doifelse{\jobsuffix}{dvi} % will some day move to app as switch
{\hbox{#2}}
- {\startTEXapplication[#1]{\usemodule[pstric]}#2\stopTEXapplication}}
+% {\startTEXapplication[#1]{\usemodule[pstric]}#2\stopTEXapplication}}
+ {\startTEXapplication[#1]{}#2\stopTEXapplication}}
\protect \endinput
diff --git a/tex/context/base/m-pstricks.mkiv b/tex/context/base/m-pstricks.mkiv
new file mode 100644
index 000000000..c800ec199
--- /dev/null
+++ b/tex/context/base/m-pstricks.mkiv
@@ -0,0 +1,66 @@
+%D \module
+%D [ file=m-pstricks,
+%D version=2010.03.14,
+%D title=\CONTEXT\ Extra Modules,
+%D subtitle=\PSTRICKS\ Connections,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\ctxloadluafile{m-pstricks}{}
+
+%D \startbuffer
+%D \usePSTRICKSmodule[pst-barcode]
+%D
+%D \startPSTRICKS
+%D \pspicture(-4mm,-1mm)(38mm,26mm)
+%D \psbarcode{9781860742712}{includetext guardwhitespace}{ean13}%
+%D \endpspicture
+%D \stopPSTRICKS
+%D \stopbuffer
+%D
+%D \typebuffer \startlinecorrection \getbuffer \stoplinecorrection
+
+\unprotect
+
+% best we can make a special colors module
+%
+% \let\@unused\plussixteen
+% \let\alloc@ \gobblefivearguments
+%
+% \def\loadpstrickscolors#1%
+% {\pushmacro\dodefinecolor
+% \pushmacro\dodefinepalet
+% \pushmacro\dodefinecolorgroup
+% \def\dodefinecolor[##1][##2]%
+% {\doifassignmentelse{##2}
+% {\getparameters[pstricks][r=0,g=0,b=0,##2]%
+% \expanded{\newrgbcolor{##1}{{\pstricksr} {\pstricksg} {\pstricksb}}}}%
+% {}}%
+% \def\dodefinepalet [##1][##2]{}%
+% \def\dodefinecolorgroup[##1][##2][##3]{}%
+% \writestatus{pstricks}{loading colors from #1}%
+% \input #1 \relax
+% \popmacro\dodefinecolorgroup
+% \popmacro\dodefinepalet
+% \popmacro\dodefinecolor}
+%
+% \input multido \relax
+% \input pstricks \relax
+% \input pst-plot \relax
+%
+% \loadpstrickscolors{colo-rgb}
+
+\definebuffer[PSTRICKS]
+
+\unexpanded\def\processPSTRICKS {\ctxlua{plugins.pstricks.process(\thebuffernumber{PSTRICKS})}}
+\unexpanded\def\usePSTRICKSmodule[#1]{\ctxlua{plugins.pstricks.usemodule("#1")}}
+\unexpanded\def\setPSTRICKS #1{\setbuffer[def-\thebuffernumber{PSTRICKS}]#1\endbuffer}
+
+\let\stopPSTRICKS\processPSTRICKS
+
+\protect \endinput
diff --git a/tex/context/base/m-pstricks.tex b/tex/context/base/m-pstricks.tex
new file mode 100644
index 000000000..28bc9f30f
--- /dev/null
+++ b/tex/context/base/m-pstricks.tex
@@ -0,0 +1,16 @@
+%D \module
+%D [ file=m-pstricks,
+%D version=1997.01.15,
+%D title=\CONTEXT\ Extra Modules,
+%D subtitle=\PSTRICKS\ Connections,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\loadmarkfile{m-pstricks}
+
+\endinput
diff --git a/tex/context/base/m-timing.tex b/tex/context/base/m-timing.tex
index f6b0348c8..f02a90087 100644
--- a/tex/context/base/m-timing.tex
+++ b/tex/context/base/m-timing.tex
@@ -36,7 +36,7 @@
\ctxloadluafile{trac-tim}{}
\startluacode
-local progress = goodies.progress
+local progress = plugins.progress
function progress.show(filename,parameters,nodes,other)
for n, name in pairs(parameters or progress.parameters(filename)) do
@@ -51,16 +51,16 @@ end
% \everyfirstshipout
\startnotmode[no-timing]
- \appendtoks\ctxlua{goodies.progress.store()}\to\everystarttext
- \appendtoks\ctxlua{goodies.progress.store()}\to\everyshipout
- \ctxlua{main.register_stop_actions(function() goodies.progress.save() end)}
+ \appendtoks\ctxlua{plugins.progress.store()}\to\everystarttext
+ \appendtoks\ctxlua{plugins.progress.store()}\to\everyshipout
+ \ctxlua{main.register_stop_actions(function() plugins.progress.save() end)}
\stopnotmode
\def\ShowNamedUsage#1#2#3%
{\setbox\scratchbox\vbox\bgroup\startMPcode
begingroup ; save p, q, b, h, w ;
path p, q, b ; numeric h, w ;
- p := \ctxlua{tex.sprint(goodies.progress.path("#1","#2"))} ;
+ p := \ctxlua{tex.sprint(plugins.progress.path("#1","#2"))} ;
% p := p shifted -llcorner p ;
if bbwidth(p) > 1 :
h := 100 ; w := 2 * h ;
@@ -71,7 +71,7 @@ end
draw b withcolor \MPcolor{usage:frame} ;
draw p withcolor \MPcolor{usage:line} ;
if ("#3" <> "") and ("#3" <> "#2") :
- q := \ctxlua{tex.sprint(goodies.progress.path("#1","#3"))} ;
+ q := \ctxlua{tex.sprint(plugins.progress.path("#1","#3"))} ;
% q := q shifted -llcorner q ;
if bbwidth(q) > 1 :
q := q xstretched w ;
@@ -87,16 +87,16 @@ end
\startlinecorrection
\box\scratchbox \endgraf
\hbox to \scratchdimen{\tttf\strut\detokenize{#2}\hss
- min:\ctxlua{tex.sprint(goodies.progress.bot("#1","\detokenize{#2}"))}, %
- max:\ctxlua{tex.sprint(goodies.progress.top("#1","\detokenize{#2}"))}, %
- pages:\ctxlua{tex.sprint(goodies.progress.pages("#1"))}%
+ min:\ctxlua{tex.sprint(plugins.progress.bot("#1","\detokenize{#2}"))}, %
+ max:\ctxlua{tex.sprint(plugins.progress.top("#1","\detokenize{#2}"))}, %
+ pages:\ctxlua{tex.sprint(plugins.progress.pages("#1"))}%
}%
\stoplinecorrection
\fi}
-\def\LoadUsage #1{\ctxlua{goodies.progress.convert("#1")}}
-\def\ShowUsage #1{\ctxlua{goodies.progress.show("#1",nil,nil,"elapsed_time")}}
-\def\ShowMemoryUsage#1{\ctxlua{goodies.progress.show("#1",nil,{}, "elapsed_time")}}
-\def\ShowNodeUsage #1{\ctxlua{goodies.progress.show("#1",{},nil, "elapsed_time")}}
+\def\LoadUsage #1{\ctxlua{plugins.progress.convert("#1")}}
+\def\ShowUsage #1{\ctxlua{plugins.progress.show("#1",nil,nil,"elapsed_time")}}
+\def\ShowMemoryUsage#1{\ctxlua{plugins.progress.show("#1",nil,{}, "elapsed_time")}}
+\def\ShowNodeUsage #1{\ctxlua{plugins.progress.show("#1",{},nil, "elapsed_time")}}
\endinput
diff --git a/tex/context/base/math-lan.mkiv b/tex/context/base/math-lan.mkiv
index f6cd96220..bcf9cdc13 100644
--- a/tex/context/base/math-lan.mkiv
+++ b/tex/context/base/math-lan.mkiv
@@ -52,7 +52,13 @@
\setupmathlabeltext [\s!en] [tanh=tanh]
\setupmathlabeltext [\s!en] [tan=tan]
-\setupmathlabeltext [\s!pl] [tan=tg]
+\setupmathlabeltext [\s!pl] [tg=tg]
\setupmathlabeltext [\s!pl] [cot=ctg]
+\setupmathlabeltext [\s!pl] [ctg=ctg]
+\setupmathlabeltext [\s!pl] [arcsin=arc\,sin]
+\setupmathlabeltext [\s!pl] [arccos=arc\,cos]
+\setupmathlabeltext [\s!pl] [arctan=arc\,tg]
+\setupmathlabeltext [\s!pl] [arctg=arc\,tg]
+\setupmathlabeltext [\s!pl] [arcctg=arc\,ctg]
\protect \endinput
diff --git a/tex/context/base/math-vfu.lua b/tex/context/base/math-vfu.lua
index c209d52ef..f810087a2 100644
--- a/tex/context/base/math-vfu.lua
+++ b/tex/context/base/math-vfu.lua
@@ -1670,34 +1670,85 @@ mathematics.make_font ( "mathtimes-math", {
} )
mathematics.make_font ( "charter-math", {
- { name = "file:bchr8a", features = "virtualmath", main = true },
+ -- { name = "file:bchr8a", features = "virtualmath", main = true },
+ { name = "file:bchri8a", features = "virtualmath", main = true },
-- { name = "md-chr7m.tfm", vector = "tex-mr" },
{ name = "md-chri7m.tfm", vector = "tex-mi", skewchar=0x7F },
{ name = "md-chri7m.tfm", vector = "tex-it", skewchar=0x7F },
{ name = "md-chr7y.tfm", vector = "tex-sy", skewchar=0x30, parameters = true },
{ name = "md-chr7v.tfm", vector = "tex-ex", extension = true },
+ -- { name = "md-chbma.tfm", vector = "tex-ma" },
+ -- { name = "md-chbmb.tfm", vector = "tex-mb" },
{ name = "msam10.tfm", vector = "tex-ma" },
{ name = "msbm10.tfm", vector = "tex-mb" },
} )
mathematics.make_font ( "garamond-math", {
- { name = "file:ugmr8y", features = "virtualmath", main = true },
+ -- { name = "file:ugmr8a", features = "virtualmath", main = true },
+ { name = "file:ugmri8a", features = "virtualmath", main = true },
-- { name = "md-gmr7m.tfm", vector = "tex-mr" },
{ name = "md-gmri7m.tfm", vector = "tex-mi", skewchar=0x7F },
{ name = "md-gmri7m.tfm", vector = "tex-it", skewchar=0x7F },
{ name = "md-gmr7y.tfm", vector = "tex-sy", skewchar=0x30, parameters = true },
{ name = "md-gmr7v.tfm", vector = "tex-ex", extension = true },
+ -- { name = "md-gmmma.tfm", vector = "tex-ma" },
+ -- { name = "md-gmmmb.tfm", vector = "tex-mb" },
{ name = "msam10.tfm", vector = "tex-ma" },
{ name = "msbm10.tfm", vector = "tex-mb" },
} )
mathematics.make_font ( "utopia-math", {
- { name = "file:putr8y", features = "virtualmath", main = true },
+ -- { name = "file:putr8a", features = "virtualmath", main = true },
+ { name = "file:putri8a", features = "virtualmath", main = true },
-- { name = "md-utr7m.tfm", vector = "tex-mr" },
{ name = "md-utri7m.tfm", vector = "tex-mi", skewchar=0x7F },
{ name = "md-utri7m.tfm", vector = "tex-it", skewchar=0x7F },
{ name = "md-utr7y.tfm", vector = "tex-sy", skewchar=0x30, parameters = true },
{ name = "md-utr7v.tfm", vector = "tex-ex", extension = true },
+ -- { name = "md-utbma.tfm", vector = "tex-ma" },
+ -- { name = "md-utbmb.tfm", vector = "tex-mb" },
+ { name = "msam10.tfm", vector = "tex-ma" },
+ { name = "msbm10.tfm", vector = "tex-mb" },
+} )
+
+mathematics.make_font ( "charter-math", {
+ -- { name = "file:bchr8a", features = "virtualmath", main = true },
+ { name = "file:bchri8a", features = "virtualmath", main = true },
+ -- { name = "md-chr7m.tfm", vector = "tex-mr" },
+ { name = "md-chri7m.tfm", vector = "tex-mi", skewchar=0x7F },
+ { name = "md-chri7m.tfm", vector = "tex-it", skewchar=0x7F },
+ { name = "md-chr7y.tfm", vector = "tex-sy", skewchar=0x30, parameters = true },
+ { name = "md-chr7v.tfm", vector = "tex-ex", extension = true },
+ -- { name = "md-chbma.tfm", vector = "tex-ma" },
+ -- { name = "md-chbmb.tfm", vector = "tex-mb" },
+ { name = "msam10.tfm", vector = "tex-ma" },
+ { name = "msbm10.tfm", vector = "tex-mb" },
+} )
+
+mathematics.make_font ( "garamond-math", {
+ -- { name = "file:ugmr8a", features = "virtualmath", main = true },
+ { name = "file:ugmri8a", features = "virtualmath", main = true },
+ -- { name = "md-gmr7m.tfm", vector = "tex-mr" },
+ { name = "md-gmri7m.tfm", vector = "tex-mi", skewchar=0x7F },
+ { name = "md-gmri7m.tfm", vector = "tex-it", skewchar=0x7F },
+ { name = "md-gmr7y.tfm", vector = "tex-sy", skewchar=0x30, parameters = true },
+ { name = "md-gmr7v.tfm", vector = "tex-ex", extension = true },
+ -- { name = "md-gmmma.tfm", vector = "tex-ma" },
+ -- { name = "md-gmmmb.tfm", vector = "tex-mb" },
+ { name = "msam10.tfm", vector = "tex-ma" },
+ { name = "msbm10.tfm", vector = "tex-mb" },
+} )
+
+mathematics.make_font ( "utopia-math", {
+ -- { name = "file:putr8a", features = "virtualmath", main = true },
+ { name = "file:putri8a", features = "virtualmath", main = true },
+ -- { name = "md-utr7m.tfm", vector = "tex-mr" },
+ { name = "md-utri7m.tfm", vector = "tex-mi", skewchar=0x7F },
+ { name = "md-utri7m.tfm", vector = "tex-it", skewchar=0x7F },
+ { name = "md-utr7y.tfm", vector = "tex-sy", skewchar=0x30, parameters = true },
+ { name = "md-utr7v.tfm", vector = "tex-ex", extension = true },
+ -- { name = "md-utbma.tfm", vector = "tex-ma" },
+ -- { name = "md-utbmb.tfm", vector = "tex-mb" },
{ name = "msam10.tfm", vector = "tex-ma" },
{ name = "msbm10.tfm", vector = "tex-mb" },
} )
@@ -1715,97 +1766,6 @@ mathematics.make_font ( "hvmath-math", {
-- the lucida mess
---~ fonts.enc.math["lbr-ma"] = {
---~ [0x000A5] = 0x03, -- yen
---~ [0x000B7] = 0xE1, -- centerdot
---~ [0x000F0] = 0x03, -- eth
---~ [0x00127] = 0x1B, -- hbar
---~ [0x003DC] = 0x03, -- digamma
---~ [0x003F6] = 0x03, -- backepsilon
---~ [0x0219A] = 0x32, -- nleftarrow
---~ [0x0219B] = 0x33, -- nrightarrow
---~ [0x0219E] = 0x23, -- twoheadleftarrow
---~ [0x021A0] = 0x25, -- twoheadrightarrow
---~ [0x021A2] = 0x28, -- leftarrowtail
---~ [0x021A3] = 0x29, -- rightarrowtail
---~ [0x021A6] = 0x2C, -- mapsto
---~ [0x021A9] = 0x3C, -- hookleftarrow
---~ [0x021AA] = 0x3E, -- hookrightarrow
---~ [0x021AB] = 0x3F, -- looparrowleft
---~ [0x021AC] = 0x40, -- looparrowright
---~ [0x021AD] = 0x91, -- leftrightsquigarrow
---~ [0x021AE] = 0x34, -- nleftrightarrow
---~ [0x021B0] = 0x7B, -- Lsh
---~ [0x021B1] = 0x7D, -- Rsh
---~ [0x021B6] = 0x87, -- curvearrowleft
---~ [0x021B7] = 0x88, -- curvearrowright
---~ [0x021BA] = 0x8C, -- circlearrowright
---~ [0x021BB] = 0x8B, -- circlearrowleft
---~ [0x021BF] = 0x76, -- upharpoonleft
---~ [0x021C2] = 0x77, -- downharpoonright
---~ [0x021C3] = 0x78, -- downharpoonleft
---~ [0x021C4] = 0x6D, -- rightleftarrows
---~ [0x021C6] = 0x6E, -- leftrightarrows
---~ [0x021C7] = 0x71, -- leftleftarrows
---~ [0x021C8] = 0x72, -- upuparrows
---~ [0x021C9] = 0x73, -- rightrightarrows
---~ [0x021CA] = 0x74, -- downdownarrows
---~ [0x021CB] = 0x79, -- leftrightharpoons
---~ [0x021CC] = 0x7A, -- rightleftharpoons
---~ [0x021CD] = 0x66, -- nLeftarrow
---~ [0x021CE] = 0x67, -- nLeftrightarrow
---~ [0x021CF] = 0x68, -- nRightarrow
---~ [0x021DA] = 0x6A, -- Lleftarrow
---~ [0x021DB] = 0x6C, -- Rrightarrow
---~ [0x021E0] = 0x38, -- dashleftarrow
---~ [0x02204] = 0x20, -- nexists
---~ [0x02226] = 0xF7, -- nparallel
---~ [0x02241] = 0x96, -- nsim
---~ [0x02268] = 0xDC, -- lneqq
---~ [0x02269] = 0xDE, -- gneqq
---~ [0x0226E] = 0x9A, -- nless
---~ [0x0226F] = 0x9B, -- ngtr
---~ [0x02270] = 0x9C, -- nleq
---~ [0x02271] = 0x9D, -- ngeq
---~ [0x02280] = 0xE5, -- nprec
---~ [0x02281] = 0xE6, -- nsucc
---~ [0x02288] = 0xC8, -- nsubseteq
---~ [0x02289] = 0xC9, -- nsupseteq
---~ [0x0228A] = 0xCC, -- subsetneq
---~ [0x0228B] = 0xCD, -- supsetneq
---~ [0x022AC] = 0xF8, -- nvdash
---~ [0x022AD] = 0xFA, -- nvDash
---~ [0x022AE] = 0xF9, -- nVdash
---~ [0x022AF] = 0xFB, -- nVDash
---~ [0x022BA] = 0x03, -- intercal
---~ [0x022D4] = 0xF3, -- pitchfork
---~ [0x022E6] = 0xE0, -- lnsim
---~ [0x022E7] = 0xE2, -- gnsim
---~ [0x022E8] = 0xEB, -- precnsim
---~ [0x022E9] = 0xEC, -- succnsim
---~ [0x022EA] = 0xF0, -- ntriangleright
---~ [0x022EB] = 0xEF, -- ntriangleleft
---~ [0x022EC] = 0xF1, -- ntrianglelefteq
---~ [0x022ED] = 0xF2, -- ntrianglerighteq
---~ [0x0231C] = 0x5B, -- ulcorner
---~ [0x0231D] = 0x5C, -- urcorner
---~ [0x0231E] = 0x5D, -- llcorner
---~ [0x0231F] = 0x5E, -- lrcorner
---~ [0x025A2] = 0x03, -- blacksquare
---~ [0x02605] = 0xAB, -- bigstar
---~ [0x02713] = 0xAC, -- checkmark
---~ [0x029EB] = 0x09, -- blacklozenge
---~ [0x02A87] = 0xDA, -- lneq
---~ [0x02A89] = 0xE4, -- lnapprox
---~ [0x02A8A] = 0xE3, -- gnapprox
---~ [0x02AB5] = 0xE9, -- precneqq
---~ [0x02AB6] = 0xEA, -- succneqq
---~ [0x02AB9] = 0xED, -- precnapprox
---~ [0x02ABA] = 0xEE, -- succnapprox
---~ [0x02ACB] = 0xCE, -- subsetneqq
---~ [0x02ACC] = 0xCF, -- supsetneqq
---~ }
-
fonts.enc.math["lbr-ma"] = {
[0x025CB] = 0x00, -- circle
[0x025CF] = 0x01, -- blackcircle
@@ -2056,12 +2016,6 @@ fonts.enc.math["lbr-mb"] = {
[0x1D718] = 0x9B, -- varkappa
}
---~ fonts.enc.math["lbr-mi"] = {
---~ ["0x00127"] = 0x9D, -- hbar
---~ ["0x003D1"] = 0x02, -- varTheta
---~ ["0x020D7"] = 0x7E, -- vec
---~ }
-
fonts.enc.math["lbr-sy"] = {
[0x021CB] = 0x8D, -- leftrightharpoons
[0x021CC] = 0x8E, -- rightleftharpoons
@@ -2109,18 +2063,6 @@ fonts.enc.math["lbr-sy"] = {
fonts.enc.math["lbr-sy"] = table.merged(fonts.enc.math["tex-sy"],fonts.enc.math["lbr-sy"])
---~ fonts.enc.math["lbr-rm"] = {
---~ [0x00060] = 0x12, -- grave
---~ [0x000A8] = 0x7F, -- ddot
---~ [0x000AF] = 0x16, -- bar
---~ [0x000B4] = 0x13, -- acute
---~ [0x002C6] = 0x5E, -- hat
---~ [0x002C7] = 0x14, -- check
---~ [0x002D8] = 0x15, -- breve
---~ [0x002D9] = 0x05, -- dot
---~ [0x002DC] = 0x7E, -- tilde
---~ }
-
mathematics.make_font ( "lucida-math", {
{ name = "file:lbr.afm", features = "virtualmath", main = true },
{ name = "hlcrim.tfm", vector = "tex-mi", skewchar=0x7F },
diff --git a/tex/context/base/mlib-pps.lua b/tex/context/base/mlib-pps.lua
index c1e1b71c0..d1e1e2e4a 100644
--- a/tex/context/base/mlib-pps.lua
+++ b/tex/context/base/mlib-pps.lua
@@ -13,6 +13,7 @@ local format, gmatch, concat, round, match = string.format, string.gmatch, table
local sprint = tex.sprint
local tonumber, type = tonumber, type
local lpegmatch = lpeg.match
+local texbox = tex.box
local starttiming, stoptiming = statistics.starttiming, statistics.stoptiming
@@ -426,11 +427,10 @@ metapost.textext_current = metapost.first_box
metapost.multipass = false
function metapost.free_boxes() -- todo: mp direct list ipv box
- local tb = tex.box
for i = metapost.first_box,metapost.last_box do
- local b = tb[i]
+ local b = texbox[i]
if b then
- tb[i] = nil -- no node.flush_list(b) needed, else double free error
+ texbox[i] = nil -- no node.flush_list(b) needed, else double free error
else
break
end
@@ -480,7 +480,8 @@ function metapost.specials.ts(specification,object,result,flusher)
metapost.textext_current = metapost.first_box + n - 1
end
local b = metapost.textext_current
- sprint(ctxcatcodes,format("\\MPLIBgettextscaled{%s}{%s}{%s}",b, metapost.sxsy(tex.wd[b],tex.ht[b],tex.dp[b])))
+ local box = texbox[b]
+ sprint(ctxcatcodes,format("\\MPLIBgettextscaled{%s}{%s}{%s}",b, metapost.sxsy(box.width,box.height,box.depth)))
result = { "Q" }
return object, result
end
@@ -697,8 +698,10 @@ function metapost.text_texts_data()
if trace_textexts then
logs.report("metapost","passed data: order %s, box %s",n,i)
end
- if tex.box[i] then
- t[#t+1] = format("_tt_w_[%i]:=%f;_tt_h_[%i]:=%f;_tt_d_[%i]:=%f;", n,tex.wd[i]/factor, n,tex.ht[i]/factor, n,tex.dp[i]/factor)
+ local box = texbox[i]
+ if box then
+ t[#t+1] = format("_tt_w_[%i]:=%f;_tt_h_[%i]:=%f;_tt_d_[%i]:=%f;",
+ n,box.width/factor,n,box.height/factor,n,box.depth/factor)
else
break
end
diff --git a/tex/context/base/mult-ini.lua b/tex/context/base/mult-ini.lua
index a1dd5ecfd..d876e98b5 100644
--- a/tex/context/base/mult-ini.lua
+++ b/tex/context/base/mult-ini.lua
@@ -8,6 +8,7 @@ if not modules then modules = { } end modules ['mult-ini'] = {
local format, gmatch, gsub = string.format, string.gmatch, string.gsub
local lpegmatch = lpeg.match
+local serialize = table.serialize
interfaces = interfaces or { }
interfaces.messages = interfaces.messages or { }
@@ -74,3 +75,27 @@ end
function interfaces.setconstant(constant,given)
constants[given] = constant
end
+
+-- it's nicer to have numbers as reference than a hash
+
+interfaces.cachedsetups = interfaces.cachedsetups or { }
+interfaces.hashedsetups = interfaces.hashedsetups or { }
+
+storage.register("interfaces.cachedsetups", interfaces.cachedsetups, "interfaces.cachedsetups")
+storage.register("interfaces.hashedsetups", interfaces.hashedsetups, "interfaces.hashedsetups")
+
+local cachedsetups = interfaces.cachedsetups
+local hashedsetups = interfaces.hashedsetups
+
+function interfaces.cachesetup(t)
+ local hash = serialize(t)
+ local done = hashedsetups[hash]
+ if done then
+ return cachedsetups[done]
+ else
+ done = #cachedsetups + 1
+ cachedsetups[done] = t
+ hashedsetups[hash] = done
+ return t
+ end
+end
diff --git a/tex/context/base/mult-sys.tex b/tex/context/base/mult-sys.tex
index 72b0bce5d..5a718cc60 100644
--- a/tex/context/base/mult-sys.tex
+++ b/tex/context/base/mult-sys.tex
@@ -64,6 +64,7 @@
\definesystemconstant {spanish} \definesystemconstant {es}
\definesystemconstant {swedish} \definesystemconstant {sv}
\definesystemconstant {turkish} \definesystemconstant {tr}
+\definesystemconstant {turkmen} \definesystemconstant {tk}
\definesystemconstant {gbenglish} \definesystemconstant {gb} \definesystemconstant {ukenglish} \definesystemconstant {uk}
\definesystemconstant {usenglish} \definesystemconstant {us}
\definesystemconstant {ukrainian} \definesystemconstant {ua}
@@ -496,6 +497,7 @@
\definesystemvariable {fl} % Floats
\definesystemvariable {fm} % ForMules
\definesystemvariable {fn} % subformulas
+\definesystemvariable {fo} % xml FO
\definesystemvariable {fp} % FilegroeP
\definesystemvariable {fq} % Features
\definesystemvariable {fr} % ForM
diff --git a/tex/context/base/node-aux.lua b/tex/context/base/node-aux.lua
new file mode 100644
index 000000000..8bbfbe918
--- /dev/null
+++ b/tex/context/base/node-aux.lua
@@ -0,0 +1,56 @@
+if not modules then modules = { } end modules ['node-aux'] = {
+ version = 1.001,
+ comment = "companion to node-spl.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local gsub, format = string.gsub, string.format
+
+local free_node = node.free
+local hpack_nodes = node.hpack
+local node_fields = node.fields
+
+function nodes.repack_hlist(list,...)
+ local temp, b = hpack_nodes(list,...)
+ list = temp.list
+ temp.list = nil
+ free_node(temp)
+ return list, b
+end
+
+function nodes.merge(a,b)
+ if a and b then
+ local t = node.fields(a.id)
+ for i=3,#t do
+ local name = t[i]
+ a[name] = b[name]
+ end
+ end
+ return a, b
+end
+
+local fields, whatsits = { }, { }
+
+for k, v in pairs(node.types()) do
+ if v == "whatsit" then
+ fields[k], fields[v] = { }, { }
+ for kk, vv in pairs(node.whatsits()) do
+ local f = node_fields(k,kk)
+ whatsits[kk], whatsits[vv] = f, f
+ end
+ else
+ local f = node_fields(k)
+ fields[k], fields[v] = f, f
+ end
+end
+
+nodes.fields, nodes.whatsits = fields, whatsits
+
+function nodes.info(n)
+ logs.report(format("%14s","type"),node.type(n.id))
+ for k,v in pairs(fields[n.id]) do
+ logs.report(format("%14s",v),gsub(gsub(tostring(n[v]),"%s+"," "),"node ",""))
+ end
+end
diff --git a/tex/context/base/node-ini.lua b/tex/context/base/node-ini.lua
index 741e53d6b..e21fc70e4 100644
--- a/tex/context/base/node-ini.lua
+++ b/tex/context/base/node-ini.lua
@@ -212,7 +212,7 @@ end
nodes.count = count
--- new
+-- new, will move
function attributes.ofnode(n)
local a = n.attr
diff --git a/tex/context/base/node-ini.mkiv b/tex/context/base/node-ini.mkiv
index 0659539bc..227533413 100644
--- a/tex/context/base/node-ini.mkiv
+++ b/tex/context/base/node-ini.mkiv
@@ -18,6 +18,7 @@
\newcount\filterstate \filterstate\plusone
\registerctxluafile{node-ini}{1.001}
+\registerctxluafile{node-aux}{1.001}
\registerctxluafile{node-tst}{1.001}
\registerctxluafile{node-tra}{1.001} % we might split it off (module)
\registerctxluafile{node-seq}{1.001} % we might generalize this one
diff --git a/tex/context/base/node-res.lua b/tex/context/base/node-res.lua
index 5398d8433..47f0c8d60 100644
--- a/tex/context/base/node-res.lua
+++ b/tex/context/base/node-res.lua
@@ -120,6 +120,48 @@ function nodes.latelua(code)
return n
end
+--[[
+<p>At some point we ran into a problem that the glue specification
+of the zeropoint dimension was overwritten when adapting a glue spec
+node. This is a side effect of glue specs being shared. After a
+couple of hours tracing and debugging Taco and I came to the
+conclusion that it made no sense to complicate the spec allocator
+and settled on a writable flag. This all is a side effect of the
+fact that some glues use reserved memory slots (with the zeropoint
+glue being a noticeable one). So, next we wrap this into a function
+and hide it for the user. And yes, LuaTeX now gives a warning as
+well.</p>
+]]--
+
+if tex.luatexversion > 51 then
+
+ function nodes.writable_spec(n)
+ local spec = n.spec
+ if not spec then
+ spec = copy_node(glue_spec)
+ n.spec = spec
+ elseif not spec.writable then
+ spec = copy_node(spec)
+ n.spec = spec
+ end
+ return spec
+ end
+
+else
+
+ function nodes.writable_spec(n)
+ local spec = n.spec
+ if not spec then
+ spec = copy_node(glue_spec)
+ else
+ spec = copy_node(spec)
+ end
+ n.spec = spec
+ return spec
+ end
+
+end
+
local cache = { }
function nodes.usernumber(num)
diff --git a/tex/context/base/node-rul.lua b/tex/context/base/node-rul.lua
index f217c3a97..17b7c7658 100644
--- a/tex/context/base/node-rul.lua
+++ b/tex/context/base/node-rul.lua
@@ -13,26 +13,28 @@ local disc = node.id("disc")
local rule = node.id("rule")
function nodes.strip_range(first,last) -- todo: dir
- local current = first
- while current ~= last do
- local id = current.id
- if id == glyph or id == disc then
---~ if id == glyph or id == rule or id == disc then
- first = current
- break
- else
- current = current.next
+ if first and last then -- just to be sure
+ local current = first
+ while current and current ~= last do
+ local id = current.id
+ if id == glyph or id == disc then
+ --~ if id == glyph or id == rule or id == disc then
+ first = current
+ break
+ else
+ current = current.next
+ end
end
- end
- local current = last
- while current ~= first do
- local id = current.id
---~ if id == glyph or id == rule or id == disc then
- if id == glyph or id == disc then
- last = current
- break
- else
- current = current.prev
+ local current = last
+ while current and current ~= first do
+ local id = current.id
+ --~ if id == glyph or id == rule or id == disc then
+ if id == glyph or id == disc then
+ last = current
+ break
+ else
+ current = current.prev
+ end
end
end
return first, last
@@ -169,6 +171,7 @@ function nodes.rules.define(settings)
end
local function flush_ruled(head,f,l,d,level,parent,strip) -- not that fast but acceptable for this purpose
+-- check for f and l
local r, m
if true then
f, l = strip_range(f,l)
diff --git a/tex/context/base/node-ser.lua b/tex/context/base/node-ser.lua
index 95b08a4d0..e632e92da 100644
--- a/tex/context/base/node-ser.lua
+++ b/tex/context/base/node-ser.lua
@@ -196,6 +196,8 @@ local function serialize(root,name,handle,depth,m)
else
handle(format("%s %s=%q,",depth,key(k),v))
end
+ elseif t == "boolean" then
+ handle(format("%s %s=%q,",depth,key(k),tostring(v)))
elseif v then -- userdata or table
serialize(v,k,handle,depth,m+1)
end
diff --git a/tex/context/base/node-tra.lua b/tex/context/base/node-tra.lua
index 39ff32209..83340331b 100644
--- a/tex/context/base/node-tra.lua
+++ b/tex/context/base/node-tra.lua
@@ -333,7 +333,8 @@ function nodes.tosequence(start,stop,compact)
if start then
local t = { }
while start do
- if start.id == glyph then
+ local id = start.id
+ if id == glyph then
local c = start.char
if compact then
if start.components then
@@ -344,11 +345,13 @@ function nodes.tosequence(start,stop,compact)
else
t[#t+1] = format("U+%04X:%s",c,utfchar(c))
end
+ elseif id == whatsit and start.subtype == 6 or start.subtype == 7 then
+ t[#t+1] = "[" .. start.dir .. "]"
else
if compact then
t[#t+1] = "[]"
else
- t[#t+1] = match(tostring(start),": (%S+)")
+ t[#t+1] = node_type(id)
end
end
if start == stop then
diff --git a/tex/context/base/pack-rul.lua b/tex/context/base/pack-rul.lua
index 9cbb9b2ca..378167c97 100644
--- a/tex/context/base/pack-rul.lua
+++ b/tex/context/base/pack-rul.lua
@@ -10,16 +10,16 @@ if not modules then modules = { } end modules ['pack-rul'] = {
<p>An explanation is given in the history document <t>mk</t>.</p>
--ldx]]--
-local texdimen, texcount, texbox, texwd = tex.dimen, tex.count, tex.box, tex.wd
+local texdimen, texcount, texbox = tex.dimen, tex.count, tex.box
local hpack, free, copy, traverse_id = node.hpack, node.free, node.copy_list, node.traverse_id
function commands.doreshapeframedbox(n)
- local noflines, lastlinelength = 0, 0
- if texwd[n] ~= 0 then
- local list = texbox[n].list
+ local noflines, lastlinelength, box = 0, 0, texbox[n]
+ if box.width ~= 0 then
+ local list = box.list
if list then
local width, done = 0, false
- for h in traverse_id('hlist',list) do
+ for h in traverse_id('hlist',list) do -- no dir etc needed
local l = h.list
if l then
done = true
@@ -37,14 +37,14 @@ function commands.doreshapeframedbox(n)
local l = h.list
if l then
-- if h.width ~= width then -- else no display math handling (uses shift)
- h.list = hpack(l,width,'exactly')
+ h.list = hpack(l,width,'exactly',h.dir)
h.shift = 0 -- needed for display math
h.width = width
-- end
end
end
end
- texwd[n] = width
+ box.width = width
end
end
end
diff --git a/tex/context/base/page-app.mkiv b/tex/context/base/page-app.mkiv
index e5c149aa0..90abf0898 100644
--- a/tex/context/base/page-app.mkiv
+++ b/tex/context/base/page-app.mkiv
@@ -96,16 +96,16 @@
\presetlocalframed[\??tg]
-\def\setupTEXpage
+\unexpanded\def\setupTEXpage
{\dodoubleargument\getparameters[\??tg]}
-\def\startTEXpage
+\unexpanded\def\startTEXpage
{\dosingleempty\dostartTEXpage}
\def\dostartTEXpage[#1]%
{\dostartfittingpage[\??tg][#1]\gobblespacetokens}
-\def\stopTEXpage
+\unexpanded\def\stopTEXpage
{\removelastspace
\dostopfittingpage}
@@ -127,14 +127,14 @@
%D
%D maybe I should support stream=yes in framed.
-\def\startTEXstream
+\unexpanded\def\startTEXstream
{\dosingleempty\dostartTEXstream}
\def\dostartTEXstream[#1]%
{\page
\defineoutputstream[tex]%
\enableoutputstream[tex]%
- \def\stopTEXstream
+ \unexpanded\def\stopTEXstream
{\disableoutputstream
\startTEXpage
\outputstreamunvbox[tex]%
diff --git a/tex/context/base/page-lin.lua b/tex/context/base/page-lin.lua
index facec7911..444210428 100644
--- a/tex/context/base/page-lin.lua
+++ b/tex/context/base/page-lin.lua
@@ -8,15 +8,19 @@ if not modules then modules = { } end modules ['page-lin'] = {
-- experimental
+local trace_numbers = false trackers.register("lines.numbers", function(v) trace_numbers = v end)
+
local format = string.format
local texsprint, texwrite, texbox = tex.sprint, tex.write, tex.box
local ctxcatcodes = tex.ctxcatcodes
local variables = interfaces.variables
-nodes = nodes or { }
-nodes.lines = nodes.lines or { }
-nodes.lines.data = nodes.lines.data or { } -- start step tag
+nodes = nodes or { }
+nodes.lines = nodes.lines or { }
+nodes.lines.data = nodes.lines.data or { } -- start step tag
+
+storage.register("lines/data", nodes.lines.data, "nodes.lines.data")
-- if there is demand for it, we can support multiple numbering streams
-- and use more than one attibute
@@ -37,6 +41,7 @@ local traverse = node.traverse
local copy_node = node.copy
local data = nodes.lines.data
+local last = #data
nodes.lines.scratchbox = nodes.lines.scratchbox or 0
@@ -99,20 +104,35 @@ function filters.line.linenumber(data) -- raw
texwrite(data.entries.linenumber or "0")
end
-
--- boxed variant
+-- boxed variant, todo: use number mechanism
nodes.lines.boxed = { }
+-- todo: cache setups, and free id no longer used
+-- use interfaces.cachesetup(t)
+
function nodes.lines.boxed.register(configuration)
- data[#data+1] = configuration
- return #data
+ last = last + 1
+ data[last] = configuration
+ if trace_numbers then
+ logs.report("lines","registering setup %s",last)
+ end
+ return last
end
+
function nodes.lines.boxed.setup(n,configuration)
local d = data[n]
if d then
- for k,v in pairs(configuration) do d[k] = v end
+ if trace_numbers then
+ logs.report("lines","updating setup %s",n)
+ end
+ for k,v in pairs(configuration) do
+ d[k] = v
+ end
else
+ if trace_numbers then
+ logs.report("lines","registering setup %s (br)",n)
+ end
data[n] = configuration
end
return n
@@ -123,10 +143,14 @@ local leftskip = nodes.leftskip
local function check_number(n,a,skip) -- move inline
local d = data[a]
if d then
- local s = d.start
+ local s = d.start or 1
current_list[#current_list+1] = { n, s }
if not skip and s % d.step == 0 then
- texsprint(ctxcatcodes, format("\\makenumber{%s}{%s}{%s}{%s}{%s}\\endgraf", d.tag or "", s, n.shift, n.width, leftskip(n.list)))
+ local tag = d.tag or ""
+ texsprint(ctxcatcodes, format("\\makenumber{%s}{%s}{%s}{%s}{%s}\\endgraf", tag, s, n.shift, n.width, leftskip(n.list)))
+ if trace_numbers then
+ logs.report("numbers","making number %s for setup %s: %s (%s)",#current_list,a,s,d.continue or "no")
+ end
else
texsprint(ctxcatcodes, "\\skipnumber\\endgraf")
end
@@ -139,9 +163,6 @@ function nodes.lines.boxed.stage_one(n)
local head = texbox[n]
if head then
local list = head.list
- --~ while list.id == vlist and not list.next do
- --~ list = list.list
- --~ end
local last_a, skip = nil, false
for n in traverse_id(hlist,list) do -- attr test here and quit as soon as zero found
if n.height == 0 and n.depth == 0 then
@@ -178,116 +199,11 @@ function nodes.lines.boxed.stage_two(n,m)
for l in traverse_id(hlist,texbox[m].list) do
t[#t+1] = copy_node(l)
end
- for j=1,#current_list do
- local l = current_list[j]
- local n, m = l[1], l[2]
- i = i + 1
- t[i].next = n.list
- n.list = t[i]
+ for i=1,#current_list do
+ local li = current_list[i]
+ local n, m, ti = li[1], li[2], t[i]
+ ti.next, n.list = n.list, ti
resolve(n,m)
end
end
end
-
--- flow variant
---
--- it's too hard to make this one robust, so for the moment it's not
--- available; todo: line refs
-
-if false then
-
- nodes.lines.flowed = { }
-
- function nodes.lines.flowed.prepare(tag)
- for i=1,#data do -- ??
- texsprint(ctxcatcodes,format("\\ctxlua{nodes.lines.flowed.prepare_a(%s)}\\ctxlua{nodes.lines.flowed.prepare_b(%s)}",i,i))
- end
- end
-
- function nodes.lines.flowed.prepare_a(i)
- local d = data[i]
- local p = d.present
- if p and p < chunksize then
- local b = nodes.lines.scratchbox
- texsprint(ctxcatcodes, format("{\\forgetall\\global\\setbox%s=\\vbox{\\unvbox%s\\relax\\offinterlineskip", b, b))
- while p < chunksize do
- texsprint(ctxcatcodes, format("\\mkmaketextlinenumber{%s}{%s}\\endgraf",d.start,1))
- p = p + 1
- d.start = d.start + d.step
- end
- d.present = p
- texsprint(ctxcatcodes, "}}")
- end
- end
-
- function nodes.lines.flowed.prepare_b(i)
- local d = data[i]
- local b = nodes.lines.scratchbox
- local l = texbox[b]
- if l then
- l = l.list
- local n = d.numbers
- while l do
- if l.id == hlist then
- local m = copy_node(l)
- m.next = nil
- if n then
- n.next = m
- else
- d.numbers = m
- end
- n = m
- end
- l = l.next
- end
- end
- tex.box[b] = nil
- end
-
- function nodes.lines.flowed.cleanup(i)
- if i then
- node.flush_list(data[i].numbers)
- else
- for i=1,#data do
- node.flush_list(data[i].numbers)
- end
- end
- end
-
- local function check_number(n,a)
- local d = data[a]
- if d then
- local m = d.numbers
- if m then
- d.numbers = m.next
- m.next = n.list
- n.list = m
- d.present = d.present - 1
- end
- end
- end
-
- function nodes.lines.flowed.apply(head)
- for n in node.traverse(head) do
- local id = n.id
- if id == hlist then
- if n.height == 0 and n.depth == 0 then
- -- skip funny hlists
- else
- local a = has_attribute(n,line_number)
- if a and a > 0 then
- if has_attribute(n,display_math) then
- if nodes.is_display_math(n) then
- check_number(n,a)
- end
- else
- check_number(n,a)
- end
- end
- end
- end
- end
- return head, true
- end
-
-end
diff --git a/tex/context/base/page-lin.mkiv b/tex/context/base/page-lin.mkiv
index 2e3703eae..1cbf649dd 100644
--- a/tex/context/base/page-lin.mkiv
+++ b/tex/context/base/page-lin.mkiv
@@ -70,34 +70,37 @@
\def\mkdoprocessboxcontents #1{\mkaddtextlinenumbers{#1}\plusone \plusone}
\def\mkdoprocesscolumncontents#1{\mkaddtextlinenumbers{#1}\currentcolumn\nofcolumns}
+\def\mklinenumberparameters
+ {continue = "\linenumberparameter\c!continue",
+ start = \linenumberparameter\c!start,
+ step = \linenumberparameter\c!step,
+ method = "\linenumberparameter\c!method",
+ tag = "\currentlinenumbering"}
+
+\def\mklinenumberupdateparameters
+ {continue = "\linenumberparameter\c!continue"}
+
\def\mkdefinetextlinenumbering
- {\setxvalue{ln:c:\currentlinenumbering}{\number\ctxlua{tex.sprint(nodes.lines.boxed.register({
- start = \linenumberparameter\c!start,
- step = \linenumberparameter\c!step,
- method = "\linenumberparameter\c!method",
- tag = "\currentlinenumbering",
- }))}}}
-
-\def\mkstarttextlinenumbering#1#2%
+ {\setxvalue{ln:c:\currentlinenumbering}{\number\ctxlua{tex.sprint(nodes.lines.boxed.register({\mklinenumberparameters}))}}}
+
+\def\mkupdatetextlinenumbering
+ {\ctxlua{nodes.lines.boxed.setup(\getvalue{ln:c:\currentlinenumbering},{\mklinenumberupdateparameters})}}
+
+\def\mkstarttextlinenumbering#1#2% always when assignment
{\globallet\mkprocesspagecontents \mkdoprocesspagecontents
\globallet\mkprocesscolumncontents\mkdoprocesscolumncontents
\global\settrue\boxcontentneedsprocessing % see core-rul.mkiv
\edef\currentlinenumbering{#1}%
\ifcase#2\relax
- % continue
+ \mkupdatetextlinenumbering % continue
\or
- \mkdefinetextlinenumbering % restart
+ \mkdefinetextlinenumbering % only when assignment
\fi
\attribute\linenumberattribute\getvalue{ln:c:\currentlinenumbering}\relax}
\def\mksetuptextlinenumbering
{\ifcsname ln:c:\currentlinenumbering\endcsname
- \expanded{\ctxlua{nodes.lines.boxed.setup(\getvalue{ln:c:\currentlinenumbering},{
- start = \linenumberparameter\c!start,
- step = \linenumberparameter\c!step,
- method = "\linenumberparameter\c!method",
- tag = "\currentlinenumbering"
- })}}%
+ \ctxlua{nodes.lines.boxed.setup(\getvalue{ln:c:\currentlinenumbering},{\mklinenumberparameters})}%
\fi}
\def\mkstoptextlinenumbering
@@ -172,7 +175,7 @@
\c!start=1,
\c!step=1,
\c!method=\v!first,
- \c!continue=v!no,
+ \c!continue=\v!no,
\c!location=\v!left,
\c!style=,
\c!color=,
@@ -211,24 +214,52 @@
\expandafter\chardef\csname\??rn:a:\v!flushright\endcsname \plustwo
\expandafter\chardef\csname\??rn:a:\v!auto \endcsname \plusfive
+% \def\dostartlinenumbering[#1][#2]% todo: c!continue
+% {\begingroup
+% \chardef\linenumbermode\plusone
+% \ifsecondargument
+% \def\currentlinenumbering{#1}%
+% \doifnumberelse{#2}% downward compatible
+% {\setvalue{\??rn#1\c!start}{#2}}%
+% {\doif{#2}\v!continue{\chardef\linenumbermode\zerocount}}%
+% \else\iffirstargument
+% \doifnumberelse{#1}% downward compatible
+% {\let\currentlinenumbering\empty
+% \setvalue{\??rn\c!start}{#1}}%
+% {\doifelse{#1}\v!continue
+% {\let\currentlinenumbering\empty
+% \chardef\linenumbermode\zerocount}
+% {\def\currentlinenumbering{#1}}}%
+% \fi\fi
+% \doif{\linenumberparameter\c!continue}\v!yes
+% {\chardef\linenumbermode\zerocount}%
+% \numberinglinestrue
+% \the\beforeeverylinenumbering
+% \mkstarttextlinenumbering\currentlinenumbering\linenumbermode}
+
\def\dostartlinenumbering[#1][#2]% todo: c!continue
{\begingroup
\chardef\linenumbermode\plusone
\ifsecondargument
\def\currentlinenumbering{#1}%
- \doifnumberelse{#2}% downward compatible
- {\setvalue{\??rn#1\c!start}{#2}}%
- {\doif{#2}\v!continue{\chardef\linenumbermode\zerocount}}%
+ \doifassignmentelse{#2}
+ {\getparameters[\??rn\currentlinenumbering][#2]}
+ {\doifnumberelse{#2}% downward compatible
+ {\setvalue{\??rn#1\c!start}{#2}}%
+ {\doif{#2}\v!continue
+ {\getparameters[\??rn\currentlinenumbering][\c!continue=\v!yes]%
+ \chardef\linenumbermode\zerocount}}}%
\else\iffirstargument
\doifnumberelse{#1}% downward compatible
{\let\currentlinenumbering\empty
\setvalue{\??rn\c!start}{#1}}%
{\doifelse{#1}\v!continue
{\let\currentlinenumbering\empty
+ \getparameters[\??rn\currentlinenumbering][\c!continue=\v!yes]%
\chardef\linenumbermode\zerocount}
{\def\currentlinenumbering{#1}}}%
\fi\fi
- \doifelse{\linenumberparameter\c!continue}\v!yes
+ \doif{\linenumberparameter\c!continue}\v!yes
{\chardef\linenumbermode\zerocount}%
\numberinglinestrue
\the\beforeeverylinenumbering
@@ -450,33 +481,3 @@
{\in[lr:b:#1]--\in[lr:e:#1]}}
\protect \endinput
-
-\iffalse % \iftrue eventually we will do it like ...
-
- \appendtoks\ctxlua{nodes.lines.flowed.prepare()}\to\everyshipout
- \appendtoks\ctxlua{nodes.lines.flowed.cleanup()}\to\everybye
-
- \def\mkstarttextlinenumbering#1#2%
- {\ctxlua{nodes.lines.flowed.prepare("#1")}%
- \attribute\linenumberattribute#2\relax}
-
- \def\mkstoptextlinenumbering
- {\attribute\linenumberattribute\attributeunsetvalue}
-
- \def\mkmaketextlinenumber#1#2%
- {\hbox \bgroup
- \ifcase#2\relax
- %
- \or
- \llap{#1\quad\hskip#2\scaledpoint}%
- \else
- \rlap{\hskip\textwidth\quad#1\hskip#2\scaledpoint}%
- \fi
- \egroup}
-
- \ctxlua{
- nodes.lines.scratchbox = \number\linenumberscratchbox ;
- -- register nodes.lines.flowed.apply in post_linebreak_filter actions
- }
-
-\fi
diff --git a/tex/context/base/spac-ver.lua b/tex/context/base/spac-ver.lua
index af9f5170f..5acfd7dbb 100644
--- a/tex/context/base/spac-ver.lua
+++ b/tex/context/base/spac-ver.lua
@@ -20,7 +20,7 @@ if not modules then modules = { } end modules ['spac-ver'] = {
local next, type, tonumber = next, type, tonumber
local format, gmatch, concat, match = string.format, string.gmatch, table.concat, string.match
local ceil, floor, max, min, round = math.ceil, math.floor, math.max, math.min, math.round
-local texsprint, texlists, texdimen, texbox, texht, texdp = tex.sprint, tex.lists, tex.dimen, tex.box, tex.ht, tex.dp
+local texsprint, texlists, texdimen, texbox = tex.sprint, tex.lists, tex.dimen, tex.box
local lpegmatch = lpeg.match
local unpack = unpack or table.unpack
@@ -63,6 +63,7 @@ local count_nodes = nodes.count
local node_ids_to_string = nodes.ids_to_string
local hpack_node = node.hpack
local vpack_node = node.vpack
+local writable_spec = nodes.writable_spec
local glyph = node.id("glyph")
local penalty = node.id("penalty")
@@ -247,6 +248,7 @@ local function snap_topskip(current,method)
local wd = w
if spec then
wd = 0
+ spec = writable_spec(current)
spec.width = wd
end
return w, wd
@@ -551,8 +553,8 @@ function vspacing.snap_box(n,how)
logs.report("snapper", "hlist not snapped, already done")
end
else
- local h, d, ch, cd, lines = snap_hlist(box,sv,texht[n],texdp[n])
- texht[n], texdp[n] = ch, cd
+ local h, d, ch, cd, lines = snap_hlist(box,sv,box.height,box.depth)
+ box.height, box.depth = ch, cd
if trace_vsnapping then
logs.report("snapper", "hlist snapped from (%s,%s) to (%s,%s) using method '%s' (%s) for '%s' (%s lines)",h,d,ch,cd,sv.name,sv.specification,"direct",lines)
end
@@ -696,6 +698,7 @@ local function collapser(head,where,what,trace,snap) -- maybe also pass tail
if cs and ps.stretch_order == 0 and ps.shrink_order == 0 and cs.stretch_order == 0 and cs.shrink_order == 0 then
local pw, pp, pm = ps.width, ps.stretch, ps.shrink
local cw, cp, cm = cs.width, cs.stretch, cs.shrink
+ ps = writable_spec(previous)
ps.width, ps.stretch, ps.shrink = pw + cw, pp + cp, pm + cm
if trace then trace_natural("removed",current) end
head, current = remove_node(head, current, true)
@@ -774,7 +777,8 @@ local function collapser(head,where,what,trace,snap) -- maybe also pass tail
head, current = remove_node(head, current, true)
elseif sc == add then
if trace then trace_skip('add',sc,so,sp,current) end
- local old, new = glue_data.spec, current.spec
+--~ local old, new = glue_data.spec, current.spec
+ local old, new = writable_spec(glue_data), current.spec
old.width = old.width + new.width
old.stretch = old.stretch + new.stretch
old.shrink = old.shrink + new.shrink
@@ -798,6 +802,7 @@ local function collapser(head,where,what,trace,snap) -- maybe also pass tail
set_attribute(current,snap_method,0)
local spec = current.spec
if spec then
+ spec = writable_spec(current)
spec.width = 0
if trace_vsnapping then
logs.report("snapper", "lineskip set to zero")
@@ -1063,7 +1068,7 @@ function nodes.repackage_graphicvadjust(head,groupcode) -- we can make an action
head, h, n = remove_node(head,h)
local pl = p.list
if n.width ~= 0 then
- n = hpack_node(n,0,'exactly')
+ n = hpack_node(n,0,'exactly') -- todo: dir
end
if pl then
pl.prev = n
diff --git a/tex/context/base/spac-ver.mkiv b/tex/context/base/spac-ver.mkiv
index 1a4291e17..efeb54c8f 100644
--- a/tex/context/base/spac-ver.mkiv
+++ b/tex/context/base/spac-ver.mkiv
@@ -1086,7 +1086,7 @@
\let\pseudoendstrut\removeunwantedspaces
\def\resetteststrut
- {\let\strutwidth\zeropoint
+ {\def\strutwidth{\zeropoint}% no let
\setstrut}
\ifdefined\setfontparameters\else
@@ -1115,7 +1115,7 @@
\lineskip\zeropoint
\lineskiplimit\maxdimen
% We also need this here now; thanks to taco for figuring that out!
- \let\minimumlinedistance\zeropoint}
+ \def\minimumlinedistance{\zeropoint}}
\def\nointerlineskip
{\prevdepth-\thousandpoint}
diff --git a/tex/context/base/spec-dpm.mkii b/tex/context/base/spec-dpm.mkii
index 9cf023fe0..efecd7928 100644
--- a/tex/context/base/spec-dpm.mkii
+++ b/tex/context/base/spec-dpm.mkii
@@ -411,7 +411,8 @@
\scratchcounter#4\advance\scratchcounter\minusone
\special{pdf: out \ifcase#5-\fi#2
% <</Page \the\scratchcounter\space /View [/Fit] /Title (#3)>>}%
- <</Title (#3) /A <</S /GoTo /D [@page\number#4\space\PDFpageviewwrd]>> >>}%
+ % <</Title (#3) /A <</S /GoTo /D [@page\number#4\space\PDFpageviewwrd]>> >>}%
+ <</Title \ifPDFunicode<#3>\else(#3)\fi\space /A <</S /GoTo /D [@page\number#4\space\PDFpageviewwrd]>> >>}%
\fi}
%D \macros
diff --git a/tex/context/base/spec-dpx.mkii b/tex/context/base/spec-dpx.mkii
index ed49ea843..c521da8c7 100644
--- a/tex/context/base/spec-dpx.mkii
+++ b/tex/context/base/spec-dpx.mkii
@@ -590,7 +590,8 @@
%\scratchcounter#4\advance\scratchcounter\minusone
\special{pdf:outline #1 %\ifcase#5 opened\fi
% <</Title (#3) /A <</S /GoTo /D (page:\the\scratchcounter)>>>>}%
- <</Title (#3) /A <</S /GoTo /D [@page\number#4\space\PDFpageviewwrd]>> >>}%
+ % <</Title (#3) /A <</S /GoTo /D [@page\number#4\space\PDFpageviewwrd]>> >>}%
+ <</Title \ifPDFunicode<#3>\else(#3)\fi\space /A <</S /GoTo /D [@page\number#4\space\PDFpageviewwrd]>> >>}%
\fi}
%D \macros
diff --git a/tex/context/base/spec-fdf.mkii b/tex/context/base/spec-fdf.mkii
index 4bf4115c6..30e15ff34 100644
--- a/tex/context/base/spec-fdf.mkii
+++ b/tex/context/base/spec-fdf.mkii
@@ -377,21 +377,39 @@
\flushPDFpageboxes
\to \everyshipout
+% \def\doPDFsetupidentity#1#2#3#4#5#6%
+% {\bgroup
+% \enablePDFdocencoding
+% \edef\!!stringa{#5}%
+% \ifx\!!stringa\empty \ifx\pdfdate\undefined\else
+% \edef\!!stringa{D:\pdfdate}%
+% \fi \fi
+% \expanded{\doPDFaddtoinfo
+% {/Title (#1)
+% /Subject (#2)
+% /Author (#3)
+% /Creator (#4)
+% /ModDate (\!!stringa)
+% /ID (\jobname.\!!stringa) % needed for pdf/x
+% /Keywords (#6)}}%
+% \egroup}
+
\def\doPDFsetupidentity#1#2#3#4#5#6%
{\bgroup
\enablePDFdocencoding
- \edef\!!stringa{#5}%
- \ifx\!!stringa\empty \ifx\pdfdate\undefined\else
- \edef\!!stringa{D:\pdfdate}%
- \fi \fi
+ \sanitizePDFencoding#1\to\idtitle \stripstring\idtitle
+ \sanitizePDFencoding#2\to\idsubject\stripstring\idsubject
+ \sanitizePDFencoding#3\to\idauthor \stripstring\idauthor
+ \sanitizePDFencoding#4\to\idcreator\stripstring\idcreator
+ \sanitizePDFencoding#6\to\idkeyword\stripstring\idkeyword
\expanded{\doPDFaddtoinfo
- {/Title (#1)
- /Subject (#2)
- /Author (#3)
- /Creator (#4)
- /ModDate (\!!stringa)
- /ID (\jobname.\!!stringa) % needed for pdf/x
- /Keywords (#6)}}%
+ {/Title \ifPDFunicode<\idtitle >\else(\idtitle )\fi
+ /Subject \ifPDFunicode<\idsubject>\else(\idsubject)\fi
+ /Author \ifPDFunicode<\idauthor >\else(\idauthor )\fi
+ /Creator \ifPDFunicode<\idcreator>\else(\idcreator)\fi
+ /ModDate (#4)
+ /ID (\jobname.#5) % needed for pdf/x
+ /Keywords \ifPDFunicode<\idkeyword>\else(\idkeyword)\fi}}%
\egroup}
%D \macros
@@ -1179,10 +1197,8 @@
\def\doPDFinsertbookmark#1#2#3#4#5% level sublevels text page open=1
{\bgroup
- % todo, unicode
- \sanitizePDFdocencoding#3\to\bookmarktext % uses scratchcounter
+ \sanitizePDFencoding#3\to\bookmarktext % uses scratchcounter
\stripstring\bookmarktext
- %\sanitizePDFstring#3\to\bookmarktext
\doPDFbookmark{#1}{#2}{\bookmarktext}{#4}{#5}%
\egroup}
@@ -2364,7 +2380,69 @@
\let^^M=\\}
\egroup
-\let\sanitizePDFencoding\sanitizePDFdocencoding
+% \let\sanitizePDFencoding\sanitizePDFdocencoding
+
+%D The conversions comes down to (for the sake of speed the
+%D implementation combines steps):
+%D
+%D \startitemize
+%D \item we expand the \UTF\ sequences into \type {\unicodechar}'s
+%D \item spaces become character 255's (so that they are not
+%D gobbled in argument fetching
+%D \item normal \ASCII\ chars are unchanged
+%D \item \par's and alike are converted to \type {\unicodechar}'s
+%D \stopitemize
+%D
+%D This happens by expansion; next we convert the resulting
+%D sequence by interpreting the stream.
+
+\long\def\sanitizePDFuniencoding#1\to#2%
+ {\enablePDFunicrlf
+ \simplifycommands % added due to Dohyun Kim
+ \let\unicodechar\relax % prevent further expansion
+ \retainlccodes\lccode32=255 % slooow
+ \lowercasestring\PDFunicodetrigger#1\to#2%
+ \edef#2{\expandafter\doPDFuni#2\empty\empty}} % slooow
+
+%D Handling of empty lines:
+
+\bgroup
+\catcode`\^^M=\@@active
+\gdef\enablePDFunicrlf%
+ {\def\\{\unicodechar{13}}%
+ \def\par{\\\\}%
+ \catcode`\^^M=\@@active%
+ \let^^M=\\}
+\egroup
+
+%D Conversion to 16 bit \UNICODE:
+
+\def\PDFunicodechar#1%
+ {\@EA\lchexnumbers\@EA{\number\utfdiv{#1}}%
+ \@EA\lchexnumbers\@EA{\number\utfmod{#1}}}
+
+\def\PDFunicodetrigger
+ {\unicodechar{65279}}
+
+%D The postprocessor:
+
+\def\doPDFuni#1%
+ {\ifx#1\relax
+ \@EA\dodoPDFuni
+ \else\ifx#1\empty
+ % quit
+ \else
+ \@EAEAEA\nodoPDFuni
+ \fi\fi#1}
+
+\def\nodoPDFuni#1%
+ {\PDFunicodechar{\ifnum`#1=255 32\else`#1\fi}\doPDFuni}
+
+\def\dodoPDFuni#1#2%
+ {\PDFunicodechar{#2}\doPDFuni}
+
+\def\sanitizePDFencoding
+ {\doifelse\currentregime{utf}{\PDFunicodetrue\sanitizePDFuniencoding}\sanitizePDFdocencoding}
%D A bit out of place, but useful:
diff --git a/tex/context/base/spec-tpd.mkii b/tex/context/base/spec-tpd.mkii
index 597993e0a..6af3b1272 100644
--- a/tex/context/base/spec-tpd.mkii
+++ b/tex/context/base/spec-tpd.mkii
@@ -1176,7 +1176,7 @@
\pdfoutline
user {<</S /GoTo /D [\PDFobjectreference\space\PDFpageviewwrd]>>}%
\ifcase#2 \else count \ifcase#5-\fi#2 \fi
- {#3}}
+ {\ifPDFunicode<#3>\else#3\fi}}
%D \macros
%D {doPDFdictionaryobject,doPDFarrayobject}
diff --git a/tex/context/base/spec-tst.mkii b/tex/context/base/spec-tst.mkii
index bdd8a29b2..543baa647 100644
--- a/tex/context/base/spec-tst.mkii
+++ b/tex/context/base/spec-tst.mkii
@@ -11,113 +11,14 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\ifcase \pdfoutput \endinput \fi
-
\unprotect
-%D The conversions comes down to (for the sake of speed the
-%D implementation combines steps):
-%D
-%D \startitemize
-%D \item we expand the \UTF\ sequences into \type {\unicodechar}'s
-%D \item spaces become character 255's (so that they are not
-%D gobbled in argument fetching
-%D \item normal \ASCII\ chars are unchanged
-%D \item \par's and alike are converted to \type {\unicodechar}'s
-%D \stopitemize
-%D
-%D This happens by expansion; next we convert the resulting
-%D sequence by interpreting the stream.
-
-\long\def\sanitizePDFuniencoding#1\to#2%
- {\enablePDFunicrlf
- \simplifycommands % added due to Dohyun Kim
- \let\unicodechar\relax % prevent further expansion
- \retainlccodes\lccode32=255 % slooow
- \lowercasestring\PDFunicodetrigger#1\to#2%
- \edef#2{\expandafter\doPDFuni#2\empty\empty}} % slooow
-
-%D Handling of empty lines:
-
-\bgroup
-\catcode`\^^M=\@@active
-\gdef\enablePDFunicrlf%
- {\def\\{\unicodechar{13}}%
- \def\par{\\\\}%
- \catcode`\^^M=\@@active%
- \let^^M=\\}
-\egroup
-
-%D Conversion to 16 bit \UNICODE:
-
-\def\PDFunicodechar#1%
- {\@EA\lchexnumbers\@EA{\number\utfdiv{#1}}%
- \@EA\lchexnumbers\@EA{\number\utfmod{#1}}}
-
-\def\PDFunicodetrigger
- {\unicodechar{65279}}
-
-%D The postprocessor:
-
-\def\doPDFuni#1%
- {\ifx#1\relax
- \@EA\dodoPDFuni
- \else\ifx#1\empty
- % quit
- \else
- \@EAEAEA\nodoPDFuni
- \fi\fi#1}
-
-\def\nodoPDFuni#1%
- {\PDFunicodechar{\ifnum`#1=255 32\else`#1\fi}\doPDFuni}
-
-\def\dodoPDFuni#1#2%
- {\PDFunicodechar{#2}\doPDFuni}
-
-\def\sanitizePDFencoding
- {\doifelse\currentregime{utf}%
- {\PDFunicodetrue\sanitizePDFuniencoding}\sanitizePDFdocencoding}
-
-% pdftex specific
-
-\def\doPDFinsertbookmark#1#2#3#4#5% level sublevels text page open=1
- {\bgroup
- \sanitizePDFencoding#3\to\bookmarktext % uses scratchcounter
- \stripstring\bookmarktext
- \doPDFbookmark{#1}{#2}{\bookmarktext}{#4}{#5}%
- \egroup}
-
-\def\doPDFbookmark#1#2#3#4#5%
- {\doPDFgetpagereference{#4}\PDFobjectreference
- \pdfoutline
- user {<</S /GoTo /D [\PDFobjectreference\space\PDFpageviewwrd]>>}%
- \ifcase#2 \else count \ifcase#5-\fi#2 \fi
- {\ifPDFunicode<#3>\else#3\fi}}
-
-\def\doPDFsetupidentity#1#2#3#4#5#6%
- {\bgroup
- \enablePDFdocencoding
- \sanitizePDFencoding#1\to\idtitle \stripstring\idtitle
- \sanitizePDFencoding#2\to\idsubject\stripstring\idsubject
- \sanitizePDFencoding#3\to\idauthor \stripstring\idauthor
- \sanitizePDFencoding#4\to\idcreator\stripstring\idcreator
- \sanitizePDFencoding#6\to\idkeyword\stripstring\idkeyword
- \expanded{\doPDFaddtoinfo
- {/Title \ifPDFunicode<\idtitle >\else(\idtitle )\fi
- /Subject \ifPDFunicode<\idsubject>\else(\idsubject)\fi
- /Author \ifPDFunicode<\idauthor >\else(\idauthor )\fi
- /Creator \ifPDFunicode<\idcreator>\else(\idcreator)\fi
- /ModDate (#4)
- /ID (\jobname.#5) % needed for pdf/x
- /Keywords \ifPDFunicode<\idkeyword>\else(\idkeyword)\fi}}%
- \egroup}
+%D The code is now merged into spec-*.mkii
\protect
\doifnotmode{demo}{\endinput}
-% \input spec-tst.tex
-
\mainlanguage[vn]
\enableregime[utf]
\usetypescript[all][computer-modern][t5]
@@ -149,4 +50,3 @@
\subsection{Mục nhỏ thứ hai} Thử tiếng Việt
\stoptext
-
diff --git a/tex/context/base/strc-itm.mkiv b/tex/context/base/strc-itm.mkiv
index 3c31bac4a..fcd5e6639 100644
--- a/tex/context/base/strc-itm.mkiv
+++ b/tex/context/base/strc-itm.mkiv
@@ -1211,7 +1211,7 @@
% \stopitemize
\setvalue{\??op:\??op:\c!textdistance:\v!none}%
- {\let\textitemdistance\zeropoint}
+ {\def\textitemdistance{\zeropoint}}
\def\doassigngiventextitemdistance#1%
{\assignvalue
diff --git a/tex/context/base/strc-lst.mkiv b/tex/context/base/strc-lst.mkiv
index b13ee5371..a2c3dfd82 100644
--- a/tex/context/base/strc-lst.mkiv
+++ b/tex/context/base/strc-lst.mkiv
@@ -617,9 +617,6 @@
{\!!widtha\listparameter\c!width}}%
\getvalue{\??li\c!alternative\listparameter\c!alternative}%
\endgraf
-% \doif{\listparameter\c!interaction}\v!text % not supported ! ! ! ! ! ! text == all
-% {\setlistparameter\currentlist\c!interaction\v!all}%
- % \dontleavehmode % new, else no margin, but wrong, better (else \indent as well):
\noindent
\domakelistelement\v!all{#2}\hbox
{\setlocalhsize
diff --git a/tex/context/base/strc-ref.lua b/tex/context/base/strc-ref.lua
index 0cf06db02..475ab318a 100644
--- a/tex/context/base/strc-ref.lua
+++ b/tex/context/base/strc-ref.lua
@@ -291,6 +291,55 @@ function commands.doiffiledefinedelse(name)
commands.doifelse(files[name])
end
+-- helpers
+
+function jobreferences.checkedfile(whatever) -- return whatever if not resolved
+ if whatever then
+ local w = files[whatever]
+ if w then
+ return w[1]
+ else
+ return whatever
+ end
+ end
+end
+
+function jobreferences.checkedurl(whatever) -- return whatever if not resolved
+ if whatever then
+ local w = urls[whatever]
+ if w then
+ local u, f = w[1], w[2]
+ if f and f ~= "" then
+ return u .. "/" .. f
+ else
+ return u
+ end
+ else
+ return whatever
+ end
+ end
+end
+
+function jobreferences.checkedfileorurl(whatever,default) -- return nil, nil if not resolved
+ if whatever then
+ local w = files[whatever]
+ if w then
+ return w[1], nil
+ else
+ local w = urls[whatever]
+ if w then
+ local u, f = w[1], w[2]
+ if f and f ~= "" then
+ return nil, u .. "/" .. f
+ else
+ return nil, u
+ end
+ end
+ end
+ end
+ return default
+end
+
-- programs
jobreferences.programs = jobreferences.programs or { }
@@ -311,6 +360,17 @@ function jobreferences.programs.get(name)
end
end
+function jobreferences.checkedprogram(whatever) -- return whatever if not resolved
+ if whatever then
+ local w = programs[whatever]
+ if w then
+ return w[1]
+ else
+ return whatever
+ end
+ end
+end
+
-- shared by urls and files
function jobreferences.whatfrom(name)
diff --git a/tex/context/base/strc-ref.mkiv b/tex/context/base/strc-ref.mkiv
index ed77edc85..2c0a8842b 100644
--- a/tex/context/base/strc-ref.mkiv
+++ b/tex/context/base/strc-ref.mkiv
@@ -93,10 +93,10 @@
%D \reference[here]{some text}
%D \stoptyping
-\def\textreference {\dosingleargument\dotextreference}
-\def\pagereference {\dosingleargument\dopagereference}
-\def\reference {\dosingleargument\doreference }
-\def\setreference {\dodoubleargument\dosetreference }
+\unexpanded\def\textreference {\dosingleargument\dotextreference}
+\unexpanded\def\pagereference {\dosingleargument\dopagereference}
+\unexpanded\def\reference {\dosingleargument\doreference }
+\unexpanded\def\setreference {\dodoubleargument\dosetreference }
%D These are implemented in a low level form as:
diff --git a/tex/context/base/trac-inf.lua b/tex/context/base/trac-inf.lua
index 315195012..72f03675a 100644
--- a/tex/context/base/trac-inf.lua
+++ b/tex/context/base/trac-inf.lua
@@ -47,6 +47,8 @@ function statistics.starttiming(instance)
if not instance.loadtime then
instance.loadtime = 0
end
+ else
+--~ logs.report("system","nested timing (%s)",tostring(instance))
end
instance.timing = it + 1
end
diff --git a/tex/context/base/trac-tim.lua b/tex/context/base/trac-tim.lua
index 674abdf60..6aebb01ab 100644
--- a/tex/context/base/trac-tim.lua
+++ b/tex/context/base/trac-tim.lua
@@ -10,10 +10,10 @@ local format, gsub = string.format, string.gsub
local concat, sort = table.concat, table.sort
local next, pairs, ipairs = next, pairs, ipairs
-goodies = goodies or { }
-goodies.progress = goodies.progress or { }
+plugins = plugins or { }
+plugins.progress = plugins.progress or { }
-local progress = goodies.progress
+local progress = plugins.progress
progress = progress or { }
diff --git a/tex/context/fonts/fonts b/tex/context/fonts/fonts
new file mode 100644
index 000000000..1019d33f6
--- /dev/null
+++ b/tex/context/fonts/fonts
@@ -0,0 +1,177 @@
+local yes = "yes", "node"
+
+local basics = {
+ analyze = yes,
+ mode = "node",
+ language = "dflt",
+ script = "arab",
+}
+
+local analysis = {
+ ccmp = yes,
+ init = yes, medi = yes, fina = yes,
+}
+
+local regular = {
+ rlig = yes, calt = yes, salt = yes, anum = yes,
+ ss01 = yes, ss03 = yes, ss07 = yes, ss10 = yes, ss12 = yes, ss15 = yes, ss16 = yes,
+ ss19 = yes, ss24 = yes, ss25 = yes, ss26 = yes, ss27 = yes, ss31 = yes, ss34 = yes,
+ ss35 = yes, ss36 = yes, ss37 = yes, ss38 = yes, ss41 = yes, ss42 = yes, ss43 = yes,
+ js16 = yes,
+}
+
+local positioning = {
+ kern = yes, curs = yes, mark = yes, mkmk = yes,
+}
+
+local minimal_stretching = {
+ js11 = yes, js03 = yes,
+}
+
+local medium_stretching = {
+ js12=yes, js05=yes,
+}
+local maximal_stretching= {
+ js13 = yes, js05 = yes, js09 = yes,
+}
+
+local wide_all = {
+ js11 = yes, js12 = yes, js13 = yes, js05 = yes, js09 = yes,
+}
+
+local shrink = {
+ flts = yes, js17 = yes, ss05 = yes, ss11 = yes, ss06 = yes, ss09 = yes,
+}
+
+local default = {
+ basics, analysis, regular, positioning, -- xxxx = yes, yyyy = 2,
+}
+
+return {
+ name = "husayni",
+ version = "1.00",
+ comment = "Goodies that complement the Husayni font by Idris Samawi Hamid.",
+ author = "Idris Samawi Hamid and Hans Hagen",
+ featuresets = { -- here we don't have references to featuresets
+ default = {
+ default,
+ },
+ minimal_stretching = {
+ default, js11 = yes, js03 = yes,
+ },
+ medium_stretching = {
+ default, js12=yes, js05=yes,
+ },
+ maximal_stretching= {
+ default, js13 = yes, js05 = yes, js09 = yes,
+ },
+ wide_all = {
+ default, js11 = yes, js12 = yes, js13 = yes, js05 = yes, js09 = yes,
+ },
+ shrink = {
+ default, flts = yes, js17 = yes, ss05 = yes, ss11 = yes, ss06 = yes, ss09 = yes,
+ },
+ },
+ solutions = { -- here we have references to featuresets, so we use strings!
+ experimental = {
+ less = { "shrink" },
+ more = { "minimal_stretching", "medium_stretching", "maximal_stretching", "wide_all" },
+ },
+ },
+ stylistics = {
+ ss01 = "Allah, Muhammad",
+ ss02 = "ss01 + Allah_final",
+ ss03 = "level-1 stack over Jiim, initial entry only",
+ ss04 = "level-1 stack over Jiim, initial/medial entry",
+ ss05 = "multi-level Jiim stacking, initial/medial entry",
+ ss06 = "aesthetic Faa/Qaaf for FJ_mm, FJ_mf connection",
+ ss07 = "initial-entry stacking over Haa",
+ ss08 = "initial/medial stacking over Haa, minus HM_mf strings",
+ ss09 = "initial/medial Haa stacking plus HM_mf strings",
+ ss10 = "basic dipped Miim, initial-entry B_S-stack over Miim",
+ ss11 = "full dipped Miim, initial-entry B_S-stack over Miim",
+ ss12 = "XBM_im initial-medial entry B_S-stack over Miim",
+ ss13 = "full initial-medial entry B_S-stacked Miim",
+ ss14 = "initial entry, stacked Laam on Miim",
+ ss15 = "full stacked Laam-on-Miim",
+ ss16 = "initial entry, stacked Ayn-on-Miim",
+ ss17 = "full stacked Ayn-on-Miim",
+ ss18 = "LMJ_im already contained in ss03--05, may remove",
+ ss19 = "LM_im",
+ ss20 = "KLM_m, sloped Miim",
+ ss21 = "KLM_i_mm/LM_mm, sloped Miim",
+ ss22 = "filled sloped Miim",
+ ss23 = "LM_mm, non-sloped Miim",
+ ss24 = "BR_i_mf, BN_i_mf",
+ ss25 = "basic LH_im might merge with ss24",
+ ss26 = "full Yaa.final special strings: BY_if, BY_mf, LY_mf",
+ ss27 = "basic thin Miim.final",
+ ss28 = "full thin Miim.final to be moved to jsnn",
+ ss29 = "basic short Miim.final",
+ ss30 = "full short Miim.final to be moved to jsnn",
+ ss31 = "basic Raa.final strings: JR and SR",
+ ss32 = "basic Raa.final strings: JR, SR, and BR",
+ ss33 = "TtR to be moved to jsnn",
+ ss34 = "AyR style also available in jsnn",
+ ss35 = "full Kaaf contexts",
+ ss36 = "full Laam contexts",
+ ss37 = "Miim-Miim contexts",
+ ss38 = "basic dipped Haa, B_SH_mm",
+ ss39 = "full dipped Haa, B_S_LH_i_mm_Mf",
+ ss40 = "aesthetic dipped medial Haa",
+ ss41 = "high and low Baa strings",
+ ss42 = "diagonal entry",
+ ss43 = "initial alternates",
+ ss44 = "hooked final alif",
+ ss45 = "BMA_f",
+ ss46 = "BM_mm_alt, for JBM combinations",
+ ss47 = "Shaddah-<kasrah> combo",
+ ss48 = "Auto-sukuun",
+ ss49 = "No vowels",
+ ss50 = "Shaddah/MaaddahHamzah only",
+ ss51 = "No Skuun",
+ ss52 = "No Waslah",
+ ss53 = "No Waslah",
+ ss54 = "chopped finals",
+ ss55 = "idgham-tanwin",
+ js01 = "Raawide",
+ js02 = "Yaawide",
+ js03 = "Kaafwide",
+ js04 = "Nuunwide",
+ js05 = "Kaafwide Nuunwide Siinwide Baawide",
+ js06 = "final Haa wide",
+ js07 = "thin Miim",
+ js08 = "short Miim",
+ js09 = "wide Siin",
+ js10 = "thuluth-style initial Haa, final Miim, MRw_mf",
+ js11 = "level-1 stretching",
+ js12 = "level-2 stretching",
+ js13 = "level-3 stretching",
+ js14 = "final Alif",
+ js15 = "hooked final Alif",
+ js16 = "aesthetic medial Faa/Qaaf",
+ js17 = "fancy isol Haa after Daal, Raa, and Waaw",
+ js18 = "Laamwide, alternate substitution",
+ js19 = "level-4 stretching, only siin and Hhaa for basmalah",
+ js20 = "level-5 stretching, only siin and Hhaa for basmalah",
+ js21 = "Haa.final_alt2",
+ },
+ colorschemes = {
+ default = {
+ [1] = {
+ "Onedotabove", "Onedotbelow", "Twodotsabove", "Twodotsbelow", "Threedotsabove", "Twodotsabove.vrt", "Twodotsbelow.vrt", "Twodotsabove.KBA", "Threedotsabove.KBA", "Threedotsbelowinv", "Hamzahabove", "Hamzahbelow", "MaaddahHamzah.identity", "Waslah","Hamzah.initial_medial",
+ },
+ [2] = {
+ "Fathah", "Dammah", "Kasrah", "FathahVertical", "DammahInverted", "KasrahVertical", "FathahVertical.alt1", "KasrahVertical.alt1", "FathahTanwiin", "DammahTanwiin", "KasrahTanwiin", "Shaddah", "Sukuun", "MaaddahHamzah", "Jazm", "Maaddah", "DammahTanwiin_alt2", "DammahTanwiin_alt1", "FathahTanwiin_alt1", "KasrahTanwiin_alt1", "Fathah.mkmk", "Dammah.mkmk", "Kasrah.mkmk", "FathahVertical.mkmk", "DammahInverted.mkmk", "KasrahVertical.mkmk", "FathahTanwiin.mkmk", "DammahTanwiin.mkmk", "KasrahTanwiin.mkmk", "DammahTanwiin_alt1.mkmk", "Waawsmall", "Yaasmall", "FathahVertical.alt2", "Waawsmall.isol", "Yaasmall.isol", "FathahVertical.isol", "Hamzah","Shaddah.lillaah","FathahVertical.alt1_mkmk","Sifr.empty","Maaddah.small","FathahVertical.alt2","Waawsmall.isol","Yaasmall.isol","FathahTanwiin.alt1_mkmk","KasrahTanwiin.alt1_mkmk",
+ },
+ [3] = {
+ "Ttaa.waqf", "SsLY.waqf", "QLY.waqf", "Miim.waqf", "LA.waqf", "Jiim.waqf", "Threedotsabove.waqf", "Siin.waqf", "Ssaad.waqf", "Qaaf.waqf", "SsL.waqf", "QF.waqf", "SKTH.waqf", "WQFH.waqf", "Kaaf.waqf", "Ayn.ruku", "Miim.nuun_high", "Siin.Ssaad", "Nuunsmall", "emptydot_low", "emptydot_high", "Sifr.fill", "Miim.nuun_low", "Nuun.tanwiin",
+ },
+ [4] = {"ZeroArabic.ayah", "OneArabic.ayah", "TwoArabic.ayah", "ThreeArabic.ayah", "FourArabic.ayah", "FiveArabic.ayah", "SixArabic.ayah", "SevenArabic.ayah", "EightArabic.ayah", "NineArabic.ayah", "FourFarsi.ayah", "FiveFarsi.ayah", "SixFarsi.ayah", "FourFarsi.urdu_ayah", "SevenFarsi.urdu_ayah","ZeroArabic.ayah_small","OneArabic.ayah_small","TwoArabic.ayah_small","ThreeArabic.ayah_small","FourArabic.ayah.001","FiveArabic.ayah_small","SixArabic.ayah_small","SevenArabic.ayah_small","EightArabic.ayah_small","NineArabic.ayah_small",
+ },
+ [5] = {
+ "Ayah", "Ayah.alt1", "Ayah.alt2", "Ayah.alt3", "Ayah2",
+ }
+ }
+ }
+}
diff --git a/tex/context/patterns/lang-lt.rme b/tex/context/patterns/lang-lt.rme
index e61792c9d..7def4fe72 100644
--- a/tex/context/patterns/lang-lt.rme
+++ b/tex/context/patterns/lang-lt.rme
@@ -33,4 +33,15 @@
%
% http://tug.org/tex-hyphen
%
+%------------------------------------------------------------------------------
+%
+% A note about lefthyphenmin/righthyphenmin (by Sigitas, February 2009):
+%
+% At the moment the lefthyphenmin & righthyphenmin are both set to 2.
+% The Lithuanian patterns were build earlier then the latest grammatical rules
+% took place in 1997. At that time it was forbidden to leave one character at boundary.
+% One may change it to one now, but from typographical point of view there is no need to do
+% any changes. Even more, changing lefthyphen and righthyphen to 1 requires
+% to review and maybe rebuild the patterns file.
+%
%------------------------------------------------------------------------------ \ No newline at end of file
diff --git a/tex/context/patterns/lang-tk.hyp b/tex/context/patterns/lang-tk.hyp
new file mode 100644
index 000000000..70002aa05
--- /dev/null
+++ b/tex/context/patterns/lang-tk.hyp
@@ -0,0 +1,8 @@
+% generated by mtxrun --script pattern --convert
+
+% for comment and copyright, see e:/tmp/patterns/lang-tk.rme
+
+% used:
+
+\hyphenation{
+} \ No newline at end of file
diff --git a/tex/context/patterns/lang-tk.pat b/tex/context/patterns/lang-tk.pat
new file mode 100644
index 000000000..e800f0f39
--- /dev/null
+++ b/tex/context/patterns/lang-tk.pat
@@ -0,0 +1,2492 @@
+% generated by mtxrun --script pattern --convert
+
+% for comment and copyright, see e:/tmp/patterns/lang-tk.rme
+
+% used: a b d e f g h i j k l m n o p r s t u w y z ä ç ö ü ý ň ş ž
+
+\patterns{
+ä1bä
+ä1be
+ä1bi
+ä1bö
+ä1bü
+ä1çä
+ä1çe
+ä1çi
+ä1çö
+ä1çü
+ä1dä
+ä1de
+ä1di
+ä1dö
+ä1dü
+ä1fä
+ä1fe
+ä1fi
+ä1fö
+ä1fü
+ä1gä
+ä1ge
+ä1gi
+ä1gö
+ä1gü
+ä1hä
+ä1he
+ä1hi
+ä1hö
+ä1hü
+ä1jä
+ä1je
+ä1ji
+ä1jö
+ä1jü
+ä1kä
+ä1ke
+ä1ki
+ä1kö
+ä1kü
+ä1lä
+ä1le
+ä1li
+ä1lö
+ä1lü
+ä1mä
+ä1me
+ä1mi
+ä1mö
+ä1mü
+ä1nä
+ä1ne
+ä1ni
+ä1nö
+ä1nü
+ä1pä
+ä1pe
+ä1pi
+ä1pö
+ä1pü
+ä1rä
+ä1re
+ä1ri
+ä1rö
+ä1rü
+ä1sä
+ä1se
+ä1si
+ä1sö
+ä1sü
+ä1tä
+ä1te
+ä1ti
+ä1tö
+ä1tü
+ä1wä
+ä1we
+ä1wi
+ä1wö
+ä1wü
+ä1ýä
+ä1ýe
+ä1ýi
+ä1ýö
+ä1ýü
+ä1zä
+ä1ze
+ä1zi
+ä1zö
+ä1zü
+ä1ňä
+ä1ňe
+ä1ňi
+ä1ňö
+ä1ňü
+ä1žä
+ä1že
+ä1ži
+ä1žö
+ä1žü
+ä1şä
+ä1şe
+ä1şi
+ä1şö
+ä1şü
+e1bä
+e1be
+e1bi
+e1bö
+e1bü
+e1çä
+e1çe
+e1çi
+e1çö
+e1çü
+e1dä
+e1de
+e1di
+e1dö
+e1dü
+e1fä
+e1fe
+e1fi
+e1fö
+e1fü
+e1gä
+e1ge
+e1gi
+e1gö
+e1gü
+e1hä
+e1he
+e1hi
+e1hö
+e1hü
+e1jä
+e1je
+e1ji
+e1jö
+e1jü
+e1kä
+e1ke
+e1ki
+e1kö
+e1kü
+e1lä
+e1le
+e1li
+e1lö
+e1lü
+e1mä
+e1me
+e1mi
+e1mö
+e1mü
+e1nä
+e1ne
+e1ni
+e1nö
+e1nü
+e1pä
+e1pe
+e1pi
+e1pö
+e1pü
+e1rä
+e1re
+e1ri
+e1rö
+e1rü
+e1sä
+e1se
+e1si
+e1sö
+e1sü
+e1tä
+e1te
+e1ti
+e1tö
+e1tü
+e1wä
+e1we
+e1wi
+e1wö
+e1wü
+e1ýä
+e1ýe
+e1ýi
+e1ýö
+e1ýü
+e1zä
+e1ze
+e1zi
+e1zö
+e1zü
+e1ňä
+e1ňe
+e1ňi
+e1ňö
+e1ňü
+e1žä
+e1že
+e1ži
+e1žö
+e1žü
+e1şä
+e1şe
+e1şi
+e1şö
+e1şü
+i1bä
+i1be
+i1bi
+i1bö
+i1bü
+i1çä
+i1çe
+i1çi
+i1çö
+i1çü
+i1dä
+i1de
+i1di
+i1dö
+i1dü
+i1fä
+i1fe
+i1fi
+i1fö
+i1fü
+i1gä
+i1ge
+i1gi
+i1gö
+i1gü
+i1hä
+i1he
+i1hi
+i1hö
+i1hü
+i1jä
+i1je
+i1ji
+i1jö
+i1jü
+i1kä
+i1ke
+i1ki
+i1kö
+i1kü
+i1lä
+i1le
+i1li
+i1lö
+i1lü
+i1mä
+i1me
+i1mi
+i1mö
+i1mü
+i1nä
+i1ne
+i1ni
+i1nö
+i1nü
+i1pä
+i1pe
+i1pi
+i1pö
+i1pü
+i1rä
+i1re
+i1ri
+i1rö
+i1rü
+i1sä
+i1se
+i1si
+i1sö
+i1sü
+i1tä
+i1te
+i1ti
+i1tö
+i1tü
+i1wä
+i1we
+i1wi
+i1wö
+i1wü
+i1ýä
+i1ýe
+i1ýi
+i1ýö
+i1ýü
+i1zä
+i1ze
+i1zi
+i1zö
+i1zü
+i1ňä
+i1ňe
+i1ňi
+i1ňö
+i1ňü
+i1žä
+i1že
+i1ži
+i1žö
+i1žü
+i1şä
+i1şe
+i1şi
+i1şö
+i1şü
+ö1bä
+ö1be
+ö1bi
+ö1bö
+ö1bü
+ö1çä
+ö1çe
+ö1çi
+ö1çö
+ö1çü
+ö1dä
+ö1de
+ö1di
+ö1dö
+ö1dü
+ö1fä
+ö1fe
+ö1fi
+ö1fö
+ö1fü
+ö1gä
+ö1ge
+ö1gi
+ö1gö
+ö1gü
+ö1hä
+ö1he
+ö1hi
+ö1hö
+ö1hü
+ö1jä
+ö1je
+ö1ji
+ö1jö
+ö1jü
+ö1kä
+ö1ke
+ö1ki
+ö1kö
+ö1kü
+ö1lä
+ö1le
+ö1li
+ö1lö
+ö1lü
+ö1mä
+ö1me
+ö1mi
+ö1mö
+ö1mü
+ö1nä
+ö1ne
+ö1ni
+ö1nö
+ö1nü
+ö1pä
+ö1pe
+ö1pi
+ö1pö
+ö1pü
+ö1rä
+ö1re
+ö1ri
+ö1rö
+ö1rü
+ö1sä
+ö1se
+ö1si
+ö1sö
+ö1sü
+ö1tä
+ö1te
+ö1ti
+ö1tö
+ö1tü
+ö1wä
+ö1we
+ö1wi
+ö1wö
+ö1wü
+ö1ýä
+ö1ýe
+ö1ýi
+ö1ýö
+ö1ýü
+ö1zä
+ö1ze
+ö1zi
+ö1zö
+ö1zü
+ö1ňä
+ö1ňe
+ö1ňi
+ö1ňö
+ö1ňü
+ö1žä
+ö1že
+ö1ži
+ö1žö
+ö1žü
+ö1şä
+ö1şe
+ö1şi
+ö1şö
+ö1şü
+ü1bä
+ü1be
+ü1bi
+ü1bö
+ü1bü
+ü1çä
+ü1çe
+ü1çi
+ü1çö
+ü1çü
+ü1dä
+ü1de
+ü1di
+ü1dö
+ü1dü
+ü1fä
+ü1fe
+ü1fi
+ü1fö
+ü1fü
+ü1gä
+ü1ge
+ü1gi
+ü1gö
+ü1gü
+ü1hä
+ü1he
+ü1hi
+ü1hö
+ü1hü
+ü1jä
+ü1je
+ü1ji
+ü1jö
+ü1jü
+ü1kä
+ü1ke
+ü1ki
+ü1kö
+ü1kü
+ü1lä
+ü1le
+ü1li
+ü1lö
+ü1lü
+ü1mä
+ü1me
+ü1mi
+ü1mö
+ü1mü
+ü1nä
+ü1ne
+ü1ni
+ü1nö
+ü1nü
+ü1pä
+ü1pe
+ü1pi
+ü1pö
+ü1pü
+ü1rä
+ü1re
+ü1ri
+ü1rö
+ü1rü
+ü1sä
+ü1se
+ü1si
+ü1sö
+ü1sü
+ü1tä
+ü1te
+ü1ti
+ü1tö
+ü1tü
+ü1wä
+ü1we
+ü1wi
+ü1wö
+ü1wü
+ü1ýä
+ü1ýe
+ü1ýi
+ü1ýö
+ü1ýü
+ü1zä
+ü1ze
+ü1zi
+ü1zö
+ü1zü
+ü1ňä
+ü1ňe
+ü1ňi
+ü1ňö
+ü1ňü
+ü1žä
+ü1že
+ü1ži
+ü1žö
+ü1žü
+ü1şä
+ü1şe
+ü1şi
+ü1şö
+ü1şü
+a1ba
+a1by
+a1bo
+a1bu
+a1ça
+a1çy
+a1ço
+a1çu
+a1da
+a1dy
+a1do
+a1du
+a1fa
+a1fy
+a1fo
+a1fu
+a1ga
+a1gy
+a1go
+a1gu
+a1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1w
+ý2p1w
+l2p1w
+l2t1w
+g2t1w
+n2t1w
+r2k1w
+r2p1w
+k2t1w
+r2h1w
+s2t1w
+l2k1w
+w2p1w
+n2s1w
+r2s1w
+l2m1w
+ý2t1ý
+ý2n1ý
+ý2d1ý
+r2t1ý
+ý2p1ý
+l2p1ý
+l2t1ý
+g2t1ý
+n2t1ý
+r2k1ý
+r2p1ý
+k2t1ý
+r2h1ý
+s2t1ý
+l2k1ý
+w2p1ý
+n2s1ý
+r2s1ý
+l2m1ý
+ý2t1z
+ý2n1z
+ý2d1z
+r2t1z
+ý2p1z
+l2p1z
+l2t1z
+g2t1z
+n2t1z
+r2k1z
+r2p1z
+k2t1z
+r2h1z
+s2t1z
+l2k1z
+w2p1z
+n2s1z
+r2s1z
+l2m1z
+ý2t1ň
+ý2n1ň
+ý2d1ň
+r2t1ň
+ý2p1ň
+l2p1ň
+l2t1ň
+g2t1ň
+n2t1ň
+r2k1ň
+r2p1ň
+k2t1ň
+r2h1ň
+s2t1ň
+l2k1ň
+w2p1ň
+n2s1ň
+r2s1ň
+l2m1ň
+ý2t1ž
+ý2n1ž
+ý2d1ž
+r2t1ž
+ý2p1ž
+l2p1ž
+l2t1ž
+g2t1ž
+n2t1ž
+r2k1ž
+r2p1ž
+k2t1ž
+r2h1ž
+s2t1ž
+l2k1ž
+w2p1ž
+n2s1ž
+r2s1ž
+l2m1ž
+ý2t1ş
+ý2n1ş
+ý2d1ş
+r2t1ş
+ý2p1ş
+l2p1ş
+l2t1ş
+g2t1ş
+n2t1ş
+r2k1ş
+r2p1ş
+k2t1ş
+r2h1ş
+s2t1ş
+l2k1ş
+w2p1ş
+n2s1ş
+r2s1ş
+l2m1ş
+s2k1d
+t2r1d
+l1s2k
+l1s2t
+n2g1l
+n1g2r
+s2k1w} \ No newline at end of file
diff --git a/tex/context/patterns/lang-tk.rme b/tex/context/patterns/lang-tk.rme
new file mode 100644
index 000000000..b03f0484c
--- /dev/null
+++ b/tex/context/patterns/lang-tk.rme
@@ -0,0 +1,16 @@
+% generated by mtxrun --script pattern --convert
+
+% hyph-tk.tex
+%
+% File auto-generated from generate_patterns_tk.rb that is part of hyph-utf8
+%
+% Author: Nazar Annagurban <nazartm at gmail.com>
+%
+% For more information about the new UTF-8 hyphenation patterns and
+% links to this file see
+% http://www.tug.org/tex-hyphen/
+%
+% Some of the patterns below represent combinations that never
+% happen in Turkmen. Would they happen, they would be hyphenated
+% according to the rules.
+% \ No newline at end of file
diff --git a/tex/generic/context/luatex-fonts-merged.lua b/tex/generic/context/luatex-fonts-merged.lua
index 800d3d525..0a4a179c7 100644
--- a/tex/generic/context/luatex-fonts-merged.lua
+++ b/tex/generic/context/luatex-fonts-merged.lua
@@ -1,6 +1,6 @@
--- merged file : c:/data/develop/context/texmf/tex/generic/context/luatex-fonts-merged.lua
--- parent file : c:/data/develop/context/texmf/tex/generic/context/luatex-fonts.lua
--- merge date : 03/12/10 19:55:31
+-- merged file : luatex-fonts-merged.lua
+-- parent file : luatex-fonts.lua
+-- merge date : 03/18/10 14:42:03
do -- begin closure to overcome local limits and interference
@@ -1433,7 +1433,9 @@ function file.removesuffix(filename)
end
function file.addsuffix(filename, suffix)
- if not find(filename,"%.[%a%d]+$") then
+ if not suffix or suffix == "" then
+ return filename
+ elseif not find(filename,"%.[%a%d]+$") then
return filename .. "." .. suffix
else
return filename
@@ -2339,7 +2341,7 @@ end
nodes.count = count
--- new
+-- new, will move
function attributes.ofnode(n)
local a = n.attr
@@ -2484,6 +2486,48 @@ function nodes.latelua(code)
return n
end
+--[[
+<p>At some point we ran into a problem that the glue specification
+of the zeropoint dimension was overwritten when adapting a glue spec
+node. This is a side effect of glue specs being shared. After a
+couple of hours tracing and debugging Taco and I came to the
+conclusion that it made no sense to complicate the spec allocator
+and settled on a writable flag. This all is a side effect of the
+fact that some glues use reserved memory slots (with the zeropoint
+glue being a noticeable one). So, next we wrap this into a function
+and hide it for the user. And yes, LuaTeX now gives a warning as
+well.</p>
+]]--
+
+if tex.luatexversion > 51 then
+
+ function nodes.writable_spec(n)
+ local spec = n.spec
+ if not spec then
+ spec = copy_node(glue_spec)
+ n.spec = spec
+ elseif not spec.writable then
+ spec = copy_node(spec)
+ n.spec = spec
+ end
+ return spec
+ end
+
+else
+
+ function nodes.writable_spec(n)
+ local spec = n.spec
+ if not spec then
+ spec = copy_node(glue_spec)
+ else
+ spec = copy_node(spec)
+ end
+ n.spec = spec
+ return spec
+ end
+
+end
+
local cache = { }
function nodes.usernumber(num)
@@ -3572,29 +3616,21 @@ local charactercache = { }
-- a virtual font has italic correction make sure to set the
-- has_italic flag. Some more flags will be added in the future.
-
function tfm.calculate_scale(tfmtable, scaledpoints, relativeid)
if scaledpoints < 0 then
scaledpoints = (- scaledpoints/1000) * tfmtable.designsize -- already in sp
end
- local delta = scaledpoints/(tfmtable.units or 1000) -- brr, some open type fonts have 2048
- return scaledpoints, delta
+ local units = tfmtable.units or 1000
+ local delta = scaledpoints/units -- brr, some open type fonts have 2048
+ return scaledpoints, delta, units
end
function tfm.do_scale(tfmtable, scaledpoints, relativeid)
-- tfm.prepare_base_kerns(tfmtable) -- optimalization
- local scaledpoints, delta = tfm.calculate_scale(tfmtable, scaledpoints, relativeid)
- if enable_auto_r_scale and relativeid then -- for the moment this is rather context specific
- local relativedata = fontdata[relativeid]
- local id_x_height = relativedata and relativedata.parameters and relativedata.parameters.x_height
- local tf_x_height = id_x_height and tfmtable.parameters and tfmtable.parameters.x_height * delta
- if tf_x_height then
- scaledpoints = (id_x_height/tf_x_height) * scaledpoints
- delta = scaledpoints/(tfmtable.units or 1000)
- end
- end
+ local t = { } -- the new table
+ local scaledpoints, delta, units = tfm.calculate_scale(tfmtable, scaledpoints, relativeid)
+ t.units_per_em = units or 1000
local hdelta, vdelta = delta, delta
- local t = { }
-- unicoded unique descriptions shared cidinfo characters changed parameters indices
for k,v in next, tfmtable do
if type(v) == "table" then
@@ -9726,7 +9762,7 @@ function fonts.methods.node.otf.features(head,font,attr)
local ra = rl [attr] if ra == nil then ra = { } rl [attr] = ra end -- attr can be false
-- sequences always > 1 so no need for optimization
for s=1,#sequences do
- local pardir, txtdir = 0, { }
+ local pardir, txtdir = 0, { }
local success = false
local sequence = sequences[s]
local r = ra[s] -- cache
@@ -9752,12 +9788,10 @@ function fonts.methods.node.otf.features(head,font,attr)
-- only first attribute match check, so we assume simple fina's
-- default can become a font feature itself
if l[language] then
---~ valid, what = true, language
valid, what = s_e or a_e, language
-- elseif l[default] then
-- valid, what = true, default
elseif l[wildcard] then
---~ valid, what = true, wildcard
valid, what = s_e or a_e, wildcard
end
if valid then
@@ -9833,19 +9867,15 @@ function fonts.methods.node.otf.features(head,font,attr)
if not lookupcache then
report_missing_cache(typ,lookupname)
else
---~ print(typ,lookupname,lookupcache,table.serialize(lookupcache))
while start do
local id = start.id
if id == glyph then
---~ if start.font == font and start.subtype<256 and (not attr or has_attribute(start,0,attr)) and (not attribute or has_attribute(start,state,attribute)) then
if start.font == font and start.subtype<256 and has_attribute(start,0,attr) and (not attribute or has_attribute(start,state,attribute)) then
local lookupmatch = lookupcache[start.char]
if lookupmatch then
-- sequence kan weg
local ok
---~ print("!!!")
start, ok = handler(start,r[4],lookupname,lookupmatch,sequence,featuredata,1)
---~ texio.write_nl(tostring(lookupname),tostring(lookupmatch),tostring(ok))
if ok then
success = true
end
@@ -9870,25 +9900,6 @@ function fonts.methods.node.otf.features(head,font,attr)
-- start = start.next
-- end
elseif id == whatsit then
---~ if subtype == 7 then
---~ local dir = start.dir
---~ if dir == "+TRT" then
---~ rlmode = -1
---~ elseif dir == "+TLT" then
---~ rlmode = 1
---~ else
---~ rlmode = 0
---~ end
---~ elseif subtype == 6 then
---~ local dir = start.dir
---~ if dir == "TRT" then
---~ rlmode = -1
---~ elseif dir == "TLT" then
---~ rlmode = 1
---~ else
---~ rlmode = 0
---~ end
---~ end
local subtype = start.subtype
if subtype == 7 then
local dir = start.dir
@@ -9974,59 +9985,40 @@ function fonts.methods.node.otf.features(head,font,attr)
-- end
elseif id == whatsit then
local subtype = start.subtype
---~ if subtype == 7 then
---~ local dir = start.dir
---~ if dir == "+TRT" then
---~ rlmode = -1
---~ elseif dir == "+TLT" then
---~ rlmode = 1
---~ else
---~ rlmode = 0
---~ end
---~ elseif subtype == 6 then
---~ local dir = start.dir
---~ if dir == "TRT" then
---~ rlmode = -1
---~ elseif dir == "TLT" then
---~ rlmode = 1
---~ else
---~ rlmode = 0
---~ end
---~ end
- local subtype = start.subtype
- if subtype == 7 then
- local dir = start.dir
- if dir == "+TRT" or dir == "+TLT" then
- insert(txtdir,dir)
- elseif dir == "-TRT" or dir == "-TLT" then
- remove(txtdir)
- end
- local d = txtdir[#txtdir]
- if d == "+TRT" then
- rlmode = -1
- elseif d == "+TLT" then
- rlmode = 1
- else
- rlmode = pardir
- end
- if trace_directions then
- logs.report("fonts","directions after textdir %s: pardir=%s, txtdir=%s:%s, rlmode=%s",dir,pardir,#txtdir,txtdir[#txtdir] or "unset",rlmode)
- end
- elseif subtype == 6 then
- local dir = start.dir
- if dir == "TRT" then
- pardir = -1
- elseif dir == "TLT" then
- pardir = 1
- else
- pardir = 0
- end
+ local subtype = start.subtype
+ if subtype == 7 then
+ local dir = start.dir
+ if dir == "+TRT" or dir == "+TLT" then
+ insert(txtdir,dir)
+ elseif dir == "-TRT" or dir == "-TLT" then
+ remove(txtdir)
+ end
+ local d = txtdir[#txtdir]
+ if d == "+TRT" then
+ rlmode = -1
+ elseif d == "+TLT" then
+ rlmode = 1
+ else
rlmode = pardir
- --~ txtdir = { }
+ end
if trace_directions then
- logs.report("fonts","directions after pardir %s: pardir=%s, txtdir=%s:%s, rlmode=%s",dir,pardir,#txtdir,txtdir[#txtdir] or "unset",rlmode)
+ logs.report("fonts","directions after textdir %s: pardir=%s, txtdir=%s:%s, rlmode=%s",dir,pardir,#txtdir,txtdir[#txtdir] or "unset",rlmode)
end
+ elseif subtype == 6 then
+ local dir = start.dir
+ if dir == "TRT" then
+ pardir = -1
+ elseif dir == "TLT" then
+ pardir = 1
+ else
+ pardir = 0
end
+ rlmode = pardir
+ --~ txtdir = { }
+ if trace_directions then
+ logs.report("fonts","directions after pardir %s: pardir=%s, txtdir=%s:%s, rlmode=%s",dir,pardir,#txtdir,txtdir[#txtdir] or "unset",rlmode)
+ end
+ end
start = start.next
else
start = start.next