summaryrefslogtreecommitdiff
path: root/tex
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2007-12-06 16:24:00 +0100
committerHans Hagen <pragma@wxs.nl>2007-12-06 16:24:00 +0100
commit139e350aef0016037e1db086dbdb093627dd5a30 (patch)
treebbc1859099729dc992f331fe99650fb9995c6a5a /tex
parent6312e2b2913bc7de6f3c0ba30b993e2b4714edf1 (diff)
downloadcontext-139e350aef0016037e1db086dbdb093627dd5a30.tar.gz
stable 2007.12.06 16:24
Diffstat (limited to 'tex')
-rw-r--r--tex/context/base/cont-new.tex2
-rw-r--r--tex/context/base/context.tex2
-rw-r--r--tex/context/base/core-syn.lua2
-rw-r--r--tex/context/base/font-def.lua17
-rw-r--r--tex/context/base/font-ini.tex6
-rw-r--r--tex/context/base/font-otf.lua140
-rw-r--r--tex/context/base/l-os.lua2
-rw-r--r--tex/context/base/luat-inp.lua2
-rw-r--r--tex/context/base/luat-tmp.lua4
-rw-r--r--tex/context/base/regi-ini.mkii2
-rw-r--r--tex/context/base/x-mmp.mkiv3
-rw-r--r--tex/context/interface/keys-cz.xml2
-rw-r--r--tex/context/interface/keys-de.xml2
-rw-r--r--tex/context/interface/keys-en.xml2
-rw-r--r--tex/context/interface/keys-fr.xml2
-rw-r--r--tex/context/interface/keys-it.xml2
-rw-r--r--tex/context/interface/keys-nl.xml2
-rw-r--r--tex/context/interface/keys-ro.xml2
18 files changed, 144 insertions, 52 deletions
diff --git a/tex/context/base/cont-new.tex b/tex/context/base/cont-new.tex
index 9e3a4eb37..0569696cb 100644
--- a/tex/context/base/cont-new.tex
+++ b/tex/context/base/cont-new.tex
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2007.12.05 13:56}
+\newcontextversion{2007.12.06 16:24}
%D This file is loaded at runtime, thereby providing an
%D excellent place for hacks, patches, extensions and new
diff --git a/tex/context/base/context.tex b/tex/context/base/context.tex
index c43b89b72..3a9c3e2c8 100644
--- a/tex/context/base/context.tex
+++ b/tex/context/base/context.tex
@@ -42,7 +42,7 @@
%D your styles an modules.
\edef\contextformat {\jobname}
-\edef\contextversion{2007.12.05 13:56}
+\edef\contextversion{2007.12.06 16:24}
%D For those who want to use this:
diff --git a/tex/context/base/core-syn.lua b/tex/context/base/core-syn.lua
index 7f6ea7614..1b4eb1e92 100644
--- a/tex/context/base/core-syn.lua
+++ b/tex/context/base/core-syn.lua
@@ -105,7 +105,7 @@ function job.loadsortedlist(class)
else
entries[#entries+1] = {
v[1], -- kind (e)
- { { v[3], v[2] } }, -- entry, key
+ { { v[2], v[3] } }, -- entry, key
v[4] -- optional meaning
}
end
diff --git a/tex/context/base/font-def.lua b/tex/context/base/font-def.lua
index 84fb9d569..4fd54b5fc 100644
--- a/tex/context/base/font-def.lua
+++ b/tex/context/base/font-def.lua
@@ -425,14 +425,15 @@ function fonts.define.specify.preset_context(name,features)
local fds = fonts.define.specify
local setups, numbers, synonyms = fds.context_setups, fds.context_numbers, fds.synonyms
local number = (setups[name] and setups[name].number) or 0
- local t = aux.settings_to_hash(features)
- for k,v in pairs(t) do
- k = synonyms[k] or k
- t[k] = v:is_boolean()
- if type(t[k]) == "nil" then
- t[k] = v
- end
- end
+--~ local t = aux.settings_to_hash(features)
+--~ for k,v in pairs(t) do
+--~ k = synonyms[k] or k
+--~ t[k] = v:is_boolean()
+--~ if type(t[k]) == "nil" then
+--~ t[k] = v
+--~ end
+--~ end
+local t = fonts.otf.meanings.resolve(aux.settings_to_hash(features)) -- todo: synonyms
if number == 0 then
numbers[#numbers+1] = name
t.number = #numbers
diff --git a/tex/context/base/font-ini.tex b/tex/context/base/font-ini.tex
index b15e3812d..8e08ef2d7 100644
--- a/tex/context/base/font-ini.tex
+++ b/tex/context/base/font-ini.tex
@@ -3536,15 +3536,15 @@
\definefontfeature
[default]
- [script=latn,language=dflt,liga=yes,kern=yes,tlig=yes,trep=yes] % texligatures=yes,texquotes=yes
+ [liga=yes,kern=yes,tlig=yes,trep=yes] % texligatures=yes,texquotes=yes
\definefontfeature
[smallcaps]
- [script=latn,language=dflt,liga=yes,kern=yes,tlig=yes,trep=yes,smcp=yes] % texligatures=yes,texquotes=yes
+ [liga=yes,kern=yes,tlig=yes,trep=yes,smcp=yes] % texligatures=yes,texquotes=yes
\definefontfeature
[oldstyle]
- [script=latn,language=dflt,liga=yes,kern=yes,tlig=yes,trep=yes,onum=yes] % texligatures=yes,texquotes=yes
+ [liga=yes,kern=yes,tlig=yes,trep=yes,onum=yes] % texligatures=yes,texquotes=yes
%D The next auxilliary macro is an alternative to \type
%D {\fontname}.
diff --git a/tex/context/base/font-otf.lua b/tex/context/base/font-otf.lua
index 68142e4c4..b4558183e 100644
--- a/tex/context/base/font-otf.lua
+++ b/tex/context/base/font-otf.lua
@@ -612,26 +612,26 @@ fonts.otf.tables.features = {
['size'] = 'Optical Size',
['smcp'] = 'Small Capitals',
['smpl'] = 'Simplified Forms',
- ['ss01'] = 'Sylistic Set 1',
- ['ss02'] = 'Sylistic Set 2',
- ['ss03'] = 'Sylistic Set 3',
- ['ss04'] = 'Sylistic Set 4',
- ['ss05'] = 'Sylistic Set 5',
- ['ss06'] = 'Sylistic Set 6',
- ['ss07'] = 'Sylistic Set 7',
- ['ss08'] = 'Sylistic Set 8',
- ['ss09'] = 'Sylistic Set 9',
- ['ss10'] = 'Sylistic Set 10',
- ['ss11'] = 'Sylistic Set 11',
- ['ss12'] = 'Sylistic Set 12',
- ['ss13'] = 'Sylistic Set 13',
- ['ss14'] = 'Sylistic Set 14',
- ['ss15'] = 'Sylistic Set 15',
- ['ss16'] = 'Sylistic Set 16',
- ['ss17'] = 'Sylistic Set 17',
- ['ss18'] = 'Sylistic Set 18',
- ['ss19'] = 'Sylistic Set 19',
- ['ss20'] = 'Sylistic Set 20',
+ ['ss01'] = 'Stylistic Set 1',
+ ['ss02'] = 'Stylistic Set 2',
+ ['ss03'] = 'Stylistic Set 3',
+ ['ss04'] = 'Stylistic Set 4',
+ ['ss05'] = 'Stylistic Set 5',
+ ['ss06'] = 'Stylistic Set 6',
+ ['ss07'] = 'Stylistic Set 7',
+ ['ss08'] = 'Stylistic Set 8',
+ ['ss09'] = 'Stylistic Set 9',
+ ['ss10'] = 'Stylistic Set 10',
+ ['ss11'] = 'Stylistic Set 11',
+ ['ss12'] = 'Stylistic Set 12',
+ ['ss13'] = 'Stylistic Set 13',
+ ['ss14'] = 'Stylistic Set 14',
+ ['ss15'] = 'Stylistic Set 15',
+ ['ss16'] = 'Stylistic Set 16',
+ ['ss17'] = 'Stylistic Set 17',
+ ['ss18'] = 'Stylistic Set 18',
+ ['ss19'] = 'Stylistic Set 19',
+ ['ss20'] = 'Stylistic Set 20',
['subs'] = 'Subscript',
['sups'] = 'Superscript',
['swsh'] = 'Swash',
@@ -690,6 +690,76 @@ function fonts.otf.meanings.baseline(id)
return fonts.otf.meanings.resolve(fonts.otf.tables.baselines,id)
end
+function table.reverse_hash(h)
+ local r = { }
+ for k,v in pairs(h) do
+ r[v] = (k:gsub(" ","")):lower()
+ end
+ return r
+end
+
+fonts.otf.tables.to_scripts = table.reverse_hash(fonts.otf.tables.scripts )
+fonts.otf.tables.to_languages = table.reverse_hash(fonts.otf.tables.languages)
+fonts.otf.tables.to_features = table.reverse_hash(fonts.otf.tables.features )
+
+do
+
+ local scripts = fonts.otf.tables.scripts
+ local languages = fonts.otf.tables.languages
+ local features = fonts.otf.tables.features
+
+ local to_scripts = fonts.otf.tables.to_scripts
+ local to_languages = fonts.otf.tables.to_languages
+ local to_features = fonts.otf.tables.to_features
+
+ function fonts.otf.meanings.resolve(features)
+ local h = { }
+ for k,v in pairs(features) do
+ k = (k:gsub(" ","")):lower()
+ if k == "language" or k =="lang" then
+ v = (k:gsub(" ","")):lower()
+ k = language
+ if not languages[v] then
+ if to_languages[v] then
+ h.language = to_languages[v]
+ else
+ h.language = "dflt"
+ end
+ else
+ h.language = v
+ end
+ elseif k == "script" then
+ v = (k:gsub(" ","")):lower()
+ if not scripts[v] then
+ if to_scripts[v] then
+ h.script = to_scripts[v]
+ else
+ h.script = "dflt"
+ end
+ else
+ h.script = v
+ end
+ else
+ if type(v) == "string" then
+ local b = v:is_boolean()
+ if type(b) == "nil" then
+ v = (k:gsub(" ","")):lower()
+ else
+ v = b
+ end
+ end
+ if to_features[k] then
+ h[to_features[k]] = v
+ else
+ h[k] = v
+ end
+ end
+ end
+ return h
+ end
+
+end
+
--[[ldx--
<p>Here we go.</p>
--ldx]]--
@@ -1391,26 +1461,42 @@ function fonts.otf.features.prepare_base_kerns(tfmdata,kind,value) -- todo what
for _, chr in pairs(tfmdata.characters) do
local d = charlist[chr.index]
if d then
- local dk = d.kerns
+ local dk = d.mykerns
if dk then
local t, done = chr.kerns or { }, false
- for _, v in pairs(dk) do
- if somevalid[v.lookup] then
- local k = unicodes[v.char]
- if k > 0 then
- t[k], done = v.off, true
+ for lookup,kerns in pairs(dk) do
+ if somevalid[lookup] then
+ for k, v in pairs(kerns) do
+ if v > 0 then
+ t[k], done = v, true
+ end
end
end
end
if done then
chr.kerns = t -- no empty assignments
end
+ else
+ dk = d.kerns
+ if dk then
+ local t, done = chr.kerns or { }, false
+ for _, v in pairs(dk) do
+ if somevalid[v.lookup] then
+ local k = unicodes[v.char]
+ if k > 0 then
+ t[k], done = v.off, true
+ end
+ end
+ end
+ if done then
+ chr.kerns = t -- no empty assignments
+ end
+ end
end
end
end
end
end
-
function fonts.otf.copy_to_tfm(data)
if data then
local tfm = { characters = { }, parameters = { } }
diff --git a/tex/context/base/l-os.lua b/tex/context/base/l-os.lua
index 1173a928e..522337a0f 100644
--- a/tex/context/base/l-os.lua
+++ b/tex/context/base/l-os.lua
@@ -43,6 +43,8 @@ end
if os.gettimeofday then
os.clock = os.gettimeofday
+else
+ os.gettimeofday = os.clock
end
do
diff --git a/tex/context/base/luat-inp.lua b/tex/context/base/luat-inp.lua
index ba5d97c29..ec8d04976 100644
--- a/tex/context/base/luat-inp.lua
+++ b/tex/context/base/luat-inp.lua
@@ -195,7 +195,7 @@ end
function input.bare_variable(str)
-- return string.gsub(string.gsub(string.gsub(str,"%s+$",""),'^"(.+)"$',"%1"),"^'(.+)'$","%1")
- return str:gsub("\s*([\"\']?)(.+)%1\s*", "%2")
+ return (str:gsub("\s*([\"\']?)(.+)%1\s*", "%2"))
end
if texio then
diff --git a/tex/context/base/luat-tmp.lua b/tex/context/base/luat-tmp.lua
index bd29f87f4..611e1f37a 100644
--- a/tex/context/base/luat-tmp.lua
+++ b/tex/context/base/luat-tmp.lua
@@ -40,7 +40,7 @@ input.usecache = not toboolean(os.getenv("TEXMFSHARECACHE") or "false",true) --
if caches.temp and caches.temp ~= "" and lfs.attributes(caches.temp,"mode") ~= "directory" then
if caches.force or io.ask(string.format("Should I create the cache path %s?",caches.temp), "no", { "yes", "no" }) == "yes" then
- lfs.mkdirs(caches.temp)
+ dir.mkdirs(caches.temp)
end
end
if not caches.temp or caches.temp == "" then
@@ -246,7 +246,7 @@ function input.aux.save_data(instance, dataname, check)
input.report("preparing " .. dataname .. " in", luaname)
for k, v in pairs(files) do
if not check or check(v,k) then -- path, name
- if #v == 1 then
+ if type(v) == "table" and #v == 1 then
files[k] = v[1]
end
else
diff --git a/tex/context/base/regi-ini.mkii b/tex/context/base/regi-ini.mkii
index a5b2cf177..538db3bcf 100644
--- a/tex/context/base/regi-ini.mkii
+++ b/tex/context/base/regi-ini.mkii
@@ -50,7 +50,7 @@
\def\mkenableregime#1%
{\doifelse{#1}{utf}%
- {\writestatus\m!regime{mapping utf to utf-8}%
+ {\writestatus\m!regimes{mapping utf to utf-8}%
\XeTeXinputencoding{utf-8}}
{\XeTeXinputencoding{#1}}}
diff --git a/tex/context/base/x-mmp.mkiv b/tex/context/base/x-mmp.mkiv
index 3b5d483b9..0f5137661 100644
--- a/tex/context/base/x-mmp.mkiv
+++ b/tex/context/base/x-mmp.mkiv
@@ -177,6 +177,9 @@
\defineXMLentity[textcomma] {{,}}
\defineXMLentity[textperiod] {{.}}
+\defineXMLentity[_] {{\_}}
+\defineXMLentity[^] {{\^}}
+
\startxmlsetups mml:mi % todo: mathvariant mathsize mathcolor mathbackground
\edef\MMPidentifier{\xmlstripped{#1}{*}}
\doifXMLentityelse{\detokenize\expandafter{\MMPidentifier}} {
diff --git a/tex/context/interface/keys-cz.xml b/tex/context/interface/keys-cz.xml
index 077d6f2b4..af511e420 100644
--- a/tex/context/interface/keys-cz.xml
+++ b/tex/context/interface/keys-cz.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
-<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="cz" version="2007.12.05 13:56">
+<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="cz" version="2007.12.06 16:24">
<cd:variables>
<cd:variable name="lesshyphenation" value="lesshyphenation"/>
diff --git a/tex/context/interface/keys-de.xml b/tex/context/interface/keys-de.xml
index 6a02edfe4..b369fddba 100644
--- a/tex/context/interface/keys-de.xml
+++ b/tex/context/interface/keys-de.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
-<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="de" version="2007.12.05 13:56">
+<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="de" version="2007.12.06 16:24">
<cd:variables>
<cd:variable name="lesshyphenation" value="lesshyphenation"/>
diff --git a/tex/context/interface/keys-en.xml b/tex/context/interface/keys-en.xml
index 2bc21ab38..3dfac6279 100644
--- a/tex/context/interface/keys-en.xml
+++ b/tex/context/interface/keys-en.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
-<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="en" version="2007.12.05 13:56">
+<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="en" version="2007.12.06 16:24">
<cd:variables>
<cd:variable name="lesshyphenation" value="lesshyphenation"/>
diff --git a/tex/context/interface/keys-fr.xml b/tex/context/interface/keys-fr.xml
index dee31e9e3..c5fceb1c1 100644
--- a/tex/context/interface/keys-fr.xml
+++ b/tex/context/interface/keys-fr.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
-<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="fr" version="2007.12.05 13:56">
+<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="fr" version="2007.12.06 16:24">
<cd:variables>
<cd:variable name="lesshyphenation" value="lesshyphenation"/>
diff --git a/tex/context/interface/keys-it.xml b/tex/context/interface/keys-it.xml
index bf14c9594..34d228a14 100644
--- a/tex/context/interface/keys-it.xml
+++ b/tex/context/interface/keys-it.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
-<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="it" version="2007.12.05 13:56">
+<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="it" version="2007.12.06 16:24">
<cd:variables>
<cd:variable name="lesshyphenation" value="lesshyphenation"/>
diff --git a/tex/context/interface/keys-nl.xml b/tex/context/interface/keys-nl.xml
index 859ee5984..c4f769ac5 100644
--- a/tex/context/interface/keys-nl.xml
+++ b/tex/context/interface/keys-nl.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
-<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="nl" version="2007.12.05 13:56">
+<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="nl" version="2007.12.06 16:24">
<cd:variables>
<cd:variable name="lesshyphenation" value="lesshyphenation"/>
diff --git a/tex/context/interface/keys-ro.xml b/tex/context/interface/keys-ro.xml
index 6c8083631..51bbaf816 100644
--- a/tex/context/interface/keys-ro.xml
+++ b/tex/context/interface/keys-ro.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
-<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="ro" version="2007.12.05 13:56">
+<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="ro" version="2007.12.06 16:24">
<cd:variables>
<cd:variable name="lesshyphenation" value="lesshyphenation"/>