summaryrefslogtreecommitdiff
path: root/tex/context/base/math-vfu.lua
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2011-11-14 01:00:14 +0200
committerMarius <mariausol@gmail.com>2011-11-14 01:00:14 +0200
commit9671aae0a69df33d2a832de35eab0f143fc3b55b (patch)
treef720944d3b4792eb6f8b068110a72667de406ea6 /tex/context/base/math-vfu.lua
parentdab6ca5e4c89c50592aa95482057ee90501ae7f6 (diff)
downloadcontext-9671aae0a69df33d2a832de35eab0f143fc3b55b.tar.gz
beta 2011.11.13 23:53
Diffstat (limited to 'tex/context/base/math-vfu.lua')
-rw-r--r--tex/context/base/math-vfu.lua18
1 files changed, 15 insertions, 3 deletions
diff --git a/tex/context/base/math-vfu.lua b/tex/context/base/math-vfu.lua
index dff7e84fa..c3f234166 100644
--- a/tex/context/base/math-vfu.lua
+++ b/tex/context/base/math-vfu.lua
@@ -421,7 +421,7 @@ end)
function vfmath.define(specification,set,goodies)
local name = specification.name -- symbolic name
local size = specification.size -- given size
- local loaded, fontlist, main = { }, { }, nil
+ local loaded, fontlist, names, main = { }, { }, { }, nil
local start = (trace_virtual or trace_timings) and os.clock()
local okset, n = { }, 0
for s=1,#set do
@@ -438,7 +438,17 @@ function vfmath.define(specification,set,goodies)
if ss.main then
main = s
end
- local f, id = fonts.constructors.readanddefine(ssname,size)
+ local alreadyloaded = names[ssname] -- for px we load one twice (saves .04 sec)
+ local f, id
+ if alreadyloaded then
+ f, id = alreadyloaded.f, alreadyloaded.id
+ if trace_virtual then
+ report_virtual("loading font %s subfont %s with name %s is reused",name,s,ssname)
+ end
+ else
+ f, id = fonts.constructors.readanddefine(ssname,size)
+ names[ssname] = { f = f, id = id }
+ end
if not f or id == 0 then
report_virtual("loading font %s subfont %s with name %s at %s is skipped, not found",name,s,ssname,size)
else
@@ -446,7 +456,9 @@ function vfmath.define(specification,set,goodies)
okset[n] = ss
loaded[n] = f
fontlist[n] = { id = id, size = size }
- if not shared[s] then shared[n] = { } end
+ if not shared[s] then
+ shared[n] = { }
+ end
if trace_virtual then
report_virtual("loading font %s subfont %s with name %s at %s as id %s using encoding %s",name,s,ssname,size,id,ss.vector or "none")
end