diff options
Diffstat (limited to 'tex/context/base/font-otl.lua')
-rw-r--r-- | tex/context/base/font-otl.lua | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/tex/context/base/font-otl.lua b/tex/context/base/font-otl.lua index 96775d0f0..5a4831835 100644 --- a/tex/context/base/font-otl.lua +++ b/tex/context/base/font-otl.lua @@ -679,7 +679,7 @@ function otf.collectlookups(rawdata,kind,script,language) return unpack(languagelookup) end --- moved from font-oth.lua +-- moved from font-oth.lua, todo: also afm local function getgsub(tfmdata,k,kind,value) local shared = tfmdata.shared @@ -735,6 +735,23 @@ function otf.getmultiple(tfmdata,k,kind) return { k } end +function otf.getkern(tfmdata,left,right,kind) + local kerns = getgsub(tfmdata,left,kind or "kern",true) -- for now we use getsub + if kerns then + local found = kerns[right] + local kind = type(found) + if kind == "table" then + found = found[1][3] -- can be more clever + elseif kind ~= "number" then + found = false + end + if found then + return found * tfmdata.parameters.factor + end + end + return 0 +end + local function check_otf(forced,specification,suffix) local name = specification.name if forced then |