summaryrefslogtreecommitdiff
path: root/tex/context/base/font-ctx.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2012-06-05 17:36:00 +0200
committerHans Hagen <pragma@wxs.nl>2012-06-05 17:36:00 +0200
commit51a2dad390d6229948b4366ad232c662c0e3ea8b (patch)
treed5b6fcd58061fbee48a8894dce58e9ea9b3be1a5 /tex/context/base/font-ctx.lua
parent1cbef76ff4aa6cc1f7dc1d38c4b0514e94ad59a5 (diff)
downloadcontext-51a2dad390d6229948b4366ad232c662c0e3ea8b.tar.gz
beta 2012.06.05 17:36
Diffstat (limited to 'tex/context/base/font-ctx.lua')
-rw-r--r--tex/context/base/font-ctx.lua22
1 files changed, 14 insertions, 8 deletions
diff --git a/tex/context/base/font-ctx.lua b/tex/context/base/font-ctx.lua
index 4b324a6db..4c8bc98e3 100644
--- a/tex/context/base/font-ctx.lua
+++ b/tex/context/base/font-ctx.lua
@@ -145,6 +145,7 @@ local markdata = allocate()
local xheightdata = allocate()
local csnames = allocate() -- namedata
local italicsdata = allocate()
+local lastmathids = allocate()
hashes.characters = chardata
hashes.descriptions = descriptions
@@ -156,6 +157,7 @@ hashes.marks = markdata
hashes.xheights = xheightdata
hashes.csnames = csnames
hashes.italics = italicsdata
+hashes.lastmathids = lastmathids
setmetatableindex(chardata, function(t,k)
local characters = fontdata[k].characters
@@ -905,9 +907,11 @@ function commands.definefont_two(global,cs,str,size,inheritancemode,classfeature
end
end
local tfmdata = definers.read(specification,size) -- id not yet known (size in spec?)
+ --
+ local lastfontid = 0
if not tfmdata then
report_defining("unable to define %s as [%s]",name,nice_cs(cs))
- texsetcount("global","lastfontid",-1)
+ lastfontid = -1
context.letvaluerelax(cs) -- otherwise the current definition takes the previous one
elseif type(tfmdata) == "number" then
if trace_defining then
@@ -918,14 +922,13 @@ function commands.definefont_two(global,cs,str,size,inheritancemode,classfeature
tex.definefont(global,cs,tfmdata)
-- resolved (when designsize is used):
setsomefontsize(fontdata[tfmdata].parameters.size .. "sp")
- texsetcount("global","lastfontid",tfmdata)
+ lastfontid = tfmdata
else
-- setting the extra characters will move elsewhere
local characters = tfmdata.characters
local parameters = tfmdata.parameters
- -- we use char0 as signal
+ -- we use char0 as signal; cf the spec pdf can handle this (no char in slot)
characters[0] = nil
- -- cf the spec pdf can handle this (no char in slot)
-- characters[0x00A0] = { width = parameters.space }
-- characters[0x2007] = { width = characters[0x0030] and characters[0x0030].width or parameters.space } -- figure
-- characters[0x2008] = { width = characters[0x002E] and characters[0x002E].width or parameters.space } -- period
@@ -943,15 +946,18 @@ function commands.definefont_two(global,cs,str,size,inheritancemode,classfeature
end
-- resolved (when designsize is used):
setsomefontsize((tfmdata.parameters.size or 655360) .. "sp")
- --~ if specification.fallbacks then
- --~ fonts.collections.prepare(specification.fallbacks)
- --~ end
- texsetcount("global","lastfontid",id)
+ lastfontid = id
end
if trace_defining then
report_defining("memory usage after: %s",statistics.memused())
report_defining("stop stage two")
end
+ --
+ texsetcount("global","lastfontid",lastfontid)
+ if mathsize then
+ lastmathids[mathsize] = lastfontid
+ end
+ --
statistics.stoptiming(fonts)
end