summaryrefslogtreecommitdiff
path: root/tex/context/modules/mkiv/s-fonts-features.lua
diff options
context:
space:
mode:
authorContext Git Mirror Bot <phg42.2a@gmail.com>2016-06-25 15:40:51 +0200
committerContext Git Mirror Bot <phg42.2a@gmail.com>2016-06-25 15:40:51 +0200
commitb2a2304cbb0c65040d7b118ac9b857d304e333e6 (patch)
treeed5212e37a91ec78c12d9f72ca1186a59c139b40 /tex/context/modules/mkiv/s-fonts-features.lua
parentb2276ae7a04a9f9c35403e508670049d8c3e4b3e (diff)
downloadcontext-b2a2304cbb0c65040d7b118ac9b857d304e333e6.tar.gz
2016-06-25 14:42:00
Diffstat (limited to 'tex/context/modules/mkiv/s-fonts-features.lua')
-rw-r--r--tex/context/modules/mkiv/s-fonts-features.lua50
1 files changed, 49 insertions, 1 deletions
diff --git a/tex/context/modules/mkiv/s-fonts-features.lua b/tex/context/modules/mkiv/s-fonts-features.lua
index 7300cb768..f78300f32 100644
--- a/tex/context/modules/mkiv/s-fonts-features.lua
+++ b/tex/context/modules/mkiv/s-fonts-features.lua
@@ -83,6 +83,51 @@ local function collectkerns(tfmdata,feature)
local lookuphash = resources.lookuphash
local feature = feature or "kern"
if sequences then
+
+ if true then
+
+ for i=1,#sequences do
+ local sequence = sequences[i]
+ if sequence.features and sequence.features[feature] then
+ local steps = sequence.steps
+ for i=1,#steps do
+ local step = steps[i]
+ local format = step.format
+ for unicode, hash in table.sortedhash(step.coverage) do
+ local kerns = combinations[unicode]
+ if not kerns then
+ kerns = { }
+ combinations[unicode] = kerns
+ end
+ for otherunicode, kern in table.sortedhash(hash) do
+ if format == "pair" then
+ local f = kern[1]
+ local s = kern[2]
+ if f then
+ if s then
+ -- todo
+ else
+ if not kerns[otherunicode] and f[3] ~= 0 then
+ kerns[otherunicode] = f[3]
+ end
+ end
+ elseif s then
+ -- todo
+ end
+ elseif format == "kern" then
+ if not kerns[otherunicode] and kern ~= 0 then
+ kerns[otherunicode] = kern
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+
+ else -- old loader
+
for i=1,#sequences do
local sequence = sequences[i]
if sequence.features and sequence.features[feature] then
@@ -107,7 +152,9 @@ local function collectkerns(tfmdata,feature)
end
end
end
+
end
+
return combinations
end
@@ -142,6 +189,7 @@ function moduledata.fonts.features.showallkerns(specification)
local tfmdata = fonts.hashes.identifiers[id]
local allkerns = collectkerns(tfmdata)
local characters = tfmdata.characters
+ local hfactor = tfmdata.parameters.hfactor
if next(allkerns) then
for first, pairs in sortedhash(allkerns) do
context.par()
@@ -150,7 +198,7 @@ function moduledata.fonts.features.showallkerns(specification)
-- if not kerns and pairs[second] then
-- -- weird
-- end
- showkernpair(first,kern,second,0)
+ showkernpair(first,kern*hfactor,second)
end
context.par()
end