summaryrefslogtreecommitdiff
path: root/tex/context/base/font-ctx.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2010-12-22 14:07:00 +0100
committerHans Hagen <pragma@wxs.nl>2010-12-22 14:07:00 +0100
commit376d3729835dd61f7b71ed0de1dd07804fe44b2b (patch)
treedb45a49eb231595dc13d1bf9b81b8fe29d4bce94 /tex/context/base/font-ctx.lua
parentc9db00dcb4b97a4c8b08d2171336e09e73587422 (diff)
downloadcontext-376d3729835dd61f7b71ed0de1dd07804fe44b2b.tar.gz
beta 2010.12.22 14:07
Diffstat (limited to 'tex/context/base/font-ctx.lua')
-rw-r--r--tex/context/base/font-ctx.lua14
1 files changed, 13 insertions, 1 deletions
diff --git a/tex/context/base/font-ctx.lua b/tex/context/base/font-ctx.lua
index bd20f2d6f..c1231fb81 100644
--- a/tex/context/base/font-ctx.lua
+++ b/tex/context/base/font-ctx.lua
@@ -153,7 +153,7 @@ end)
function definers.registered(hash)
local id = fonts.internalized[hash]
- return id, id and fonts.identifiers[id]
+ return id, id and fontdata[id]
end
function definers.register(tfmdata,id)
@@ -569,6 +569,7 @@ function definers.stage_two(global,cs,str,size,classfeatures,fontfeatures,classf
if not tfmdata then
report_define("unable to define %s as \\%s",name,cs)
texsetcount("global","lastfontid",-1)
+ context.letvaluerelax(cs) -- otherwise the current definition takes the previous one
elseif type(tfmdata) == "number" then
if trace_defining then
report_define("reusing %s with id %s as \\%s (features: %s/%s, fallbacks: %s/%s, goodies: %s/%s)",
@@ -993,3 +994,14 @@ end
function fonts.currentid()
return currentfont() or 0
end
+
+-- interfaces
+
+function commands.doifelsecurrentfonthasfeature(name) -- can be made faster with a supportedfeatures hash
+ local f = fontdata[currentfont()]
+ f = f and f.shared
+ f = f and f.otfdata
+ f = f and f.luatex
+ f = f and f.features
+ commands.doifelse(f and (f.gpos[name] or f.gsub[name]))
+end