summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv
diff options
context:
space:
mode:
authorContext Git Mirror Bot <phg42.2a@gmail.com>2016-09-06 01:12:18 +0200
committerContext Git Mirror Bot <phg42.2a@gmail.com>2016-09-06 01:12:18 +0200
commit9db0d829e3ee2c3ab607c3c624adf189b2da15f4 (patch)
tree0d65a3fea48b3ded2a98fb637cd70b0a4b488a28 /tex/context/base/mkiv
parent3f59c56887a9a6c4bda68ab8d99e67d2afc902f9 (diff)
downloadcontext-9db0d829e3ee2c3ab607c3c624adf189b2da15f4.tar.gz
2016-09-06 00:33:00
Diffstat (limited to 'tex/context/base/mkiv')
-rw-r--r--tex/context/base/mkiv/cont-new.mkiv2
-rw-r--r--tex/context/base/mkiv/context.css3
-rw-r--r--tex/context/base/mkiv/context.mkiv2
-rw-r--r--tex/context/base/mkiv/font-ext.lua14
-rw-r--r--tex/context/base/mkiv/font-map.lua101
-rw-r--r--tex/context/base/mkiv/font-mis.lua2
-rw-r--r--tex/context/base/mkiv/font-otl.lua2
-rw-r--r--tex/context/base/mkiv/l-dir.lua30
-rw-r--r--tex/context/base/mkiv/node-met.lua2
-rw-r--r--tex/context/base/mkiv/node-nut.lua2
-rw-r--r--tex/context/base/mkiv/status-files.pdfbin9292 -> 9181 bytes
-rw-r--r--tex/context/base/mkiv/status-lua.pdfbin368304 -> 368800 bytes
12 files changed, 117 insertions, 43 deletions
diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv
index 0b90445f6..36549b442 100644
--- a/tex/context/base/mkiv/cont-new.mkiv
+++ b/tex/context/base/mkiv/cont-new.mkiv
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2016.09.05 10:28}
+\newcontextversion{2016.09.06 00:28}
%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/mkiv/context.css b/tex/context/base/mkiv/context.css
index be1dad796..b0aa38573 100644
--- a/tex/context/base/mkiv/context.css
+++ b/tex/context/base/mkiv/context.css
@@ -18,6 +18,9 @@ a.dir-view:link, a.dir-view:active, a.dir-view:visited {
.invalid {
color: #FF0000 ;
}
+.invisible {
+ visibility: hidden ;
+}
button, .commonlink, .smallbutton {
font-weight: bold ;
font-size: 12px ;
diff --git a/tex/context/base/mkiv/context.mkiv b/tex/context/base/mkiv/context.mkiv
index cc9538cca..20c1ef0f0 100644
--- a/tex/context/base/mkiv/context.mkiv
+++ b/tex/context/base/mkiv/context.mkiv
@@ -39,7 +39,7 @@
%D up and the dependencies are more consistent.
\edef\contextformat {\jobname}
-\edef\contextversion{2016.09.05 10:28}
+\edef\contextversion{2016.09.06 00:28}
\edef\contextkind {beta}
%D For those who want to use this:
diff --git a/tex/context/base/mkiv/font-ext.lua b/tex/context/base/mkiv/font-ext.lua
index 16e201bd3..4af279590 100644
--- a/tex/context/base/mkiv/font-ext.lua
+++ b/tex/context/base/mkiv/font-ext.lua
@@ -1155,3 +1155,17 @@ implement {
end
end
}
+
+-- requested for latex but not supported unless really needed in context:
+--
+-- registerotffeature {
+-- name = "ignoremathconstants",
+-- description = "ignore math constants table",
+-- initializers = {
+-- base = function(tfmdata,key,value)
+-- if value then
+-- tfmdata.mathparameters = nil
+-- end
+-- end
+-- }
+-- }
diff --git a/tex/context/base/mkiv/font-map.lua b/tex/context/base/mkiv/font-map.lua
index 7ebb7349a..e2254f8ca 100644
--- a/tex/context/base/mkiv/font-map.lua
+++ b/tex/context/base/mkiv/font-map.lua
@@ -12,7 +12,7 @@ local match, format, find, concat, gsub, lower = string.match, string.format, st
local P, R, S, C, Ct, Cc, lpegmatch = lpeg.P, lpeg.R, lpeg.S, lpeg.C, lpeg.Ct, lpeg.Cc, lpeg.match
local floor = math.floor
local formatters = string.formatters
-local sortedhash = table.sortedhash
+local sortedhash, sortedkeys = table.sortedhash, table.sortedkeys
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_mapping = v end)
@@ -237,30 +237,37 @@ local namesplitter = Ct(C((1 - ligseparator - varseparator)^1) * (ligseparator *
-- to be completed .. for fonts that use unicodes for ligatures which
-- is a actually a bad thing and should be avoided in the first place
-local overloads = allocate {
- IJ = { name = "I_J", unicode = { 0x49, 0x4A }, mess = 0x0132 },
- ij = { name = "i_j", unicode = { 0x69, 0x6A }, mess = 0x0133 },
- ff = { name = "f_f", unicode = { 0x66, 0x66 }, mess = 0xFB00 },
- fi = { name = "f_i", unicode = { 0x66, 0x69 }, mess = 0xFB01 },
- fl = { name = "f_l", unicode = { 0x66, 0x6C }, mess = 0xFB02 },
- ffi = { name = "f_f_i", unicode = { 0x66, 0x66, 0x69 }, mess = 0xFB03 },
- ffl = { name = "f_f_l", unicode = { 0x66, 0x66, 0x6C }, mess = 0xFB04 },
- fj = { name = "f_j", unicode = { 0x66, 0x6A } },
- fk = { name = "f_k", unicode = { 0x66, 0x6B } },
-}
-
-for k, v in next, overloads do
- local name = v.name
- local mess = v.mess
- if name then
- overloads[name] = v
- end
- if mess then
- overloads[mess] = v
+do
+
+ local overloads = allocate {
+ IJ = { name = "I_J", unicode = { 0x49, 0x4A }, mess = 0x0132 },
+ ij = { name = "i_j", unicode = { 0x69, 0x6A }, mess = 0x0133 },
+ ff = { name = "f_f", unicode = { 0x66, 0x66 }, mess = 0xFB00 },
+ fi = { name = "f_i", unicode = { 0x66, 0x69 }, mess = 0xFB01 },
+ fl = { name = "f_l", unicode = { 0x66, 0x6C }, mess = 0xFB02 },
+ ffi = { name = "f_f_i", unicode = { 0x66, 0x66, 0x69 }, mess = 0xFB03 },
+ ffl = { name = "f_f_l", unicode = { 0x66, 0x66, 0x6C }, mess = 0xFB04 },
+ fj = { name = "f_j", unicode = { 0x66, 0x6A } },
+ fk = { name = "f_k", unicode = { 0x66, 0x6B } },
+ }
+
+ local o = { }
+
+ for k, v in next, overloads do
+ local name = v.name
+ local mess = v.mess
+ if name then
+ o[name] = v
+ end
+ if mess then
+ o[mess] = v
+ end
+ o[k] = v
end
-end
-mappings.overloads = overloads
+ mappings.overloads = o
+
+end
function mappings.addtounicode(data,filename,checklookups)
local resources = data.resources
@@ -273,6 +280,7 @@ function mappings.addtounicode(data,filename,checklookups)
end
local properties = data.properties
local descriptions = data.descriptions
+ local overloads = mappings.overloads
-- we need to move this code
unicodes['space'] = unicodes['space'] or 32
unicodes['hyphen'] = unicodes['hyphen'] or 45
@@ -291,17 +299,25 @@ function mappings.addtounicode(data,filename,checklookups)
local usedmap = cidinfo and fonts.cid.getmap(cidinfo)
local uparser = makenameparser() -- hm, every time?
if usedmap then
- oparser = usedmap and makenameparser(cidinfo.ordering)
- cidnames = usedmap.names
- cidcodes = usedmap.unicodes
+ oparser = usedmap and makenameparser(cidinfo.ordering)
+ cidnames = usedmap.names
+ cidcodes = usedmap.unicodes
end
- local ns = 0
- local nl = 0
+ local ns = 0
+ local nl = 0
+ --
+ -- in order to avoid differences between runs due to hash randomization we
+ -- run over a sorted list
--
- for du, glyph in next, descriptions do
- local name = glyph.name
+ local dlist = sortedkeys(descriptions)
+ --
+ -- for du, glyph in next, descriptions do
+ for i=1,#dlist do
+ local du = dlist[i]
+ local glyph = descriptions[du]
+ local name = glyph.name
if name then
- local overload = overloads[name]
+ local overload = overloads[name] or overloads[du]
if overload then
-- get rid of weird ligatures
-- glyph.name = overload.name
@@ -437,6 +453,11 @@ function mappings.addtounicode(data,filename,checklookups)
end
end
end
+ else
+ local overload = overloads[du]
+ if overload then
+ glyph.unicode = overload.unicode
+ end
end
end
if type(checklookups) == "function" then
@@ -447,7 +468,10 @@ function mappings.addtounicode(data,filename,checklookups)
local collected = false
local unicoded = 0
- for unicode, glyph in next, descriptions do
+ -- for du, glyph in next, descriptions do
+ for i=1,#dlist do
+ local du = dlist[i]
+ local glyph = descriptions[du]
if glyph.class == "ligature" and (force_ligatures or not glyph.unicode) then
if not collected then
collected = fonts.handlers.otf.readers.getcomponents(data)
@@ -455,7 +479,7 @@ function mappings.addtounicode(data,filename,checklookups)
break
end
end
- local u = collected[unicode] -- always tables
+ local u = collected[du] -- always tables
if u then
local n = #u
for i=1,n do
@@ -479,7 +503,10 @@ function mappings.addtounicode(data,filename,checklookups)
report_fonts("%n ligature tounicode mappings deduced from gsub ligature features",unicoded)
end
if trace_mapping then
- for unic, glyph in sortedhash(descriptions) do
+ -- for unic, glyph in sortedhash(descriptions) do
+ for i=1,#dlist do
+ local du = dlist[i]
+ local glyph = descriptions[du]
local name = glyph.name or "-"
local index = glyph.index or 0
local unicode = glyph.unicode
@@ -489,12 +516,12 @@ function mappings.addtounicode(data,filename,checklookups)
for i=1,#unicode do
unicodes[i] = formatters("%U",unicode[i])
end
- report_fonts("internal slot %U, name %a, unicode %U, tounicode % t",index,name,unic,unicodes)
+ report_fonts("internal slot %U, name %a, unicode %U, tounicode % t",index,name,du,unicodes)
else
- report_fonts("internal slot %U, name %a, unicode %U, tounicode %U",index,name,unic,unicode)
+ report_fonts("internal slot %U, name %a, unicode %U, tounicode %U",index,name,du,unicode)
end
else
- report_fonts("internal slot %U, name %a, unicode %U",index,name,unic)
+ report_fonts("internal slot %U, name %a, unicode %U",index,name,du)
end
end
end
diff --git a/tex/context/base/mkiv/font-mis.lua b/tex/context/base/mkiv/font-mis.lua
index f610ee983..5a3bf4999 100644
--- a/tex/context/base/mkiv/font-mis.lua
+++ b/tex/context/base/mkiv/font-mis.lua
@@ -21,7 +21,7 @@ local readers = otf.readers
if readers then
- otf.version = otf.version or 3.026
+ otf.version = otf.version or 3.027
otf.cache = otf.cache or containers.define("fonts", "otl", otf.version, true)
function fonts.helpers.getfeatures(name,save)
diff --git a/tex/context/base/mkiv/font-otl.lua b/tex/context/base/mkiv/font-otl.lua
index 0662290bd..cf6603fc7 100644
--- a/tex/context/base/mkiv/font-otl.lua
+++ b/tex/context/base/mkiv/font-otl.lua
@@ -52,7 +52,7 @@ local report_otf = logs.reporter("fonts","otf loading")
local fonts = fonts
local otf = fonts.handlers.otf
-otf.version = 3.026 -- beware: also sync font-mis.lua and in mtx-fonts
+otf.version = 3.027 -- beware: also sync font-mis.lua and in mtx-fonts
otf.cache = containers.define("fonts", "otl", otf.version, true)
otf.svgcache = containers.define("fonts", "svg", otf.version, true)
otf.pdfcache = containers.define("fonts", "pdf", otf.version, true)
diff --git a/tex/context/base/mkiv/l-dir.lua b/tex/context/base/mkiv/l-dir.lua
index 81ac65e50..db4125cd2 100644
--- a/tex/context/base/mkiv/l-dir.lua
+++ b/tex/context/base/mkiv/l-dir.lua
@@ -335,6 +335,36 @@ end
dir.globfiles = globfiles
+local function globdirs(path,recurse,func,files) -- func == pattern or function
+ if type(func) == "string" then
+ local s = func
+ func = function(name) return find(name,s) end
+ end
+ files = files or { }
+ local noffiles = #files
+ for name in walkdir(path) do
+ if find(name,"^%.") then
+ --- skip
+ else
+ local mode = attributes(name,'mode')
+ if mode == "directory" then
+ if not func or func(name) then
+ noffiles = noffiles + 1
+ files[noffiles] = path .. "/" .. name
+ if recurse then
+ globdirs(path .. "/" .. name,recurse,func,files)
+ end
+ end
+ end
+ end
+ end
+ return files
+end
+
+dir.globdirs = globdirs
+
+-- inspect(globdirs("e:/tmp"))
+
-- t = dir.glob("c:/data/develop/context/sources/**/????-*.tex")
-- t = dir.glob("c:/data/develop/tex/texmf/**/*.tex")
-- t = dir.glob("c:/data/develop/context/texmf/**/*.tex")
diff --git a/tex/context/base/mkiv/node-met.lua b/tex/context/base/mkiv/node-met.lua
index ece7b5149..ded2280c4 100644
--- a/tex/context/base/mkiv/node-met.lua
+++ b/tex/context/base/mkiv/node-met.lua
@@ -133,7 +133,7 @@ if not node.rangedimensions then -- LUATEXVERSION < 0.99
local dimensions = node.dimensions
local getfield = node.getfield
- local findtail = node.tail
+ local find_tail = node.tail
function node.rangedimensions(parent,first,last)
return dimensions(
diff --git a/tex/context/base/mkiv/node-nut.lua b/tex/context/base/mkiv/node-nut.lua
index 3b73ce134..7562e5292 100644
--- a/tex/context/base/mkiv/node-nut.lua
+++ b/tex/context/base/mkiv/node-nut.lua
@@ -230,7 +230,7 @@ if not direct.rangedimensions then -- LUATEXVERSION < 0.99
local dimensions = direct.dimensions
local getfield = direct.getfield
- local findtail = direct.tail
+ local find_tail = direct.tail
function direct.rangedimensions(parent,first,last)
return dimensions(
diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf
index 00e9651dd..ed02cb42b 100644
--- a/tex/context/base/mkiv/status-files.pdf
+++ b/tex/context/base/mkiv/status-files.pdf
Binary files differ
diff --git a/tex/context/base/mkiv/status-lua.pdf b/tex/context/base/mkiv/status-lua.pdf
index c822d48db..9a312c723 100644
--- a/tex/context/base/mkiv/status-lua.pdf
+++ b/tex/context/base/mkiv/status-lua.pdf
Binary files differ