summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/font-def.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/font-def.lua')
-rw-r--r--Master/texmf-dist/tex/context/base/font-def.lua27
1 files changed, 8 insertions, 19 deletions
diff --git a/Master/texmf-dist/tex/context/base/font-def.lua b/Master/texmf-dist/tex/context/base/font-def.lua
index 5074e49ed75..cb056ff1bce 100644
--- a/Master/texmf-dist/tex/context/base/font-def.lua
+++ b/Master/texmf-dist/tex/context/base/font-def.lua
@@ -43,6 +43,7 @@ specifiers.variants = variants
definers.methods = definers.methods or { }
local internalized = allocate() -- internal tex numbers (private)
+local lastdefined = nil -- we don't want this one to end up in s-tra-02
local loadedfonts = constructors.loadedfonts
local designsizes = constructors.designsizes
@@ -328,20 +329,8 @@ function definers.loadfont(specification)
return tfmdata
end
-local function checkvirtual(tfmdata)
- -- begin of experiment: we can use { "slot", 0, number } in virtual fonts
- local fonts = tfmdata.fonts
- local selfid = font.nextid()
- if fonts and #fonts > 0 then
- for i=1,#fonts do
- if fonts[i][2] == 0 then
- fonts[i][2] = selfid
- end
- end
- else
- tfmdata.fonts = { "id", selfid }
- end
- -- end of experiment
+function constructors.checkvirtualids()
+ -- dummy in plain version
end
function constructors.readanddefine(name,size) -- no id -- maybe a dummy first
@@ -356,7 +345,8 @@ function constructors.readanddefine(name,size) -- no id -- maybe a dummy first
if not id then
local tfmdata = definers.loadfont(specification)
if tfmdata then
- checkvirtual(tfmdata) -- experiment, will become obsolete when slots can selfreference
+ tfmdata.properties.hash = hash
+ constructors.checkvirtualids(tfmdata) -- experiment, will become obsolete when slots can selfreference
id = font.define(tfmdata)
definers.register(tfmdata,id)
else
@@ -378,9 +368,6 @@ not gain much. By the way, passing id's back to in the callback was
introduced later in the development.</p>
--ldx]]--
-local lastdefined = nil -- we don't want this one to end up in s-tra-02
-local internalized = { }
-
function definers.current() -- or maybe current
return lastdefined
end
@@ -393,7 +380,9 @@ end
function definers.register(tfmdata,id)
if tfmdata and id then
local hash = tfmdata.properties.hash
- if not internalized[hash] then
+ if not hash then
+ report_defining("registering font, id %a, name %a, invalid hash",id,tfmdata.properties.filename or "?")
+ elseif not internalized[hash] then
internalized[hash] = id
if trace_defining then
report_defining("registering font, id %s, hash %a",id,hash)