From 8e3049413845d8d8e1f7e672bc613d4e473ee868 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Fri, 4 Feb 2011 00:30:00 +0100 Subject: beta 2011.02.04 00:30 --- tex/context/base/catc-def.mkiv | 3 +- tex/context/base/char-tex.lua | 121 ++++++++ tex/context/base/cont-new.mkii | 2 +- tex/context/base/cont-new.mkiv | 2 +- tex/context/base/context.mkii | 2 +- tex/context/base/context.mkiv | 2 +- tex/context/base/data-ini.lua | 1 + tex/context/base/data-lst.lua | 64 ++-- tex/context/base/data-pre.lua | 39 ++- tex/context/base/data-res.lua | 1 + tex/context/base/enco-ini.mkiv | 234 ++------------ tex/context/base/font-ini.mkiv | 43 +-- tex/context/base/font-syn.lua | 8 +- tex/context/base/java-imp-ans.mkiv | 23 +- tex/context/base/java-imp-fil.mkiv | 30 +- tex/context/base/java-imp-fld.mkiv | 453 +++++++++++++++------------- tex/context/base/java-imp-stp.mkiv | 136 +++++---- tex/context/base/java-ini.lua | 15 +- tex/context/base/java-ini.mkiv | 12 +- tex/context/base/l-dir.lua | 28 +- tex/context/base/lpdf-fld.lua | 167 +++++++++- tex/context/base/lpdf-ini.lua | 2 +- tex/context/base/m-zint.mkiv | 10 +- tex/context/base/math-ini.mkiv | 14 +- tex/context/base/status-files.pdf | Bin 8943 -> 23175 bytes tex/context/base/supp-fil.lua | 1 + tex/context/base/symb-eur.mkiv | 52 ++++ tex/context/base/symb-ini.lua | 30 ++ tex/context/base/symb-ini.mkiv | 14 +- tex/context/base/type-ini.mkiv | 43 +-- tex/context/interface/cont-cs.xml | 29 ++ tex/context/interface/cont-de.xml | 29 ++ tex/context/interface/cont-en.xml | 29 ++ tex/context/interface/cont-fr.xml | 29 ++ tex/context/interface/cont-it.xml | 29 ++ tex/context/interface/cont-nl.xml | 29 ++ tex/context/interface/cont-pe.xml | 29 ++ tex/context/interface/cont-ro.xml | 29 ++ tex/generic/context/luatex-fonts-merged.lua | 2 +- 39 files changed, 1133 insertions(+), 653 deletions(-) create mode 100644 tex/context/base/symb-eur.mkiv create mode 100644 tex/context/base/symb-ini.lua (limited to 'tex') diff --git a/tex/context/base/catc-def.mkiv b/tex/context/base/catc-def.mkiv index 275a9a6cd..0bd7deed7 100644 --- a/tex/context/base/catc-def.mkiv +++ b/tex/context/base/catc-def.mkiv @@ -103,7 +103,8 @@ \catcode\spaceasciicode \spacecatcode \catcode\endoffileasciicode \ignorecatcode \catcode\circumflexasciicode\superscriptcatcode - \catcode\underscoreasciicode\subscriptcatcode +% \catcode\underscoreasciicode\subscriptcatcode + \catcode\underscoreasciicode\lettercatcode \catcode\ampersandasciicode \alignmentcatcode \catcode\backslashasciicode \escapecatcode \catcode\leftbraceasciicode \begingroupcatcode diff --git a/tex/context/base/char-tex.lua b/tex/context/base/char-tex.lua index b8ae0b53f..36eb7f889 100644 --- a/tex/context/base/char-tex.lua +++ b/tex/context/base/char-tex.lua @@ -18,6 +18,118 @@ characters = characters or { } local characters = characters characters.tex = characters.tex or { } +local accentmapping = allocate { + ['"'] = { [""] = "¨", + A = "Ä", a = "ä", + E = "Ë", e = "ë", + I = "Ï", i = "ï", + O = "Ö", o = "ö", + U = "Ü", u = "ü", + Y = "Ÿ", y = "ÿ", + }, + ["'"] = { [""] = "´", + A = "Á", a = "á", + C = "Ć", c = "ć", + E = "É", e = "é", + I = "Í", i = "í", + L = "Ĺ", l = "ĺ", + N = "Ń", n = "ń", + O = "Ó", o = "ó", + R = "Ŕ", r = "ŕ", + S = "Ś", s = "ś", + U = "Ú", u = "ú", + Y = "Ý", y = "ý", + Z = "Ź", z = "ź", + }, + ["."] = { [""] = "˙", + C = "Ċ", c = "ċ", + E = "Ė", e = "ė", + G = "Ġ", g = "ġ", + I = "İ", i = "i", + Z = "Ż", z = "ż", + }, + ["="] = { [""] = "¯", + A = "Ā", a = "ā", + E = "Ē", e = "ē", + I = "Ī", i = "ī", + O = "Ō", o = "ō", + U = "Ū", u = "ū", + }, + ["H"] = { [""] = "˝", + O = "Ő", o = "ő", + U = "Ű", u = "ű", + }, + ["^"] = { [""] = "ˆ", + A = "Â", a = "â", + C = "Ĉ", c = "ĉ", + E = "Ê", e = "ê", + G = "Ĝ", g = "ĝ", + H = "Ĥ", h = "ĥ", + I = "Î", i = "î", + J = "Ĵ", j = "ĵ", + O = "Ô", o = "ô", + S = "Ŝ", s = "ŝ", + U = "Û", u = "û", + W = "Ŵ", w = "ŵ", + Y = "Ŷ", y = "ŷ", + }, + ["`"] = { [""] = "`", + A = "À", a = "à", + E = "È", e = "è", + I = "Ì", i = "ì", + O = "Ò", o = "ò", + U = "Ù", u = "ù", + Y = "Ỳ", y = "ỳ", + }, + ["c"] = { [""] = "¸", + C = "Ç", c = "ç", + K = "Ķ", k = "ķ", + L = "Ļ", l = "ļ", + N = "Ņ", n = "ņ", + R = "Ŗ", r = "ŗ", + S = "Ş", s = "ş", + T = "Ţ", t = "ţ", + }, + ["k"] = { [""] = "˛", + A = "Ą", a = "ą", + E = "Ę", e = "ę", + I = "Į", i = "į", + U = "Ų", u = "ų", + }, + ["r"] = { [""] = "˚", + A = "Å", a = "å", + U = "Ů", u = "ů", + }, + ["u"] = { [""] = "˘", + A = "Ă", a = "ă", + E = "Ĕ", e = "ĕ", + G = "Ğ", g = "ğ", + I = "Ĭ", i = "ĭ", + O = "Ŏ", o = "ŏ", + U = "Ŭ", u = "ŭ", + }, + ["v"] = { [""] = "ˇ", + C = "Č", c = "č", + D = "Ď", d = "ď", + E = "Ě", e = "ě", + L = "Ľ", l = "ľ", + N = "Ň", n = "ň", + R = "Ř", r = "ř", + S = "Š", s = "š", + T = "Ť", t = "ť", + Z = "Ž", z = "ž", + }, + ["~"] = { [""] = "˜", + A = "Ã", a = "ã", + I = "Ĩ", i = "ĩ", + N = "Ñ", n = "ñ", + O = "Õ", o = "õ", + U = "Ũ", u = "ũ", + }, +} + +characters.tex.accentmapping = accentmapping + local accent_map = allocate { -- incomplete ['~'] = "̃" , -- ̃ Ẽ ['"'] = "̈" , -- ̈ Ë @@ -89,3 +201,12 @@ end --~ print(characters.tex.toutf([[\"{e}]]),true) --~ print(characters.tex.toutf([[{\"{e}}]],true)) + +function characters.tex.defineaccents() + for accent, group in next, accentmapping do + context.dodefineaccentcommand(accent) + for character, mapping in next, group do + context.dodefineaccent(accent,character,mapping) + end + end +end diff --git a/tex/context/base/cont-new.mkii b/tex/context/base/cont-new.mkii index 2b199b518..fa64d0998 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{2011.02.01 22:02} +\newcontextversion{2011.02.04 00:30} %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 8a557e7a7..6a5e1e7ef 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{2011.02.01 22:02} +\newcontextversion{2011.02.04 00:30} %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.mkii b/tex/context/base/context.mkii index b98d076be..dd590a9ae 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{2011.02.01 22:02} +\edef\contextversion{2011.02.04 00:30} %D For those who want to use this: diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv index 0d60cf7e8..1768d5269 100644 --- a/tex/context/base/context.mkiv +++ b/tex/context/base/context.mkiv @@ -20,7 +20,7 @@ %D your styles an modules. \edef\contextformat {\jobname} -\edef\contextversion{2011.02.01 22:02} +\edef\contextversion{2011.02.04 00:30} %D For those who want to use this: diff --git a/tex/context/base/data-ini.lua b/tex/context/base/data-ini.lua index ff115977c..63a7571fe 100644 --- a/tex/context/base/data-ini.lua +++ b/tex/context/base/data-ini.lua @@ -225,4 +225,5 @@ resolvers.settrace(osgetenv("MTX_INPUT_TRACE")) if not resolvers.resolve then function resolvers.resolve (s) return s end function resolvers.unresolve(s) return s end + function resolvers.repath (s) return s end end diff --git a/tex/context/base/data-lst.lua b/tex/context/base/data-lst.lua index c84853e81..23a2fc2fe 100644 --- a/tex/context/base/data-lst.lua +++ b/tex/context/base/data-lst.lua @@ -6,7 +6,7 @@ if not modules then modules = { } end modules ['data-lst'] = { license = "see context related readme files" } --- used in mtxrun +-- used in mtxrun, can be loaded later .. todo local find, concat, upper, format = string.find, table.concat, string.upper, string.format @@ -22,50 +22,42 @@ local function tabstr(str) end end -local function list(list,report,pattern) - pattern = pattern and pattern ~= "" and upper(pattern) or "" - local instance = resolvers.instance - local report = report or texio.write_nl - local sorted = table.sortedkeys(list) - local result = { } - for i=1,#sorted do - local key = sorted[i] - if key ~= "" and (pattern == "" or find(upper(key),pattern)) then - local raw = tabstr(rawget(list,key)) - local val = tabstr(list[key]) - local res = resolvers.resolve(val) - if raw and raw ~= "" then - if raw == val then - if val == res then - result[#result+1] = { key, raw } - else - result[#result+1] = { key, format('%s => %s',raw,res) } - end - else - if val == res then - result[#result+1] = { key, format('%s => %s',raw,val) } - else - result[#result+1] = { key, format('%s => %s => %s',raw,val,res) } - end - end - else - result[#result+1] = { key, "unset" } +function resolvers.listers.variables(pattern) + local instance = resolvers.instance + local environment = instance.environment + local variables = instance.variables + local expansions = instance.expansions + local pattern = upper(pattern or "") + local configured = { } + local order = instance.order + for i=1,#order do + for k, v in next, order[i] do + if v ~= nil and configured[k] == nil then + configured[k] = v end end end - utilities.formatters.formatcolumns(result) - for i=1,#result do - report(result[i]) + local env = table.fastcopy(environment) + local var = table.fastcopy(variables) + local exp = table.fastcopy(expansions) + for key, value in table.sortedpairs(configured) do + if key ~= "" and (pattern == "" or find(upper(key),pattern)) then + logs.simple(key) + logs.simple(" env: %s",tabstr(rawget(environment,key)) or "unset") + logs.simple(" var: %s",tabstr(configured[key]) or "unset") + logs.simple(" exp: %s",tabstr(expansions[key]) or "unset") + logs.simple(" res: %s",resolvers.resolve(expansions[key]) or "unset") + end end + instance.environment = table.fastcopy(env) + instance.variables = table.fastcopy(var) + instance.expansions = table.fastcopy(exp) end -function resolvers.listers.variables (report,pattern) list(resolvers.instance.variables, report,pattern) end -function resolvers.listers.expansions(report,pattern) list(resolvers.instance.expansions,report,pattern) end - function resolvers.listers.configurations(report) local configurations = resolvers.instance.specification local report = report or texio.write_nl for i=1,#configurations do - report(configurations[i]) + report(resolvers.resolve(configurations[i])) end end diff --git a/tex/context/base/data-pre.lua b/tex/context/base/data-pre.lua index 44751ae5a..2e566de87 100644 --- a/tex/context/base/data-pre.lua +++ b/tex/context/base/data-pre.lua @@ -22,6 +22,7 @@ resolvers.prefixes = prefixes local gsub = string.gsub local cleanpath, findgivenfile, expansion = resolvers.cleanpath, resolvers.findgivenfile, resolvers.expansion local getenv = resolvers.getenv -- we can probably also use resolvers.expansion +local P, Cs, lpegmatch = lpeg.P, lpeg.Cs, lpeg.match prefixes.environment = function(str) return cleanpath(expansion(str)) @@ -85,8 +86,6 @@ prefixes.home = function(str) return cleanpath(file.join(getenv('HOME'),str)) end -prefixes["~"] = prefixes.home - prefixes.env = prefixes.environment prefixes.rel = prefixes.relative prefixes.loc = prefixes.locate @@ -145,3 +144,39 @@ if os.uname then end end + +if os.type == "unix" then + + local pattern + + local function makepattern(t,k,v) + local colon = P(":") + local p + for k, v in table.sortedpairs(prefixes) do + if p then + p = P(k) + p + else + p = P(k) + end + end + pattern = Cs((p * colon + colon/";" + P(1))^0) + if t then + t[k] = v + end + end + + makepattern() + + getmetatable(prefixes).__newindex = makepattern + + function resolvers.repath(str) + return lpegmatch(pattern,str) + end + +else -- already the default: + + function resolvers.repath(str) + return str + end + +end diff --git a/tex/context/base/data-res.lua b/tex/context/base/data-res.lua index 0c6ce1969..a53816c3f 100644 --- a/tex/context/base/data-res.lua +++ b/tex/context/base/data-res.lua @@ -192,6 +192,7 @@ function resolvers.newinstance() -- todo: all vars will become lowercase and alp if v ~= nil then v = checkedvariable(v) or "" end + v = resolvers.repath(v) -- for taco who has a : separated osfontdir t[k] = v return v end } ) diff --git a/tex/context/base/enco-ini.mkiv b/tex/context/base/enco-ini.mkiv index d7fac77c2..2c15e2ab7 100644 --- a/tex/context/base/enco-ini.mkiv +++ b/tex/context/base/enco-ini.mkiv @@ -36,34 +36,18 @@ \unprotect -%D Quite some commands are now obsolete. We keep only a few commands -%D around, just in case they are used in styles (and in for instance -%D symb and xtag files). - -\unexpanded\def\startencoding [#1]{} % used in symb -\let\stopencoding \relax -\unexpanded\def\setupencoding [#1]{} -\def\enablemapping [#1]{} -\def\enableencoding[#1]{} - -\def\currentencoding{utf} -\def\currentmapping {utf} -\let\defaultencoding\s!default - -% todo: - -% \def\showaccents {\f!encodingprefix\s!run} -% \def\showcharacters {\f!encodingprefix\s!run} -% \def\showcharacterbounds {\f!encodingprefix\s!run} -% \def\showhyphenations {\f!encodingprefix\s!run} -% \def\showmapping {\f!encodingprefix\s!run} - %D \macros %D {defineaccent, definecharacter, definecommand} +\unexpanded\def\dodefineaccentcommand#1% + {\setevalue{\string#1}{\noexpand\dohandleaccent{\string#1}}} + +\unexpanded\def\dodefineaccent#1#2#3% no spaces, used low level + {\setvalue{\??ac\string#1\string#2\empty}{#3}} + \unexpanded\def\defineaccent#1 #2 #3 % - {\setevalue{\string#1}{\noexpand\dohandleaccent{\string#1}}% - \setvalue{\??ac\string#1\string#2}{#3}} + {\dodefineaccentcommand{#1}% + \dodefineaccent{#1}{#2}{#3}} \def\dohandleaccent#1#2% {\csname\??ac\string#1\string#2\empty\endcsname} @@ -71,19 +55,17 @@ \unexpanded\def\definecharacter#1 #2 % {\doifnumberelse{\string#2} {\setevalue{\string#1}{\utfchar{#2}}} % or {\expandafter\chardef\csname#1\endcsname#2\relax} - {\setuvalue {\string#1}{#2}}} + {\setuvalue{\string#1}{#2}}} \unexpanded\def\definecommand#1 #2 % {\setuvalue{\string#1}{#2}} %D \macros -%D {everyuppercase, EveryUppercase, -%D everyuppercase, EveryUppercase, -%D everysanitize, EverySanitize} +%D {everyuppercase, everylowercase, everysanitize} -\newevery \everyuppercase \EveryUppercase -\newevery \everylowercase \EveryLowercase -\newevery \everysanitize \EverySanitize +\newtoks \everyuppercase +\newtoks \everylowercase +\newtoks \everysanitize %D Some saved meanings (not really needed): @@ -272,52 +254,6 @@ \def\leftsubguillemot {\guilsingleleft} \def\rightsubguillemot {\guilsingleright} -% obsolete: - -% \greekleftquot {[obsolete]} -% \greekrightquot {[obsolete]} -% \greekapostrophos {[obsolete]} -% \greekupsilondialytika{[obsolete]} -% \Ycaron {[obsolete]} -% \ycaron {[obsolete]} - -% to be done in char-def: - -% \definecharacter cyrillicGUP {GUP} -% \definecharacter cyrillicGHCRS {GHCRS} -% \definecharacter cyrillicZHDSC {ZHDSC} -% \definecharacter cyrillicKDSC {KDSC} -% \definecharacter cyrillicKBEAK {KBEAK} -% \definecharacter cyrillicKVCRS {KVCRS} -% \definecharacter cyrillicNG {NG} -% \definecharacter cyrillicOTLD {OTLD} -% \definecharacter cyrillicY {Y} -% \definecharacter cyrillicYHCRS {YHCRS} -% \definecharacter cyrillicHDSC {HDSC} -% \definecharacter cyrillicCHVCRS {CHVCRS} -% \definecharacter cyrillicCHRDSC {CHRDSC} -% \definecharacter cyrillicQ {Q} -% \definecharacter cyrillicW {W} -% -% \definecharacter cyrillicgup {gup} -% \definecharacter cyrillicghcrs {ghcrs} -% \definecharacter cyrilliczhdsc {zhdsc} -% \definecharacter cyrillickdsc {kdsc} -% \definecharacter cyrillickbeak {kbeak} -% \definecharacter cyrillickvcrs {kvcrs} -% \definecharacter cyrillicng {ng} -% \definecharacter cyrillicotld {otld} -% \definecharacter cyrillicy {y} -% \definecharacter cyrillicyhcrs {yhcrs} -% \definecharacter cyrillichdsc {hdsc} -% \definecharacter cyrillicchvcrs {chvcrs} -% \definecharacter cyrillicchrdsc {chrdsc} -% \definecharacter cyrillicq {q} -% \definecharacter cyrillicw {w} - -% \definecharacter softhyphen 45 -% \definecharacter compoundwordmark 23 - % left-overs (some day in private unicode space, so that we can roundtrip) \unexpanded\def\textblacksquare {\dontleavehmode\hbox{\vrule\!!width.3\s!em\!!height.4\s!em\!!depth-.1\s!em}} @@ -364,119 +300,24 @@ {\copy\controlspacebox} % a few defaults (\{}), we really need the verbose \empty as it will be -% stringified - -\defineaccent ^ {\empty} {\textcircumflex} -\defineaccent ` {\empty} {\textgrave} -\defineaccent ~ {\empty} {\texttilde} -\defineaccent " {\empty} {\textdiaeresis} -\defineaccent ' {\empty} {\textacute} -\defineaccent . {\empty} {\textdotaccent} -\defineaccent = {\empty} {\textmacron} -\defineaccent c {\empty} {\textcedilla} -\defineaccent H {\empty} {\texthungarumlaut} -\defineaccent k {\empty} {\textogonek} -\defineaccent r {\empty} {\textring} -\defineaccent u {\empty} {\textbreve} -\defineaccent v {\empty} {\textcaron} - -% from enco-acc: +% stringified .. anyhow, we define this at the lua end now but keep it here as a +% reference % -% we should to this at the lua end and share code .. - -\defineaccent ^ A {\Acircumflex} \defineaccent ^ a {\acircumflex} -\defineaccent ^ C {\Ccircumflex} \defineaccent ^ c {\ccircumflex} -\defineaccent ^ E {\Ecircumflex} \defineaccent ^ e {\ecircumflex} -\defineaccent ^ G {\Gcircumflex} \defineaccent ^ g {\gcircumflex} -\defineaccent ^ H {\Hcircumflex} \defineaccent ^ h {\hcircumflex} -\defineaccent ^ I {\Icircumflex} \defineaccent ^ i {\icircumflex} \defineaccent ^ {\i} {\icircumflex} -\defineaccent ^ J {\Jcircumflex} \defineaccent ^ j {\jcircumflex} \defineaccent ^ {\j} {\jcircumflex} -\defineaccent ^ O {\Ocircumflex} \defineaccent ^ o {\ocircumflex} -\defineaccent ^ S {\Scircumflex} \defineaccent ^ s {\scircumflex} -\defineaccent ^ U {\Ucircumflex} \defineaccent ^ u {\ucircumflex} -\defineaccent ^ W {\Wcircumflex} \defineaccent ^ w {\wcircumflex} -\defineaccent ^ Y {\Ycircumflex} \defineaccent ^ y {\ycircumflex} - -\defineaccent ` A {\Agrave} \defineaccent ` a {\agrave} -\defineaccent ` E {\Egrave} \defineaccent ` e {\egrave} -\defineaccent ` I {\Igrave} \defineaccent ` i {\igrave} \defineaccent ` {\i} {\igrave} -\defineaccent ` O {\Ograve} \defineaccent ` o {\ograve} -\defineaccent ` U {\Ugrave} \defineaccent ` u {\ugrave} -\defineaccent ` Y {\Ygrave} \defineaccent ` y {\ygrave} - -\defineaccent ~ A {\Atilde} \defineaccent ~ a {\atilde} -\defineaccent ~ I {\Itilde} \defineaccent ~ i {\itilde} \defineaccent ~ {\i} {\itilde} -\defineaccent ~ O {\Otilde} \defineaccent ~ o {\otilde} -\defineaccent ~ U {\Utilde} \defineaccent ~ u {\utilde} -\defineaccent ~ N {\Ntilde} \defineaccent ~ n {\ntilde} - -\defineaccent " A {\Adiaeresis} \defineaccent " a {\adiaeresis} -\defineaccent " E {\Ediaeresis} \defineaccent " e {\ediaeresis} -\defineaccent " I {\Idiaeresis} \defineaccent " i {\idiaeresis} \defineaccent " {\i} {\idiaeresis} -\defineaccent " O {\Odiaeresis} \defineaccent " o {\odiaeresis} -\defineaccent " U {\Udiaeresis} \defineaccent " u {\udiaeresis} -\defineaccent " Y {\Ydiaeresis} \defineaccent " y {\ydiaeresis} - -\defineaccent ' A {\Aacute} \defineaccent ' a {\aacute} -\defineaccent ' C {\Cacute} \defineaccent ' c {\cacute} -\defineaccent ' E {\Eacute} \defineaccent ' e {\eacute} -\defineaccent ' I {\Iacute} \defineaccent ' i {\iacute} \defineaccent ' {\i} {\iacute} -\defineaccent ' L {\Lacute} \defineaccent ' l {\lacute} -\defineaccent ' N {\Nacute} \defineaccent ' n {\nacute} -\defineaccent ' O {\Oacute} \defineaccent ' o {\oacute} -\defineaccent ' R {\Racute} \defineaccent ' r {\racute} -\defineaccent ' S {\Sacute} \defineaccent ' s {\sacute} -\defineaccent ' U {\Uacute} \defineaccent ' u {\uacute} -\defineaccent ' Y {\Yacute} \defineaccent ' y {\yacute} -\defineaccent ' Z {\Zacute} \defineaccent ' z {\zacute} - -\defineaccent . C {\Cdotaccent} \defineaccent . c {\cdotaccent} -\defineaccent . E {\Edotaccent} \defineaccent . e {\edotaccent} -\defineaccent . G {\Gdotaccent} \defineaccent . g {\gdotaccent} -\defineaccent . I {\Idotaccent} \defineaccent . i {\idotaccent} \defineaccent . {\i} {\idotaccent} -\defineaccent . Z {\Zdotaccent} \defineaccent . z {\zdotaccent} - -\defineaccent = A {\Amacron} \defineaccent = a {\amacron} -\defineaccent = E {\Emacron} \defineaccent = e {\emacron} -\defineaccent = I {\Imacron} \defineaccent = i {\imacron} \defineaccent = {\i} {\imacron} -\defineaccent = O {\Omacron} \defineaccent = o {\omacron} -\defineaccent = U {\Umacron} \defineaccent = u {\umacron} - -\defineaccent c C {\Ccedilla} \defineaccent c c {\ccedilla} -\defineaccent c K {\Kcedilla} \defineaccent c k {\kcedilla} -\defineaccent c L {\Lcedilla} \defineaccent c l {\lcedilla} -\defineaccent c N {\Ncedilla} \defineaccent c n {\ncedilla} -\defineaccent c R {\Rcedilla} \defineaccent c r {\rcedilla} -\defineaccent c S {\Scedilla} \defineaccent c s {\scedilla} -\defineaccent c T {\Tcedilla} \defineaccent c t {\tcedilla} - -\defineaccent H O {\Ohungarumlaut} \defineaccent H o {\ohungarumlaut} -\defineaccent H u {\uhungarumlaut} \defineaccent H U {\Uhungarumlaut} - -\defineaccent k A {\Aogonek} \defineaccent k a {\aogonek} -\defineaccent k E {\Eogonek} \defineaccent k e {\eogonek} -\defineaccent k I {\Iogonek} \defineaccent k i {\iogonek} -\defineaccent k U {\Uogonek} \defineaccent k u {\uogonek} - -\defineaccent r A {\Aring} \defineaccent r a {\aring} -\defineaccent r U {\Uring} \defineaccent r u {\uring} - -\defineaccent u A {\Abreve} \defineaccent u a {\abreve} -\defineaccent u E {\Ebreve} \defineaccent u e {\ebreve} -\defineaccent u G {\Gbreve} \defineaccent u g {\gbreve} -\defineaccent u I {\Ibreve} \defineaccent u i {\ibreve} \defineaccent u {\i} {\ibreve} -\defineaccent u O {\Obreve} \defineaccent u o {\obreve} -\defineaccent u U {\Ubreve} \defineaccent u u {\ubreve} - -\defineaccent v C {\Ccaron} \defineaccent v c {\ccaron} -\defineaccent v D {\Dcaron} \defineaccent v d {\dcaron} -\defineaccent v E {\Ecaron} \defineaccent v e {\ecaron} -\defineaccent v L {\Lcaron} \defineaccent v l {\lcaron} -\defineaccent v N {\Ncaron} \defineaccent v n {\ncaron} -\defineaccent v R {\Rcaron} \defineaccent v r {\rcaron} -\defineaccent v S {\Scaron} \defineaccent v s {\scaron} -\defineaccent v T {\Tcaron} \defineaccent v t {\tcaron} -\defineaccent v Z {\Zcaron} \defineaccent v z {\zcaron} +% \defineaccent ^ {\empty} {\textcircumflex} +% \defineaccent ` {\empty} {\textgrave} +% \defineaccent ~ {\empty} {\texttilde} +% \defineaccent " {\empty} {\textdiaeresis} +% \defineaccent ' {\empty} {\textacute} +% \defineaccent . {\empty} {\textdotaccent} +% \defineaccent = {\empty} {\textmacron} +% \defineaccent c {\empty} {\textcedilla} +% \defineaccent H {\empty} {\texthungarumlaut} +% \defineaccent k {\empty} {\textogonek} +% \defineaccent r {\empty} {\textring} +% \defineaccent u {\empty} {\textbreve} +% \defineaccent v {\empty} {\textcaron} + +\ctxlua{characters.tex.defineaccents()} % from enco-mis: @@ -499,21 +340,6 @@ %D A smaller and bolder variant, more like the math and monospaced ones. -% \def\fakeunderscore -% {\dontleavehmode\hbox % was \leavevmode -% {\setbox\scratchbox\hbox{(}% -% \scratchdimen.2\dp\scratchbox -% \setbox\scratchbox\hbox{\space}% -% \vrule -% \!!depth \scratchdimen -% \!!width \wd\scratchbox -% \!!height\zeropoint}} - -% \startTEXpage -% \ruledhbox{\strut$1\fakeunderscore^{1\fakeunderscore}$} -% \ruledhbox{\strut$1\xfakeunderscore^{1\xfakeunderscore}$} -% \stopTEXpage - \def\fakeunderscore {\relax\ifmmode \vrule\!!depth .12\fontexheight\mathstylefont\normalmathstyle\!!width \fontinterwordspace\mathstylefont\normalmathstyle\!!height\zeropoint\relax diff --git a/tex/context/base/font-ini.mkiv b/tex/context/base/font-ini.mkiv index 6a8c9594f..25ed87eaa 100644 --- a/tex/context/base/font-ini.mkiv +++ b/tex/context/base/font-ini.mkiv @@ -2093,11 +2093,6 @@ \ctxlua{fonts.definers.resetnullfont()}% in luatex 0.70 this will also do the previous \globallet\resetnullfont\relax} -% \def\preloaddefaultfonts -% {\resetpreloadfonts -% \setupbodyfont[modern,\fontstyle,\fontbody]% -% \showmessage\m!fonts6{\normalizedbodyfontsize\normalspace\fontstyle}} - \def\preloaddefaultfonts {\resetpreloadfonts \setupbodyfont[modern,\fontstyle,\fontbody]% @@ -2114,16 +2109,34 @@ \showmessage\m!fonts6{fallback modern tt \normalizedbodyfontsize}} \def\resetpreloadfonts - {\global\let\firststagepreloadfonts \relax - \global\let\secondstagepreloadfonts\relax - \global\let\thirdstagepreloadfonts \relax - \global\let\fourthstagepreloadfonts\relax + {\glet\preloaddefaultfonts \relax + \glet\preloaddefaultfontstt \relax + \glet\preloaddefaultfontsmm \relax + \glet\zerostagepreloadfonts \relax + \glet\firststagepreloadfonts \relax + \glet\secondstagepreloadfonts\relax + \glet\thirdstagepreloadfonts \relax + \glet\fourthstagepreloadfonts\relax + \global\everyhbox\emptytoks + \global\everyvbox\emptytoks \resetnullfont} +\def\dozerostagepreloadfonts + {\definedfont[\s!file:lmmono10-regular sa 1]} + +\def\zerostagepreloadfonts + {\writestatus\m!fonts{beware: no fonts are loaded yet, using 'lm mono' in box}% + \glet\zerostagepreloadfonts\dozerostagepreloadfonts + \zerostagepreloadfonts} + +\appendtoks + \everyhbox{\zerostagepreloadfonts} + \everyvbox{\zerostagepreloadfonts} +\to \everydump + \def\firststagepreloadfonts % see core-def.mkiv {\doifmodeelse{*nofonts} - {%\resetpreloadfonts - \writestatus\m!fonts{latin modern fonts are not preloaded}} + {\writestatus\m!fonts{latin modern fonts are not preloaded}} {\preloaddefaultfonts \writestatus\m!fonts{preloading latin modern fonts (first stage)}}} @@ -2131,14 +2144,6 @@ {\writestatus\m!fonts{preloading latin modern fonts (second stage)}% \preloaddefaultfonts} -% \def\thirdstagepreloadfonts -% {\ifx\fontclass\empty -% \writestatus\m!fonts{preloading latin modern fonts (third stage)}% -% \preloaddefaultfonts -% \else -% \resetpreloadfonts -% \fi} - \def\thirdstagepreloadfonts {\ifx\fontclass\empty \writestatus\m!fonts{preloading latin modern fonts (third stage)}% diff --git a/tex/context/base/font-syn.lua b/tex/context/base/font-syn.lua index c5ae5dc75..5eb7551cd 100644 --- a/tex/context/base/font-syn.lua +++ b/tex/context/base/font-syn.lua @@ -52,7 +52,7 @@ names.be_clever = true names.enabled = true names.cache = containers.define("fonts","data",names.version,true) -local autoreload = false +local autoreload = true directives.register("fonts.autoreload", function(v) autoreload = toboolean(v) end) @@ -926,11 +926,13 @@ local function is_reloaded() local c_status = table.serialize(resolvers.datastate()) local f_status = table.serialize(data.datastate) if c_status == f_status then - -- report_names("font database matches configuration and file hashes") + report_names("font database has matching configuration and file hashes") return else - report_names("font database does not match configuration and file hashes") + report_names("font database has mismatching configuration and file hashes") end + else + report_names("font database is regenerated (controlled by directive 'fonts.autoreload')") end names.loaded = false reloaded = true diff --git a/tex/context/base/java-imp-ans.mkiv b/tex/context/base/java-imp-ans.mkiv index 636c894f9..cc63266e2 100644 --- a/tex/context/base/java-imp-ans.mkiv +++ b/tex/context/base/java-imp-ans.mkiv @@ -8,21 +8,26 @@ %D copyright={PRAGMA / Hans Hagen \& Ton Otten}] %C %C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. -\startJSpreamble{Do_Check_Answer} used later +% event.target.display = display.hidden - function Do_Check_Answer (field, value) - { if (event.value.toLowerCase()==value.toLowerCase()) - { event.target.hidden = true } - % { event.target.display = display.hidden } - return("\040") } // funny, "" does not work +\startJSpreamble{Do_Check_Answer} used later + + function Do_Check_Answer(field,value) { + if (event.value.toLowerCase() == value.toLowerCase()) { + event.target.hidden = true ; + } + return("\040") // funny, "" does not work + } \stopJSpreamble +% needs to be done better in mkiv: + \startJScode{Check_Answer} uses {Do_Check_Answer} - event.value = Do_Check_Answer(JS_S_1, JS_S_2) ; + event.value = Do_Check_Answer(JS_S_1, JS_S_2) ; \stopJScode \endinput diff --git a/tex/context/base/java-imp-fil.mkiv b/tex/context/base/java-imp-fil.mkiv index 4d79a2ace..592e9460d 100644 --- a/tex/context/base/java-imp-fil.mkiv +++ b/tex/context/base/java-imp-fil.mkiv @@ -13,19 +13,23 @@ \startJSpreamble Auxiliary used now - function DocumentFileName () - { var Paths = this.path.split("/") ; - Paths = Paths[Paths.length-1].split(".") ; - return(Paths[0]) } - - function Print_Page_Range(From, To) % gaat mis, nog geen args mogelijk - { if ((Number(From)>0)&&(Number(To)>=Number(From))) - { var myFrom = Number(From)-1 ; - var myTo = Number(To)-1 ; - this.print(false,myFrom,myTo,true) } } - - function Print_This_Page () - { this.print(false,this.pageNum,this.pageNum,true) } + function DocumentFileName() { + var Paths = this.path.split("/") ; + Paths = Paths[Paths.length-1].split(".") ; + return(Paths[0]) + } + + function Print_Page_Range(From,To) { + if ((Number(From)>0) && (Number(To) >= Number(From))) { + var myFrom = Number(From)-1 ; + var myTo = Number(To)-1 ; + this.print(false,myFrom,myTo,true) ; + } + } + + function Print_This_Page() { + this.print(false,this.pageNum,this.pageNum,true) ; + } \stopJSpreamble diff --git a/tex/context/base/java-imp-fld.mkiv b/tex/context/base/java-imp-fld.mkiv index 93a90dc0a..30847b201 100644 --- a/tex/context/base/java-imp-fld.mkiv +++ b/tex/context/base/java-imp-fld.mkiv @@ -11,216 +11,249 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -% will be simplified, since we now parse functions - -% nu nog alles geladen, moet dus anders - -\startJSpreamble {Sanitize_TeX_Input} used later - - function Sanitized_TeX_String (value) - { var v = value ; - v = v.replace( /\\\\oe/g,"\\234") ; - v = v.replace( /\\\\<>/g,"\\273") ; - v = v.replace( /\\\\`A/g,"\\300") ; - v = v.replace( /\\\\'A/g,"\\301") ; - v = v.replace( /\\\\^A/g,"\\302") ; - v = v.replace( /\\\\~A/g,"\\303") ; - v = v.replace( /\\\\"A/g,"\\304") ; - v = v.replace( /\\\\oA/g,"\\305") ; - v = v.replace( /\\\\AE/g,"\\306") ; - v = v.replace( /\\\\,C/g,"\\307") ; - v = v.replace( /\\\\`E/g,"\\310") ; - v = v.replace( /\\\\'E/g,"\\311") ; - v = v.replace( /\\\\^E/g,"\\312") ; - v = v.replace( /\\\\"E/g,"\\313") ; - v = v.replace( /\\\\`I/g,"\\314") ; - v = v.replace( /\\\\'I/g,"\\315") ; - v = v.replace( /\\\\^I/g,"\\316") ; - v = v.replace( /\\\\"I/g,"\\317") ; - v = v.replace( /\\\\~N/g,"\\321") ; - v = v.replace( /\\\\`O/g,"\\322") ; - v = v.replace( /\\\\'O/g,"\\323") ; - v = v.replace( /\\\\^O/g,"\\324") ; - v = v.replace( /\\\\~O/g,"\\325") ; - v = v.replace( /\\\\"O/g,"\\326") ; - v = v.replace( /\\\\`U/g,"\\331") ; - v = v.replace( /\\\\'U/g,"\\332") ; - v = v.replace( /\\\\^U/g,"\\333") ; - v = v.replace( /\\\\"U/g,"\\334") ; - v = v.replace( /\\\\'Y/g,"\\335") ; - v = v.replace( /\\\\ss/g,"\\337") ; - v = v.replace( /\\\\`a/g,"\\340") ; - v = v.replace( /\\\\'a/g,"\\341") ; - v = v.replace( /\\\\^a/g,"\\342") ; - v = v.replace( /\\\\~a/g,"\\343") ; - v = v.replace( /\\\\"a/g,"\\344") ; - v = v.replace( /\\\\oa/g,"\\345") ; - v = v.replace( /\\\\ae/g,"\\346") ; - v = v.replace( /\\\\,c/g,"\\347") ; - v = v.replace( /\\\\`e/g,"\\350") ; - v = v.replace( /\\\\'e/g,"\\351") ; - v = v.replace( /\\\\^e/g,"\\352") ; - v = v.replace( /\\\\"e/g,"\\353") ; - v = v.replace( /\\\\`i/g,"\\354") ; - v = v.replace( /\\\\'i/g,"\\355") ; - v = v.replace( /\\\\^i/g,"\\356") ; - v = v.replace( /\\\\"i/g,"\\357") ; - v = v.replace( /\\\\~n/g,"\\361") ; - v = v.replace( /\\\\`o/g,"\\362") ; - v = v.replace( /\\\\'o/g,"\\363") ; - v = v.replace( /\\\\^o/g,"\\364") ; - v = v.replace( /\\\\~o/g,"\\365") ; - v = v.replace( /\\\\"o/g,"\\366") ; - v = v.replace( /\\\\`u/g,"\\371") ; - v = v.replace( /\\\\'u/g,"\\372") ; - v = v.replace( /\\\\^u/g,"\\373") ; - v = v.replace( /\\\\"u/g,"\\374") ; - v = v.replace( /\\\\'y/g,"\\375") ; - v = v.replace( /\\\\"y/g,"\\377") ; - return(v) } - - var TeX_Key_Mode = 0 ; - - function Initialize_TeX_Keystroke () - { TeX_Key_Char = "" ; - TeX_Key_Mode = 0 } - - function Sanitized_TeX_Keystroke (change) - { if (change=="\\\\") - { TeX_Key_Mode = 1 ; - return("") } - else if (TeX_Key_Mode==1) - { TeX_Key_Mode = 2 ; - TeX_Key_Char = change ; - return("") } - else if (TeX_Key_Mode==2) - { TeX_Key_Mode = 0 ; - TeX_Key_Char = "\\\\"+TeX_Key_Char+change ; - return(Sanitized_TeX_String(TeX_Key_Char)) } - else - { TeX_Key_Mode = 0 ; - return(change) } } +%D In \LUATEX\ the following does not work out well: +%D +%D \starttyping +%D v = v.replace(/\\\\"e/g,"\\353") ; +%D \stoptyping +%D +%D But this does: +%D +%D \starttyping +%D v = String(v).replace(/\\\\"e/g,"\\353") ; +%D \stoptyping +%D +%D Probably a \UNICODE\ issue. Beware, in \MKIV\ we have a +%D different escaping of \type {\\}. + +\startluasetups javascript:pdfencoding + local verbatim = context.verbatim + verbatim("{\n") + for accent, group in table.sortedhash(characters.tex.accentmapping) do + for character, mapping in table.sortedhash(group) do + if character == "" then + character = " " + end + if accent == '"' then + verbatim(" '%s%s' : '\\u%04X',\n",accent,character,utf.byte(mapping)) + else + verbatim(' "%s%s" : "\\u%04X",\n',accent,character,utf.byte(mapping)) + end + end + end + verbatim(" 'OE' : '\\u0152',\n") + verbatim(" 'oe' : '\\u0153',\n") + verbatim(" 'AE' : '\\u00C6',\n") + verbatim(" 'ae' : '\\u00C7',\n") + verbatim(" '<<' : '\\u00AB',\n") + verbatim(" '>>' : '\\u00BB',\n") + verbatim(" 'ss' : '\\u00DF' \n") + verbatim("}\n") +\stopluasetups + +% maybe make { } tex braces in javascript code so that we can call lua + +\def\JavaScriptTeXAccentMapping{\luasetup{javascript:pdfencoding}} + +\startJSpreamble SanitizeTeXInput used later + +var TeXAccentMapping = \JavaScriptTeXAccentMapping + +function TeX_Replacer(original,str) { + return (TeXAccentMapping[str] || str) ; +} -\stopJSpreamble +function Sanitized_TeX_String(value) { + return (value.replace(/\\(..)/g, TeX_Replacer)) ; +} -\startJScode {Initialize_TeX_Key} uses {Sanitize_TeX_Input} - Initialize_TeX_Keystroke() ; -\stopJScode +var TeX_Key_Mode = 0 ; +var TeX_Key_Char = "" ; -\startJScode {Convert_TeX_Key} uses {Sanitize_TeX_Input} - if (!event.willCommit) - { event.change = Sanitized_TeX_Keystroke(event.change) } -\stopJScode +function Initialize_TeX_Keystroke() { + TeX_Key_Char = "" ; + TeX_Key_Mode = 0 ; +} -\startJScode{Convert_TeX_String} uses {Sanitize_TeX_Input} - event.value = Sanitized_TeX_String(event.value) ; -\stopJScode +function Sanitized_TeX_Keystroke(change) { + if (!event.willCommit) { + if (change=="\\") { + TeX_Key_Mode = 1 ; + return ("") + } else if (TeX_Key_Mode == 1) { + TeX_Key_Mode = 2 ; + TeX_Key_Char = change ; + return ("") + } else if (TeX_Key_Mode == 2) { + TeX_Key_Mode = 0 ; + TeX_Key_Char = "\\"+TeX_Key_Char+change ; + return (Sanitized_TeX_String(TeX_Key_Char)) + } else { + TeX_Key_Mode = 0 ; + return (change) + } + } +} + +function Initialize_TeX_Key() { + Initialize_TeX_Keystroke() ; +} -\startJSpreamble fields_1 used now +function Convert_TeX_Key() { + if (!event.willCommit) { + event.change = Sanitized_TeX_Keystroke(event.change) ; + } +} + +function Convert_TeX_String() { + event.value = Sanitized_TeX_String(event.value) ; +} + +\stopJSpreamble + +% \startJScode {Initialize_TeX_Key} uses {SanitizeTeXInput} +% Initialize_TeX_Keystroke() ; +% \stopJScode +% +% \startJScode {Convert_TeX_Key} uses {SanitizeTeXInput} +% if (!event.willCommit) { +% event.change = Sanitized_TeX_Keystroke(event.change) ; +% } +% \stopJScode +% +% \startJScode{Convert_TeX_String} uses {SanitizeTeXInput} +% event.value = Sanitized_TeX_String(event.value) ; +% \stopJScode + +% was used now but we autocheck anyway so lets test this for a while + +\startJSpreamble FieldsStates used later var visible_field = new Array() ; var visible_fields = 0 ; -function PresetFields ( ) - { this.syncAnnotScan() } +function PresetFields() { + this.syncAnnotScan() ; +} -function Preset_Fields ( ) - { this.syncAnnotScan() } +function Preset_Fields() { + this.syncAnnotScan() ; +} -function Hide_When_Down ( ) - { event.target.hidden = true } +function Hide_When_Down() { + event.target.hidden = true ; +} -function Hide_Field ( Name ) - { var v = this.getField(Name) ; - if (v) - { v.hidden = true ; +function Hide_Field(Name) { + var v = this.getField(Name) ; + if (v) { + v.hidden = true ; v.readonly = true ; - this.dirty = false } } + this.dirty = false ; + } +} -function Do_Vide_Field ( Name, Closable ) - { var v = this.getField(Name) ; - if (v) - { ++visible_fields ; +function Do_Vide_Field(Name, Closable) { + var v = this.getField(Name) ; + if (v) { + ++visible_fields ; visible_field[visible_fields] = Name ; v.hidden = false ; - if (Closable) - { v.readonly = false ; - v.value = "On" } - this.dirty = false } } - -function Vide_Field ( Name ) - { Do_Vide_Field(Name,false) } - -function Vide_Hide_Field ( Name ) - { Do_Vide_Field(Name,true) } - -function Hide_Fields () - { while (visible_fields>0) - { Hide_Field(visible_field[visible_fields]) ; - --visible_fields } } - -function Vide_Fields ( Name ) - { Hide_Fields () ; - Vide_Field ( Name) } - -function Vide_Hide_Fields ( Name ) - { Hide_Fields () ; - Vide_Hide_Field ( Name) } - -function Toggle_Hide ( Name ) - { var v = this.getField(Name) ; - if (v) - { v.hidden = !v.hidden ; - this.dirty = false } } - -function Field_On ( Name ) - { v = this.getField(Name) ; - if (v) { v.value = "On" ; this.dirty = false } } - -function Field_Off ( Name ) - { var v = this.getField(Name) ; - if (v) { v.value = "Off" ; this.dirty = false } } - -function Toggle_Value ( Name ) - { var v = this.getField(Name) ; - if (v) - { if (v.value=="On") - { v.value = "Off" } - else - { v.value = "On" } } - this.dirty = false } - -function Toggle_Read ( Name ) - { var v = this.getField(Name); - if (v) { v.readonly = !v.readonly } } - -function Flip_Fields ( Name ) - { var Names = Name.split(",") ; - for (var i=0;i0) { + Hide_Field(visible_field[visible_fields]) ; + --visible_fields ; + } +} + +function Vide_Fields(Name) { + Hide_Fields() ; + Vide_Field(Name) ; +} + +function Vide_Hide_Fields(Name) { + Hide_Fields() ; + Vide_Hide_Field(Name) ; +} + +function Toggle_Hide(Name) { + var v = this.getField(Name) ; + if (v) { + v.hidden = !v.hidden ; + this.dirty = false ; + } +} + +function Field_On(Name) { + v = this.getField(Name) ; + if (v) { + v.value = "On" ; + this.dirty = false ; + } +} + +function Field_Off(Name) { + var v = this.getField(Name) ; + if (v) { + v.value = "Off" ; + this.dirty = false ; + } +} + +function Toggle_Value(Name) { + var v = this.getField(Name) ; + if (v) { + if (v.value == "On") { + v.value = "Off" ; + } else { + v.value = "On" ; + } + } + this.dirty = false ; +} + +function Toggle_Read(Name) { + var v = this.getField(Name); + if (v) { + v.readonly = !v.readonly ; + } +} + +function Flip_Fields(Name) { + var Names = Name.split(",") ; + for (var i=0; i < Names.length; i++) { + v = this.getField(Names[i]) ; + if (v) { + v.hidden = !v.hidden ; + v.value = "On" ; + } + } +} + +function Forget_Changes() { + this.dirty = false ; +} + +function ForgetChanges() { + this.dirty = false ; +} +\stopJSpreamble \definereference[ForgetChanges][JS(Forget_Changes)] @@ -229,7 +262,7 @@ function ForgetChanges () \startJSpreamble FieldStack used later -function Reset_Fields ( FieldSet ) { +function Reset_Fields(FieldSet) { var i = 1 ; while (true) { v = this.getField(FieldSet+":"+i) ; @@ -242,7 +275,7 @@ function Reset_Fields ( FieldSet ) { } } -function Set_Fields ( FieldSet ) { +function Set_Fields(FieldSet) { var i = 1 ; while (true) { v = this.getField(FieldSet+":"+i) ; @@ -255,7 +288,7 @@ function Set_Fields ( FieldSet ) { } } -function Set_Field ( FieldSet, FieldName ) { +function Set_Field(FieldSet, FieldName) { Reset_Fields(FieldSet) ; v = this.getField(FieldSet+":"+FieldName) ; if (v) { @@ -263,7 +296,7 @@ function Set_Field ( FieldSet, FieldName ) { } } -function Reset_Field ( FieldSet, FieldName ) { +function Reset_Field(FieldSet, FieldName) { Set_Fields(FieldSet) ; v = this.getField(FieldSet+":"+FieldName) ; if (v) { @@ -271,7 +304,7 @@ function Reset_Field ( FieldSet, FieldName ) { } } -function Walk_Field ( FieldSet ) { +function Walk_Field(FieldSet) { var i = 1 ; while (true) { v = this.getField(FieldSet+":"+i) ; @@ -298,7 +331,7 @@ function Walk_Field ( FieldSet ) { var FieldSets = new Array() ; -function Do_Get_Check_Walk_Field ( FieldSet ) { +function Do_Get_Check_Walk_Field(FieldSet) { var f = FieldSets[FieldSet] if (! f) { f = new Array() ; @@ -313,7 +346,7 @@ function Do_Get_Check_Walk_Field ( FieldSet ) { return f } -function Do_Next_Auto_Walk_Field ( FieldSet ) { +function Do_Next_Auto_Walk_Field(FieldSet) { var fieldset = Do_Get_Check_Walk_Field(FieldSet) ; if (fieldset) { var v = this.getField(FieldSet + ":" + fieldset.number) ; @@ -329,12 +362,12 @@ function Do_Next_Auto_Walk_Field ( FieldSet ) { v = this.getField(FieldSet + ":" + fieldset.number) ; } if (v) { - v.value = "On" + v.value = "On" ; } } } -function Do_Stop_Auto_Walk_Field ( FieldSet ) { +function Do_Stop_Auto_Walk_Field(FieldSet) { var fieldset = Do_Get_Check_Walk_Field(FieldSet) ; if (fieldset) { try { @@ -345,7 +378,7 @@ function Do_Stop_Auto_Walk_Field ( FieldSet ) { } } -function Do_Start_Auto_Walk_Field ( FieldSet ) { +function Do_Start_Auto_Walk_Field(FieldSet) { var fieldset = Do_Get_Check_Walk_Field(FieldSet) ; if (fieldset) { Do_Stop_Auto_Walk_Field(FieldSet) ; @@ -353,7 +386,7 @@ function Do_Start_Auto_Walk_Field ( FieldSet ) { } } -function Start_Walk_Field ( FieldSet, Delay ) { +function Start_Walk_Field(FieldSet, Delay) { var fieldset = Do_Get_Check_Walk_Field(FieldSet) ; if (fieldset) { fieldset.number = 0 ; @@ -367,7 +400,7 @@ function Start_Walk_Field ( FieldSet, Delay ) { } } -function Pause_Walk_Field ( FieldSet ) { +function Pause_Walk_Field(FieldSet) { var fieldset = Do_Get_Check_Walk_Field(FieldSet) ; if (fieldset) { if (fieldset.running) { @@ -382,7 +415,7 @@ function Pause_Walk_Field ( FieldSet ) { } } -function Stop_Walk_Field ( FieldSet ) { +function Stop_Walk_Field(FieldSet) { var fieldset = Do_Get_Check_Walk_Field(FieldSet) ; if (fieldset) { Do_Stop_Auto_Walk_Field(FieldSet) ; @@ -391,7 +424,7 @@ function Stop_Walk_Field ( FieldSet ) { } } -function Reset_Walk_Field ( FieldSet ) { +function Reset_Walk_Field(FieldSet) { var fieldset = Do_Get_Check_Walk_Field(FieldSet) ; if (fieldset) { Do_Stop_Auto_Walk_Field(FieldSet) ; @@ -402,7 +435,7 @@ function Reset_Walk_Field ( FieldSet ) { } } -function Previous_Walk_Field ( FieldSet ) { +function Previous_Walk_Field(FieldSet) { var fieldset = Do_Get_Check_Walk_Field(FieldSet) ; if (fieldset) { Do_Stop_Auto_Walk_Field(FieldSet) ; @@ -424,7 +457,7 @@ function Previous_Walk_Field ( FieldSet ) { } } -function Next_Walk_Field ( FieldSet ) { +function Next_Walk_Field(FieldSet) { var fieldset = Do_Get_Check_Walk_Field(FieldSet) ; if (fieldset) { Do_Stop_Auto_Walk_Field(FieldSet) ; @@ -448,7 +481,7 @@ function Next_Walk_Field ( FieldSet ) { } } -function Set_Walk_Field_Delay ( FieldSet, Delay ) { +function Set_Walk_Field_Delay(FieldSet, Delay) { var fieldset = Do_Get_Check_Walk_Field(FieldSet) ; if (fieldset) { if (Delay) { diff --git a/tex/context/base/java-imp-stp.mkiv b/tex/context/base/java-imp-stp.mkiv index df4fbcc2f..ebddd8cc6 100644 --- a/tex/context/base/java-imp-stp.mkiv +++ b/tex/context/base/java-imp-stp.mkiv @@ -17,99 +17,101 @@ % we cannot use doc_visited[this.pageNum] instead of doc_currentstep because % of some funny side effect (i.e. dup or so) +% todo: test with later as we do autoinsert now + \startJSpreamble Steps used now - var doc_ocglist = this.getOCGs() ; - var doc_stepname = "step" ; - var doc_currentstep = 0 ; - var doc_maxstep = 50 ; - var doc_visited = new Array() ; - var doc_busy = new Array() ; - - function SetupStepper ( layername, laststep ) { - doc_stepname = layername ; - doc_maxstep = laststep ; - for (var i=0; i<=this.numPages; i++) { - doc_visited[i] = 0 ; - doc_busy[i] = 0 ; - } - } +var doc_ocglist = this.getOCGs() ; +var doc_stepname = "step" ; +var doc_currentstep = 0 ; +var doc_maxstep = 50 ; +var doc_visited = new Array() ; +var doc_busy = new Array() ; +function SetupStepper(layername,laststep) { + doc_stepname = layername ; + doc_maxstep = laststep ; for (var i=0; i<=this.numPages; i++) { doc_visited[i] = 0 ; doc_busy[i] = 0 ; } +} - function GetOCG ( name ) { - for (var i=0; i < doc_ocglist.length; i++) { - if (doc_ocglist[i].name == name) { - return doc_ocglist[i] ; - } +for (var i=0; i<=this.numPages; i++) { + doc_visited[i] = 0 ; + doc_busy[i] = 0 ; +} + +function GetOCG(name) { + for (var i=0; i < doc_ocglist.length; i++) { + if (doc_ocglist[i].name == name) { + return doc_ocglist[i] ; } - return null ; } + return null ; +} - function CheckBusy ( ) { - var ocg = GetOCG("step:busy") ; - if (ocg != null) { - if (doc_visited[this.pageNum]==0) { +function CheckBusy() { + var ocg = GetOCG("step:busy") ; + if (ocg != null) { + if (doc_visited[this.pageNum]==0) { + ocg.state = true ; + } else { + if (doc_visited[this.pageNum] 0 then + checkpdfdocencoding() usedfonts.tttf = fontnames.tt.tf local acroform = pdfdictionary { NeedAppearances = true, Fields = pdfreference(pdfflushobject(collected)), - DR = pdfdictionary { Font = registerfonts() }, + DR = pdfdictionary { + Font = registerfonts(), + Encoding = pdfdocencodingcapsule, + }, CO = fieldsetlist(calculationset), DA = "/tttf 12 Tf 0 g", } diff --git a/tex/context/base/lpdf-ini.lua b/tex/context/base/lpdf-ini.lua index 839b68895..2defa3f2e 100644 --- a/tex/context/base/lpdf-ini.lua +++ b/tex/context/base/lpdf-ini.lua @@ -43,7 +43,7 @@ local lpdf = lpdf local function tosixteen(str) if not str or str == "" then - return "()" + return "" -- not () as we want an indication that it's unicode else local r, n = { " + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tex/context/interface/cont-de.xml b/tex/context/interface/cont-de.xml index d6d65eddc..17b2480c4 100644 --- a/tex/context/interface/cont-de.xml +++ b/tex/context/interface/cont-de.xml @@ -10267,6 +10267,8 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tex/context/interface/cont-en.xml b/tex/context/interface/cont-en.xml index 0f928f671..b532f2b21 100644 --- a/tex/context/interface/cont-en.xml +++ b/tex/context/interface/cont-en.xml @@ -10267,6 +10267,8 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tex/context/interface/cont-fr.xml b/tex/context/interface/cont-fr.xml index 354465e08..da74f6013 100644 --- a/tex/context/interface/cont-fr.xml +++ b/tex/context/interface/cont-fr.xml @@ -10267,6 +10267,8 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tex/context/interface/cont-it.xml b/tex/context/interface/cont-it.xml index c215ed4cd..292915a06 100644 --- a/tex/context/interface/cont-it.xml +++ b/tex/context/interface/cont-it.xml @@ -10267,6 +10267,8 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tex/context/interface/cont-nl.xml b/tex/context/interface/cont-nl.xml index aa99a0a2f..ad038db16 100644 --- a/tex/context/interface/cont-nl.xml +++ b/tex/context/interface/cont-nl.xml @@ -10267,6 +10267,8 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tex/context/interface/cont-pe.xml b/tex/context/interface/cont-pe.xml index 08e0284da..929f3c4b5 100644 --- a/tex/context/interface/cont-pe.xml +++ b/tex/context/interface/cont-pe.xml @@ -10267,6 +10267,8 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tex/context/interface/cont-ro.xml b/tex/context/interface/cont-ro.xml index 27863b40a..14abb248b 100644 --- a/tex/context/interface/cont-ro.xml +++ b/tex/context/interface/cont-ro.xml @@ -10267,6 +10267,8 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tex/generic/context/luatex-fonts-merged.lua b/tex/generic/context/luatex-fonts-merged.lua index 471ba0986..cae16b0c3 100644 --- a/tex/generic/context/luatex-fonts-merged.lua +++ b/tex/generic/context/luatex-fonts-merged.lua @@ -1,6 +1,6 @@ -- merged file : luatex-fonts-merged.lua -- parent file : luatex-fonts.lua --- merge date : 02/01/11 22:02:04 +-- merge date : 02/04/11 00:30:28 do -- begin closure to overcome local limits and interference -- cgit v1.2.3