diff options
author | Hans Hagen <pragma@wxs.nl> | 2019-10-02 13:21:40 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2019-10-02 13:21:40 +0200 |
commit | 6ab4432f6fe56cc63e53aeb256c89f01a04fb84f (patch) | |
tree | 5b45957afb0df55f2d5f06d43e6ac1c17d9f94cc /tex | |
parent | 7b12427f475e64e06f5dd7b537462b6d990526f6 (diff) | |
download | context-6ab4432f6fe56cc63e53aeb256c89f01a04fb84f.tar.gz |
2019-10-02 12:50:00
Diffstat (limited to 'tex')
-rw-r--r-- | tex/context/base/mkii/cont-new.mkii | 2 | ||||
-rw-r--r-- | tex/context/base/mkii/context.mkii | 2 | ||||
-rw-r--r-- | tex/context/base/mkiv/cont-new.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/mkiv/context.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/mkiv/context.mkxl | 2 | ||||
-rw-r--r-- | tex/context/base/mkiv/font-tpk.lua | 5 | ||||
-rw-r--r-- | tex/context/base/mkiv/lpdf-emb.lua | 43 | ||||
-rw-r--r-- | tex/context/base/mkiv/status-files.pdf | bin | 26607 -> 26630 bytes | |||
-rw-r--r-- | tex/context/base/mkiv/status-lua.pdf | bin | 268646 -> 268646 bytes | |||
-rw-r--r-- | tex/context/base/mkiv/syst-aux.mkxl | 35 | ||||
-rw-r--r-- | tex/context/interface/mkiv/i-context.pdf | bin | 893298 -> 893298 bytes | |||
-rw-r--r-- | tex/context/interface/mkiv/i-readme.pdf | bin | 61165 -> 61165 bytes | |||
-rw-r--r-- | tex/generic/context/luatex/luatex-fonts-merged.lua | 2 |
13 files changed, 67 insertions, 28 deletions
diff --git a/tex/context/base/mkii/cont-new.mkii b/tex/context/base/mkii/cont-new.mkii index d7278d1a4..296525c5c 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{2019.10.01 10:36} +\newcontextversion{2019.10.02 12:43} %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 25110cc9f..ed7ade881 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{2019.10.01 10:36} +\edef\contextversion{2019.10.02 12:43} %D For those who want to use this: diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv index 08c80fddc..2236514eb 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{2019.10.01 10:36} +\newcontextversion{2019.10.02 12:43} %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 a37681efa..87efea55e 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{2019.10.01 10:36} +\edef\contextversion{2019.10.02 12:43} \edef\contextkind {beta} %D Kind of special: diff --git a/tex/context/base/mkiv/context.mkxl b/tex/context/base/mkiv/context.mkxl index bd0b8591d..c3552f09f 100644 --- a/tex/context/base/mkiv/context.mkxl +++ b/tex/context/base/mkiv/context.mkxl @@ -29,7 +29,7 @@ %D {YYYY.MM.DD HH:MM} format. \edef\contextformat {\jobname} -\edef\contextversion{2019.10.01 10:36} +\edef\contextversion{2019.10.02 12:43} \edef\contextkind {beta} %D Kind of special: diff --git a/tex/context/base/mkiv/font-tpk.lua b/tex/context/base/mkiv/font-tpk.lua index 26e3fc0f0..bdfb0c2ee 100644 --- a/tex/context/base/mkiv/font-tpk.lua +++ b/tex/context/base/mkiv/font-tpk.lua @@ -282,7 +282,8 @@ ID %t EI Q]] ] - function readers.pktopdf(glyph,width) + function readers.pktopdf(glyph,data,factor) + local width = data.width * factor local xsize = glyph.xsize or 0 local ysize = glyph.ysize or 0 local xoffset = glyph.xoffset or 0 @@ -319,7 +320,7 @@ Q]] ] r = r + 1 ; result[r] = char(extract(b,8,8)) end end - return template(width,llx,lly,urx,ury,xdpi,ydpi,llx,lly,xsize,ysize,result) + return template(width,llx,lly,urx,ury,xdpi,ydpi,llx,lly,xsize,ysize,result), width end function readers.loadpk(filename) diff --git a/tex/context/base/mkiv/lpdf-emb.lua b/tex/context/base/mkiv/lpdf-emb.lua index 0447ce9b0..eace34ca1 100644 --- a/tex/context/base/mkiv/lpdf-emb.lua +++ b/tex/context/base/mkiv/lpdf-emb.lua @@ -1545,19 +1545,24 @@ do -- pk inclusion (not really tested but not really used either) function methods.pk(filename) - local resolution = 600 - local widthfactor = resolution / 72 - local scalefactor = 72 / resolution / 10 local pkfullname = resolvers.findpk(basedfontname,resolution) if not pkfullname or pkfullname == "" then return end local readers = fonts.handlers.tfm.readers local result = readers.loadpk(pkfullname) + local convert = readers.pktopdf if not result or result.error then return end - return result.glyphs, widthfactor / 65536, scalefactor, readers.pktopdf + local resolution = 600 + local widthfactor = resolution / 72 + local scalefactor = 72 / resolution / 10 + local factor = widthfactor / 65536 + local function pktopdf(glyph,data) + return convert(glyph,data,factor) -- return pdfcode, width + end + return result.glyphs, scalefactor, pktopdf, false, false end -- not scaling in svg but here using a cm might be more efficient in terms of bytes @@ -1576,7 +1581,8 @@ do local units = details.parameters.units local factor = units * bpfactor / scale local fixdepth = pdfshapes.fixdepth - local function pdftopdf(glyph,width,data) + local function pdftopdf(glyph,data) + local width = data.width or 0 local image = copypage(pdfdoc,glyph) embedimage(image) width = width * factor @@ -1587,7 +1593,7 @@ do local depth = data.depth or 0 local height = data.height or 0 if depth ~= 0 or height ~= 0 then - return f_stream_d(width,(-height-depth)*factor,pdf), width + return f_image_d(width,(-height-depth)*factor,name), width end end return f_image(width,name), width @@ -1598,7 +1604,7 @@ do local function getresources() return pdfdictionary { XObject = xforms } end - return pdfshapes, 1, 1/units, pdftopdf, closepdf, getresources + return pdfshapes, 1/units, pdftopdf, closepdf, getresources end end @@ -1614,7 +1620,8 @@ do local units = details.parameters.units local factor = units * bpfactor / scale local fixdepth = mpshapes.fixdepth - local function mpstopdf(mp,width,data) + local function mpstopdf(mp,data) + local width = data.width if decompress then mp = decompress(mp) end @@ -1634,7 +1641,7 @@ do serialize = false, } end - return mpshapes, 1, 1/units, mpstopdf, nil, getresources + return mpshapes, 1/units, mpstopdf, false, getresources end end @@ -1654,7 +1661,8 @@ do local xforms = pdfdictionary() local nofglyphs = 0 if pngshapes then - local function pngtopdf(glyph,width,data) + local function pngtopdf(glyph,data) + local width = data.width local info = graphics.identifiers.png(glyph.data,"string") local image = lpdf.injectors.png(info,"string") embedimage(image) @@ -1671,7 +1679,7 @@ do local function getresources() return pdfdictionary { XObject = xforms } end - return pngshapes, 1, 1, pngtopdf, closepng, getresources + return pngshapes, 1, pngtopdf, closepng, getresources end end @@ -1680,7 +1688,7 @@ do local colrvalues = details.properties.indexdata[2] local usedfonts = { } local dd = details.fontdata.descriptions -- temp hack - local function colrtopdf(description,wd,data) -- todo: chardata instead of descriptions + local function colrtopdf(description,data) -- descriptions by index local colorlist = description.colors if colorlist then @@ -1717,7 +1725,7 @@ do fontprefix = "V", } end - return colrshapes, 1, 1, colrtopdf, false, getresources + return colrshapes, 1, colrtopdf, false, getresources end mainwriters["type3"] = function(details) @@ -1728,8 +1736,7 @@ do if not method then return end - local glyphs, widthfactor, scalefactor, - glyphtopdf, reset, getresources = method(basedfontname,details) + local glyphs, scalefactor, glyphtopdf, reset, getresources = method(basedfontname,details) if not glyphs then return end @@ -1770,12 +1777,8 @@ do local name = f_index(index) local glyph = glyphs[index] if glyph then - local width = widthfactor * data.width - local stream, wd = glyphtopdf(glyph,width,data) + local stream, width = glyphtopdf(glyph,data) if stream then - if wd then - width = wd - end if index - 1 ~= lastindex then d = d + 1 differences[d] = index end diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf Binary files differindex 9298a31e7..e62e508a4 100644 --- a/tex/context/base/mkiv/status-files.pdf +++ b/tex/context/base/mkiv/status-files.pdf diff --git a/tex/context/base/mkiv/status-lua.pdf b/tex/context/base/mkiv/status-lua.pdf Binary files differindex 6f7d7e6b5..b84c61b2e 100644 --- a/tex/context/base/mkiv/status-lua.pdf +++ b/tex/context/base/mkiv/status-lua.pdf diff --git a/tex/context/base/mkiv/syst-aux.mkxl b/tex/context/base/mkiv/syst-aux.mkxl index c14e03008..7ade250d9 100644 --- a/tex/context/base/mkiv/syst-aux.mkxl +++ b/tex/context/base/mkiv/syst-aux.mkxl @@ -5957,6 +5957,41 @@ % \setmeasure {xxx}{1cm} %D \macros +%D {definequantity} +%D +%D These do the same but for numbers. + +\installsystemnamespace{quantity} + +\unexpanded\def\definequantity + {\dodoubleargument\syst_helpers_define_quantity} + +\def\syst_helpers_define_quantity[#1][#2]% + {\expandafter\def\csname\??quantity#1\endcsname{#2}} + +\unexpanded\def\freezequantity + {\dodoubleargument\syst_helpers_freeze_quantity} + +\def\syst_helpers_freeze_quantity[#1][#2]% + {\expandafter\edef\csname\??quantity#1\endcsname{\the\numexpr#2}} + +\unexpanded\def\setquantity #1#2{\expandafter\def \csname\??quantity#1\endcsname{#2}} % quick way +\unexpanded\def\setgquantity#1#2{\expandafter\gdef\csname\??quantity#1\endcsname{#2}} % quick way +\unexpanded\def\setequantity#1#2{\expandafter\edef\csname\??quantity#1\endcsname{\the\numexpr#2}} % quick way +\unexpanded\def\setxquantity#1#2{\expandafter\xdef\csname\??quantity#1\endcsname{\the\numexpr#2}} % quick way + +\def\quantity + {\the\quantitied} + +\def\quantitied#1% + {\numexpr\ifcsname\??quantity#1\endcsname\lastnamedcs\else\zeropoint\fi\relax} + +\def\directquantity#1% + {\the\numexpr#1\relax} + +% let\quantified\quantitied + +%D \macros %D {dividedsize} %D %D This one can be used inside a measure (used in m4all): diff --git a/tex/context/interface/mkiv/i-context.pdf b/tex/context/interface/mkiv/i-context.pdf Binary files differindex 8aeaeaf09..8471d15b4 100644 --- a/tex/context/interface/mkiv/i-context.pdf +++ b/tex/context/interface/mkiv/i-context.pdf diff --git a/tex/context/interface/mkiv/i-readme.pdf b/tex/context/interface/mkiv/i-readme.pdf Binary files differindex 66f97e2ec..87356b5f9 100644 --- a/tex/context/interface/mkiv/i-readme.pdf +++ b/tex/context/interface/mkiv/i-readme.pdf diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index f23352419..9e38b5e5c 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/01/19 10:36:53 +-- merge date : 10/02/19 12:43:06 do -- begin closure to overcome local limits and interference |