diff options
author | Hans Hagen <pragma@wxs.nl> | 2023-02-07 19:22:47 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2023-02-07 19:22:47 +0100 |
commit | d643b65f7ab840157f538914b07f8d3cddf94bec (patch) | |
tree | 7e81499d7428d62e640d5ec3e159f8d93ec4e52d /tex/context/base/mkxl | |
parent | 0d0874ba797ee44f9fa53ed0fe95d7a863bf2f1b (diff) | |
download | context-d643b65f7ab840157f538914b07f8d3cddf94bec.tar.gz |
2023-02-07 19:04:00
Diffstat (limited to 'tex/context/base/mkxl')
-rw-r--r-- | tex/context/base/mkxl/cont-new.mkxl | 2 | ||||
-rw-r--r-- | tex/context/base/mkxl/context.mkxl | 2 | ||||
-rw-r--r-- | tex/context/base/mkxl/font-onr.lmt | 14 | ||||
-rw-r--r-- | tex/context/base/mkxl/font-otl.lmt | 2 | ||||
-rw-r--r-- | tex/context/base/mkxl/font-tpk.lmt | 2 | ||||
-rw-r--r-- | tex/context/base/mkxl/lpdf-lmt.lmt | 5 | ||||
-rw-r--r-- | tex/context/base/mkxl/math-act.lmt | 14 | ||||
-rw-r--r-- | tex/context/base/mkxl/math-fnt.lmt | 5 | ||||
-rw-r--r-- | tex/context/base/mkxl/math-vfu.lmt | 95 |
9 files changed, 84 insertions, 57 deletions
diff --git a/tex/context/base/mkxl/cont-new.mkxl b/tex/context/base/mkxl/cont-new.mkxl index 549404709..9a267bc5f 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{2023.02.06 17:55} +\newcontextversion{2023.02.07 19:02} %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 e51c3d732..143c67ffb 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{2023.02.06 17:55} +\immutable\edef\contextversion{2023.02.07 19:02} %overloadmode 1 % check frozen / warning %overloadmode 2 % check frozen / error diff --git a/tex/context/base/mkxl/font-onr.lmt b/tex/context/base/mkxl/font-onr.lmt index f48b8e545..2c18f6e89 100644 --- a/tex/context/base/mkxl/font-onr.lmt +++ b/tex/context/base/mkxl/font-onr.lmt @@ -44,7 +44,7 @@ afm.version = 1.513 -- incrementing this number one up will force a local pfb = handlers.pfb or { } handlers.pfb = pfb -pfb.version = 1.000 +pfb.version = 1.002 local readers = afm.readers or { } afm.readers = readers @@ -212,6 +212,7 @@ do + C("FontName") * nam + C("FontMatrix") * arr + C("FontBBox") * arr + + C("FontType") * num ) ) / function (t,k,v) t[lower(k)] = v end + P(1) )^0 * Carg(1) @@ -278,8 +279,12 @@ do binary = decrypt(binary,55665,4) - encoding = names or lpegmatch(p_filterencoding,ascii) - metadata = names or lpegmatch(p_filtermetadata,ascii,1,{}) + if not encoding then + encoding = lpegmatch(p_filterencoding,ascii) + end + if not metadata then + metadata = lpegmatch(p_filtermetadata,ascii,1,{}) + end glyphs = { } routines = { } @@ -299,8 +304,9 @@ do } }, } + local version = metadata.FontType or 1 -- only cff 1 in type 1 fonts - fonts.handlers.otf.readers.parsecharstrings(false,data,glyphs,true,"cff",streams,true) + fonts.handlers.otf.readers.parsecharstrings(false,data,glyphs,true,"cff",streams,true,true) elseif not names then lpegmatch(p_filternames,binary,1,filename) end diff --git a/tex/context/base/mkxl/font-otl.lmt b/tex/context/base/mkxl/font-otl.lmt index 0d654edf6..065a2c2ee 100644 --- a/tex/context/base/mkxl/font-otl.lmt +++ b/tex/context/base/mkxl/font-otl.lmt @@ -52,7 +52,7 @@ local report_otf = logs.reporter("fonts","otf loading") local fonts = fonts local otf = fonts.handlers.otf -otf.version = 3.131 -- beware: also sync font-mis.lua and in mtx-fonts +otf.version = 3.133 -- 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) diff --git a/tex/context/base/mkxl/font-tpk.lmt b/tex/context/base/mkxl/font-tpk.lmt index 2ad74d2a9..d265433c5 100644 --- a/tex/context/base/mkxl/font-tpk.lmt +++ b/tex/context/base/mkxl/font-tpk.lmt @@ -44,7 +44,7 @@ if not fonts then fonts = { handlers = { tfm = { } } } end local handlers = fonts.handlers local tfm = handlers.tfm or { } handlers.tfm = tfm -tfm.version = 1.005 +tfm.version = 1.006 local readers = tfm.readers or { } tfm.readers = readers diff --git a/tex/context/base/mkxl/lpdf-lmt.lmt b/tex/context/base/mkxl/lpdf-lmt.lmt index 6c321ec54..1d47c1620 100644 --- a/tex/context/base/mkxl/lpdf-lmt.lmt +++ b/tex/context/base/mkxl/lpdf-lmt.lmt @@ -1192,6 +1192,7 @@ local flushimage do local r = boxresources[objnum] if r then flushlist(l.list) + l.list = nil -- added end boxresources[objnum] = l if immediate then @@ -2131,6 +2132,10 @@ local finalize do finalize = function(driver,details) + if not details then + report("something is wrong, no details in 'finalize'") + end + level = level + 1 pdf_goto_pagemode() -- for now diff --git a/tex/context/base/mkxl/math-act.lmt b/tex/context/base/mkxl/math-act.lmt index 3a7324586..faa0d2ae5 100644 --- a/tex/context/base/mkxl/math-act.lmt +++ b/tex/context/base/mkxl/math-act.lmt @@ -3452,8 +3452,18 @@ do } local chars = fontchars[id] local dropin = fontdata[id] - local index = #fonts + 1 - fonts[index] = { id = id, size = size } + local index = false + for i=1,#fonts do + local f = fonts[i] + if f.id == id and f.size == size then + index = i + break + end + end + if not index then + index = #fonts + 1 + fonts[index] = { id = id, size = size } + end -- copy characters for s=firstsource,lastsource do local t = s + offset diff --git a/tex/context/base/mkxl/math-fnt.lmt b/tex/context/base/mkxl/math-fnt.lmt index cf14b4aa2..911e0adb5 100644 --- a/tex/context/base/mkxl/math-fnt.lmt +++ b/tex/context/base/mkxl/math-fnt.lmt @@ -54,14 +54,13 @@ local cache = setmetatableindex(function(t,width) return v end) - local function register_extensible(font,char,style,box) -- We don't share (yet)! local fontdata = chardata[font] local oldchar = fontdata[char] if oldchar and oldchar.keepvirtual then -- for now, needed for iwona etc - return + return nil else local bx = tonut(box) updaters.apply("tagging.state.disable") -- fast enough @@ -81,7 +80,6 @@ local function register_extensible(font,char,style,box) local p = fonts.hashes.parameters[font] local sx = round(1000/p.extendfactor) local sy = round(1000/p.squeezefactor) - nuts.setscales(g,1000,sx,sy) -- we saved a scaled glyph stream so we now use an unscaled one ... horrible hack: if sx ~= 1000 then wd = wd * 7200/7227 @@ -98,6 +96,7 @@ local function register_extensible(font,char,style,box) cache[wd][ht][dp][font][unicode] = private end local glyph = new_glyph(font,private,al) + nuts.setscales(glyph,1000,sx,sy) -- -- if fonts.hashes.properties[font].compactmath then -- nuts.setscales(g,1000,1000,1000) diff --git a/tex/context/base/mkxl/math-vfu.lmt b/tex/context/base/mkxl/math-vfu.lmt index 1046a0c19..53988036c 100644 --- a/tex/context/base/mkxl/math-vfu.lmt +++ b/tex/context/base/mkxl/math-vfu.lmt @@ -17,6 +17,9 @@ if not modules then modules = { } end modules ['math-vfu'] = { -- from when we emulated \UNICODE\ math and \OPENTYPE\ math fonts using traditional -- fonts. +-- Musical timestamp: Januari 2023 Riverside ID.Entity release date, after all we +-- only use the following code for ther Polish Iwona, Kurier and Antykwa fonts. + local type, next, tonumber = type, next, tonumber local max = math.max local fastcopy, sortedhash = table.copy, table.sortedhash @@ -674,52 +677,56 @@ local noitalics = true -- false can be used to test the engine -- bit to suit that purpose. It might get even simpler. local function virtualize(s,uni,fci,skewchar,move,mathparameters,unicode,parameters) - local kerns = fci.kerns - local width = fci.width - local height = fci.height - local depth = fci.depth - local italic = fci.italic - local advance = width - local bottomright - local topanchor - local yoffset - if kerns and skewchar then - local k = kerns[skewchar] - if k then - topanchor = width/2 + k + if fci then + local kerns = fci.kerns + local width = fci.width + local height = fci.height + local depth = fci.depth + local italic = fci.italic + local advance = width + local bottomright + local topanchor + local yoffset + if kerns and skewchar then + local k = kerns[skewchar] + if k then + topanchor = width/2 + k + end end + if italic and noitalics then + width = width + italic + bottomright = - italic + italic = nil + end + if move then -- 0x222B + local axis = move * mathparameters.axisheight + local half = (height + depth ) / 2 + yoffset = depth - (half - axis) + height = half + axis + depth = half - axis + end + -- + return { + advance = advance, + width = width, + height = height, + depth = depth, + italic = italic, + bottomright = bottomright, + topanchor = topanchor, + yoffset = yoffset, + commands = { slotcommand[s][uni] }, + -- keepvirtual = true, + next = fci.next, + parts = fci.parts, + partsorientation = fci.partsorientation, + partsitalic = fci.partsitalic, + unicode = unicode, + name = fci.name, + } + else + -- error end - if italic and noitalics then - width = width + italic - bottomright = - italic - italic = nil - end - if move then -- 0x222B - local axis = move * mathparameters.axisheight - local half = (height + depth ) / 2 - yoffset = depth - (half - axis) - height = half + axis - depth = half - axis - end - -- - return { - advance = advance, - width = width, - height = height, - depth = depth, - italic = italic, - bottomright = bottomright, - topanchor = topanchor, - yoffset = yoffset, - commands = { slotcommand[s][uni] }, - -- keepvirtual = true, - next = fci.next, - parts = fci.parts, - partsorientation = fci.partsorientation, - partsitalic = fci.partsitalic, - unicode = unicode, - name = fci.name, - } end function vfmath.define(specification,set,goodies) |