From 4a4cabe9005295cfa349269ccb6e0ffa5f9d4fb3 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Mon, 7 Jun 2021 20:24:45 +0200 Subject: 2021-06-07 20:03:00 --- tex/context/base/mkiv/font-otl.lua | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'tex/context/base/mkiv/font-otl.lua') 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 -- cgit v1.2.3