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 --- .../documents/general/manuals/luametatex.pdf | Bin 1162901 -> 1169268 bytes .../manuals/luametatex/luametatex-enhancements.tex | 72 ++++++++++++++++++++- scripts/context/lua/mtx-fonts.lua | 2 +- tex/context/base/mkii/cont-new.mkii | 2 +- tex/context/base/mkii/context.mkii | 2 +- tex/context/base/mkii/mult-de.mkii | 1 + tex/context/base/mkiv/cont-new.mkiv | 2 +- tex/context/base/mkiv/context.mkiv | 2 +- tex/context/base/mkiv/font-imp-unicode.lua | 26 +++++++- tex/context/base/mkiv/font-mis.lua | 2 +- tex/context/base/mkiv/font-otl.lua | 22 ++++++- tex/context/base/mkiv/font-oup.lua | 28 ++++---- tex/context/base/mkiv/status-files.pdf | Bin 23890 -> 23932 bytes tex/context/base/mkiv/status-lua.pdf | Bin 230104 -> 230100 bytes tex/context/base/mkxl/cont-new.mkxl | 2 +- tex/context/base/mkxl/context.mkxl | 2 +- tex/context/base/mkxl/lpdf-emb.lmt | 43 +++++++++--- tex/context/interface/mkii/keys-de.xml | 1 + tex/generic/context/luatex/luatex-fonts-merged.lua | 44 +++++++++---- 19 files changed, 207 insertions(+), 46 deletions(-) diff --git a/doc/context/documents/general/manuals/luametatex.pdf b/doc/context/documents/general/manuals/luametatex.pdf index 93943c488..380e07035 100644 Binary files a/doc/context/documents/general/manuals/luametatex.pdf and b/doc/context/documents/general/manuals/luametatex.pdf differ diff --git a/doc/context/sources/general/manuals/luametatex/luametatex-enhancements.tex b/doc/context/sources/general/manuals/luametatex/luametatex-enhancements.tex index 8a1466301..4b4156d5d 100644 --- a/doc/context/sources/general/manuals/luametatex/luametatex-enhancements.tex +++ b/doc/context/sources/general/manuals/luametatex/luametatex-enhancements.tex @@ -821,6 +821,21 @@ This can be a bit nicer than using the uppercase tricks (using the property of \stopsubsection +\startsubsection[title={\lpr {lettonothing} and \lpr {glettonothing}}] + +This primitive is equivalent to: + +\starttyping +\protected\def\lettonothing#1{\def#1{}} +\stoptyping + +and although it might feel faster (only measurable with millions of calls) it's +mostly there because it is easier on tracing (less clutter). An advantage over +letting to an empty predefined macro is also that in tracing we keep seeing the +name (relaxing would show the relax equivalent). + +\stopsubsection + \startsubsection[title={\lpr {glet}}] This primitive is similar to: @@ -1541,13 +1556,42 @@ related primitives. \topicindex {tracing} If \prm {tracingonline} is larger than~2, the node list display will also print -the node number of the nodes. +the node number of the nodes as well as set attributes (these can be made verbose +by a callback). We have only a generic whatsit but again a callback can be used +to provide detail. So, when a box is shown in \CONTEXT\ you will see quite a lot +more than in other engines. Because nodes have more fields, more is shown anyway, +and for nodes that have sublists (like discretionaries) these are also shown. All +that could have been delegated to \LUA\ but it felt wrong to not made that a core +engine feature. When bit~1 of \lpr {tracinglevels} is set the current level is prepended to tracing lines in the log and when bit~2 is set the input level is prepended. You can set both bits and get both numbers prepended. In \CONTEXT\ we default to the value~3, so you get prefixes like \type {3:4:} followed by a space. +When \type {\tracingcommands} is larger than 3 the mode switch will be not be +prefixed to the \type {{command}} but get its own \type {[line]}. + +When \type {\tracinglevels} variable is set to 3 the group and input level are +shown, a value of 1 or 2 shows only one of them (in \CONTEXT\ we default to 3). + +When \type {\tracinghyphenation} is set to 1 duplicate patterns are reported (in +\CONTEXT\ we default to that) and higher values will also show details about the +\LUA\ hyphenation (exception) feedback loop discussed elsewhere. + +When set to 1 the \type {\tracingmath} variable triggers the reporting of the +mode (inline or display) an mlist is processed. + +Because in \LUATEX\ the saving and restoring of locally redefined macros and set +variables is optimized a bit in order to prevent redundant stack usage, there +will be less tracing visible. + +Also, because we have a more extensive macro argument parser, a fast path (and +less storage demands) for macros with no arguments, and flags that can be set for +macros the way macros are traced can be different in details (we therefore have +for instance \type {\meaningfull} and \type {\meaningless} as variants of \type +{\meaning}). + \stopsubsection % \startsubsection[title={\lpr {lastnodetype}, \lpr {lastnodesubtype}, \lpr @@ -2071,6 +2115,9 @@ more parsing options: \NC 0 \NC discard but count the argument \NC \NR \ML \NC * \NC ignore spaces \NC \NR +\NC . \NC ignore pars and spaces \NC \NR +\NC , \NC push back space when no match \NC \NR +\ML \NC : \NC pick up scanning here \NC \NR \NC ; \NC quit scanning \NC \NR \LL @@ -2222,7 +2269,7 @@ users redefine instances but there a warning or error is kind of welcome. \stopsection -\startsection[title=Constants] +\startsection[title={Constants with \lpr{integerdef} and \lpr {dimendef}}] It is rather common to store constant values in a register or character definition. @@ -2250,6 +2297,27 @@ in a previous section. \stopsection +\startsection[title={Serialization with \lpr {todimension}, \lpr {toscaled} and \lpr {tointeger}}] + +These three serializers take a verbose or symbolic quantity: + +\starttyping +\todimension 10pt \todimension \scratchdimen % with unit +\toscaled 10pt \toscaled \scratchdimen % without unit +\tointeger 10 \tointeger \scratchcounter +\stoptyping + +This is particularly handy in cases where you don't know what you deal with, for instance +when a value is stored in a macro. Using \type {\the} could fail there while: + +\starttyping +\the\dimexpr10pt\relax +\stoptyping + +is often overkill and gives more noise in a trace. + +\stopsection + \startsection[title=Nodes] The \ETEX\ primitive \type {\lastnodetype} is not honest in reporting the diff --git a/scripts/context/lua/mtx-fonts.lua b/scripts/context/lua/mtx-fonts.lua index 8abfee0cb..3f3125c10 100644 --- a/scripts/context/lua/mtx-fonts.lua +++ b/scripts/context/lua/mtx-fonts.lua @@ -16,7 +16,7 @@ local lower = string.lower local concat = table.concat local write_nl = (logs and logs.writer) or (texio and texio.write_nl) or print -local otlversion = 3.116 +local otlversion = 3.117 local helpinfo = [[ diff --git a/tex/context/base/mkii/cont-new.mkii b/tex/context/base/mkii/cont-new.mkii index c309dfe62..150c7b604 100644 --- a/tex/context/base/mkii/cont-new.mkii +++ b/tex/context/base/mkii/cont-new.mkii @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2021.06.07 14:39} +\newcontextversion{2021.06.07 20:01} %D This file is loaded at runtime, thereby providing an %D excellent place for hacks, patches, extensions and new diff --git a/tex/context/base/mkii/context.mkii b/tex/context/base/mkii/context.mkii index 5838c977b..27a43b3ec 100644 --- a/tex/context/base/mkii/context.mkii +++ b/tex/context/base/mkii/context.mkii @@ -20,7 +20,7 @@ %D your styles an modules. \edef\contextformat {\jobname} -\edef\contextversion{2021.06.07 14:39} +\edef\contextversion{2021.06.07 20:01} %D For those who want to use this: diff --git a/tex/context/base/mkii/mult-de.mkii b/tex/context/base/mkii/mult-de.mkii index f031a5702..60671069c 100644 --- a/tex/context/base/mkii/mult-de.mkii +++ b/tex/context/base/mkii/mult-de.mkii @@ -1265,6 +1265,7 @@ \setinterfaceconstant{symbolset}{symbolset} \setinterfaceconstant{symcolor}{symfarbe} \setinterfaceconstant{symstyle}{symstil} +\setinterfaceconstant{synchronize}{synchronize} \setinterfaceconstant{synonym}{synonym} \setinterfaceconstant{synonymcolor}{synonymfarbe} \setinterfaceconstant{synonymcommand}{synonymbefehl} diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv index 110f450ea..85b195e06 100644 --- a/tex/context/base/mkiv/cont-new.mkiv +++ b/tex/context/base/mkiv/cont-new.mkiv @@ -13,7 +13,7 @@ % \normalend % uncomment this to get the real base runtime -\newcontextversion{2021.06.07 14:39} +\newcontextversion{2021.06.07 20:01} %D This file is loaded at runtime, thereby providing an excellent place for hacks, %D patches, extensions and new features. There can be local overloads in cont-loc diff --git a/tex/context/base/mkiv/context.mkiv b/tex/context/base/mkiv/context.mkiv index 86e739ab2..458df82f8 100644 --- a/tex/context/base/mkiv/context.mkiv +++ b/tex/context/base/mkiv/context.mkiv @@ -45,7 +45,7 @@ %D {YYYY.MM.DD HH:MM} format. \edef\contextformat {\jobname} -\edef\contextversion{2021.06.07 14:39} +\edef\contextversion{2021.06.07 20:01} %D Kind of special: diff --git a/tex/context/base/mkiv/font-imp-unicode.lua b/tex/context/base/mkiv/font-imp-unicode.lua index ddb965ec9..7b2cd29bf 100644 --- a/tex/context/base/mkiv/font-imp-unicode.lua +++ b/tex/context/base/mkiv/font-imp-unicode.lua @@ -18,6 +18,8 @@ local registerotffeature = fonts.handlers.otf.features.register local extraprivates = helpers.extraprivates local addprivate = helpers.addprivate +local tounicode = fonts.mappings.tounicode + local function initialize(tfmdata) for i=1,#extraprivates do local e = extraprivates[i] @@ -38,8 +40,6 @@ constructors.newfeatures.otf.register { } } -local tounicode = fonts.mappings.tounicode - local function initialize(tfmdata,key,value) if value == "ligatures" then local private = fonts.constructors and fonts.constructors.privateoffset or 0xF0000 @@ -80,3 +80,25 @@ registerotffeature { node = initialize, } } + +local function initialize(tfmdata,key,value) + if value then +-- local c = tfmdata.characters[0x002D] +-- if c then +-- c.tounicode = tounicode(0x002D) +-- end + local c = tfmdata.descriptions[0x002D] + if c then + c.tounicode = tounicode(0x002D) + end + end +end + +registerotffeature { + name = "hardhyphen", + description = "hardhyphen", + manipulators = { + base = initialize, + node = initialize, + } +} diff --git a/tex/context/base/mkiv/font-mis.lua b/tex/context/base/mkiv/font-mis.lua index 6620dd9f4..1748640d2 100644 --- a/tex/context/base/mkiv/font-mis.lua +++ b/tex/context/base/mkiv/font-mis.lua @@ -21,7 +21,7 @@ local readers = otf.readers if readers then - otf.version = otf.version or 3.116 + otf.version = otf.version or 3.117 otf.cache = otf.cache or containers.define("fonts", "otl", otf.version, true) function fonts.helpers.getfeatures(name,save) 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 diff --git a/tex/context/base/mkiv/font-oup.lua b/tex/context/base/mkiv/font-oup.lua index c93ad4743..975e62f64 100644 --- a/tex/context/base/mkiv/font-oup.lua +++ b/tex/context/base/mkiv/font-oup.lua @@ -37,12 +37,16 @@ local f_index = formatters["I%05X"] local f_character_y = formatters["%C"] local f_character_n = formatters["[ %C ]"] -local check_duplicates = true -- can become an option (pseudo feature) / aways needed anyway +local check_duplicates = true -- can become an option (pseudo feature) / always needed anyway local check_soft_hyphen = true -- can become an option (pseudo feature) / needed for tagging -directives.register("otf.checksofthyphen",function(v) - check_soft_hyphen = v -end) +if CONTEXTLMTXMODE and CONTEXTLMTXMODE > 0 then + check_soft_hyphen = false -- solved better elsewhere +else + directives.register("otf.checksofthyphen",function(v) + check_soft_hyphen = v + end) +end local function replaced(list,index,replacement) if type(list) == "number" then @@ -454,7 +458,7 @@ local function copyduplicates(fontdata) local duplicates = resources.duplicates if check_soft_hyphen then -- ebgaramond has a zero width empty soft hyphen - -- antykwatorunsks lacks a soft hyphen + -- antykwatorunska lacks a soft hyphen local ds = descriptions[0xAD] if not ds or ds.width == 0 then if ds then @@ -759,6 +763,7 @@ local function unifyglyphs(fontdata,usenames) local resources = fontdata.resources local zero = glyphs[0] local zerocode = zero.unicode + local nofglyphs = #glyphs if not zerocode then zerocode = private zero.unicode = zerocode @@ -775,7 +780,7 @@ local function unifyglyphs(fontdata,usenames) -- if names then -- seldom uses, we don't issue message ... this branch might even go away - for index=1,#glyphs do + for index=1,nofglyphs do local glyph = glyphs[index] local unicode = glyph.unicode -- this is the primary one if not unicode then @@ -808,7 +813,7 @@ local function unifyglyphs(fontdata,usenames) descriptions[unicode] = glyph end elseif trace_unicodes then - for index=1,#glyphs do + for index=1,nofglyphs do local glyph = glyphs[index] local unicode = glyph.unicode -- this is the primary one if not unicode then @@ -849,7 +854,7 @@ local function unifyglyphs(fontdata,usenames) descriptions[unicode] = glyph end else - for index=1,#glyphs do + for index=1,nofglyphs do local glyph = glyphs[index] local unicode = glyph.unicode -- this is the primary one if not unicode then @@ -876,8 +881,8 @@ local function unifyglyphs(fontdata,usenames) end end -- - for index=1,#glyphs do - local math = glyphs[index].math + for index=1,nofglyphs do + local math = glyphs[index].math if math then local list = math.vparts if list then @@ -902,7 +907,7 @@ local function unifyglyphs(fontdata,usenames) -- local colorpalettes = resources.colorpalettes if colorpalettes then - for index=1,#glyphs do + for index=1,nofglyphs do local colors = glyphs[index].colors if colors then for i=1,#colors do @@ -918,6 +923,7 @@ local function unifyglyphs(fontdata,usenames) fontdata.names = names fontdata.descriptions = descriptions fontdata.hashmethod = hashmethod + fontdata.nofglyphs = nofglyphs -- return indices, names end diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf index 41913dee0..ccfc1e97d 100644 Binary files a/tex/context/base/mkiv/status-files.pdf and b/tex/context/base/mkiv/status-files.pdf differ diff --git a/tex/context/base/mkiv/status-lua.pdf b/tex/context/base/mkiv/status-lua.pdf index 6cb724cb6..87961ecff 100644 Binary files a/tex/context/base/mkiv/status-lua.pdf and b/tex/context/base/mkiv/status-lua.pdf differ diff --git a/tex/context/base/mkxl/cont-new.mkxl b/tex/context/base/mkxl/cont-new.mkxl index 8db3bab5c..9b6307fa6 100644 --- a/tex/context/base/mkxl/cont-new.mkxl +++ b/tex/context/base/mkxl/cont-new.mkxl @@ -13,7 +13,7 @@ % \normalend % uncomment this to get the real base runtime -\newcontextversion{2021.06.07 14:39} +\newcontextversion{2021.06.07 20:01} %D This file is loaded at runtime, thereby providing an excellent place for hacks, %D patches, extensions and new features. There can be local overloads in cont-loc diff --git a/tex/context/base/mkxl/context.mkxl b/tex/context/base/mkxl/context.mkxl index cf167155e..8f5fc4d21 100644 --- a/tex/context/base/mkxl/context.mkxl +++ b/tex/context/base/mkxl/context.mkxl @@ -29,7 +29,7 @@ %D {YYYY.MM.DD HH:MM} format. \immutable\edef\contextformat {\jobname} -\immutable\edef\contextversion{2021.06.07 14:39} +\immutable\edef\contextversion{2021.06.07 20:01} %overloadmode 1 % check frozen / warning %overloadmode 2 % check frozen / error diff --git a/tex/context/base/mkxl/lpdf-emb.lmt b/tex/context/base/mkxl/lpdf-emb.lmt index fa2cbe8cf..35e5cae18 100644 --- a/tex/context/base/mkxl/lpdf-emb.lmt +++ b/tex/context/base/mkxl/lpdf-emb.lmt @@ -186,7 +186,7 @@ end if unicode then unicode = tounicode(unicode) else - unicode = "FFFD" + unicode = "FFFD" -- wide only end mapping[length] = f_mapping(index,unicode) end @@ -236,10 +236,11 @@ end return widths end - collectindices = function(descriptions,indices) + collectindices = function(descriptions,indices,used) local minindex = 0xFFFF local maxindex = 0 local reverse = { } + local copies = { } -- todo: already at definition time trigger copying streams -- and add extra indices ... first i need a good example of -- a clash @@ -252,7 +253,11 @@ end -- end -- end for unicode, data in next, descriptions do - reverse[data.index or unicode] = data + local index = data.index + reverse[index or unicode] = data + if used[index] and data.dupindex then + copies[index] = data.dupindex + end end for index in next, indices do if index > maxindex then @@ -266,7 +271,10 @@ end if minindex > maxindex then minindex = maxindex end - return indices, minindex, maxindex + if next(copies) then + inspect(copies) + end + return indices, copies, minindex, maxindex end includecidset = false @@ -704,8 +712,9 @@ do local indices = details.indices local metabbox = { fontheader.xmin, fontheader.ymin, fontheader.xmax, fontheader.ymax } local indices, + copies, minindex, - maxindex = collectindices(descriptions,indices) + maxindex = collectindices(descriptions,indices,details.used) local glyphstreams = tablecreators.glyf(fontfile) local locations = tablecreators.loca(fontfile) local horizontals = tablecreators.hmtx(fontfile) @@ -751,6 +760,12 @@ do local data = indices[index] if data then local blob = blobs[index] -- we assume padding + if not blob then + local copy = copies[index] + if copy then + blob = blobs[copy] + end + end if blob and #blob > 0 then g = g + 1 ; glyphstreams[g] = blob h = h + 1 ; horizontals [h] = tocardinal2(data.width or 0) @@ -1346,8 +1361,9 @@ do -- local indices, + copies, minindex, - maxindex = collectindices(descriptions,indices) + maxindex = collectindices(descriptions,indices,details.used) local streamoffset = 0 local glyphstreams, charmappings = tablecreators.cff(fontfile) @@ -1369,7 +1385,16 @@ do end for index=minindex,maxindex do if indices[index] then - local blob = blobs[index] or "\14" + local blob = blobs[index] + if not blob then + local copy = copies[index] + if copy then + blob = blobs[copy] + end + end + if not blob then + blob = "\14" + end sparsemax = sparsemax + 1 glyphstreams[sparsemax] = blob charmappings[sparsemax] = tocardinal2(index) @@ -1896,8 +1921,9 @@ do local factor = parameters.factor -- normally 1 local fontmatrix = pdfarray { scalefactor, 0, 0, scalefactor, 0, 0 } local indices, + copies, minindex, - maxindex = collectindices(details.fontdata.characters,details.indices) + maxindex = collectindices(details.fontdata.characters,details.indices,details.used) local widths = pdfarray() local differences = pdfarray() local charprocs = pdfdictionary() @@ -2091,6 +2117,7 @@ function lpdf.flushfonts() fontdata = fontdata, filename = resources.filename or properties.filename or "unset", indices = { }, + used = used, rawdata = rawdata, properties = properties, -- we assume consistency parameters = parameters, -- we assume consistency diff --git a/tex/context/interface/mkii/keys-de.xml b/tex/context/interface/mkii/keys-de.xml index 259908cba..ab68cfb9b 100644 --- a/tex/context/interface/mkii/keys-de.xml +++ b/tex/context/interface/mkii/keys-de.xml @@ -1271,6 +1271,7 @@ + diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index 1c0e02c4f..45eb65e78 100644 --- a/tex/generic/context/luatex/luatex-fonts-merged.lua +++ b/tex/generic/context/luatex/luatex-fonts-merged.lua @@ -1,6 +1,6 @@ -- merged file : c:/data/develop/context/sources/luatex-fonts-merged.lua -- parent file : c:/data/develop/context/sources/luatex-fonts.lua --- merge date : 2021-06-07 14:39 +-- merge date : 2021-06-07 20:01 do -- begin closure to overcome local limits and interference @@ -20842,7 +20842,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 local allocate=utilities.storage.allocate @@ -20858,7 +20858,7 @@ local trace_defining=false registertracker("fonts.defining",function(v) trace_d local report_otf=logs.reporter("fonts","otf loading") local fonts=fonts local otf=fonts.handlers.otf -otf.version=3.116 +otf.version=3.117 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) @@ -21231,7 +21231,21 @@ local function copytotfm(data,cache_id) properties.name=filename or fullname 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.private=properties.private or data.private or privateoffset return { @@ -23523,9 +23537,13 @@ local f_character_y=formatters["%C"] local f_character_n=formatters["[ %C ]"] local check_duplicates=true local check_soft_hyphen=true -directives.register("otf.checksofthyphen",function(v) - check_soft_hyphen=v -end) +if CONTEXTLMTXMODE and CONTEXTLMTXMODE>0 then + check_soft_hyphen=false +else + directives.register("otf.checksofthyphen",function(v) + check_soft_hyphen=v + end) +end local function replaced(list,index,replacement) if type(list)=="number" then return replacement @@ -24199,6 +24217,7 @@ local function unifyglyphs(fontdata,usenames) local resources=fontdata.resources local zero=glyphs[0] local zerocode=zero.unicode + local nofglyphs=#glyphs if not zerocode then zerocode=private zero.unicode=zerocode @@ -24213,7 +24232,7 @@ local function unifyglyphs(fontdata,usenames) indices[0]=zerocode end if names then - for index=1,#glyphs do + for index=1,nofglyphs do local glyph=glyphs[index] local unicode=glyph.unicode if not unicode then @@ -24246,7 +24265,7 @@ local function unifyglyphs(fontdata,usenames) descriptions[unicode]=glyph end elseif trace_unicodes then - for index=1,#glyphs do + for index=1,nofglyphs do local glyph=glyphs[index] local unicode=glyph.unicode if not unicode then @@ -24287,7 +24306,7 @@ local function unifyglyphs(fontdata,usenames) descriptions[unicode]=glyph end else - for index=1,#glyphs do + for index=1,nofglyphs do local glyph=glyphs[index] local unicode=glyph.unicode if not unicode then @@ -24313,7 +24332,7 @@ local function unifyglyphs(fontdata,usenames) descriptions[unicode]=glyph end end - for index=1,#glyphs do + for index=1,nofglyphs do local math=glyphs[index].math if math then local list=math.vparts @@ -24336,7 +24355,7 @@ local function unifyglyphs(fontdata,usenames) end local colorpalettes=resources.colorpalettes if colorpalettes then - for index=1,#glyphs do + for index=1,nofglyphs do local colors=glyphs[index].colors if colors then for i=1,#colors do @@ -24351,6 +24370,7 @@ local function unifyglyphs(fontdata,usenames) fontdata.names=names fontdata.descriptions=descriptions fontdata.hashmethod=hashmethod + fontdata.nofglyphs=nofglyphs return indices,names end local p_crappyname do -- cgit v1.2.3