From b0343246fc469fa519ae66fbfae28c8547cc3d56 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Mon, 1 Mar 2010 23:24:00 +0100 Subject: beta 2010.03.01 23:24 --- tex/context/base/attr-ini.lua | 12 +++-- tex/context/base/attr-ini.mkiv | 6 +-- tex/context/base/colo-ini.mkiv | 34 ++++++++----- tex/context/base/cont-new.tex | 2 +- tex/context/base/context.tex | 2 +- tex/context/base/font-def.lua | 1 + tex/context/base/font-ini.lua | 3 ++ tex/context/base/font-ini.mkiv | 2 +- tex/context/base/font-otb.lua | 9 ++-- tex/context/base/font-otf.lua | 3 ++ tex/context/base/l-dimen.lua | 1 + tex/context/base/node-pag.lua | 3 +- tex/context/base/node-par.lua | 75 ++++++++++++++++++++--------- tex/context/base/node-par.mkiv | 8 ++- tex/context/base/node-pro.lua | 2 +- tex/context/base/node-tsk.lua | 32 ++++++------ tex/context/base/strc-def.mkiv | 2 +- tex/context/base/strc-doc.lua | 47 ++++++++++++++---- tex/context/base/strc-num.mkiv | 2 +- tex/context/base/task-ini.lua | 4 -- tex/context/base/typo-cap.lua | 7 ++- tex/context/base/typo-krn.lua | 18 ++++--- tex/context/base/typo-mir.lua | 3 +- tex/context/interface/cont-cs.xml | 1 + tex/context/interface/cont-de.xml | 1 + tex/context/interface/cont-en.xml | 1 + tex/context/interface/cont-fr.xml | 1 + tex/context/interface/cont-it.xml | 1 + tex/context/interface/cont-nl.xml | 1 + tex/context/interface/cont-pe.xml | 1 + tex/context/interface/cont-ro.xml | 1 + tex/generic/context/luatex-fonts-merged.lua | 18 +++++-- 32 files changed, 205 insertions(+), 99 deletions(-) (limited to 'tex') 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--

We start with a lot of tables and related functions.

--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

We collect a bunch of converters in the number namespace.

--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 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 @@ + 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 @@ + 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 @@ + 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 @@ + 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 @@ + 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 @@ + 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 @@ + 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 @@ + 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--

We start with a lot of tables and related functions.

--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 -- cgit v1.2.3