summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/font-otl.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2021-06-07 20:24:45 +0200
committerContext Git Mirror Bot <phg@phi-gamma.net>2021-06-07 20:24:45 +0200
commit4a4cabe9005295cfa349269ccb6e0ffa5f9d4fb3 (patch)
tree12b97e5027069dcfa1e02f4f9a2937c7e7d6f3e8 /tex/context/base/mkiv/font-otl.lua
parenta9c0902d867e6e44f7503ba67ef1d1debc349b02 (diff)
downloadcontext-4a4cabe9005295cfa349269ccb6e0ffa5f9d4fb3.tar.gz
2021-06-07 20:03:00
Diffstat (limited to 'tex/context/base/mkiv/font-otl.lua')
-rw-r--r--tex/context/base/mkiv/font-otl.lua22
1 files changed, 19 insertions, 3 deletions
diff --git a/tex/context/base/mkiv/font-otl.lua b/tex/context/base/mkiv/font-otl.lua
index 4619e13dc..6b564e4c1 100644
--- a/tex/context/base/mkiv/font-otl.lua
+++ b/tex/context/base/mkiv/font-otl.lua
@@ -26,7 +26,7 @@ if not modules then modules = { } end modules ['font-otl'] = {
local lower = string.lower
local type, next, tonumber, tostring, unpack = type, next, tonumber, tostring, unpack
local abs = math.abs
-local derivetable = table.derive
+local derivetable, sortedhash = table.derive, table.sortedhash
local formatters = string.formatters
local setmetatableindex = table.setmetatableindex
@@ -52,7 +52,7 @@ local report_otf = logs.reporter("fonts","otf loading")
local fonts = fonts
local otf = fonts.handlers.otf
-otf.version = 3.116 -- beware: also sync font-mis.lua and in mtx-fonts
+otf.version = 3.117 -- beware: also sync font-mis.lua and in mtx-fonts
otf.cache = containers.define("fonts", "otl", otf.version, true)
otf.svgcache = containers.define("fonts", "svg", otf.version, true)
otf.pngcache = containers.define("fonts", "png", otf.version, true)
@@ -504,7 +504,23 @@ local function copytotfm(data,cache_id)
properties.subfont = subfont
--
if not CONTEXTLMTXMODE or CONTEXTLMTXMODE == 0 then
- properties.encodingbytes = 2
+ --
+ properties.encodingbytes = 2
+elseif CONTEXTLMTXMODE then
+ local duplicates = resources and resources.duplicates
+ if duplicates then
+ local maxindex = data.nofglyphs or metadata.nofglyphs
+ if maxindex then
+ for u, d in sortedhash(duplicates) do
+ for uu in sortedhash(d) do
+ maxindex = maxindex + 1
+ descriptions[uu].dupindex = descriptions[u].index
+ descriptions[uu].index = maxindex
+ end
+ end
+ end
+ end
+ --
end
--
-- properties.name = specification.name