diff options
Diffstat (limited to 'tex/context/base/font-def.lua')
-rw-r--r-- | tex/context/base/font-def.lua | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/tex/context/base/font-def.lua b/tex/context/base/font-def.lua index 864e5bd16..96de480ac 100644 --- a/tex/context/base/font-def.lua +++ b/tex/context/base/font-def.lua @@ -6,8 +6,6 @@ if not modules then modules = { } end modules ['font-def'] = { license = "see context related readme files" } --- We can overload some of the definers.functions so we don't local them. - local concat = table.concat local format, gmatch, match, find, lower, gsub = string.format, string.gmatch, string.match, string.find, string.lower, string.gsub local tostring, next = tostring, next @@ -44,6 +42,7 @@ definers.methods = definers.methods or { } local internalized = allocate() -- internal tex numbers (private) + local loadedfonts = constructors.loadedfonts local designsizes = constructors.designsizes @@ -73,7 +72,7 @@ and prepares a table that will move along as we proceed.</p> -- name name(sub) name(sub)*spec name*spec -- name@spec*oeps -local splitter, splitspecifiers = nil, "" -- not so nice +local splitter, splitspecifiers = nil, "" local P, C, S, Cc = lpeg.P, lpeg.C, lpeg.S, lpeg.Cc @@ -84,7 +83,7 @@ local space = P(" ") definers.defaultlookup = "file" -local prefixpattern = P(false) +local prefixpattern = P(false) local function addspecifier(symbol) splitspecifiers = splitspecifiers .. symbol @@ -120,12 +119,12 @@ function definers.registersplit(symbol,action,verbosename) end end -local function makespecification(specification,lookup,name,sub,method,detail,size) +function definers.makespecification(specification,lookup,name,sub,method,detail,size) size = size or 655360 if trace_defining then report_defining("%s -> lookup: %s, name: %s, sub: %s, method: %s, detail: %s", - specification, lookup ~= "" and lookup or "[file]", name ~= "" and name or "-", - sub ~= "" and sub or "-", method ~= "" and method or "-", detail ~= "" and detail or "-") + specification, (lookup ~= "" and lookup) or "[file]", (name ~= "" and name) or "-", + (sub ~= "" and sub) or "-", (method ~= "" and method) or "-", (detail ~= "" and detail) or "-") end if not lookup or lookup == "" then lookup = definers.defaultlookup @@ -145,13 +144,10 @@ local function makespecification(specification,lookup,name,sub,method,detail,siz return t end - -definers.makespecification = makespecification - function definers.analyze(specification, size) -- can be optimized with locals local lookup, name, sub, method, detail = getspecification(specification or "") - return makespecification(specification, lookup, name, sub, method, detail, size) + return definers.makespecification(specification, lookup, name, sub, method, detail, size) end --[[ldx-- @@ -198,7 +194,7 @@ function resolvers.spec(specification) if resolved then specification.resolved = resolved specification.sub = sub - specification.forced = file.suffix(resolved) + specification.forced = file.extname(resolved) specification.name = file.removesuffix(resolved) end else @@ -246,13 +242,12 @@ specification yet.</p> function definers.applypostprocessors(tfmdata) local postprocessors = tfmdata.postprocessors if postprocessors then - local properties = tfmdata.properties for i=1,#postprocessors do local extrahash = postprocessors[i](tfmdata) -- after scaling etc if type(extrahash) == "string" and extrahash ~= "" then -- e.g. a reencoding needs this extrahash = gsub(lower(extrahash),"[^a-z]","-") - properties.fullname = format("%s-%s",properties.fullname,extrahash) + tfmdata.properties.fullname = format("%s-%s",tfmdata.properties.fullname,extrahash) end end end |