summaryrefslogtreecommitdiff
path: root/tex
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2018-10-18 00:46:16 +0200
committerContext Git Mirror Bot <phg@phi-gamma.net>2018-10-18 00:46:16 +0200
commite2ee706a3114129601a30908d6b8cbb57068d32c (patch)
tree222b1047f4a7fe1144fefe5d0e52b78604a00f58 /tex
parente5f189d9965a70c8f3043c07c7b07d41ef268e93 (diff)
downloadcontext-e2ee706a3114129601a30908d6b8cbb57068d32c.tar.gz
2018-10-18 00:16:00
Diffstat (limited to 'tex')
-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/mkiv/char-act.mkiv10
-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-con.lua3
-rw-r--r--tex/context/base/mkiv/font-map.lua63
-rw-r--r--tex/context/base/mkiv/font-oup.lua2
-rw-r--r--tex/context/base/mkiv/grph-img.lua1
-rw-r--r--tex/context/base/mkiv/grph-inc.lua65
-rw-r--r--tex/context/base/mkiv/lpdf-img.lua2
-rw-r--r--tex/context/base/mkiv/spac-hor.mkiv2
-rw-r--r--tex/context/base/mkiv/status-files.pdfbin26098 -> 26094 bytes
-rw-r--r--tex/context/base/mkiv/status-lua.pdfbin270199 -> 270225 bytes
-rw-r--r--tex/context/base/mkiv/tabl-tsp.mkiv29
-rw-r--r--tex/context/interface/mkiv/i-context.pdfbin857333 -> 857326 bytes
-rw-r--r--tex/context/interface/mkiv/i-readme.pdfbin60773 -> 60771 bytes
-rw-r--r--tex/context/modules/mkiv/m-scite.mkiv6
-rw-r--r--tex/context/modules/mkiv/s-fonts-system.lua66
-rw-r--r--tex/context/modules/mkiv/s-fonts-system.mkiv6
-rw-r--r--tex/generic/context/luatex/luatex-fonts-merged.lua36
21 files changed, 187 insertions, 112 deletions
diff --git a/tex/context/base/mkii/cont-new.mkii b/tex/context/base/mkii/cont-new.mkii
index 72d476f01..3f7c0e7ef 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{2018.10.17 15:06}
+\newcontextversion{2018.10.18 00:07}
%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 922f96320..d530cd65d 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{2018.10.17 15:06}
+\edef\contextversion{2018.10.18 00:07}
%D For those who want to use this:
diff --git a/tex/context/base/mkiv/char-act.mkiv b/tex/context/base/mkiv/char-act.mkiv
index ff4dc621f..dd9a325f2 100644
--- a/tex/context/base/mkiv/char-act.mkiv
+++ b/tex/context/base/mkiv/char-act.mkiv
@@ -50,7 +50,7 @@
% \unexpanded\gdef\setcontrolspaces{\catcode\spaceasciicode\activecatcode\def {\controlspace}}
% \egroup
-\unexpanded\def\obeyspaces {\catcode\spaceasciicode\activecatcode\letcharcode\spaceasciicode\obeyedspace }
+%unexpanded\def\obeyspaces {\catcode\spaceasciicode\activecatcode\letcharcode\spaceasciicode\obeyedspace }
\unexpanded\def\setcontrolspaces{\catcode\spaceasciicode\activecatcode\letcharcode\spaceasciicode\controlspace}
%D \macros
@@ -78,12 +78,16 @@
% \unexpanded\def\ignorepages{\catcode\formfeedasciicode \ignorecatcode}
% \unexpanded\def\ignoreeofs {\catcode\endoffileasciicode\ignorecatcode}
+% but ... as we don't want to freeze to \obeyedspace etc which can be set after \obeyspaces, we
+% use an idirectness
+
\def\_obeyed_space_{\obeyedspace}
\def\_obeyed_tab_ {\obeyedtab}
\def\_obeyed_line_ {\obeyedline}
\def\_obeyed_page_ {\obeyedpage}
-\unexpanded\def\obeytabs {\catcode\tabasciicode \activecatcode\letcharcode\tabasciicode \_obeyed_tab_ }
+\unexpanded\def\obeyspaces {\catcode\spaceasciicode \activecatcode\letcharcode\spaceasciicode \_obeyed_space_}
+\unexpanded\def\obeytabs {\catcode\tabasciicode \activecatcode\letcharcode\tabasciicode \_obeyed_tab_}
\unexpanded\def\obeylines {\catcode\endoflineasciicode\activecatcode\letcharcode\endoflineasciicode\_obeyed_line_}
\unexpanded\def\obeypages {\catcode\formfeedasciicode \activecatcode\letcharcode\formfeedasciicode \_obeyed_page_}
@@ -92,6 +96,8 @@
\unexpanded\def\ignorepages{\catcode\formfeedasciicode \ignorecatcode}
\unexpanded\def\ignoreeofs {\catcode\endoffileasciicode\ignorecatcode}
+\unexpanded\def\setcontrolspaces{\catcode\spaceasciicode\activecatcode\letcharcode\spaceasciicode\_control_space_}
+
%D \macros
%D {naturaltextext}
%D
diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv
index 5ce172570..02b2e4f41 100644
--- a/tex/context/base/mkiv/cont-new.mkiv
+++ b/tex/context/base/mkiv/cont-new.mkiv
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2018.10.17 15:06}
+\newcontextversion{2018.10.18 00:07}
%D This file is loaded at runtime, thereby providing an excellent place for
%D hacks, patches, extensions and new features.
diff --git a/tex/context/base/mkiv/context.mkiv b/tex/context/base/mkiv/context.mkiv
index 8b144d609..e8a83d039 100644
--- a/tex/context/base/mkiv/context.mkiv
+++ b/tex/context/base/mkiv/context.mkiv
@@ -42,7 +42,7 @@
%D has to match \type {YYYY.MM.DD HH:MM} format.
\edef\contextformat {\jobname}
-\edef\contextversion{2018.10.17 15:06}
+\edef\contextversion{2018.10.18 00:07}
\edef\contextkind {beta}
%D For those who want to use this:
diff --git a/tex/context/base/mkiv/font-con.lua b/tex/context/base/mkiv/font-con.lua
index d238084d0..b067c8c40 100644
--- a/tex/context/base/mkiv/font-con.lua
+++ b/tex/context/base/mkiv/font-con.lua
@@ -425,6 +425,7 @@ function constructors.scale(tfmdata,specification)
targetparameters.extrafactor = extrafactor -- context specific
--
local tounicode = fonts.mappings.tounicode
+ local unknowncode = tounicode(0xFFFD)
--
local defaultwidth = resources.defaultwidth or 0
local defaultheight = resources.defaultheight or 0
@@ -740,7 +741,7 @@ function constructors.scale(tfmdata,specification)
-- in luatex > 0.85 we can do this:
-- chr.tounicode = isunicode
else
--- chr.tounicode = "FFFD"
+ chr.tounicode = unknowncode
end
if hasquality then
-- we could move these calculations elsewhere (saves calculations)
diff --git a/tex/context/base/mkiv/font-map.lua b/tex/context/base/mkiv/font-map.lua
index 712b1584c..7dd538858 100644
--- a/tex/context/base/mkiv/font-map.lua
+++ b/tex/context/base/mkiv/font-map.lua
@@ -225,7 +225,7 @@ local unknown = f_single(0xFFFD)
-- elseif k < 0xD7FF or (k > 0xDFFF and k <= 0xFFFF) then
-- v = f_single(k)
-- else
--- k = k - 0x10000
+-- local k = k - 0x10000
-- v = f_double(rshift(k,10)+0xD800,k%1024+0xDC00)
-- end
-- t[k] = v
@@ -251,33 +251,62 @@ local conc = { }
-- table.makeweak(hash)
+-- table.setmetatableindex(hash,function(t,k)
+-- if type(k) == "table" then
+-- local n = #k
+-- for l=1,n do
+-- conc[l] = hash[k[l]]
+-- end
+-- return concat(conc,"",1,n)
+-- end
+-- local v
+-- if k >= 0x00E000 and k <= 0x00F8FF then
+-- v = unknown
+-- elseif k >= 0x0F0000 and k <= 0x0FFFFF then
+-- v = unknown
+-- elseif k >= 0x100000 and k <= 0x10FFFF then
+-- v = unknown
+-- elseif k < 0xD7FF or (k > 0xDFFF and k <= 0xFFFF) then
+-- v = f_single(k)
+-- else
+-- local k = k - 0x10000
+-- v = f_double(rshift(k,10)+0xD800,k%1024+0xDC00)
+-- end
+-- t[k] = v
+-- return v
+-- end)
+--
+-- local function tounicode(unicode)
+-- return hash[unicode]
+-- end
+
table.setmetatableindex(hash,function(t,k)
+ if k < 0xD7FF or (k > 0xDFFF and k <= 0xFFFF) then
+ v = f_single(k)
+ else
+ local k = k - 0x10000
+ v = f_double(rshift(k,10)+0xD800,k%1024+0xDC00)
+ end
+ t[k] = v
+ return v
+end)
+
+local function tounicode(k)
if type(k) == "table" then
local n = #k
for l=1,n do
conc[l] = hash[k[l]]
end
return concat(conc,"",1,n)
- end
- local v
- if k >= 0x00E000 and k <= 0x00F8FF then
- v = unknown
+ elseif k >= 0x00E000 and k <= 0x00F8FF then
+ return unknown
elseif k >= 0x0F0000 and k <= 0x0FFFFF then
- v = unknown
+ return unknown
elseif k >= 0x100000 and k <= 0x10FFFF then
- v = unknown
- elseif k < 0xD7FF or (k > 0xDFFF and k <= 0xFFFF) then
- v = f_single(k)
+ return unknown
else
- k = k - 0x10000
- v = f_double(rshift(k,10)+0xD800,k%1024+0xDC00)
+ return hash[k]
end
- t[k] = v
- return v
-end)
-
-local function tounicode(unicode)
- return hash[unicode]
end
local function fromunicode16(str)
diff --git a/tex/context/base/mkiv/font-oup.lua b/tex/context/base/mkiv/font-oup.lua
index 14df60822..cd44bfef7 100644
--- a/tex/context/base/mkiv/font-oup.lua
+++ b/tex/context/base/mkiv/font-oup.lua
@@ -970,7 +970,7 @@ local function stripredundant(fontdata)
local n = 0
local c = 0
-- in context we always strip
- if not context and fonts.privateoffsets.keepnames then
+ if (not context and fonts.privateoffsets.keepnames) or forcekeep then
for unicode, d in next, descriptions do
if d.class == "base" then
d.class = nil
diff --git a/tex/context/base/mkiv/grph-img.lua b/tex/context/base/mkiv/grph-img.lua
index 3714b649e..c76733cbf 100644
--- a/tex/context/base/mkiv/grph-img.lua
+++ b/tex/context/base/mkiv/grph-img.lua
@@ -687,7 +687,6 @@ do
else
return
end
- -- maybe alpha some day
if colordepth == 8 then
colordepth = 1
elseif colordepth == 16 then
diff --git a/tex/context/base/mkiv/grph-inc.lua b/tex/context/base/mkiv/grph-inc.lua
index 553c60463..a41d3a3f6 100644
--- a/tex/context/base/mkiv/grph-inc.lua
+++ b/tex/context/base/mkiv/grph-inc.lua
@@ -2262,45 +2262,32 @@ local function png_checker(data) -- same as jpg (for now)
end
directives.register("graphics.pdf.uselua",function(v)
- if v then
- report("%s Lua based PDF inclusion","enabling")
- checkers.pdf = pdf_checker
- else
- report("%s Lua based PDF inclusion","disabling")
- checkers.pdf = nil
- end
+ checkers.pdf = v and pdf_checker or nil
+ report("%s Lua based PDF inclusion",v and "enabling" or "disabling")
end)
directives.register("graphics.jpg.uselua",function(v)
- if v then
- report("%s Lua based JPG inclusion","enabling")
- checkers.jpg = jpg_checker
- else
- report("%s Lua based JPG inclusion","disabling")
- checkers.jpg = nil
- end
+ checkers.jpg = v and jpg_checker or nil
+ report("%s Lua based JPG inclusion",v and "enabling" or "disabling")
end)
directives.register("graphics.jp2.uselua",function(v)
- if v then
- report("%s Lua based JP2 inclusion","enabling")
- checkers.jp2 = jp2_checker
- else
- report("%s Lua based JP2 inclusion","disabling")
- checkers.jp2 = nil
- end
+ checkers.jp2 = v and jp2_checker or nil
+ report("%s Lua based JP2 inclusion",v and "enabling" or "disabling")
end)
directives.register("graphics.png.uselua",function(v)
- if v then
- report("%s Lua based PNG inclusion","enabling")
- checkers.png = png_checker
- else
- report("%s Lua based PNG inclusion","disabling")
- checkers.png = nil
- end
+ checkers.png = v and png_checker or nil
+ report("%s Lua based PNG inclusion",v and "enabling" or "disabling")
end)
+directives.register("graphics.uselua",function(v)
+ checkers.pdf = v and pdf_checker or nil
+ checkers.jpg = v and jpg_checker or nil
+ checkers.jp2 = v and jp2_checker or nil
+ checkers.png = v and png_checker or nil
+ report("%s Lua based PDF, PNG, JPG and JP2 inclusion",v and "enabling" or "disabling")
+end)
-- directives.enable("graphics.pdf.uselua")
--
@@ -2344,30 +2331,18 @@ function bitmaps.new(xsize,ysize,colorspace,colordepth,mask)
end
local function flush(bitmap)
- img.write(lpdf.injectors.bitmap(bitmap))
+ return img.node(lpdf.injectors.bitmap(bitmap))
end
bitmaps.flush = flush
-function bitmaps.tocontext(bitmap,width,height)
- if type(width) == "number" then
- width = width .. "sp"
- end
- if type(height) == "number" then
- height = height .. "sp"
- end
- if not height and not height then
- width = bitmap.xsize .. "bp"
- height = bitmap.ysize .. "bp"
- end
+function bitmaps.tocontext(bitmap)
context.scale (
{
- width = width,
- height = height,
+ width = bitmap.xsize .. "bp",
+ height = bitmap.ysize .. "bp",
},
- function()
- flush(bitmap)
- end
+ flush(bitmap)
)
end
diff --git a/tex/context/base/mkiv/lpdf-img.lua b/tex/context/base/mkiv/lpdf-img.lua
index 28890887a..11aa00787 100644
--- a/tex/context/base/mkiv/lpdf-img.lua
+++ b/tex/context/base/mkiv/lpdf-img.lua
@@ -39,6 +39,8 @@ local report_jpg = logs.reporter("graphics","jpg")
local report_jp2 = logs.reporter("graphics","jp2")
local report_png = logs.reporter("graphics","png")
+trackers.register("graphics.backend", function(v) trace = v end)
+
local injectors = { }
lpdf.injectors = injectors
diff --git a/tex/context/base/mkiv/spac-hor.mkiv b/tex/context/base/mkiv/spac-hor.mkiv
index 3e4c28157..db8d12ae2 100644
--- a/tex/context/base/mkiv/spac-hor.mkiv
+++ b/tex/context/base/mkiv/spac-hor.mkiv
@@ -1122,6 +1122,8 @@
\unexpanded\def\spac_spaces_checked_normal {\mathortext\normalspace{\dontleavehmode\normalspace}}%
\unexpanded\def\spac_spaces_checked_fixed {\mathortext\normalspace{\dontleavehmode\fixedspace}}%
+% hm, order matters when we \let in \obeyspaces
+
\installspacemethod \v!on
{\obeyspaces
\let\obeyedspace\spac_spaces_checked_control
diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf
index 20a7f18e1..e2c84f900 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 b48b2651a..6875b27e6 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/mkiv/tabl-tsp.mkiv b/tex/context/base/mkiv/tabl-tsp.mkiv
index 2c4b694b3..e0ddce38a 100644
--- a/tex/context/base/mkiv/tabl-tsp.mkiv
+++ b/tex/context/base/mkiv/tabl-tsp.mkiv
@@ -441,6 +441,35 @@
\exitloop
\fi\fi}
+%D Maybe handy:
+%D
+%D \starttyping
+%D \splitfloat
+%D {\placefigure{some caption}}
+%D {\startsplittext
+%D \typefile[option=TEX,before=,after=]{oeps.tex}
+%D \stopsplittext}
+%D \stoptyping
+
+\def\handlesplittext#1%
+ {\setbox\tsplitresult\vbox
+ {\vsplit\tsplitcontent to \dimexpr#1-\lineheight\relax}}
+
+\unexpanded\def\startsplittext
+ {\begingroup
+ \resettsplit
+ \let\tsplitminimumfreelines\!!zerocount
+ \let\tsplitminimumfreespace\!!zeropoint
+ \let\extrasplitfloatlines \!!plusone
+ \let\tsplitdirectsplitter \handlesplittext
+ \setbox\tsplitcontent\vbox\bgroup
+ \insidefloattrue}
+
+\unexpanded\def\stopsplittext
+ {\egroup
+ \handledirecttsplit
+ \endgroup}
+
\protect \endinput
% test cases
diff --git a/tex/context/interface/mkiv/i-context.pdf b/tex/context/interface/mkiv/i-context.pdf
index e1e1bc1cd..5af37d839 100644
--- a/tex/context/interface/mkiv/i-context.pdf
+++ b/tex/context/interface/mkiv/i-context.pdf
Binary files differ
diff --git a/tex/context/interface/mkiv/i-readme.pdf b/tex/context/interface/mkiv/i-readme.pdf
index b8ae1bd64..003bdabaf 100644
--- a/tex/context/interface/mkiv/i-readme.pdf
+++ b/tex/context/interface/mkiv/i-readme.pdf
Binary files differ
diff --git a/tex/context/modules/mkiv/m-scite.mkiv b/tex/context/modules/mkiv/m-scite.mkiv
index eaac6ecae..9182fa2ec 100644
--- a/tex/context/modules/mkiv/m-scite.mkiv
+++ b/tex/context/modules/mkiv/m-scite.mkiv
@@ -227,7 +227,7 @@ local function lexdata(data,lexname)
end
data = indent(data)
end
-io.savedata("temp.logs ",data)
+ -- io.savedata("temp.log",data)
assignbuffer("lex",data)
end
@@ -324,11 +324,11 @@ visualizers.register("json", visualizer)
\unexpanded\def\buff_scite_slxb#1%
{\hangindent\numexpr#1+2\relax\scitespaceskip
- \hskip#1\scitespaceskip
+ \begstrut\hskip#1\scitespaceskip
\hangafter 1\relax}
\unexpanded\def\buff_scite_slxe
- {\par}
+ {\endstrut\par}
\unexpanded\def\buff_scite_slxs {\hskip\scitespaceskip\relax}
\unexpanded\def\buff_scite_slxf#1{\hskip#1\scitespaceskip\relax}
diff --git a/tex/context/modules/mkiv/s-fonts-system.lua b/tex/context/modules/mkiv/s-fonts-system.lua
index 5d2692473..dc0f2e6a3 100644
--- a/tex/context/modules/mkiv/s-fonts-system.lua
+++ b/tex/context/modules/mkiv/s-fonts-system.lua
@@ -114,7 +114,7 @@ end
local splitter = lpeg.splitat(lpeg.S("._"),true)
-local method = 3
+local method = 4
function moduledata.fonts.system.showinstalledglyphnames(specification)
specification = interfaces.checkedspecification(specification)
@@ -129,7 +129,8 @@ function moduledata.fonts.system.showinstalledglyphnames(specification)
end
end
for filename in table.sortedhash(files) do
- logs.report("system","fontfile: %s",file.nameonly(filename))
+ local fontname = file.nameonly(filename)
+ logs.report("system","fontfile: %s",fontname)
local data = table.load(filename)
if data then
if method == 1 then
@@ -178,31 +179,60 @@ function moduledata.fonts.system.showinstalledglyphnames(specification)
end
end
end
+ elseif method == 4 then
+ local descriptions = data.descriptions
+ if descriptions then
+ for u, d in sortedhash(descriptions) do
+ local n = d.name
+ local u = d.unicode
+ if n and not u and not find(n,"^%.") then
+ local n = names[n]
+ n[#n+1] = fontname
+ end
+ end
+ end
else
-- nothing
end
end
end
- if next(names) then
- context.starttabulate { "|l|pl|" }
- local f_u = formatters["%04X~(%i)"]
- local f_s = formatters["%s~(%i)"]
- for k, v in sortedhash(names) do
- local t = { }
- for k, v in sortedhash(v) do
- if type(k) == "string" then
- t[#t+1] = f_s(k,v)
- else
- t[#t+1] = f_u(k,v)
+ -- names[".notdef"] = nil
+ -- names[".null"] = nil
+ if method == 4 then
+ if next(names) then
+ context.starttabulate { "|l|pl|" }
+ local f_u = formatters["%04X~(%i)"]
+ local f_s = formatters["%s~(%i)"]
+ for k, v in sortedhash(names) do
+ NC() ctx_verbatim(k)
+ NC() context("% t",v)
+ NC() NR()
+ end
+ context.stoptabulate()
+ end
+ table.save("s-fonts-system-glyph-unknowns.lua",names)
+ else
+ if next(names) then
+ context.starttabulate { "|l|pl|" }
+ local f_u = formatters["%04X~(%i)"]
+ local f_s = formatters["%s~(%i)"]
+ for k, v in sortedhash(names) do
+ local t = { }
+ for k, v in sortedhash(v) do
+ if type(k) == "string" then
+ t[#t+1] = f_s(k,v)
+ else
+ t[#t+1] = f_u(k,v)
+ end
end
+ NC() ctx_verbatim(k)
+ NC() context("%, t",t)
+ NC() NR()
end
- NC() ctx_verbatim(k)
- NC() context("% t",t)
- NC() NR()
+ context.stoptabulate()
end
- context.stoptabulate()
+ table.save("s-fonts-system-glyph-names.lua",names)
end
- table.save("s-fonts-system-glyph-names.lua",names)
end
-- -- --
diff --git a/tex/context/modules/mkiv/s-fonts-system.mkiv b/tex/context/modules/mkiv/s-fonts-system.mkiv
index 03599b0df..9a0f7485d 100644
--- a/tex/context/modules/mkiv/s-fonts-system.mkiv
+++ b/tex/context/modules/mkiv/s-fonts-system.mkiv
@@ -39,12 +39,12 @@
% \showinstalledfonts
- \enabletrackers[otf.keepnames]
+% \enabletrackers[otf.keepnames]
- \cacheinstalledfonts[suffixes={otf,ttf,afm}]
+% \cacheinstalledfonts[suffixes={otf,ttf,afm}]
% \cacheinstalledfonts[threshold=4000000,suffixes={otf,ttf,afm}]
% \cacheinstalledfonts[threshold=2000000,suffixes={otf,ttf,afm}]
-% \showinstalledglyphnames
+ \showinstalledglyphnames
\stoptext
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua
index f97f82489..0a14e6082 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 : 10/17/18 15:06:55
+-- merge date : 10/18/18 00:07:52
do -- begin closure to overcome local limits and interference
@@ -9414,6 +9414,7 @@ function constructors.scale(tfmdata,specification)
targetparameters.forcedsize=forcedsize
targetparameters.extrafactor=extrafactor
local tounicode=fonts.mappings.tounicode
+ local unknowncode=tounicode(0xFFFD)
local defaultwidth=resources.defaultwidth or 0
local defaultheight=resources.defaultheight or 0
local defaultdepth=resources.defaultdepth or 0
@@ -9669,6 +9670,7 @@ function constructors.scale(tfmdata,specification)
chr.unicode=isunicode
chr.tounicode=tounicode(isunicode)
else
+ chr.tounicode=unknowncode
end
if hasquality then
local ve=character.expansion_factor
@@ -10759,31 +10761,31 @@ local unknown=f_single(0xFFFD)
local hash={}
local conc={}
table.setmetatableindex(hash,function(t,k)
+ if k<0xD7FF or (k>0xDFFF and k<=0xFFFF) then
+ v=f_single(k)
+ else
+ local k=k-0x10000
+ v=f_double(rshift(k,10)+0xD800,k%1024+0xDC00)
+ end
+ t[k]=v
+ return v
+end)
+local function tounicode(k)
if type(k)=="table" then
local n=#k
for l=1,n do
conc[l]=hash[k[l]]
end
return concat(conc,"",1,n)
- end
- local v
- if k>=0x00E000 and k<=0x00F8FF then
- v=unknown
+ elseif k>=0x00E000 and k<=0x00F8FF then
+ return unknown
elseif k>=0x0F0000 and k<=0x0FFFFF then
- v=unknown
+ return unknown
elseif k>=0x100000 and k<=0x10FFFF then
- v=unknown
- elseif k<0xD7FF or (k>0xDFFF and k<=0xFFFF) then
- v=f_single(k)
+ return unknown
else
- k=k-0x10000
- v=f_double(rshift(k,10)+0xD800,k%1024+0xDC00)
+ return hash[k]
end
- t[k]=v
- return v
-end)
-local function tounicode(unicode)
- return hash[unicode]
end
local function fromunicode16(str)
if #str==4 then
@@ -21065,7 +21067,7 @@ local function stripredundant(fontdata)
if descriptions then
local n=0
local c=0
- if not context and fonts.privateoffsets.keepnames then
+ if (not context and fonts.privateoffsets.keepnames) or forcekeep then
for unicode,d in next,descriptions do
if d.class=="base" then
d.class=nil