diff options
author | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-07-30 01:22:07 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-07-30 01:22:07 +0200 |
commit | 5135aef167bec739fe429e1aa987671768b237bc (patch) | |
tree | bd9f9696704e57c45f453bb7dc6becd5501cb657 /tex/context/base/mkiv/font-ctx.lua | |
parent | 9d7c4ba8449bec1da920c01e24a17c41bbf2211d (diff) | |
download | context-5135aef167bec739fe429e1aa987671768b237bc.tar.gz |
2016-07-30 00:31:00
Diffstat (limited to 'tex/context/base/mkiv/font-ctx.lua')
-rw-r--r-- | tex/context/base/mkiv/font-ctx.lua | 71 |
1 files changed, 39 insertions, 32 deletions
diff --git a/tex/context/base/mkiv/font-ctx.lua b/tex/context/base/mkiv/font-ctx.lua index 0342ee0ac..33945083e 100644 --- a/tex/context/base/mkiv/font-ctx.lua +++ b/tex/context/base/mkiv/font-ctx.lua @@ -42,6 +42,7 @@ local report_cummulative = logs.reporter("fonts","cummulative") local report_defining = logs.reporter("fonts","defining") local report_status = logs.reporter("fonts","status") local report_mapfiles = logs.reporter("fonts","mapfiles") +local report_newline = logs.newline local setmetatableindex = table.setmetatableindex @@ -1713,15 +1714,16 @@ function loggers.reportdefinedfonts() properties.fullname or "", properties.sharedwith or "", } - report_status("%s: % t",properties.name,sortedkeys(data)) end formatcolumns(t," ") - report_status() + logs.pushtarget("logfile") + report_newline() report_status("defined fonts:") - report_status() + report_newline() for k=1,tn do report_status(t[k]) end + logs.poptarget() end end @@ -1740,12 +1742,14 @@ function loggers.reportusedfeatures() setup.number = n -- restore it (normally not needed as we're done anyway) end formatcolumns(t," ") - report_status() + logs.pushtarget("logfile") + report_newline() report_status("defined featuresets:") - report_status() + report_newline() for k=1,n do report_status(t[k]) end + logs.poptarget() end end @@ -2522,35 +2526,38 @@ end -- for the font manual -local trace_files = false - -trackers.register("fonts.files",function(v) trace_files = v end) - statistics.register("used fonts",function() - if trace_files then - local files = { } - local list = { } - for id, tfmdata in sortedhash(fontdata) do - local filename = tfmdata.properties.filename - local filedata = files[filename] - if filedata then - filedata.instances = filedata.instances + 1 - else - local rawdata = tfmdata.shared and tfmdata.shared.rawdata - local metadata = rawdata and rawdata.metadata - files[filename] = { - instances = 1, - filename = filename, - version = metadata and metadata.version, - size = rawdata and rawdata.size, - } + if trace_usage then + local filename = file.nameonly(environment.jobname) .. "-fonts-usage.lua" + if next(fontdata) then + local files = { } + local list = { } + for id, tfmdata in sortedhash(fontdata) do + local filename = tfmdata.properties.filename + if filename then + local filedata = files[filename] + if filedata then + filedata.instances = filedata.instances + 1 + else + local rawdata = tfmdata.shared and tfmdata.shared.rawdata + local metadata = rawdata and rawdata.metadata + files[filename] = { + instances = 1, + filename = filename, + version = metadata and metadata.version, + size = rawdata and rawdata.size, + } + end + else + -- what to do + end end + for k, v in sortedhash(files) do + list[#list+1] = v + end + table.save(filename,list) + else + os.remove(filename) end - for k, v in sortedhash(files) do - list[#list+1] = v - end - local filename = file.nameonly(environment.jobname) .. "-usedfonts.lua" - table.save(filename,list) - return format("log saved in '%s'",filename) end end) |