summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/font-otc.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2017-03-20 18:51:53 +0100
committerContext Git Mirror Bot <phg42.2a@gmail.com>2017-03-20 18:51:53 +0100
commit8e0089484acf80066e7393b1245d59dda211be09 (patch)
treea444a174ea8de55816cb4a9c3def00fb4521e7d8 /tex/context/base/mkiv/font-otc.lua
parent8f5c555274eb48fcaaa3d7f340ee77710846fb7e (diff)
downloadcontext-8e0089484acf80066e7393b1245d59dda211be09.tar.gz
2017-03-20 17:38:00
Diffstat (limited to 'tex/context/base/mkiv/font-otc.lua')
-rw-r--r--tex/context/base/mkiv/font-otc.lua27
1 files changed, 27 insertions, 0 deletions
diff --git a/tex/context/base/mkiv/font-otc.lua b/tex/context/base/mkiv/font-otc.lua
index a99d3db9f..dc855a74d 100644
--- a/tex/context/base/mkiv/font-otc.lua
+++ b/tex/context/base/mkiv/font-otc.lua
@@ -318,9 +318,18 @@ local function addfeature(data,feature,specifications)
return coverage
end
+ local function resetspacekerns()
+ -- a bit of a hack, this nil setting but it forces a
+ -- rehash of the resources needed .. the feature itself
+ -- should be a kern (at least for now)
+ data.properties.hasspacekerns = true
+ data.resources .spacekerns = nil
+ end
+
local function prepare_kern(list,featuretype)
local coverage = { }
local cover = coveractions[featuretype]
+ local isspace = false
for code, replacement in next, list do
local unicode = tounicode(code)
local description = descriptions[unicode]
@@ -330,11 +339,17 @@ local function addfeature(data,feature,specifications)
local u = tounicode(k)
if u then
r[u] = v
+ if u == 32 then
+ isspace = true
+ end
end
end
if next(r) then
cover(coverage,unicode,r)
done = done + 1
+ if unicode == 32 then
+ isspace = true
+ end
else
skip = skip + 1
end
@@ -342,6 +357,9 @@ local function addfeature(data,feature,specifications)
skip = skip + 1
end
end
+ if isspace then
+ resetspacekerns()
+ end
return coverage
end
@@ -358,11 +376,17 @@ local function addfeature(data,feature,specifications)
local u = tounicode(k)
if u then
r[u] = v
+ if u == 32 then
+ isspace = true
+ end
end
end
if next(r) then
cover(coverage,unicode,r)
done = done + 1
+ if unicode == 32 then
+ isspace = true
+ end
else
skip = skip + 1
end
@@ -370,6 +394,9 @@ local function addfeature(data,feature,specifications)
skip = skip + 1
end
end
+ if isspace then
+ resetspacekerns()
+ end
else
report_otf("unknown cover type %a",featuretype)
end