summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2010-03-01 23:24:00 +0100
committerHans Hagen <pragma@wxs.nl>2010-03-01 23:24:00 +0100
commitb0343246fc469fa519ae66fbfae28c8547cc3d56 (patch)
tree45efdef9b54bcc1efbb5c2e2b7d1424c7dca9f2a
parent8ce9c33634056a6c8b9673c7f14a27cef1f3348f (diff)
downloadcontext-b0343246fc469fa519ae66fbfae28c8547cc3d56.tar.gz
beta 2010.03.01 23:24
-rw-r--r--scripts/context/lua/mtx-mtxworks.lua14
-rw-r--r--scripts/context/lua/mtx-server-ctx-fonttest.lua2
-rw-r--r--scripts/context/lua/mtx-server-ctx-help.lua4
-rw-r--r--scripts/context/lua/mtx-texworks.lua1
-rwxr-xr-xscripts/context/stubs/mswin/mtxworks.exebin5633 -> 0 bytes
-rwxr-xr-xscripts/context/stubs/unix/mtxworks2
-rw-r--r--tex/context/base/attr-ini.lua12
-rw-r--r--tex/context/base/attr-ini.mkiv6
-rw-r--r--tex/context/base/colo-ini.mkiv34
-rw-r--r--tex/context/base/cont-new.tex2
-rw-r--r--tex/context/base/context.tex2
-rw-r--r--tex/context/base/font-def.lua1
-rw-r--r--tex/context/base/font-ini.lua3
-rw-r--r--tex/context/base/font-ini.mkiv2
-rw-r--r--tex/context/base/font-otb.lua9
-rw-r--r--tex/context/base/font-otf.lua3
-rw-r--r--tex/context/base/l-dimen.lua1
-rw-r--r--tex/context/base/node-pag.lua3
-rw-r--r--tex/context/base/node-par.lua75
-rw-r--r--tex/context/base/node-par.mkiv8
-rw-r--r--tex/context/base/node-pro.lua2
-rw-r--r--tex/context/base/node-tsk.lua32
-rw-r--r--tex/context/base/strc-def.mkiv2
-rw-r--r--tex/context/base/strc-doc.lua47
-rw-r--r--tex/context/base/strc-num.mkiv2
-rw-r--r--tex/context/base/task-ini.lua4
-rw-r--r--tex/context/base/typo-cap.lua7
-rw-r--r--tex/context/base/typo-krn.lua18
-rw-r--r--tex/context/base/typo-mir.lua3
-rw-r--r--tex/context/interface/cont-cs.xml1
-rw-r--r--tex/context/interface/cont-de.xml1
-rw-r--r--tex/context/interface/cont-en.xml1
-rw-r--r--tex/context/interface/cont-fr.xml1
-rw-r--r--tex/context/interface/cont-it.xml1
-rw-r--r--tex/context/interface/cont-nl.xml1
-rw-r--r--tex/context/interface/cont-pe.xml1
-rw-r--r--tex/context/interface/cont-ro.xml1
-rw-r--r--tex/generic/context/luatex-fonts-merged.lua18
38 files changed, 222 insertions, 105 deletions
diff --git a/scripts/context/lua/mtx-mtxworks.lua b/scripts/context/lua/mtx-mtxworks.lua
new file mode 100644
index 000000000..1239ae4c5
--- /dev/null
+++ b/scripts/context/lua/mtx-mtxworks.lua
@@ -0,0 +1,14 @@
+if not modules then modules = { } end modules ['mtx-mtxworks'] = {
+ version = 1.002,
+ comment = "companion to mtxrun.lua",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- this is a shortcut to "mtxrun --script texworks --start"
+
+environment.setargument("start",true)
+
+require "mtx-texworks"
+
diff --git a/scripts/context/lua/mtx-server-ctx-fonttest.lua b/scripts/context/lua/mtx-server-ctx-fonttest.lua
index 23a3b5d11..af4d778cf 100644
--- a/scripts/context/lua/mtx-server-ctx-fonttest.lua
+++ b/scripts/context/lua/mtx-server-ctx-fonttest.lua
@@ -6,7 +6,7 @@ if not modules then modules = { } end modules ['mtx-server-ctx-fonttest'] = {
license = "see context related readme files"
}
-dofile(resolvers.find_file("l-aux.lua","tex"))
+--~ dofile(resolvers.find_file("l-aux.lua","tex"))
dofile(resolvers.find_file("trac-lmx.lua","tex"))
dofile(resolvers.find_file("font-ott.lua","tex"))
dofile(resolvers.find_file("font-syn.lua","tex"))
diff --git a/scripts/context/lua/mtx-server-ctx-help.lua b/scripts/context/lua/mtx-server-ctx-help.lua
index b6c97118b..4416a0ec1 100644
--- a/scripts/context/lua/mtx-server-ctx-help.lua
+++ b/scripts/context/lua/mtx-server-ctx-help.lua
@@ -8,8 +8,8 @@ if not modules then modules = { } end modules ['mtx-server-ctx-help'] = {
-- todo in lua interface: noargument, oneargument, twoarguments, threearguments
-dofile(resolvers.find_file("l-aux.lua","tex"))
-dofile(resolvers.find_file("l-url.lua","tex"))
+--~ dofile(resolvers.find_file("l-aux.lua","tex"))
+--~ dofile(resolvers.find_file("l-url.lua","tex"))
dofile(resolvers.find_file("trac-lmx.lua","tex"))
-- problem ... serialize parent stack
diff --git a/scripts/context/lua/mtx-texworks.lua b/scripts/context/lua/mtx-texworks.lua
index e2063ad7e..427bc9eff 100644
--- a/scripts/context/lua/mtx-texworks.lua
+++ b/scripts/context/lua/mtx-texworks.lua
@@ -83,7 +83,6 @@ function scripts.texworks.start(indeed)
end
end
-
logs.extendbanner("TeXworks Startup Script 1.00",true)
messages.help = [[
diff --git a/scripts/context/stubs/mswin/mtxworks.exe b/scripts/context/stubs/mswin/mtxworks.exe
deleted file mode 100755
index 9a67fc133..000000000
--- a/scripts/context/stubs/mswin/mtxworks.exe
+++ /dev/null
Binary files differ
diff --git a/scripts/context/stubs/unix/mtxworks b/scripts/context/stubs/unix/mtxworks
deleted file mode 100755
index ef8f230c3..000000000
--- a/scripts/context/stubs/unix/mtxworks
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-mtxrun --script texworks --start
diff --git a/tex/context/base/attr-ini.lua b/tex/context/base/attr-ini.lua
index 37615c140..dd56e083a 100644
--- a/tex/context/base/attr-ini.lua
+++ b/tex/context/base/attr-ini.lua
@@ -15,6 +15,7 @@ local concat = table.concat
local texsprint = tex.sprint
local ctxcatcodes = tex.ctxcatcodes
+local unsetvalue = attributes.unsetvalue
-- todo: document this but first reimplement this as it reflects the early
-- days of luatex / mkiv and we have better ways now
@@ -79,10 +80,13 @@ local templates = {
}
local models = {
- all = 1,
- gray = 2,
- rgb = 3,
- cmyk = 4,
+ [interfaces.variables.none] = unsetvalue,
+ black = unsetvalue,
+ bw = unsetvalue,
+ all = 1,
+ gray = 2,
+ rgb = 3,
+ cmyk = 4,
}
colors.model = "all"
diff --git a/tex/context/base/attr-ini.mkiv b/tex/context/base/attr-ini.mkiv
index 051128558..87d06c48a 100644
--- a/tex/context/base/attr-ini.mkiv
+++ b/tex/context/base/attr-ini.mkiv
@@ -70,14 +70,14 @@
\newcount\currentcolormodel
-\def\setcolormodel#1%
+\def\dosetcolormodel#1%
{\currentcolormodel\ctxlua{tex.print(colors.setmodel('#1'))}%
\attribute\colormodelattribute\currentcolormodel}
-\setcolormodel{all}
+\dosetcolormodel{all}
\appendtoks
- \setcolormodel{all}% redundant?
+ \dosetcolormodel{all}% redundant?
\to \everyjob
\def\registerrgbcolor #1#2#3#4{\ctxlua{colors.register('#1','rgb' ,#2,#3,#4)}}
diff --git a/tex/context/base/colo-ini.mkiv b/tex/context/base/colo-ini.mkiv
index fc81908e4..36de4afcb 100644
--- a/tex/context/base/colo-ini.mkiv
+++ b/tex/context/base/colo-ini.mkiv
@@ -59,6 +59,7 @@
\newif\ifSPOTsupported
\newif\ifpreferGRAY
\newif\ifGRAYprefered
+\newif\ifconvertGRAY \convertGRAYtrue
\newif\ifreduceCMYK
\newif\ifconverttoGRAY
\newif\ifweightGRAY \weightGRAYtrue
@@ -269,9 +270,12 @@
{\ifMPspotcolors \showcolormessage\m!colors {9}{\v!mp\v!spot}\MPspotcolorsfalse \fi}
{\ifMPspotcolors \else\showcolormessage\m!colors{10}{\v!mp\v!spot}\MPspotcolorstrue \fi}%
\preferGRAYfalse
+ \convertGRAYtrue
\processaction
[\@@clconversion]
[ \v!yes=>\preferGRAYtrue,
+ \v!no=>\convertGRAYfalse,
+ \v!never=>\convertGRAYfalse,
\v!always=>\preferGRAYtrue\RGBsupportedfalse\CMYKsupportedfalse]%
\ifRGBsupported
\converttoGRAYfalse
@@ -710,35 +714,43 @@
\ifx\currentcolormodel\undefined \newcount\currentcolormodel \fi
-\def\setcolormodel#1%
- {\showcolormessage\m!colors1{#1}%
- \dosetcolormodel{#1}}
+% \def\setcolormodel#1%
+% {\showcolormessage\m!colors1{#1}%
+% \dosetcolormodel{#1}}
\def\dosetcolormodel#1% no message
{\currentcolormodel\ctxlua{tex.print(colors.setmodel('#1',\ifweightGRAY true\else false\fi))}%
\attribute\colormodelattribute\currentcolormodel}
-\setcolormodel{all}
+\dosetcolormodel{all}
+
\def\dosetupcolormodel
{\ifincolor
\ifRGBsupported
\ifCMYKsupported
- \setcolormodel{all}%
+ \dosetcolormodel{all}%
\else
- \setcolormodel{rgb}%
+ \dosetcolormodel{rgb}%
\fi
\else
\ifCMYKsupported
- \setcolormodel{cmyk}%
+ \dosetcolormodel{cmyk}%
\else
- \setcolormodel{gray}%
+ \ifconvertGRAY
+ \dosetcolormodel{gray}%
+ \else
+ \dosetcolormodel{none}%
+ \fi
\fi
\fi
\else
- \setcolormodel{gray}%
- \fi
- }%\aftergroup\dosetupcolormodel}
+ \ifconvertGRAY
+ \dosetcolormodel{gray}%
+ \else
+ \dosetcolormodel{none}%
+ \fi
+ \fi}
\appendtoks
\dosetupcolormodel
diff --git a/tex/context/base/cont-new.tex b/tex/context/base/cont-new.tex
index ad7d67d32..aadc97bdf 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.02.25 19:46}
+\newcontextversion{2010.03.01 23:24}
%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 20cd0b843..56f2c37ad 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.02.25 19:46}
+\edef\contextversion{2010.03.01 23:24}
%D For those who want to use this:
diff --git a/tex/context/base/font-def.lua b/tex/context/base/font-def.lua
index fcbbce1a3..ed92351e6 100644
--- a/tex/context/base/font-def.lua
+++ b/tex/context/base/font-def.lua
@@ -535,6 +535,7 @@ function define.register(fontdata,id)
logs.report("define font","loading at 2 id %s, hash: %s",id or "?",hash or "?")
end
fonts.ids[id] = fontdata
+ fonts.chr[id] = fontdata.characters
tfm.internalized[hash] = id
end
end
diff --git a/tex/context/base/font-ini.lua b/tex/context/base/font-ini.lua
index 5cff22760..bcf46ad7d 100644
--- a/tex/context/base/font-ini.lua
+++ b/tex/context/base/font-ini.lua
@@ -23,6 +23,7 @@ fontloader.totable = fontloader.to_table
fonts = fonts or { }
fonts.ids = fonts.ids or { } -- aka fontdata
+fonts.chr = fonts.chr or { } -- aka chardata
fonts.tfm = fonts.tfm or { }
fonts.mode = 'base'
@@ -35,6 +36,8 @@ fonts.ids[0] = { -- nullfont
name = "nullfont",
}
+fonts.chr[0] = { }
+
fonts.methods = fonts.methods or {
base = { tfm = { }, afm = { }, otf = { }, vtf = { }, fix = { } },
node = { tfm = { }, afm = { }, otf = { }, vtf = { }, fix = { } },
diff --git a/tex/context/base/font-ini.mkiv b/tex/context/base/font-ini.mkiv
index 2d1953663..40142ea10 100644
--- a/tex/context/base/font-ini.mkiv
+++ b/tex/context/base/font-ini.mkiv
@@ -2923,7 +2923,7 @@
% \def\sc{\setfontfeature{smallcaps}}
\def\os{\setfontfeature{just-os}}
-%D Code for swithcing to fraktur and script has also been
+%D Code for switching to fraktur and script has also been
%D changed. We now have an alphabet switcher.
\ifx\mathtext\undefined \let\mathtext\hbox \fi
diff --git a/tex/context/base/font-otb.lua b/tex/context/base/font-otb.lua
index 020b107a5..a3d347737 100644
--- a/tex/context/base/font-otb.lua
+++ b/tex/context/base/font-otb.lua
@@ -305,12 +305,13 @@ end
-- to do complete mixed runs and not run featurewise (as we did before).
local supported_gsub = {
- 'liga','dlig','rlig','hlig',
- 'pnum','onum','tnum','lnum',
+ 'liga', 'dlig', 'rlig', 'hlig',
+ 'pnum', 'onum', 'tnum', 'lnum',
'zero',
- 'smcp','cpsp','c2sc','ornm','aalt',
- 'hwid','fwid',
+ 'smcp', 'cpsp', 'c2sc', 'ornm', 'aalt',
+ 'hwid', 'fwid',
'ssty', 'rtlm', -- math
+-- 'tlig', 'trep',
}
local supported_gpos = {
diff --git a/tex/context/base/font-otf.lua b/tex/context/base/font-otf.lua
index 1465e138b..9aa1a3a1f 100644
--- a/tex/context/base/font-otf.lua
+++ b/tex/context/base/font-otf.lua
@@ -87,6 +87,9 @@ otf.notdef = false
otf.cache = containers.define("fonts", "otf", otf.version, true)
otf.cleanup_aat = false -- only context
+local wildcard = "*"
+local default = "dflt"
+
--[[ldx--
<p>We start with a lot of tables and related functions.</p>
--ldx]]--
diff --git a/tex/context/base/l-dimen.lua b/tex/context/base/l-dimen.lua
index e15e29463..52ef06dcb 100644
--- a/tex/context/base/l-dimen.lua
+++ b/tex/context/base/l-dimen.lua
@@ -100,6 +100,7 @@ end
<p>We collect a bunch of converters in the <type>number</type> namespace.</p>
--ldx]]--
+number.maxdimen = 1073741823
number.todimen = todimen
number.dimenfactors = dimenfactors
diff --git a/tex/context/base/node-pag.lua b/tex/context/base/node-pag.lua
index 2f149ab44..4bc53c6dd 100644
--- a/tex/context/base/node-pag.lua
+++ b/tex/context/base/node-pag.lua
@@ -6,7 +6,8 @@ if not modules then modules = { } end modules ['node-pag'] = {
license = "see context related readme files"
}
--- this callback might disappear
+-- this callback might disappear and come back in the same way
+-- as par builders
pagebuilders = pagebuilders or { }
diff --git a/tex/context/base/node-par.lua b/tex/context/base/node-par.lua
index ee0dfaf8a..a8ad969fe 100644
--- a/tex/context/base/node-par.lua
+++ b/tex/context/base/node-par.lua
@@ -9,54 +9,85 @@ if not modules then modules = { } end modules ['node-par'] = {
parbuilders = parbuilders or { }
parbuilders.constructors = parbuilders.constructors or { }
parbuilders.names = parbuilders.names or { }
+parbuilders.numbers = parbuilders.numbers or { }
parbuilders.attribute = attributes.numbers['parbuilder'] or 999
-local constructors, names, p_attribute = parbuilders.constructors, parbuilders.names, parbuilders.attribute
+storage.register("parbuilders.names", parbuilders.names, "parbuilders.names")
+storage.register("parbuilders.numbers", parbuilders.numbers, "parbuilders.numbers")
-storage.register("parbuilders.names", parbuilders.names, "parbuilders.names")
+local constructors, names, numbers, p_attribute = parbuilders.constructors, parbuilders.names, parbuilders.numbers, parbuilders.attribute
local has_attribute = node.has_attribute
local starttiming, stoptiming = statistics.starttiming, statistics.stoptiming
--- store parbuilders.names
+local mainconstructor = nil -- not stored in format
-function parbuilders.register(name,attribute)
- parbuilders.names[attribute] = name
+function parbuilders.register(name,number)
+ parbuilders.names[number] = name
+ parbuilders.numbers[name] = number
end
-function parbuilders.constructor(head,is_display)
- local attribute = has_attribute(head,p_attribute)
- if attribute then
- local constructor = names[attribute]
- if constructor then
- return constructors[constructor](head,is_display)
+function parbuilders.setmain(name)
+ mainconstructor = numbers[name]
+end
+
+-- return values:
+--
+-- true : tex will break itself
+-- false : idem but dangerous
+-- head : list of valid vmode nodes with last being hlist
+
+function parbuilders.constructor(head,followed_by_display)
+ if type(head) == "boolean" then
+ return head
+ else
+ local attribute = has_attribute(head,p_attribute) or mainconstructor
+ if attribute then
+ local constructor = names[attribute]
+ if constructor then
+ return constructors[constructor](head,followed_by_display)
+ end
end
+ return true -- let tex break
end
- return false
end
-- just for testing
-function parbuilders.constructors.default(head,is_display)
- return false
+function parbuilders.constructors.default(head,followed_by_display)
+ return true -- let tex break
end
-- also for testing (no surrounding spacing done)
-function parbuilders.constructors.oneline(head,is_display)
+function parbuilders.constructors.oneline(head,followed_by_display)
return node.hpack(head)
end
-local actions = tasks.actions("parbuilders",1)
+-- It makes no sense to have a sequence here as we already have
+-- pre and post hooks and only one parbuilder makes sense, so no:
+--
+-- local actions = tasks.actions("parbuilders",1)
+
+-- todo: enable one as main
-local function processor(head,is_display)
- starttiming(parbuilders)
- local _, done = actions(head,is_display)
- stoptiming(parbuilders)
- return done
+local actions = parbuilders.constructor
+local enabled = false
+
+function parbuilders.enable () enabled = true end
+function parbuilders.disable() enabled = false end
+
+local function processor(head,followed_by_display)
+ if enabled then
+ starttiming(parbuilders)
+ local head = actions(head,followed_by_display)
+ stoptiming(parbuilders)
+ return head
+ else
+ return true -- ler tex do the work
+ end
end
---~ callbacks.register('linebreak_filter', actions, "breaking paragraps into lines")
callbacks.register('linebreak_filter', processor, "breaking paragraps into lines")
statistics.register("linebreak processing time", function()
diff --git a/tex/context/base/node-par.mkiv b/tex/context/base/node-par.mkiv
index 574991282..1381d272a 100644
--- a/tex/context/base/node-par.mkiv
+++ b/tex/context/base/node-par.mkiv
@@ -48,13 +48,17 @@
{\globalpopmacro\@@currentparbuilder
\attribute\parbuilderattribute\@@currentparbuilder\relax}
+\def\setmainparbuilder[#1]%
+ {\ctxlua{parbuilders.setmain("#1")}}
+
% no high level interface, after all implementing a linebreaker is not something that
% the average user will do
\defineparbuilder[default] % just for testing
\defineparbuilder[oneline] % just for testing
+\defineparbuilder[basic] % just for testing
-\def\enableparbuilders {\ctxlua{tasks.enableaction ("parbuilders", "parbuilders.constructor")}}
-\def\disableparbuilders{\ctxlua{tasks.disableaction("parbuilders", "parbuilders.constructor")}}
+\def\enableparbuilders {\ctxlua{parbuilders.enable ()}}
+\def\disableparbuilders{\ctxlua{parbuilders.disable()}}
\protect \endinput
diff --git a/tex/context/base/node-pro.lua b/tex/context/base/node-pro.lua
index 24d11cbe9..4f5b3dcbe 100644
--- a/tex/context/base/node-pro.lua
+++ b/tex/context/base/node-pro.lua
@@ -145,5 +145,5 @@ end
callbacks.register('post_linebreak_filter', nodes.processors.post_linebreak_filter,"all kind of horizontal manipulations (after par break)")
statistics.register("h-node processing time", function()
- return statistics.elapsedseconds(nodes,"including kernel")
+ return statistics.elapsedseconds(nodes,"including kernel") -- hm, ok here?
end)
diff --git a/tex/context/base/node-tsk.lua b/tex/context/base/node-tsk.lua
index 9accfc6d7..4b1c133d7 100644
--- a/tex/context/base/node-tsk.lua
+++ b/tex/context/base/node-tsk.lua
@@ -289,20 +289,20 @@ tasks.new (
}
)
-tasks.new (
- "parbuilders",
- {
- "before", -- for users
- "lists",
- "after", -- for users
- }
-)
+--~ tasks.new (
+--~ "parbuilders",
+--~ {
+--~ "before", -- for users
+--~ "lists",
+--~ "after", -- for users
+--~ }
+--~ )
-tasks.new (
- "pagebuilders",
- {
- "before", -- for users
- "lists",
- "after", -- for users
- }
-)
+--~ tasks.new (
+--~ "pagebuilders",
+--~ {
+--~ "before", -- for users
+--~ "lists",
+--~ "after", -- for users
+--~ }
+--~ )
diff --git a/tex/context/base/strc-def.mkiv b/tex/context/base/strc-def.mkiv
index 0ef59b300..f1a8aab87 100644
--- a/tex/context/base/strc-def.mkiv
+++ b/tex/context/base/strc-def.mkiv
@@ -110,7 +110,7 @@
\definestructureseparatorset [\s!default] [] [.]
\definestructureconversionset [\s!default] [] [numbers]
-\definestructureresetset [\s!default] [] [1]
+\definestructureresetset [\s!default] [] [1] % each level
\definestructureprefixset [\s!default] [section-1,section-2,section-3] []
\definestructureprefixset [\v!all] [section-1,section-2,section-3,section-4,section-5,section-6,section-7,section-8] []
diff --git a/tex/context/base/strc-doc.lua b/tex/context/base/strc-doc.lua
index 45951cf06..b3b9d05a5 100644
--- a/tex/context/base/strc-doc.lua
+++ b/tex/context/base/strc-doc.lua
@@ -6,9 +6,15 @@ if not modules then modules = { } end modules ['strc-doc'] = {
license = "see context related readme files"
}
+-- todo: associate counter with head
+
+-- we need to freeze and document this module
+
local next, type = next, type
local format, gsub, find, concat, gmatch, match = string.format, string.gsub, string.find, table.concat, string.gmatch, string.match
local texsprint, texwrite = tex.sprint, tex.write
+local concat = table.concat
+local max, min = math.max, math.min
local ctxcatcodes = tex.ctxcatcodes
local variables = interfaces.variables
@@ -16,6 +22,7 @@ local variables = interfaces.variables
--~ if not trackers then trackers = { register = function() end } end
local trace_sectioning = false trackers.register("structure.sectioning", function(v) trace_sectioning = v end)
+local trace_detail = false trackers.register("structure.detail", function(v) trace_detail = v end)
local function report(...)
--~ print(...)
@@ -190,15 +197,18 @@ end
function sections.somelevel(given)
-- old number
local numbers, ownnumbers, forced, status, olddepth = data.numbers, data.ownnumbers, data.forced, data.status, data.depth
---~ print("old",olddepth,given.metadata.name,levelmap[given.metadata.name])
- local newdepth = tonumber(levelmap[given.metadata.name] or (olddepth > 0 and olddepth) or 1) -- hm, levelmap only works for section-*
---~ print("new",newdepth)
+ local givenname = given.metadata.name
+ local mappedlevel = levelmap[givenname]
+ local newdepth = tonumber(mappedlevel or (olddepth > 0 and olddepth) or 1) -- hm, levelmap only works for section-*
local directives = given.directives
local resetset = (directives and directives.resetset) or ""
- local resetter = sets.getall("structure:resets",data.block,resetset)
+ -- local resetter = sets.getall("structure:resets",data.block,resetset)
-- a trick to permits userdata to overload title, ownnumber and reference
-- normally these are passed as argument but nowadays we provide several
-- interfaces (we need this because we want to be compatible)
+ if trace_detail then
+ logs.report("structure","name '%s', mapped level '%s', old depth '%s', new depth '%s', reset set '%s'",givenname,mappedlevel,olddepth,newdepth,resetset)
+ end
local u = given.userdata
if u then
-- kind of obsolete as we can pass them directly anyway
@@ -212,7 +222,9 @@ function sections.somelevel(given)
if newdepth > olddepth then
for i=olddepth+1,newdepth do
local s = tonumber(sets.get("structure:resets",data.block,resetset,i))
---~ logs.report("structure >","old: %s, new:%s, reset: %s (%s: %s)",olddepth,newdepth,s,resetset,table.concat(resetter,","))
+ if trace_detail then
+ logs.report("structure","new>old (%s>%s), reset set '%s', reset value '%s', current '%s'",olddepth,newdepth,resetset,s or "?",numbers[i] or "?")
+ end
if not s or s == 0 then
numbers[i] = numbers[i] or 0
ownnumbers[i] = ownnumbers[i] or ""
@@ -225,7 +237,9 @@ function sections.somelevel(given)
elseif newdepth < olddepth then
for i=olddepth,newdepth+1,-1 do
local s = tonumber(sets.get("structure:resets",data.block,resetset,i))
---~ logs.report("structure <","old: %s, new:%s, reset: %s (%s: %s)",olddepth,newdepth,s,resetset,table.concat(resetter,","))
+ if trace_detail then
+ logs.report("structure","new<old (%s<%s), reset set '%s', reset value '%s', current '%s'",olddepth,newdepth,resetset,s or "?",numbers[i] or "?")
+ end
if not s or s == 0 then
numbers[i] = numbers[i] or 0
ownnumbers[i] = ownnumbers[i] or ""
@@ -243,7 +257,7 @@ structure.counters.check(newdepth)
-- new number
olddepth = newdepth
if given.metadata.increment then
- local oldn, newn = numbers[newdepth], 0
+ local oldn, newn = numbers[newdepth] or 0, 0
local fd = forced[newdepth]
if fd then
if fd[1] == "add" then
@@ -255,16 +269,26 @@ structure.counters.check(newdepth)
newn = 1 -- maybe zero is nicer
end
forced[newdepth] = nil
+ if trace_detail then
+ logs.report("structure","old depth '%s', new depth '%s, old n '%s', new n '%s', forced '%s'",olddepth,newdepth,oldn,newn,concat(fd,""))
+ end
elseif newn then
newn = oldn + 1
+ if trace_detail then
+ logs.report("structure","old depth '%s', new depth '%s, old n '%s', new n '%s', increment",olddepth,newdepth,oldn,newn)
+ end
else
local s = tonumber(sets.get("structure:resets",data.block,resetset,newdepth))
---~ logs.report("structure =","old: %s, new:%s, reset: %s (%s: %s)",olddepth,newdepth,s,resetset,table.concat(resetter,","))
- if not s or s == 0 then
+ if not s then
+ newn = oldn or 0
+ elseif s == 0 then
newn = oldn or 0
else
newn = s - 1
end
+ if trace_detail then
+ logs.report("structure","old depth '%s', new depth '%s, old n '%s', new n '%s', reset",olddepth,newdepth,oldn,newn)
+ end
end
numbers[newdepth] = newn
end
@@ -288,6 +312,9 @@ structure.counters.check(newdepth)
if #ownnumbers > 0 then
numberdata.ownnumbers = table.fastcopy(ownnumbers)
end
+ if trace_detail then
+ logs.report("structure","name '%s', numbers '%s', own numbers '%s'",givenname,concat(numberdata.numbers, " "),concat(numberdata.ownnumbers, " "))
+ end
given.references.section = sections.save(given)
-- given.numberdata = nil
end
@@ -297,7 +324,7 @@ function sections.writestatus()
local numbers, ownnumbers, status, depth = data.numbers, data.ownnumbers, data.status, data.depth
local d = status[depth]
local o = concat(ownnumbers,".",1,depth)
- local n = (numbers and concat(numbers,".",1,depth)) or 0
+ local n = (numbers and concat(numbers,".",1,min(depth,#numbers))) or 0
local l = d.titledata.title or ""
local t = (l ~= "" and l) or d.titledata.title or "[no title]"
local m = d.metadata.name
diff --git a/tex/context/base/strc-num.mkiv b/tex/context/base/strc-num.mkiv
index 01e9d2177..42f59c9e7 100644
--- a/tex/context/base/strc-num.mkiv
+++ b/tex/context/base/strc-num.mkiv
@@ -267,7 +267,7 @@
)}%
\endgroup}
-\def\convertedsubstructurecounter
+\unexpanded\def\convertedsubstructurecounter
{\dotripleempty\doconvertedsubstructurecounter}
\def\doconvertedsubstructurecounter[#1][#2][#3]% #2 can be n or n:m
diff --git a/tex/context/base/task-ini.lua b/tex/context/base/task-ini.lua
index 3a1714e89..5db86ee8d 100644
--- a/tex/context/base/task-ini.lua
+++ b/tex/context/base/task-ini.lua
@@ -51,8 +51,6 @@ tasks.appendaction("math", "normalizers", "noads.respace_characters", nil
tasks.appendaction("math", "builders", "noads.mlist_to_hlist") -- always on
-tasks.appendaction("parbuilders", "lists", "parbuilders.constructor") -- disabled
-
-- quite experimental
tasks.appendaction("finalizers", "lists", "nodes.repackage_graphicvadjust") -- todo
@@ -89,8 +87,6 @@ tasks.disableaction("shipouts", "nodes.add_destinations")
tasks.disableaction("mvlbuilders", "nodes.migrate_outwards")
-tasks.disableaction("parbuilders", "parbuilders.constructor")
-
callbacks.freeze("find_.*_file", "find file using resolver")
callbacks.freeze("read_.*_file", "read file at once")
callbacks.freeze("open_.*_file", "open file for reading")
diff --git a/tex/context/base/typo-cap.lua b/tex/context/base/typo-cap.lua
index 302953192..5f741da7c 100644
--- a/tex/context/base/typo-cap.lua
+++ b/tex/context/base/typo-cap.lua
@@ -20,6 +20,7 @@ local glyph = node.id("glyph")
local kern = node.id("kern")
local fontdata = fonts.ids
+local fontchar = fonts.chr
local chardata = characters.data
cases = cases or { }
@@ -50,7 +51,8 @@ local function helper(start, code, codes, special, attribute, once)
start.font = lastfont
end
end
- local ifc = fontdata[fnt].characters
+ -- local ifc = fontdata[fnt].characters
+ local ifc = fontchar[fnt]
local ucs = dc[codes]
if ucs then
local ok = true
@@ -148,7 +150,8 @@ actions[8] = function(start)
lastfont = nil
local ch = start.char
local mr = math.random
- local tfm = fontdata[start.font].characters
+ -- local tfm = fontdata[start.font].characters
+ local tfm = fontchar[start.font]
if chardata[ch].lccode then
while true do
local d = chardata[mr(1,0xFFFF)]
diff --git a/tex/context/base/typo-krn.lua b/tex/context/base/typo-krn.lua
index 59b89ff10..3de601911 100644
--- a/tex/context/base/typo-krn.lua
+++ b/tex/context/base/typo-krn.lua
@@ -97,15 +97,16 @@ local function process(namespace,attribute,head,force)
-- fontdata access can be done more efficient
if prev.font == lastfont then
local prevchar, lastchar = prev.char, start.char
- local tfm = fontdata[lastfont].characters[prevchar]
+ local fnt = fontdata[lastfont]
+ local tfm = fnt.characters[prevchar]
local ickern = tfm.kerns
if ickern and ickern[lastchar] then
- krn = scale(ickern[lastchar]+fontdata[lastfont].parameters.quad,krn)
+ krn = scale(ickern[lastchar]+fnt.parameters.quad,krn)
else
- krn = scale(fontdata[lastfont].parameters.quad,krn)
+ krn = scale(fnt.parameters.quad,krn)
end
else
- krn = scale(fontdata[lastfont].parameters.quad,krn)
+ krn = scale(fnt.parameters.quad,krn)
end
insert_node_before(head,start,make_kern_node(krn))
done = true
@@ -158,15 +159,16 @@ local function process(namespace,attribute,head,force)
else
if prv and prv.id == glyph and prv.font == lastfont then
local prevchar, lastchar = prv.char, start.char
- local tfm = fontdata[lastfont].characters[prevchar]
+ local fnt = fontdata[lastfont]
+ local tfm = fnt.characters[prevchar]
local ickern = tfm.kerns
if ickern and ickern[lastchar] then
- krn = scale(ickern[lastchar]+fontdata[lastfont].parameters.quad,krn)
+ krn = scale(ickern[lastchar]+fnt.parameters.quad,krn)
else
- krn = scale(fontdata[lastfont].parameters.quad,krn)
+ krn = scale(fnt.parameters.quad,krn)
end
else
- krn = scale(fontdata[lastfont].parameters.quad,krn)
+ krn = scale(fnt.parameters.quad,krn)
end
disc.replace = make_kern_node(krn)
end
diff --git a/tex/context/base/typo-mir.lua b/tex/context/base/typo-mir.lua
index d60af700e..6c119c2f2 100644
--- a/tex/context/base/typo-mir.lua
+++ b/tex/context/base/typo-mir.lua
@@ -29,6 +29,7 @@ local whatsit = node.id("whatsit")
local mthnode = node.id('math')
local fontdata = fonts.ids
+local fontchar = fonts.chr
local chardata = characters.data
--~ Analysis by Idris:
@@ -237,7 +238,7 @@ function mirroring.process(namespace,attribute,start) -- todo: make faster
end
if d == "on" then
local mirror = chardata[char].mirror -- maybe make a special mirror table
- if mirror and fontdata[current.font].characters[mirror] then
+ if mirror and fontchar[current.font][mirror] then
-- todo: set attribute
if autodir < 0 then
current.char = mirror
diff --git a/tex/context/interface/cont-cs.xml b/tex/context/interface/cont-cs.xml
index b5ac17192..106f50197 100644
--- a/tex/context/interface/cont-cs.xml
+++ b/tex/context/interface/cont-cs.xml
@@ -577,6 +577,7 @@
<cd:constant type="ano"/>
<cd:constant type="ne"/>
<cd:constant type="vzdy"/>
+ <cd:constant type="nikdy"/>
</cd:parameter>
<cd:parameter name="redukce">
<cd:constant type="ano"/>
diff --git a/tex/context/interface/cont-de.xml b/tex/context/interface/cont-de.xml
index 221329735..f2ce1cfe5 100644
--- a/tex/context/interface/cont-de.xml
+++ b/tex/context/interface/cont-de.xml
@@ -577,6 +577,7 @@
<cd:constant type="ja"/>
<cd:constant type="nein"/>
<cd:constant type="immer"/>
+ <cd:constant type="nie"/>
</cd:parameter>
<cd:parameter name="reduktion">
<cd:constant type="ja"/>
diff --git a/tex/context/interface/cont-en.xml b/tex/context/interface/cont-en.xml
index fa4a6e983..9d2319722 100644
--- a/tex/context/interface/cont-en.xml
+++ b/tex/context/interface/cont-en.xml
@@ -577,6 +577,7 @@
<cd:constant type="yes"/>
<cd:constant type="no"/>
<cd:constant type="always"/>
+ <cd:constant type="never"/>
</cd:parameter>
<cd:parameter name="reduction">
<cd:constant type="yes"/>
diff --git a/tex/context/interface/cont-fr.xml b/tex/context/interface/cont-fr.xml
index ea9864b3d..2e38c3667 100644
--- a/tex/context/interface/cont-fr.xml
+++ b/tex/context/interface/cont-fr.xml
@@ -577,6 +577,7 @@
<cd:constant type="oui"/>
<cd:constant type="non"/>
<cd:constant type="toujours"/>
+ <cd:constant type="jamais"/>
</cd:parameter>
<cd:parameter name="reduction">
<cd:constant type="oui"/>
diff --git a/tex/context/interface/cont-it.xml b/tex/context/interface/cont-it.xml
index 71ba4249a..94e61e619 100644
--- a/tex/context/interface/cont-it.xml
+++ b/tex/context/interface/cont-it.xml
@@ -577,6 +577,7 @@
<cd:constant type="si"/>
<cd:constant type="no"/>
<cd:constant type="sempre"/>
+ <cd:constant type="mai"/>
</cd:parameter>
<cd:parameter name="riduzione">
<cd:constant type="si"/>
diff --git a/tex/context/interface/cont-nl.xml b/tex/context/interface/cont-nl.xml
index 2440bb7aa..a337bbb6e 100644
--- a/tex/context/interface/cont-nl.xml
+++ b/tex/context/interface/cont-nl.xml
@@ -577,6 +577,7 @@
<cd:constant type="ja"/>
<cd:constant type="nee"/>
<cd:constant type="altijd"/>
+ <cd:constant type="nooit"/>
</cd:parameter>
<cd:parameter name="reductie">
<cd:constant type="ja"/>
diff --git a/tex/context/interface/cont-pe.xml b/tex/context/interface/cont-pe.xml
index 90c74a4c2..9bcda97f7 100644
--- a/tex/context/interface/cont-pe.xml
+++ b/tex/context/interface/cont-pe.xml
@@ -577,6 +577,7 @@
<cd:constant type="بله"/>
<cd:constant type="نه"/>
<cd:constant type="همواره"/>
+ <cd:constant type="هیچگاه"/>
</cd:parameter>
<cd:parameter name="کاهش">
<cd:constant type="بله"/>
diff --git a/tex/context/interface/cont-ro.xml b/tex/context/interface/cont-ro.xml
index 880fa9c8a..0e83841d3 100644
--- a/tex/context/interface/cont-ro.xml
+++ b/tex/context/interface/cont-ro.xml
@@ -577,6 +577,7 @@
<cd:constant type="da"/>
<cd:constant type="nu"/>
<cd:constant type="totdeauna"/>
+ <cd:constant type="niciodata"/>
</cd:parameter>
<cd:parameter name="reducere">
<cd:constant type="da"/>
diff --git a/tex/generic/context/luatex-fonts-merged.lua b/tex/generic/context/luatex-fonts-merged.lua
index 47feb5236..58929f7e8 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 : 02/25/10 19:56:12
+-- merge date : 03/01/10 23:28:51
do -- begin closure to overcome local limits and interference
@@ -3278,6 +3278,7 @@ fontloader.totable = fontloader.to_table
fonts = fonts or { }
fonts.ids = fonts.ids or { } -- aka fontdata
+fonts.chr = fonts.chr or { } -- aka chardata
fonts.tfm = fonts.tfm or { }
fonts.mode = 'base'
@@ -3290,6 +3291,8 @@ fonts.ids[0] = { -- nullfont
name = "nullfont",
}
+fonts.chr[0] = { }
+
fonts.methods = fonts.methods or {
base = { tfm = { }, afm = { }, otf = { }, vtf = { }, fix = { } },
node = { tfm = { }, afm = { }, otf = { }, vtf = { }, fix = { } },
@@ -5665,6 +5668,9 @@ otf.notdef = false
otf.cache = containers.define("fonts", "otf", otf.version, true)
otf.cleanup_aat = false -- only context
+local wildcard = "*"
+local default = "dflt"
+
--[[ldx--
<p>We start with a lot of tables and related functions.</p>
--ldx]]--
@@ -7779,12 +7785,13 @@ end
-- to do complete mixed runs and not run featurewise (as we did before).
local supported_gsub = {
- 'liga','dlig','rlig','hlig',
- 'pnum','onum','tnum','lnum',
+ 'liga', 'dlig', 'rlig', 'hlig',
+ 'pnum', 'onum', 'tnum', 'lnum',
'zero',
- 'smcp','cpsp','c2sc','ornm','aalt',
- 'hwid','fwid',
+ 'smcp', 'cpsp', 'c2sc', 'ornm', 'aalt',
+ 'hwid', 'fwid',
'ssty', 'rtlm', -- math
+-- 'tlig', 'trep',
}
local supported_gpos = {
@@ -11582,6 +11589,7 @@ function define.register(fontdata,id)
logs.report("define font","loading at 2 id %s, hash: %s",id or "?",hash or "?")
end
fonts.ids[id] = fontdata
+ fonts.chr[id] = fontdata.characters
tfm.internalized[hash] = id
end
end