summaryrefslogtreecommitdiff
path: root/tex/context
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
parenta9c0902d867e6e44f7503ba67ef1d1debc349b02 (diff)
downloadcontext-4a4cabe9005295cfa349269ccb6e0ffa5f9d4fb3.tar.gz
2021-06-07 20:03:00
Diffstat (limited to 'tex/context')
-rw-r--r--tex/context/base/mkii/cont-new.mkii2
-rw-r--r--tex/context/base/mkii/context.mkii2
-rw-r--r--tex/context/base/mkii/mult-de.mkii1
-rw-r--r--tex/context/base/mkiv/cont-new.mkiv2
-rw-r--r--tex/context/base/mkiv/context.mkiv2
-rw-r--r--tex/context/base/mkiv/font-imp-unicode.lua26
-rw-r--r--tex/context/base/mkiv/font-mis.lua2
-rw-r--r--tex/context/base/mkiv/font-otl.lua22
-rw-r--r--tex/context/base/mkiv/font-oup.lua28
-rw-r--r--tex/context/base/mkiv/status-files.pdfbin23890 -> 23932 bytes
-rw-r--r--tex/context/base/mkiv/status-lua.pdfbin230104 -> 230100 bytes
-rw-r--r--tex/context/base/mkxl/cont-new.mkxl2
-rw-r--r--tex/context/base/mkxl/context.mkxl2
-rw-r--r--tex/context/base/mkxl/lpdf-emb.lmt43
-rw-r--r--tex/context/interface/mkii/keys-de.xml1
15 files changed, 104 insertions, 31 deletions
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
--- a/tex/context/base/mkiv/status-files.pdf
+++ b/tex/context/base/mkiv/status-files.pdf
Binary files differ
diff --git a/tex/context/base/mkiv/status-lua.pdf b/tex/context/base/mkiv/status-lua.pdf
index 6cb724cb6..87961ecff 100644
--- a/tex/context/base/mkiv/status-lua.pdf
+++ b/tex/context/base/mkiv/status-lua.pdf
Binary files 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 @@
<cd:constant name='symbolset' value='symbolset'/>
<cd:constant name='symcolor' value='symfarbe'/>
<cd:constant name='symstyle' value='symstil'/>
+ <cd:constant name='synchronize' value='synchronize'/>
<cd:constant name='synonym' value='synonym'/>
<cd:constant name='synonymcolor' value='synonymfarbe'/>
<cd:constant name='synonymcommand' value='synonymbefehl'/>