diff options
author | Karl Berry <karl@freefriends.org> | 2021-03-06 21:58:15 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-03-06 21:58:15 +0000 |
commit | 974640d66e61e81cb197ad96fdff7b08343e4c5a (patch) | |
tree | 2e1f75f32f312b7f24ba82b4590ae230bcd6f399 /Master/texmf-dist/tex/context/base/mkiv/font-otr.lua | |
parent | b4fa72e61230aca75f7f6fbf988821f71edfb6b2 (diff) |
context
git-svn-id: svn://tug.org/texlive/trunk@58167 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/font-otr.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/mkiv/font-otr.lua | 117 |
1 files changed, 53 insertions, 64 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-otr.lua b/Master/texmf-dist/tex/context/base/mkiv/font-otr.lua index e726053202f..531f665de72 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/font-otr.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/font-otr.lua @@ -1,5 +1,6 @@ if not modules then modules = { } end modules ['font-otr'] = { version = 1.001, + optimize = true, comment = "companion to font-ini.mkiv", author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", copyright = "PRAGMA ADE / ConTeXt Development Team", @@ -2084,8 +2085,6 @@ local function readtable(tag,f,fontdata,specification,...) end end -local variablefonts_supported = (context and true) or (logs and logs.application and true) or false - local function readdata(f,offset,specification) local fontdata, tables = loadtables(f,specification,offset) @@ -2094,12 +2093,6 @@ local function readdata(f,offset,specification) prepareglyps(fontdata) end - if not variablefonts_supported then - specification.instance = nil - specification.variable = nil - specification.factors = nil - end - fontdata.temporary = { } readtable("name",f,fontdata,specification) @@ -2118,71 +2111,66 @@ local function readdata(f,offset,specification) readtable("avar",f,fontdata,specification) readtable("fvar",f,fontdata,specification) - if variablefonts_supported then - - local variabledata = fontdata.variabledata - - if variabledata then - local instances = variabledata.instances - local axis = variabledata.axis - if axis and (not instances or #instances == 0) then - instances = { } - variabledata.instances = instances - local function add(n,subfamily,value) - local values = { } - for i=1,#axis do - local a = axis[i] - values[i] = { - axis = a.tag, - value = i == n and value or a.default, - } - end - instances[#instances+1] = { - subfamily = subfamily, - values = values, - } - end + local variabledata = fontdata.variabledata + + if variabledata then + local instances = variabledata.instances + local axis = variabledata.axis + if axis and (not instances or #instances == 0) then + instances = { } + variabledata.instances = instances + local function add(n,subfamily,value) + local values = { } for i=1,#axis do - local a = axis[i] - local tag = a.tag - add(i,"default"..tag,a.default) - add(i,"minimum"..tag,a.minimum) - add(i,"maximum"..tag,a.maximum) + local a = axis[i] + values[i] = { + axis = a.tag, + value = i == n and value or a.default, + } end - -- report("%i fake instances added",#instances) + instances[#instances+1] = { + subfamily = subfamily, + values = values, + } end - end - - if not specification.factors then - local instance = specification.instance - if type(instance) == "string" then - local factors = helpers.getfactors(fontdata,instance) - if factors then - specification.factors = factors - fontdata.factors = factors - fontdata.instance = instance - report("user instance: %s, factors: % t",instance,factors) - else - report("user instance: %s, bad factors",instance) - end + for i=1,#axis do + local a = axis[i] + local tag = a.tag + add(i,"default"..tag,a.default) + add(i,"minimum"..tag,a.minimum) + add(i,"maximum"..tag,a.maximum) end + -- report("%i fake instances added",#instances) end - - if not fontdata.factors then - if fontdata.variabledata then - local factors = helpers.getfactors(fontdata,true) - if factors then - specification.factors = factors - fontdata.factors = factors - -- report("factors: % t",factors) - -- else - -- report("bad factors") - end + end + if not specification.factors then + local instance = specification.instance + if type(instance) == "string" then + local factors = helpers.getfactors(fontdata,instance) + if factors then + specification.factors = factors + fontdata.factors = factors + fontdata.instance = instance + report("user instance: %s, factors: % t",instance,factors) else - -- report("unknown instance") + report("user instance: %s, bad factors",instance) end end + end + if not fontdata.factors then + if fontdata.variabledata then + local factors = helpers.getfactors(fontdata,true) + if factors then + specification.factors = factors + fontdata.factors = factors + -- report("factors: % t",factors) + -- else + -- report("bad factors") + end + else + -- report("unknown instance") + end end readtable("os/2",f,fontdata,specification) @@ -2433,6 +2421,7 @@ function readers.loadfont(filename,n,instance) hascolor = fontdata.hascolor or false, instance = fontdata.instance, factors = fontdata.factors, + nofsubfonts = fontdata.subfonts and #fontdata.subfonts or nil, }, resources = { -- filename = fontdata.filename, |