diff options
author | Marius <mariausol@gmail.com> | 2013-01-21 20:00:26 +0200 |
---|---|---|
committer | Marius <mariausol@gmail.com> | 2013-01-21 20:00:26 +0200 |
commit | 4d27cc671b4add8a51b6e8196512625419b4080a (patch) | |
tree | 02971a0c04536e94f1512910401bcafa403e0f14 /tex | |
parent | 3346c745a354c0726c1ec68fb1f2d04e5bc85a9b (diff) | |
download | context-4d27cc671b4add8a51b6e8196512625419b4080a.tar.gz |
beta 2013.01.21 18:18
Diffstat (limited to 'tex')
31 files changed, 298 insertions, 215 deletions
diff --git a/tex/context/base/cont-new.mkii b/tex/context/base/cont-new.mkii index e1d8f6f91..2d272051e 100644 --- a/tex/context/base/cont-new.mkii +++ b/tex/context/base/cont-new.mkii @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2013.01.17 18:16} +\newcontextversion{2013.01.21 18:18} %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/cont-new.mkiv b/tex/context/base/cont-new.mkiv index 6339c3793..e30f91f58 100644 --- a/tex/context/base/cont-new.mkiv +++ b/tex/context/base/cont-new.mkiv @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2013.01.17 18:16} +\newcontextversion{2013.01.21 18:18} %D This file is loaded at runtime, thereby providing an excellent place for %D hacks, patches, extensions and new features. diff --git a/tex/context/base/context-version.pdf b/tex/context/base/context-version.pdf Binary files differindex 66ce96cb4..1e37d5bb4 100644 --- a/tex/context/base/context-version.pdf +++ b/tex/context/base/context-version.pdf diff --git a/tex/context/base/context-version.png b/tex/context/base/context-version.png Binary files differindex 4d1a73000..beb1a9ba9 100644 --- a/tex/context/base/context-version.png +++ b/tex/context/base/context-version.png diff --git a/tex/context/base/context.mkii b/tex/context/base/context.mkii index e0c952341..0796a482c 100644 --- a/tex/context/base/context.mkii +++ b/tex/context/base/context.mkii @@ -20,7 +20,7 @@ %D your styles an modules. \edef\contextformat {\jobname} -\edef\contextversion{2013.01.17 18:16} +\edef\contextversion{2013.01.21 18:18} %D For those who want to use this: diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv index ab199bceb..db76f786a 100644 --- a/tex/context/base/context.mkiv +++ b/tex/context/base/context.mkiv @@ -25,7 +25,7 @@ %D up and the dependencies are more consistent. \edef\contextformat {\jobname} -\edef\contextversion{2013.01.17 18:16} +\edef\contextversion{2013.01.21 18:18} %D For those who want to use this: diff --git a/tex/context/base/font-lib.mkvi b/tex/context/base/font-lib.mkvi index 4ccb6057c..a15bfc833 100644 --- a/tex/context/base/font-lib.mkvi +++ b/tex/context/base/font-lib.mkvi @@ -41,6 +41,8 @@ \registerctxluafile{font-otc}{1.001} % otf context \registerctxluafile{font-oth}{1.001} % otf helpers +\registerctxluafile{font-odv}{1.001} % otf devanagari (experimental) + \registerctxluafile{font-pat}{1.001} % patchers \registerctxluafile{node-fnt}{1.001} % here diff --git a/tex/context/base/font-map.lua b/tex/context/base/font-map.lua index 685f9beea..f9e52c10a 100644 --- a/tex/context/base/font-map.lua +++ b/tex/context/base/font-map.lua @@ -11,6 +11,7 @@ local tonumber = tonumber local match, format, find, concat, gsub, lower = string.match, string.format, string.find, table.concat, string.gsub, string.lower local P, R, S, C, Ct, Cc, lpegmatch = lpeg.P, lpeg.R, lpeg.S, lpeg.C, lpeg.Ct, lpeg.Cc, lpeg.match local utfbyte = utf.byte +local floor = math.floor local trace_loading = false trackers.register("fonts.loading", function(v) trace_loading = v end) local trace_mapping = false trackers.register("fonts.mapping", function(v) trace_unimapping = v end) @@ -65,25 +66,27 @@ local function makenameparser(str) end end ---~ local parser = mappings.makenameparser("Japan1") ---~ local parser = mappings.makenameparser() ---~ local function test(str) ---~ local b, a = lpegmatch(parser,str) ---~ print((a and table.serialize(b)) or b) ---~ end ---~ test("a.sc") ---~ test("a") ---~ test("uni1234") ---~ test("uni1234.xx") ---~ test("uni12349876") ---~ test("index1234") ---~ test("Japan1.123") +-- local parser = mappings.makenameparser("Japan1") +-- local parser = mappings.makenameparser() +-- local function test(str) +-- local b, a = lpegmatch(parser,str) +-- print((a and table.serialize(b)) or b) +-- end +-- test("a.sc") +-- test("a") +-- test("uni1234") +-- test("uni1234.xx") +-- test("uni12349876") +-- test("index1234") +-- test("Japan1.123") local function tounicode16(unicode) if unicode < 0x10000 then return format("%04X",unicode) + elseif unicode < 0x1FFFFFFFFF then + return format("%04X%04X",floor(unicode/1024),unicode%1024+0xDC00) else - return format("%04X%04X",unicode/1024+0xD800,unicode%1024+0xDC00) + report_fonts("can't convert %s into tounicode",unicode) end end @@ -93,8 +96,10 @@ local function tounicode16sequence(unicodes) local unicode = unicodes[l] if unicode < 0x10000 then t[l] = format("%04X",unicode) + elseif unicode < 0x1FFFFFFFFF then + t[l] = format("%04X%04X",floor(unicode/1024),unicode%1024+0xDC00) else - t[l] = format("%04X%04X",unicode/1024+0xD800,unicode%1024+0xDC00) + report_fonts ("can't convert %s into tounicode",unicode) end end return concat(t) diff --git a/tex/context/base/font-mat.mkvi b/tex/context/base/font-mat.mkvi index 3fbfa7a55..165b644d2 100644 --- a/tex/context/base/font-mat.mkvi +++ b/tex/context/base/font-mat.mkvi @@ -378,19 +378,23 @@ % and inline text bold) so we will need explicit switches as well as % an automatic one. (We will use lucida as an example.) -\unexpanded\def\mr +\ifdefined\mathdefault \else \let\mathdefault\relax \fi + +\unexpanded\def\mr % math regular {\ifmmode \font_helpers_synchronize_math_family_mr \else \font_helpers_set_current_font_alternative\s!mr - \fi} + \fi + \mathdefault} -\unexpanded\def\mb +\unexpanded\def\mb % math bold {\ifmmode \font_helpers_synchronize_math_family_mb \else \font_helpers_set_current_font_alternative\s!mb - \fi} + \fi + \mathdefault} \appendtoks \font_helpers_synchronize_math_family % auto bold diff --git a/tex/context/base/font-odv.lua b/tex/context/base/font-odv.lua index eb8f7a9da..baacc3fce 100644 --- a/tex/context/base/font-odv.lua +++ b/tex/context/base/font-odv.lua @@ -830,12 +830,7 @@ function handlers.devanagari_reorder_matras(start,kind,lookupname,replacement) - current = next end local startnext = start.next --- local startprev = start.prev --- startnext.prev = startprev --- if startprev then --- startprev.next = startnext --- end -remove_node(start,start) + remove_node(start,start) local next = current.next if next then next.prev = start @@ -889,13 +884,8 @@ function handlers.devanagari_reorder_reph(start,kind,lookupname,replacement) if next and next.id == glyph_code and next.subtype<256 and next.font == startfont and has_attribute(next,a_syllabe) == startattr and zw_char[next.char] then current = next end --- startnext = start.next --- startprev = start.prev --- startnext.prev = startprev --- if startprev then --- startprev.next = startnext --- end -remove_node(start,start) + startnext = start.next + remove_node(start,start) local next = current.next if next then next.prev = start @@ -914,12 +904,7 @@ remove_node(start,start) while current and current.id == glyph_code and current.subtype<256 and current.font == startfont and has_attribute(current,a_syllabe) == startattr do --step 4 if has_attribute(current,a_state) == 9 then --post-base startnext = start.next --- startprev = start.prev --- startnext.prev = startprev --- if startprev then --- startprev.next = startnext --- end -remove_node(start,start) + remove_node(start,start) local prev = current.prev start.prev = prev prev.next = start @@ -951,19 +936,12 @@ remove_node(start,start) -- here we can loose the old start node: maybe best split cases if c then startnext = start.next - -- if c ~= startnext then -- needs testing --- startprev = start.prev --- startnext.prev = startprev --- if startprev then --- startprev.next = startnext --- end -remove_node(start,start) + remove_node(start,start) local prev = c.prev start.prev = prev prev.next = start start.next = c c.prev = start - -- end start = startnext startattr = has_attribute(start,a_syllabe) end @@ -978,12 +956,7 @@ remove_node(start,start) end if start ~= current then startnext = start.next --- startprev = start.prev --- startnext.prev = startprev --- if startprev then --- startprev.next = startnext --- end -remove_node(start,start) + remove_node(start,start) local next = current.next if next then next.prev = start @@ -1026,12 +999,7 @@ function handlers.devanagari_reorder_pre_base_reordering_consonants(start,kind,l end end startnext = start.next --- startprev = start.prev --- startnext.prev = startprev --- if startprev then --- startprev.next = startnext --- end -removenode(start,start) + removenode(start,start) local next = current.next if next then next.prev = start @@ -1050,12 +1018,7 @@ removenode(start,start) while current and current.id == glyph_code and current.subtype<256 and current.font == startfont and has_attribute(current,a_syllabe) == startattr do if not consonant[current.char] and has_attribute(current,a_state) then --main startnext = start.next --- startprev = start.prev --- startnext.prev = startprev --- if startprev then --- startprev.next = startnext --- end -removenode(start,start) + removenode(start,start) local prev = current.prev start.prev = prev prev.next = start diff --git a/tex/context/base/font-otc.lua b/tex/context/base/font-otc.lua index 777267254..980c6f637 100644 --- a/tex/context/base/font-otc.lua +++ b/tex/context/base/font-otc.lua @@ -311,14 +311,14 @@ end local anum_specification = { { type = "substitution", - features = { arab = { URD = true, dflt = true } }, + features = { arab = { urd = true, dflt = true } }, data = anum_arabic, flags = noflags, -- { }, valid = valid, }, { type = "substitution", - features = { arab = { URD = true } }, + features = { arab = { urd = true } }, data = anum_persian, flags = noflags, -- { }, valid = valid, diff --git a/tex/context/base/font-pat.lua b/tex/context/base/font-pat.lua index 50d99f668..172dc3e94 100644 --- a/tex/context/base/font-pat.lua +++ b/tex/context/base/font-pat.lua @@ -49,9 +49,9 @@ local function patch(data,filename) { scripts = { arab = { - ["ARA "] = true, - ["FAR "] = true, - ["URD "] = true, + ["ara "] = true, + ["far "] = true, + ["urd "] = true, ["dflt"] = true, } }, diff --git a/tex/context/base/font-pre.mkiv b/tex/context/base/font-pre.mkiv index 8d3edb9ec..21da2bf26 100644 --- a/tex/context/base/font-pre.mkiv +++ b/tex/context/base/font-pre.mkiv @@ -91,6 +91,42 @@ [simplearabic] [script=hebr] +% \definefont [DevaOne] [file:chandas.ttf*devanagari-one at 12pt] +% \definefont [DevaTwo] [file:kokila.ttf*devanagari-two at 18pt] + +\definefontfeature + [devanagari-one] + [mode=node, + language=dflt, + script=deva, + nukt=yes, + akhn=yes, + rphf=yes, + blwf=yes, + half=yes, + vatu=yes, + pres=yes, + abvs=yes, + blws=yes, + psts=yes, + haln=yes, + abvm=yes, + blwm=yes, + dist=yes] + +\definefontfeature + [devanagari-two] + [devanagari-one] + [script=dev2, + locl=yes, + pref=yes, + rkrf=yes, + pstf=yes, + cjct=yes, + init=yes, + calt=yes, + kern=yes] + % symbols: \definefontfeature diff --git a/tex/context/base/grph-inc.lua b/tex/context/base/grph-inc.lua index 4701e224f..fd282dac2 100644 --- a/tex/context/base/grph-inc.lua +++ b/tex/context/base/grph-inc.lua @@ -1217,17 +1217,19 @@ end local function runprogram(binary,argument,variables) local binary = match(binary,"[%S]+") -- to be sure - if os.which(binary) then - if type(argument) == "table" then - argument = concat(argument," ") -- for old times sake - end + if type(argument) == "table" then + argument = concat(argument," ") -- for old times sake + end + if not os.which(binary) then + report_inclusion("program '%s' is not installed, not running: %s",binary,command) + elseif not argument or argument == "" then + report_inclusion("nothing to run %q",binary) + else local command = format("%q %s",binary,replacetemplate(longtostring(argument),variables)) if trace_conversion or trace_programs then report_inclusion("running: %s",command) end os.spawn(command) - else - report_inclusion("program '%s' is not installed, not running: %s",binary,command) end end @@ -1359,7 +1361,7 @@ programs.convert = { local function converter(oldname,newname) local convert = programs.convert - runprogram(convert.command, convert.gifargument, { + runprogram(convert.command, convert.argument, { newname = newname, oldname = oldname, } ) diff --git a/tex/context/base/math-def.mkiv b/tex/context/base/math-def.mkiv index 0d80b3de0..250c9bc5e 100644 --- a/tex/context/base/math-def.mkiv +++ b/tex/context/base/math-def.mkiv @@ -328,6 +328,11 @@ \unexpanded\def\normaldoublebrace {\Umathaccents 0 \defaultmathfamily "23DE 0 \defaultmathfamily "23DF } \unexpanded\def\normaldoubleparent{\Umathaccents 0 \defaultmathfamily "23DC 0 \defaultmathfamily "23DD } +% let's keep this + +\def\Umathbotaccent{\Umathaccent \s!bottom } +\def\Umathaccents {\Umathaccent \s!both } + \let\normaloverbrace \overbrace \let\normalunderbrace \underbrace \let\normaloverparent \overparent diff --git a/tex/context/base/math-ini.mkiv b/tex/context/base/math-ini.mkiv index 8c5b59356..6cd084a38 100644 --- a/tex/context/base/math-ini.mkiv +++ b/tex/context/base/math-ini.mkiv @@ -143,8 +143,7 @@ \let\mathalternate\setmathalternate % obsolete -\unexpanded\def\mr {\setmathattribute\s!regular\s!tf\setmathstylealterternate\s!tf} - +\unexpanded\def\mathupright {\setmathattribute\s!regular\s!tf\setmathstylealterternate\s!tf} \unexpanded\def\mathdefault {\setmathattribute\s!regular\s!it\setmathstylealterternate\s!it} \unexpanded\def\mathscript {\setmathalphabet \s!script \setmathstylealterternate\s!script} \unexpanded\def\mathfraktur {\setmathalphabet \s!fraktur \setmathstylealterternate\s!fraktur} @@ -183,8 +182,6 @@ \unexpanded\def\mathfrak#1{{\mathfraktur #1}} % for AMS compatibility \unexpanded\def\mathbb #1{{\mathblackboard#1}} % for AMS compatibility -\let\normalmr\mr - \let\normaltf\tf \unexpanded\def\tf{\ifmmode\mathtf\else\normaltf\fi} \let\normalbf\bf \unexpanded\def\bf{\ifmmode\mathbf\else\normalbf\fi} \let\normalit\it \unexpanded\def\it{\ifmmode\mathit\else\normalit\fi} @@ -195,7 +192,9 @@ \let\normalrm\rm \unexpanded\def\rm{\ifmmode\mathrm\else\normalrm\fi} \let\normalss\ss \unexpanded\def\ss{\ifmmode\mathss\else\normalss\fi} \let\normaltt\tt \unexpanded\def\tt{\ifmmode\mathtt\else\normaltt\fi} - \unexpanded\def\mr{\ifmmode \normalmr\fi} + +\ifdefined\mr \else \let\mr\relax \fi +\ifdefined\mb \else \let\mb\relax \fi \prependtoks \mathdefault @@ -499,7 +498,7 @@ \newtoks\activatedmathcharacters -\def\activatemathcharacter#1% +\unexpanded\def\activatemathcharacter#1% {\appendtoks \global\mathcode#1=\activemathcharcode \to \activatedmathcharacters} @@ -1282,10 +1281,6 @@ \unexpanded\def\mathoptext#1{\mathop{\text{#1}}} -% for a while: - -\def\Umathbotaccent{\Umathaccent bottom } - % new: % \startsetups math:morespacing @@ -1312,10 +1307,7 @@ % \def\mathextensiblecode#1#2% % {\cldcontext{mathematics.extensiblecode(\number#1,\number#2)}} -\def\mathextensiblecode#1#2% - {\ctxcommand{extensiblecode(\number#1,\number#2)}} - -\def\mathhorizontalcode#1#2% - {\ctxcommand{horizontalcode(\number#1,\number#2)}} +\def\mathextensiblecode#1#2{\ctxcommand{extensiblecode(\number#1,\number#2)}} +\def\mathhorizontalcode#1#2{\ctxcommand{horizontalcode(\number#1,\number#2)}} \protect \endinput diff --git a/tex/context/base/math-map.lua b/tex/context/base/math-map.lua index cd1673611..f2ef7e8ae 100644 --- a/tex/context/base/math-map.lua +++ b/tex/context/base/math-map.lua @@ -456,7 +456,7 @@ remap("it","bi") mathematics.boldmap = boldmap -local mathremap = { } +local mathremap = allocate { } for alphabet, styles in next, alphabets do -- per 9/6/2011 we also have attr for missing for style, data in next, styles do @@ -469,6 +469,8 @@ for alphabet, styles in next, alphabets do -- per 9/6/2011 we also have attr for end end +mathematics.mapremap = mathremap + -- beware, these are shared tables (no problem since they're not -- in unicode) @@ -539,7 +541,7 @@ function mathematics.syncstyle(style) end function mathematics.syncname(alphabet) ---~ local r = mathremap[mathalphabet] + -- local r = mathremap[mathalphabet] local r = mathremap[texattribute[mathalphabet]] local style = r and r.style or "tf" local data = alphabets[alphabet][style] @@ -606,6 +608,31 @@ function mathematics.remapalphabets(char,mathalphabet,mathgreek) return nil end +-- begin of experiment + +local fallback = { + tf = "bf", + it = "bi", + bf = "tf", + bi = "it", +} + +function mathematics.fallbackstyleattr(attribute) + local r = mathremap[attribute] + local alphabet = r.alphabet or "regular" + local style = r.style or "tf" + local fback = fallback[style] + if fback then + local data = alphabets[alphabet][fback] + if data then + local attr = data.attribute + return attribute ~= attr and attr + end + end +end + +-- end of experiment + local function checkedcopy(characters,child,parent) for k, v in next, child do if not characters[v] then diff --git a/tex/context/base/mult-ini.mkiv b/tex/context/base/mult-ini.mkiv index eb5517277..79b94f202 100644 --- a/tex/context/base/mult-ini.mkiv +++ b/tex/context/base/mult-ini.mkiv @@ -123,6 +123,10 @@ \def\s!to {to} \let\!!to \s!to % obsolete \def\s!attr {attr} +\def\s!bottom{bottom} +\def\s!top {top} +\def\s!both {both} + %D Kind of special: \edef\!!TLT{\detokenize{TLT}} diff --git a/tex/context/base/mult-low.lua b/tex/context/base/mult-low.lua index 5e797590e..9b95be3cd 100644 --- a/tex/context/base/mult-low.lua +++ b/tex/context/base/mult-low.lua @@ -331,5 +331,7 @@ return { "definenamedlua", "obeylualines", "obeyluatokens", "startluacode", "stopluacode", "startlua", "stoplua", + -- + "Umathbotaccent", } } diff --git a/tex/context/base/mult-prm.lua b/tex/context/base/mult-prm.lua index 7287b1fb1..e1ff6803f 100644 --- a/tex/context/base/mult-prm.lua +++ b/tex/context/base/mult-prm.lua @@ -84,7 +84,7 @@ return { "Udelimiterover", "Udelimiterunder", "Umathaccent", - "Umathaccents", +--"Umathaccents", "Umathaxis", "Umathbinbinspacing", "Umathbinclosespacing", @@ -94,7 +94,7 @@ return { "Umathbinordspacing", "Umathbinpunctspacing", "Umathbinrelspacing", - "Umathbotaccent", +--"Umathbotaccent", "Umathchar", "Umathchardef", "Umathcharnum", @@ -412,7 +412,7 @@ return { "Udelimiterover", "Udelimiterunder", "Umathaccent", - "Umathaccents", +--"Umathaccents", "Umathaxis", "Umathbinbinspacing", "Umathbinclosespacing", @@ -422,7 +422,7 @@ return { "Umathbinordspacing", "Umathbinpunctspacing", "Umathbinrelspacing", - "Umathbotaccent", +--"Umathbotaccent", "Umathchar", "Umathchardef", "Umathcharnum", diff --git a/tex/context/base/mult-prm.mkiv b/tex/context/base/mult-prm.mkiv index 8c9179a16..e385341c2 100644 --- a/tex/context/base/mult-prm.mkiv +++ b/tex/context/base/mult-prm.mkiv @@ -37,8 +37,11 @@ luatex = { }, aleph = { + "AlephVersion", "Alephminorversion", "Alephrevision", "Alephversion", }, omega = { + "Omegaminorversion", "Omegarevision", "Omegaversion", + "omathcode", "odelcode", "omathchardef", "omathchar", "omathaccent", "odelimiter", "oradical", }, xetex = { "XeTeXversion", diff --git a/tex/context/base/mult-sys.mkiv b/tex/context/base/mult-sys.mkiv index b487ceaba..f98076666 100644 --- a/tex/context/base/mult-sys.mkiv +++ b/tex/context/base/mult-sys.mkiv @@ -100,8 +100,8 @@ \definesystemconstant {Support} \definesystemconstant {Type} -\definesystemconstant {Math} -\definesystemconstant {MathBold} +\definesystemconstant {Math} % not used +\definesystemconstant {MathBold} % not used \definesystemconstant {MathRoman} \definesystemconstant {MathRomanBold} diff --git a/tex/context/base/s-abr-01.tex b/tex/context/base/s-abr-01.tex index 68cdea6f0..bbaa1e941 100644 --- a/tex/context/base/s-abr-01.tex +++ b/tex/context/base/s-abr-01.tex @@ -139,6 +139,7 @@ \logo [JBIG] {jbig} \logo [KPATHSEA] {kpathsea} \logo [KPSE] {kpse} +\logo [KVM] {kvm} \logo [KPSEWHICH] {kpsewhich} \logo [MKTEXLSR] {mktexlsr} \logo [MYSQL] {MySQL} @@ -152,6 +153,7 @@ \logo [LPEG] {lpeg} \logo [LUA] {Lua} \logo [LUAJIT] {LuaJIT} +\logo [LUAJITTEX] {Luajit\TeX} \logo [LUATEX] {Lua\TeX} \logo [LUATOOLS] {luatools} \logo [LMX] {lmx} @@ -305,6 +307,7 @@ \logo [XSLT] {xslt} \logo [XSLTPROC] {xsltproc} \logo [XYPIC] {XYPIC} % wrong logo +\logo [VMWARE] {VMWare} \logo [YandY] {y\&y} \logo [ZIP] {zip} diff --git a/tex/context/base/s-abr-04.tex b/tex/context/base/s-abr-04.tex index 0725bcdcf..dcd93c6f1 100644 --- a/tex/context/base/s-abr-04.tex +++ b/tex/context/base/s-abr-04.tex @@ -138,6 +138,7 @@ \logo [LUA] {Lua} \logo [LUAJIT] {LuaJIT} \logo [LUATEX] {Lua\TeX} +\logo [LUAJITTEX] {Luajit\TeX} \logo [LUATOOLS] {luatools} \logo [MACOSX] {MacOSX} \logo [MACROTEX] {Macro\TeX} diff --git a/tex/context/base/s-fnt-21.mkiv b/tex/context/base/s-fnt-21.mkiv index a48854679..588c98016 100644 --- a/tex/context/base/s-fnt-21.mkiv +++ b/tex/context/base/s-fnt-21.mkiv @@ -32,7 +32,7 @@ \endgroup \stopsetups -\def\ShowOtfTrackerSample#1% +\unexpanded\def\ShowOtfTrackerSample#1% {\doiffile{#1} {\blank \startlinecorrection @@ -44,3 +44,21 @@ \egroup \stoplinecorrection \blank}} + +\endinput + +% \usemodule[fnt-20] +% +% \starttext +% +% \setvariables +% [otftracker] +% [direction=-1, +% sample=لا, +% title=Test, +% font=file:arabtype, +% % font=file:husayni, +% % font=file:scheherazaderegot, +% features=arabic] +% +% \stoptext diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf Binary files differindex 49660f7d2..0c20b0e47 100644 --- a/tex/context/base/status-files.pdf +++ b/tex/context/base/status-files.pdf diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf Binary files differindex 90da15dfd..8f0c2a65d 100644 --- a/tex/context/base/status-lua.pdf +++ b/tex/context/base/status-lua.pdf diff --git a/tex/context/base/trac-inf.lua b/tex/context/base/trac-inf.lua index 826271169..1d39f24a6 100644 --- a/tex/context/base/trac-inf.lua +++ b/tex/context/base/trac-inf.lua @@ -74,11 +74,11 @@ local function stoptiming(instance, report) end local function elapsed(instance) - if type(instance) == "table" then + if type(instance) == "number" then + return instance or 0 + else local timer = timers[instance or "notimer"] return timer and timer.loadtime or 0 - else - return tonumber(instance) or 0 end end diff --git a/tex/context/base/trac-vis.mkiv b/tex/context/base/trac-vis.mkiv index 99269c6dc..f7559932c 100644 --- a/tex/context/base/trac-vis.mkiv +++ b/tex/context/base/trac-vis.mkiv @@ -115,6 +115,16 @@ {\edef\spac_struts_vide_hbox{\hbox attr \visualattribute \ctxcommand{visual("strut")} }% \spac_struts_vide_hbox} +%D For manuals: + +\unexpanded\def\markfonts#1% + {\dontleavehmode + \begingroup + \setbox\scratchbox\hbox{\getbuffer}% + \ctxcommand{markfonts(\number\scratchbox)}% + \unhbox\scratchbox + \endgroup} + %D We keep this one: \unexpanded\def\dontinterfere diff --git a/tex/context/base/type-imp-xits.mkiv b/tex/context/base/type-imp-xits.mkiv index cf3856eae..f83050e14 100644 --- a/tex/context/base/type-imp-xits.mkiv +++ b/tex/context/base/type-imp-xits.mkiv @@ -23,12 +23,12 @@ \starttypescript [\s!math] [xits,xitsbidi] [\s!name] \loadfontgoodies[xits-math] - \definefontsynonym[\s!MathRoman ][\s!file:xits-math.otf] [\s!features=\s!math\mathsizesuffix,\s!goodies=xits-math] - \definefontsynonym[\s!MathRoman L2R][\s!file:xits-math.otf] [\s!features=\s!math\mathsizesuffix-l2r,\s!goodies=xits-math] - \definefontsynonym[\s!MathRoman R2L][\s!file:xits-math.otf] [\s!features=\s!math\mathsizesuffix-r2l,\s!goodies=xits-math] - \definefontsynonym[\s!MathBold ][\s!file:xits-mathbold.otf][\s!features=\s!math\mathsizesuffix,\s!goodies=xits-math] - \definefontsynonym[\s!MathBold L2R][\s!file:xits-mathbold.otf][\s!features=\s!math\mathsizesuffix-l2r,\s!goodies=xits-math] - \definefontsynonym[\s!MathBold R2L][\s!file:xits-mathbold.otf][\s!features=\s!math\mathsizesuffix-r2l,\s!goodies=xits-math] + \definefontsynonym[\s!MathRoman ][\s!file:xits-math.otf] [\s!features=\s!math\mathsizesuffix,\s!goodies=xits-math] + \definefontsynonym[\s!MathRoman L2R][\s!file:xits-math.otf] [\s!features=\s!math\mathsizesuffix-l2r,\s!goodies=xits-math] + \definefontsynonym[\s!MathRoman R2L][\s!file:xits-math.otf] [\s!features=\s!math\mathsizesuffix-r2l,\s!goodies=xits-math] + \definefontsynonym[\s!MathRomanBold ][\s!file:xits-mathbold.otf][\s!features=\s!math\mathsizesuffix,\s!goodies=xits-math] + \definefontsynonym[\s!MathRomanBold L2R][\s!file:xits-mathbold.otf][\s!features=\s!math\mathsizesuffix-l2r,\s!goodies=xits-math] + \definefontsynonym[\s!MathRomanBold R2L][\s!file:xits-mathbold.otf][\s!features=\s!math\mathsizesuffix-r2l,\s!goodies=xits-math] \stoptypescript \starttypescript [\s!serif] [xits] [\s!name] @@ -52,7 +52,7 @@ \definetypeface [xitsbidi] [\s!rm] [\s!serif] [xits] [\s!default] \definetypeface [xitsbidi] [\s!ss] [\s!sans] [heros] [\s!default] [\s!rscale=0.9] \definetypeface [xitsbidi] [\s!tt] [\s!mono] [modern] [\s!default] [\s!rscale=1.05] - %definetypeface [xitsbidi] [\s!mm] [\s!math] [xitsbidi] [bidi] [\s!direction=\s!both] + %definetypeface [xitsbidi] [\s!mm] [\s!math] [xitsbidi] [bidi] [\s!direction=\s!both] \definetypeface [xitsbidi] [\s!mm] [\s!math] [xitsbidi] [\s!default] [\s!direction=\s!both] \stoptypescript diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index 5739422b5..0b714c1a7 100644 --- a/tex/generic/context/luatex/luatex-fonts-merged.lua +++ b/tex/generic/context/luatex/luatex-fonts-merged.lua @@ -1,6 +1,6 @@ -- merged file : luatex-fonts-merged.lua -- parent file : luatex-fonts.lua --- merge date : 01/17/13 18:16:10 +-- merge date : 01/21/13 18:18:50 do -- begin closure to overcome local limits and interference @@ -5212,6 +5212,7 @@ local tonumber = tonumber local match, format, find, concat, gsub, lower = string.match, string.format, string.find, table.concat, string.gsub, string.lower local P, R, S, C, Ct, Cc, lpegmatch = lpeg.P, lpeg.R, lpeg.S, lpeg.C, lpeg.Ct, lpeg.Cc, lpeg.match local utfbyte = utf.byte +local floor = math.floor local trace_loading = false trackers.register("fonts.loading", function(v) trace_loading = v end) local trace_mapping = false trackers.register("fonts.mapping", function(v) trace_unimapping = v end) @@ -5266,25 +5267,27 @@ local function makenameparser(str) end end ---~ local parser = mappings.makenameparser("Japan1") ---~ local parser = mappings.makenameparser() ---~ local function test(str) ---~ local b, a = lpegmatch(parser,str) ---~ print((a and table.serialize(b)) or b) ---~ end ---~ test("a.sc") ---~ test("a") ---~ test("uni1234") ---~ test("uni1234.xx") ---~ test("uni12349876") ---~ test("index1234") ---~ test("Japan1.123") +-- local parser = mappings.makenameparser("Japan1") +-- local parser = mappings.makenameparser() +-- local function test(str) +-- local b, a = lpegmatch(parser,str) +-- print((a and table.serialize(b)) or b) +-- end +-- test("a.sc") +-- test("a") +-- test("uni1234") +-- test("uni1234.xx") +-- test("uni12349876") +-- test("index1234") +-- test("Japan1.123") local function tounicode16(unicode) if unicode < 0x10000 then return format("%04X",unicode) + elseif unicode < 0x1FFFFFFFFF then + return format("%04X%04X",floor(unicode/1024),unicode%1024+0xDC00) else - return format("%04X%04X",unicode/1024+0xD800,unicode%1024+0xDC00) + report_fonts("can't convert %s into tounicode",unicode) end end @@ -5294,8 +5297,10 @@ local function tounicode16sequence(unicodes) local unicode = unicodes[l] if unicode < 0x10000 then t[l] = format("%04X",unicode) + elseif unicode < 0x1FFFFFFFFF then + t[l] = format("%04X%04X",floor(unicode/1024),unicode%1024+0xDC00) else - t[l] = format("%04X%04X",unicode/1024+0xD800,unicode%1024+0xDC00) + report_fonts ("can't convert %s into tounicode",unicode) end end return concat(t) @@ -8511,14 +8516,14 @@ local traverse_id = node.traverse_id local insert_node_before = node.insert_before local insert_node_after = node.insert_after -local kernpair = attributes.private('kernpair') -local ligacomp = attributes.private('ligacomp') -local markbase = attributes.private('markbase') -local markmark = attributes.private('markmark') -local markdone = attributes.private('markdone') -local cursbase = attributes.private('cursbase') -local curscurs = attributes.private('curscurs') -local cursdone = attributes.private('cursdone') +local a_kernpair = attributes.private('kernpair') +local a_ligacomp = attributes.private('ligacomp') +local a_markbase = attributes.private('markbase') +local a_markmark = attributes.private('markmark') +local a_markdone = attributes.private('markdone') +local a_cursbase = attributes.private('cursbase') +local a_curscurs = attributes.private('curscurs') +local a_cursdone = attributes.private('cursdone') -- This injector has been tested by Idris Samawi Hamid (several arabic fonts as well as -- the rather demanding Husayni font), Khaled Hosny (latin and arabic) and Kaj Eigner @@ -8544,8 +8549,8 @@ function injections.setcursive(start,nxt,factor,rlmode,exit,entry,tfmstart,tfmne local dx, dy = factor*(exit[1]-entry[1]), factor*(exit[2]-entry[2]) local ws, wn = tfmstart.width, tfmnext.width local bound = #cursives + 1 - start[cursbase] = bound - nxt[curscurs] = bound + start[a_cursbase] = bound + nxt[a_curscurs] = bound cursives[bound] = { rlmode, dx, dy, ws, wn } return dx, dy, bound end @@ -8554,14 +8559,14 @@ function injections.setpair(current,factor,rlmode,r2lflag,spec,tfmchr) local x, y, w, h = factor*spec[1], factor*spec[2], factor*spec[3], factor*spec[4] -- dy = y - h if x ~= 0 or w ~= 0 or y ~= 0 or h ~= 0 then - local bound = current[kernpair] + local bound = current[a_kernpair] if bound then local kb = kerns[bound] -- inefficient but singles have less, but weird anyway, needs checking kb[2], kb[3], kb[4], kb[5] = (kb[2] or 0) + x, (kb[3] or 0) + y, (kb[4] or 0)+ w, (kb[5] or 0) + h else bound = #kerns + 1 - current[kernpair] = bound + current[a_kernpair] = bound kerns[bound] = { rlmode, x, y, w, h, r2lflag, tfmchr.width } end return x, y, w, h, bound @@ -8573,7 +8578,7 @@ function injections.setkern(current,factor,rlmode,x,tfmchr) local dx = factor*x if dx ~= 0 then local bound = #kerns + 1 - current[kernpair] = bound + current[a_kernpair] = bound kerns[bound] = { rlmode, dx } return dx, bound else @@ -8583,7 +8588,7 @@ end function injections.setmark(start,base,factor,rlmode,ba,ma,index) -- ba=baseanchor, ma=markanchor local dx, dy = factor*(ba[1]-ma[1]), factor*(ba[2]-ma[2]) -- the index argument is no longer used but when this - local bound = base[markbase] -- fails again we should pass it + local bound = base[a_markbase] -- fails again we should pass it local index = 1 if bound then local mb = marks[bound] @@ -8591,8 +8596,8 @@ local index = 1 -- if not index then index = #mb + 1 end index = #mb + 1 mb[index] = { dx, dy, rlmode } - start[markmark] = bound - start[markdone] = index + start[a_markmark] = bound + start[a_markdone] = index return dx, dy, bound else report_injections("possible problem, U+%05X is base mark without data (id: %s)",base.char,bound) @@ -8601,9 +8606,9 @@ index = #mb + 1 -- index = index or 1 index = index or 1 bound = #marks + 1 - base[markbase] = bound - start[markmark] = bound - start[markdone] = index + base[a_markbase] = bound + start[a_markmark] = bound + start[a_markdone] = index marks[bound] = { [index] = { dx, dy, rlmode } } return dx, dy, bound end @@ -8616,12 +8621,12 @@ local function trace(head) report_injections("begin run") for n in traverse_id(glyph_code,head) do if n.subtype < 256 then - local kp = n[kernpair] - local mb = n[markbase] - local mm = n[markmark] - local md = n[markdone] - local cb = n[cursbase] - local cc = n[curscurs] + local kp = n[a_kernpair] + local mb = n[a_markbase] + local mm = n[a_markmark] + local md = n[a_markdone] + local cb = n[a_cursbase] + local cc = n[a_curscurs] report_injections("char U+%05X, font=%s",n.char,n.font) if kp then local k = kerns[kp] @@ -8687,7 +8692,7 @@ function injections.handler(head,where,keep) if tm then mk[n] = tm[n.char] end - local k = n[kernpair] + local k = n[a_kernpair] if k then local kk = kerns[k] if kk then @@ -8736,9 +8741,9 @@ function injections.handler(head,where,keep) for i=1,nofvalid do -- valid == glyphs local n = valid[i] if not mk[n] then - local n_cursbase = n[cursbase] + local n_cursbase = n[a_cursbase] if p_cursbase then - local n_curscurs = n[curscurs] + local n_curscurs = n[a_curscurs] if p_cursbase == n_curscurs then local c = cursives[n_curscurs] if c then @@ -8799,14 +8804,14 @@ function injections.handler(head,where,keep) if has_marks then for i=1,nofvalid do local p = valid[i] - local p_markbase = p[markbase] + local p_markbase = p[a_markbase] if p_markbase then local mrks = marks[p_markbase] local nofmarks = #mrks for n in traverse_id(glyph_code,p.next) do - local n_markmark = n[markmark] + local n_markmark = n[a_markmark] if p_markbase == n_markmark then - local index = n[markdone] or 1 + local index = n[a_markdone] or 1 local d = mrks[index] if d then local rlmode = d[3] @@ -8909,7 +8914,7 @@ function injections.handler(head,where,keep) end for n in traverse_id(glyph_code,head) do if n.subtype < 256 then - local k = n[kernpair] + local k = n[a_kernpair] if k then local kk = kerns[k] if kk then @@ -8990,6 +8995,8 @@ analyzers.initializers = initializers analyzers.methods = methods analyzers.useunicodemarks = false +local a_state = attributes.private('state') + local nodecodes = nodes.nodecodes local glyph_code = nodecodes.glyph @@ -8997,7 +9004,6 @@ local traverse_id = node.traverse_id local traverse_node_list = node.traverse local fontdata = fonts.hashes.identifiers -local state = attributes.private('state') local categories = characters and characters.categories or { } -- sorry, only in context local otffeatures = fonts.constructors.newfeatures("otf") @@ -9038,40 +9044,40 @@ function analyzers.setstate(head,font) if d then if d.class == "mark" or (useunicodemarks and categories[char] == "mn") then done = true - current[state] = 5 -- mark + current[a_state] = 5 -- mark elseif n == 0 then first, last, n = current, current, 1 - current[state] = 1 -- init + current[a_state] = 1 -- init else last, n = current, n+1 - current[state] = 2 -- medi + current[a_state] = 2 -- medi end else -- finish if first and first == last then - last[state] = 4 -- isol + last[a_state] = 4 -- isol elseif last then - last[state] = 3 -- fina + last[a_state] = 3 -- fina end first, last, n = nil, nil, 0 end elseif id == disc_code then -- always in the middle - current[state] = 2 -- midi + current[a_state] = 2 -- midi last = current else -- finish if first and first == last then - last[state] = 4 -- isol + last[a_state] = 4 -- isol elseif last then - last[state] = 3 -- fina + last[a_state] = 3 -- fina end first, last, n = nil, nil, 0 end current = current.next end if first and first == last then - last[state] = 4 -- isol + last[a_state] = 4 -- isol elseif last then - last[state] = 3 -- fina + last[a_state] = 3 -- fina end return head, done end @@ -9233,19 +9239,19 @@ local function finish(first,last) if first == last then local fc = first.char if isol_fina_medi_init[fc] or isol_fina[fc] then - first[state] = 4 -- isol + first[a_state] = 4 -- isol else warning(first,"isol") - first[state] = 0 -- error + first[a_state] = 0 -- error end else local lc = last.char if isol_fina_medi_init[lc] or isol_fina[lc] then -- why isol here ? -- if laststate == 1 or laststate == 2 or laststate == 4 then - last[state] = 3 -- fina + last[a_state] = 3 -- fina else warning(last,"fina") - last[state] = 0 -- error + last[a_state] = 0 -- error end end first, last = nil, nil @@ -9253,10 +9259,10 @@ local function finish(first,last) -- first and last are either both set so we never com here local fc = first.char if isol_fina_medi_init[fc] or isol_fina[fc] then - first[state] = 4 -- isol + first[a_state] = 4 -- isol else warning(first,"isol") - first[state] = 0 -- error + first[a_state] = 0 -- error end first = nil end @@ -9269,37 +9275,37 @@ function methods.arab(head,font,attr) -- maybe make a special version with no tr local marks = tfmdata.resources.marks local first, last, current, done = nil, nil, head, false while current do - if current.id == glyph_code and current.font == font and current.subtype<256 and not current[state] then + if current.id == glyph_code and current.font == font and current.subtype<256 and not current[a_state] then done = true local char = current.char if marks[char] or (useunicodemarks and categories[char] == "mn") then - current[state] = 5 -- mark + current[a_state] = 5 -- mark elseif isol[char] then -- can be zwj or zwnj too first, last = finish(first,last) - current[state] = 4 -- isol + current[a_state] = 4 -- isol first, last = nil, nil elseif not first then if isol_fina_medi_init[char] then - current[state] = 1 -- init + current[a_state] = 1 -- init first, last = first or current, current elseif isol_fina[char] then - current[state] = 4 -- isol + current[a_state] = 4 -- isol first, last = nil, nil else -- no arab first, last = finish(first,last) end elseif isol_fina_medi_init[char] then first, last = first or current, current - current[state] = 2 -- medi + current[a_state] = 2 -- medi elseif isol_fina[char] then - if not last[state] == 1 then + if not last[a_state] == 1 then -- tricky, we need to check what last may be ! - last[state] = 2 -- medi + last[a_state] = 2 -- medi end - current[state] = 3 -- fina + current[a_state] = 3 -- fina first, last = nil, nil elseif char >= 0x0600 and char <= 0x06FF then - current[state] = 6 -- rest + current[a_state] = 6 -- rest first, last = finish(first,last) else --no first, last = finish(first,last) @@ -9529,15 +9535,15 @@ local privateattribute = attributes.private -- more complex than an average font) but I need proper examples of all cases, not -- of only some. -local state = privateattribute('state') -local markbase = privateattribute('markbase') -local markmark = privateattribute('markmark') -local markdone = privateattribute('markdone') -- assigned at the injection end -local cursbase = privateattribute('cursbase') -local curscurs = privateattribute('curscurs') -local cursdone = privateattribute('cursdone') -local kernpair = privateattribute('kernpair') -local ligacomp = privateattribute('ligacomp') -- assigned here (ideally it should be combined) +local a_state = privateattribute('state') +local a_markbase = privateattribute('markbase') +local a_markmark = privateattribute('markmark') +local a_markdone = privateattribute('markdone') -- assigned at the injection end +local a_cursbase = privateattribute('cursbase') +local a_curscurs = privateattribute('curscurs') +local a_cursdone = privateattribute('cursdone') +local a_kernpair = privateattribute('kernpair') +local a_ligacomp = privateattribute('ligacomp') -- assigned here (ideally it should be combined) local injections = nodes.injections local setmark = injections.setmark @@ -9763,9 +9769,9 @@ local function toligature(kind,lookupname,start,stop,char,markflag,discfound) -- baseindex = baseindex + componentindex componentindex = getcomponentindex(start) elseif not deletemarks then -- quite fishy - start[ligacomp] = baseindex + (start[ligacomp] or componentindex) + start[a_ligacomp] = baseindex + (start[a_ligacomp] or componentindex) if trace_marks then - logwarning("%s: keep mark %s, gets index %s",pref(kind,lookupname),gref(char),start[ligacomp]) + logwarning("%s: keep mark %s, gets index %s",pref(kind,lookupname),gref(char),start[a_ligacomp]) end head, current = insert_node_after(head,current,copy_node(start)) -- unlikely that mark has components end @@ -9775,9 +9781,9 @@ local function toligature(kind,lookupname,start,stop,char,markflag,discfound) -- while start and start.id == glyph_code do -- hm, is id test needed ? local char = start.char if marks[char] then - start[ligacomp] = baseindex + (start[ligacomp] or componentindex) + start[a_ligacomp] = baseindex + (start[a_ligacomp] or componentindex) if trace_marks then - logwarning("%s: keep mark %s, gets index %s",pref(kind,lookupname),gref(char),start[ligacomp]) + logwarning("%s: keep mark %s, gets index %s",pref(kind,lookupname),gref(char),start[a_ligacomp]) end else break @@ -10053,7 +10059,7 @@ function handlers.gpos_mark2ligature(start,kind,lookupname,markanchors,sequence) end end end - local index = start[ligacomp] + local index = start[a_ligacomp] local baseanchors = descriptions[basechar] if baseanchors then baseanchors = baseanchors.anchors @@ -10099,10 +10105,10 @@ function handlers.gpos_mark2mark(start,kind,lookupname,markanchors,sequence) local markchar = start.char if marks[markchar] then local base = start.prev -- [glyph] [basemark] [start=mark] - local slc = start[ligacomp] + local slc = start[a_ligacomp] if slc then -- a rather messy loop ... needs checking with husayni while base do - local blc = base[ligacomp] + local blc = base[a_ligacomp] if blc and blc ~= slc then base = base.prev else @@ -10151,7 +10157,7 @@ function handlers.gpos_mark2mark(start,kind,lookupname,markanchors,sequence) end function handlers.gpos_cursive(start,kind,lookupname,exitanchors,sequence) -- to be checked - local alreadydone = cursonce and start[cursbase] + local alreadydone = cursonce and start[a_cursbase] if not alreadydone then local done = false local startchar = start.char @@ -10700,7 +10706,7 @@ function chainprocs.gpos_mark2ligature(start,stop,kind,chainname,currentcontext, end end -- todo: like marks a ligatures hash - local index = start[ligacomp] + local index = start[a_ligacomp] local baseanchors = descriptions[basechar].anchors if baseanchors then local baseanchors = baseanchors['baselig'] @@ -10742,7 +10748,7 @@ end function chainprocs.gpos_mark2mark(start,stop,kind,chainname,currentcontext,lookuphash,currentlookup,chainlookupname) local markchar = start.char if marks[markchar] then ---~ local alreadydone = markonce and start[markmark] +--~ local alreadydone = markonce and start[a_markmark] --~ if not alreadydone then -- local markanchors = descriptions[markchar].anchors markanchors = markanchors and markanchors.mark local subtables = currentlookup.subtables @@ -10753,10 +10759,10 @@ function chainprocs.gpos_mark2mark(start,stop,kind,chainname,currentcontext,look end if markanchors then local base = start.prev -- [glyph] [basemark] [start=mark] - local slc = start[ligacomp] + local slc = start[a_ligacomp] if slc then -- a rather messy loop ... needs checking with husayni while base do - local blc = base[ligacomp] + local blc = base[a_ligacomp] if blc and blc ~= slc then base = base.prev else @@ -10807,7 +10813,7 @@ end -- ! ! ! untested ! ! ! function chainprocs.gpos_cursive(start,stop,kind,chainname,currentcontext,lookuphash,currentlookup,chainlookupname) - local alreadydone = cursonce and start[cursbase] + local alreadydone = cursonce and start[a_cursbase] if not alreadydone then local startchar = start.char local subtables = currentlookup.subtables @@ -11526,9 +11532,9 @@ local function featuresprocessor(head,font,attr) if start.font == font and start.subtype<256 then local a = start[0] if a then - a = (a == attr) and (not attribute or start[state] == attribute) + a = (a == attr) and (not attribute or start[a_state] == attribute) else - a = not attribute or start[state] == attribute + a = not attribute or start[a_state] == attribute end if a then local lookupmatch = lookupcache[start.char] @@ -11599,9 +11605,9 @@ local function featuresprocessor(head,font,attr) if start.font == font and start.subtype<256 then local a = start[0] if a then - a = (a == attr) and (not attribute or start[state] == attribute) + a = (a == attr) and (not attribute or start[a_state] == attribute) else - a = not attribute or start[state] == attribute + a = not attribute or start[a_state] == attribute end if a then for i=1,ns do |