diff options
author | Karl Berry <karl@freefriends.org> | 2017-05-10 17:56:24 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2017-05-10 17:56:24 +0000 |
commit | 347d616d3cb26d19d9c79f8b0439712cf5f9012b (patch) | |
tree | 7e7766f16f342eb6a8fb4824d3c9e8376a65f2f1 /Master/texmf-dist/tex/context | |
parent | b74dd6fa976d54286d0465def3cbd3a725770307 (diff) |
context (May 9 10:39)
git-svn-id: svn://tug.org/texlive/trunk@44279 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context')
18 files changed, 264 insertions, 108 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkii/cont-new.mkii b/Master/texmf-dist/tex/context/base/mkii/cont-new.mkii index d75587f5661..293a87f1957 100644 --- a/Master/texmf-dist/tex/context/base/mkii/cont-new.mkii +++ b/Master/texmf-dist/tex/context/base/mkii/cont-new.mkii @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2017.05.06 23:06} +\newcontextversion{2017.05.09 10:14} %D This file is loaded at runtime, thereby providing an %D excellent place for hacks, patches, extensions and new diff --git a/Master/texmf-dist/tex/context/base/mkii/context.mkii b/Master/texmf-dist/tex/context/base/mkii/context.mkii index dfbd7e33a06..ee0cb8adf20 100644 --- a/Master/texmf-dist/tex/context/base/mkii/context.mkii +++ b/Master/texmf-dist/tex/context/base/mkii/context.mkii @@ -20,7 +20,7 @@ %D your styles an modules. \edef\contextformat {\jobname} -\edef\contextversion{2017.05.06 23:06} +\edef\contextversion{2017.05.09 10:14} %D For those who want to use this: diff --git a/Master/texmf-dist/tex/context/base/mkiv/cont-new.mkiv b/Master/texmf-dist/tex/context/base/mkiv/cont-new.mkiv index c539cac7e4e..8412a0bce13 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/cont-new.mkiv +++ b/Master/texmf-dist/tex/context/base/mkiv/cont-new.mkiv @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2017.05.06 23:06} +\newcontextversion{2017.05.09 10:14} %D This file is loaded at runtime, thereby providing an excellent place for %D hacks, patches, extensions and new features. diff --git a/Master/texmf-dist/tex/context/base/mkiv/context.mkiv b/Master/texmf-dist/tex/context/base/mkiv/context.mkiv index bc713993f04..be0623bd439 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/context.mkiv +++ b/Master/texmf-dist/tex/context/base/mkiv/context.mkiv @@ -39,7 +39,7 @@ %D up and the dependencies are more consistent. \edef\contextformat {\jobname} -\edef\contextversion{2017.05.06 23:06} +\edef\contextversion{2017.05.09 10:14} \edef\contextkind {beta} %D For those who want to use this: diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-dsp.lua b/Master/texmf-dist/tex/context/base/mkiv/font-dsp.lua index d43348cdfb1..b46e1b82cd2 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/font-dsp.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/font-dsp.lua @@ -307,11 +307,13 @@ end) -- italic = "ital", -- }, "self") +-- todo: spaces in name but not before : + local pattern = lpeg.Cf ( lpeg.Ct("") * lpeg.Cg ( --(lpeg.R("az")^1/names) * lpeg.S(" :") * - lpeg.C(lpeg.R("az")^1) * lpeg.S(" :=") * + lpeg.C((lpeg.R("az","09")+lpeg.P(" "))^1) * lpeg.S(" :=") * (lpeg.patterns.number/tonumber) * lpeg.S(" ,")^0 )^1, rawset ) @@ -371,7 +373,10 @@ local function getaxisscale(segments,minimum,default,maximum,user) local e for i=1,#segments do local s = segments[i] - if s[1] >= default then + if type(s) ~= "number" then + report("using default axis scale") + return default + elseif s[1] >= default then if s[2] == default then return default else @@ -3329,7 +3334,7 @@ function readers.stat(f,fontdata,specification) end -- The avar table is optional and used in combination with fvar. Given the --- detailed explanation about bad valeus we expect the worst and do some +-- detailed explanation about bad values we expect the worst and do some -- checking. function readers.avar(f,fontdata,specification) @@ -3337,7 +3342,7 @@ function readers.avar(f,fontdata,specification) if tableoffset then local function collect() - local nofvalues = readulong(f) + local nofvalues = readushort(f) local values = { } local lastfrom = false local lastto = false @@ -3349,7 +3354,7 @@ function readers.avar(f,fontdata,specification) -- ignore else values[#values+1] = { f, t } - lasfrom, lastto = f, t + lastfrom, lastto = f, t end end nofvalues = #values @@ -3358,7 +3363,7 @@ function readers.avar(f,fontdata,specification) if some[1] == -1 and some[2] == -1 then some = values[nofvalues] if some[1] == 1 and some[2] == 1 then - for i=2,size-1 do + for i=2,nofvalues-1 do some = values[i] if some[1] == 0 and some[2] == 0 then return values @@ -3370,10 +3375,11 @@ function readers.avar(f,fontdata,specification) return false end - local version = readulong(f) -- 1.0 - local reserved = readulong(f) - local nofaxis = readulong(f) - local segments = { } + local majorversion = readushort(f) -- 1 + local minorversion = readushort(f) -- 0 + local reserved = readushort(f) + local nofaxis = readushort(f) + local segments = { } for i=1,nofaxis do segments[i] = collect() end @@ -3403,9 +3409,9 @@ function readers.fvar(f,fontdata,specification) for i=1,nofaxis do axis[i] = { tag = readtag(f), -- ital opsz slnt wdth wght - minimum = readfixed(f), -- we get weird values from a test font ... to be checked - default = readfixed(f), -- idem - maximum = readfixed(f), -- idem + minimum = readfixed(f), + default = readfixed(f), + maximum = readfixed(f), flags = readushort(f), name = lower(extras[readushort(f)] or "bad name"), } @@ -3425,10 +3431,6 @@ function readers.fvar(f,fontdata,specification) local flags = readushort(f) -- 0, not used yet local values = { } for i=1,nofaxis do - -- depends on what we want to see: - -- - -- values[axis[i].tag] = readfixed(f) - -- values[i] = { axis = axis[i].tag, value = readfixed(f), @@ -3516,6 +3518,7 @@ function readers.hvar(f,fontdata,specification) innerindex[i] = band(mapdata,innermask) end -- use last entry when no match i + setvariabledata(fontdata,"hvarwidths",true) local glyphs = fontdata.glyphs for i=0,fontdata.nofglyphs-1 do local glyph = glyphs[i] diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-otr.lua b/Master/texmf-dist/tex/context/base/mkiv/font-otr.lua index 977be70a6a5..3addf332493 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/font-otr.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/font-otr.lua @@ -2075,6 +2075,39 @@ local function readdata(f,offset,specification) if variablefonts_supported then + local variabledata = fontdata.variabledata + + if variabledata then + local instances = variabledata.instances + local axis = variabledata.axis + if axis and (not instances or #instances == 0) then + instances = { } + variabledata.instances = instances + local function add(n,subfamily,value) + local values = { } + for i=1,#axis do + local a = axis[i] + values[i] = { + axis = a.tag, + value = i == n and value or a.default, + } + end + instances[#instances+1] = { + subfamily = subfamily, + values = values, + } + end + for i=1,#axis do + local a = axis[i] + local tag = a.tag + add(i,"default"..tag,a.default) + add(i,"minimum"..tag,a.minimum) + add(i,"maximum"..tag,a.maximum) + end + -- report("%i fake instances added",#instances) + end + end + if not specification.factors then local instance = specification.instance if type(instance) == "string" then @@ -2089,19 +2122,19 @@ local function readdata(f,offset,specification) end end end + if not fontdata.factors then if fontdata.variabledata then local factors = helpers.getfactors(fontdata,true) if factors then specification.factors = factors - fontdata.factors = factors - fontdata.instance = instance - report("font instance: %s, factors: % t",instance,factors) + fontdata.factors = factors + report("factors: % t",factors) else - report("user instance: %s, bad factors",instance) + report("bad factors") end else - report("unknown instance") + -- report("unknown instance") end end diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-sym.mkvi b/Master/texmf-dist/tex/context/base/mkiv/font-sym.mkvi index c1ffd6361ae..0e709f161a7 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/font-sym.mkvi +++ b/Master/texmf-dist/tex/context/base/mkiv/font-sym.mkvi @@ -173,6 +173,8 @@ \unexpanded\def\getnamedglyphdirect#fontname#character{{\setdirectsymbolicfont{#fontname}\clf_fontchar{#character}}} \unexpanded\def\getglyphstyled #fontname#character{{\setstyledsymbolicfont{#fontname}\doifelsenumber{#character}\char\donothing#character}} \unexpanded\def\getglyphdirect #fontname#character{{\setdirectsymbolicfont{#fontname}\doifelsenumber{#character}\char\donothing#character}} +\unexpanded\def\resolvedglyphstyled#fontname#character{{\setstyledsymbolicfont{#fontname}\clf_tochar{#character}}} +\unexpanded\def\resolvedglyphdirect#fontname#character{{\setdirectsymbolicfont{#fontname}\clf_tochar{#character}}} % this one is wrong: diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-ttf.lua b/Master/texmf-dist/tex/context/base/mkiv/font-ttf.lua index 290a3dfe879..37b30f31448 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/font-ttf.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/font-ttf.lua @@ -40,6 +40,8 @@ local concat = table.concat local report = logs.reporter("otf reader","ttf") +local trace_deltas = false + local readers = fonts.handlers.otf.readers local streamreader = readers.streamreader @@ -154,14 +156,15 @@ end -- We had two loops (going backward) but can do it in one loop .. but maybe we -- should only accept fonts with proper hvar tables. -local function applyaxis(glyph,shape,points,deltas) +local function applyaxis(glyph,shape,deltas,dowidth) + local points = shape.points if points then local nofpoints = #points --- local h = nofpoints + 2 -- weird, the example font seems to have left first --- ----- l = nofpoints + 2 --- ----- v = nofpoints + 3 --- ----- t = nofpoints + 4 --- local width = glyph.width + local h = nofpoints + 1 -- weird, the example font seems to have left first + ----- l = nofpoints + 2 + ----- v = nofpoints + 3 + ----- t = nofpoints + 4 + local width = dowidth and glyph.width -- what if hvar for i=1,#deltas do local deltaset = deltas[i] local xvalues = deltaset.xvalues @@ -176,30 +179,22 @@ local function applyaxis(glyph,shape,points,deltas) local p = points[d] if p then if xvalues then - local x = xvalues[d] + local x = xvalues[i] if x and x ~= 0 then p[1] = p[1] + factor * x end end if yvalues then - local y = yvalues[d] + local y = yvalues[i] if y and y ~= 0 then p[2] = p[2] + factor * y end end - elseif width then --- weird one-off and bad values --- --- if d == h then --- print("index",d) --- inspect(dpoints) --- inspect(xvalues) --- local x = xvalues[i] --- if x then --- print("phantom h advance",width,factor*x) --- width = width + factor * x --- end --- end + elseif width then -- and p == h then + local x = xvalues[d+1] + if x then + width = width + factor * x + end end end else @@ -218,10 +213,24 @@ local function applyaxis(glyph,shape,points,deltas) end end end --- todo : phantom point hadvance + if width then + local x = xvalues[h] + if x then + width = width + factor * x + end + end end end --- glyph.width = width + -- for i=1,nofpoints do + -- local p = points[i] + -- p[1] = round(p[1]) + -- p[2] = round(p[2]) + -- end + if width then + glyph.width = width + end + else + report("no points for glyph %a",glyph.name) end end @@ -935,8 +944,10 @@ local function readpoints(f) else if count < 128 then -- no second byte, use count + elseif bittest(count,0x80) then + count = band(count,0x7F) * 256 + readbyte(f) else - count = band(count,0x80) * 256 + readbyte(f) + -- bad news end local points = { } local p = 0 @@ -1055,15 +1066,16 @@ function readers.gvar(f,fontdata,specification,glyphdata,shapedata) local data = { } local tuples = { } local glyphdata = fontdata.glyphs + local dowidth = fontdata.variabledata.hvarwidths -- there is one more offset (so that one can calculate the size i suppose) -- so we could test for overflows but we simply assume sane font files if bittest(flags,0x0001) then - for i=1,nofglyphs do - data[i] = readulong(f) + for i=1,nofglyphs+1 do + data[i] = dataoffset + readulong(f) end else - for i=1,nofglyphs do - data[i] = 2*readushort(f) + for i=1,nofglyphs+1 do + data[i] = dataoffset + 2*readushort(f) end end -- @@ -1073,15 +1085,22 @@ function readers.gvar(f,fontdata,specification,glyphdata,shapedata) tuples[i] = readtuplerecord(f,nofaxis) end end - local lastoffset = false + local nextoffset = false + local startoffset = data[1] for i=1,nofglyphs do -- hm one more cf spec - local startoffset = dataoffset + data[i] - if startoffset == lastoffset then - -- no deltas + nextoffset = data[i+1] + local glyph = glyphdata[i-1] + local name = trace_deltas and glyph.name + if startoffset == nextoffset then + if name then + report("no deltas for glyph %a",name) + end else local shape = shapedata[i-1] -- todo 0 if not shape then - -- no shape + if name then + report("no shape for glyph %a",name) + end else lastoffset = startoffset setposition(f,startoffset) @@ -1121,7 +1140,7 @@ function readers.gvar(f,fontdata,specification,glyphdata,shapedata) -- advance = advance + 2*nofaxis else if index+1 > #tuples then - print("error, bad index",index) + report("error, bad tuple index",index) end peak = tuples[index+1] -- hm, needs checking, only peak? end @@ -1182,7 +1201,11 @@ function readers.gvar(f,fontdata,specification,glyphdata,shapedata) -- * 1 end end - if s ~= 0 then + if s == 0 then + if name then + report("no deltas applied for glyph %a",name) + end + else deltas[#deltas+1] = { factor = s, points = points, @@ -1192,21 +1215,11 @@ function readers.gvar(f,fontdata,specification,glyphdata,shapedata) end end if shape.type == "glyph" then --- if fontdata.glyphs[i-1].name == "X" then --- if deltas then --- for i=1,#deltas do --- local d = deltas[i] --- local x = d.xvalues --- local y = d.yvalues --- if x and y then --- for i=1,#x do --- print(i-1,x[i],y[i]) --- end --- end --- end --- end +-- if glyph.name == "u1f31d" then +-- if glyph.unicode == 127773 then +-- inspect(deltas) -- end - applyaxis(glyphdata[i],shape,shape.points,deltas) + applyaxis(glyph,shape,deltas,dowidth) else -- todo: args_are_xy_values mess .. i have to be really bored -- and motivated to deal with it @@ -1214,6 +1227,7 @@ function readers.gvar(f,fontdata,specification,glyphdata,shapedata) end end end + startoffset = nextoffset end end end diff --git a/Master/texmf-dist/tex/context/base/mkiv/status-files.pdf b/Master/texmf-dist/tex/context/base/mkiv/status-files.pdf Binary files differindex 0440c4cd837..c6da00b9129 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/status-files.pdf +++ b/Master/texmf-dist/tex/context/base/mkiv/status-files.pdf diff --git a/Master/texmf-dist/tex/context/base/mkiv/status-lua.pdf b/Master/texmf-dist/tex/context/base/mkiv/status-lua.pdf Binary files differindex db8b36d2f05..89f2632f33a 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/status-lua.pdf +++ b/Master/texmf-dist/tex/context/base/mkiv/status-lua.pdf diff --git a/Master/texmf-dist/tex/context/base/mkiv/util-fil.lua b/Master/texmf-dist/tex/context/base/mkiv/util-fil.lua index de3c999b72e..01bcd571e9a 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/util-fil.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/util-fil.lua @@ -195,23 +195,41 @@ function files.readinteger4le(f) end end +-- function files.readfixed2(f) +-- local a, b = byte(f:read(2),1,2) +-- if a >= 0x80 then +-- return (0x100 * a + b - 0x10000)/256.0 +-- else +-- return (0x100 * a + b)/256.0 +-- end +-- end + function files.readfixed2(f) local a, b = byte(f:read(2),1,2) if a >= 0x80 then - return (0x100 * a + b - 0x10000)/256.0 + return (a - 0x100) + b/0x100 else - return (0x100 * a + b)/256.0 + return (a ) + b/0x100 end end -- (real) (n>>16) + ((n&0xffff)/65536.0)) +-- function files.readfixed4(f) +-- local a, b, c, d = byte(f:read(4),1,4) +-- if a >= 0x80 then +-- return (0x1000000 * a + 0x10000 * b + 0x100 * c + d - 0x100000000)/65536.0 +-- else +-- return (0x1000000 * a + 0x10000 * b + 0x100 * c + d)/65536.0 +-- end +-- end + function files.readfixed4(f) local a, b, c, d = byte(f:read(4),1,4) if a >= 0x80 then - return (0x1000000 * a + 0x10000 * b + 0x100 * c + d - 0x100000000)/65536.0 + return (0x100 * a + b - 0x10000) + (0x100 * c + d)/0x10000 else - return (0x1000000 * a + 0x10000 * b + 0x100 * c + d)/65536.0 + return (0x100 * a + b ) + (0x100 * c + d)/0x10000 end end @@ -281,8 +299,8 @@ if fio and fio.readcardinal1 then files.readinteger2 = fio.readinteger2 files.readinteger3 = fio.readinteger3 files.readinteger4 = fio.readinteger4 - files.readfixed2 = fio.readfixed2 - files.readfixed4 = fio.readfixed4 + -- files.readfixed2 = fio.readfixed2 -- needs recent luatex + -- files.readfixed4 = fio.readfixed4 -- needs recent luatex files.read2dot14 = fio.read2dot14 files.setposition = fio.setposition files.getposition = fio.getposition diff --git a/Master/texmf-dist/tex/context/base/mkiv/util-sac.lua b/Master/texmf-dist/tex/context/base/mkiv/util-sac.lua index 50bb14d3557..b509d9a9b7c 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/util-sac.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/util-sac.lua @@ -239,9 +239,9 @@ function streams.readfixed4(f) f[2] = j + 1 local a, b, c, d = byte(f[1],i,j) if a >= 0x80 then - return (0x1000000 * a + 0x10000 * b + 0x100 * c + d - 0x100000000)/65536.0 + return (0x100 * a + b - 0x10000) + (0x100 * c + d)/0x10000 else - return (0x1000000 * a + 0x10000 * b + 0x100 * c + d)/65536.0 + return (0x100 * a + b ) + (0x100 * c + d)/0x10000 end end @@ -251,9 +251,9 @@ function streams.readfixed2(f) f[2] = j + 1 local a, b = byte(f[1],i,j) if a >= 0x80 then - return (0x100 * a + b - 0x10000)/256.0 + return (a - 0x100) + b/0x100 else - return (0x100 * a + b)/256.0 + return (a ) + b/0x100 end end @@ -300,7 +300,7 @@ if sio and sio.readcardinal2 then local readfixed4 = sio.readfixed4 local read2dot14 = sio.read2dot14 local readbytes = sio.readbytes - local readbytetable = sio.readbytetable + local readbytetable = sio.readbytetable function streams.readcardinal1(f) local i = f[2] @@ -342,16 +342,16 @@ if sio and sio.readcardinal2 then f[2] = i + 4 return readinteger4(f[1],i) end - function streams.readfixed2(f) - local i = f[2] - f[2] = i + 2 - return readfixed2(f[1],i) - end - function streams.readfixed4(f) - local i = f[2] - f[2] = i + 4 - return readfixed4(f[1],i) - end + -- function streams.readfixed2(f) -- needs recent luatex + -- local i = f[2] + -- f[2] = i + 2 + -- return readfixed2(f[1],i) + -- end + -- function streams.readfixed4(f) -- needs recent luatex + -- local i = f[2] + -- f[2] = i + 4 + -- return readfixed4(f[1],i) + -- end function streams.read2dot4(f) local i = f[2] f[2] = i + 2 diff --git a/Master/texmf-dist/tex/context/interface/mkiv/context-en.xml b/Master/texmf-dist/tex/context/interface/mkiv/context-en.xml index 34eb5c821f5..e8353dbdce3 100644 --- a/Master/texmf-dist/tex/context/interface/mkiv/context-en.xml +++ b/Master/texmf-dist/tex/context/interface/mkiv/context-en.xml @@ -11748,6 +11748,26 @@ </cd:keywords> </cd:arguments> </cd:command> + <cd:command file="font-sym.mkvi" name="resolvedglyphstyled"> + <cd:arguments> + <cd:keywords delimiters="braces"> + <cd:constant type="cd:font"/> + </cd:keywords> + <cd:keywords delimiters="braces"> + <cd:constant type="cd:text"/> + </cd:keywords> + </cd:arguments> + </cd:command> + <cd:command file="font-sym.mkvi" name="resolvedglyphdirect"> + <cd:arguments> + <cd:keywords delimiters="braces"> + <cd:constant type="cd:font"/> + </cd:keywords> + <cd:keywords delimiters="braces"> + <cd:constant type="cd:text"/> + </cd:keywords> + </cd:arguments> + </cd:command> <cd:command file="font-sym.mkvi" name="setfont"> <cd:arguments> <cd:keywords delimiters="none"> diff --git a/Master/texmf-dist/tex/context/interface/mkiv/i-context.pdf b/Master/texmf-dist/tex/context/interface/mkiv/i-context.pdf Binary files differindex 17ac84dd3e0..361ff877c8b 100644 --- a/Master/texmf-dist/tex/context/interface/mkiv/i-context.pdf +++ b/Master/texmf-dist/tex/context/interface/mkiv/i-context.pdf diff --git a/Master/texmf-dist/tex/context/interface/mkiv/i-fonts.xml b/Master/texmf-dist/tex/context/interface/mkiv/i-fonts.xml index 434d1f69420..c246905f046 100644 --- a/Master/texmf-dist/tex/context/interface/mkiv/i-fonts.xml +++ b/Master/texmf-dist/tex/context/interface/mkiv/i-fonts.xml @@ -1406,6 +1406,24 @@ </cd:arguments> </cd:command> + <cd:command name="resolvedglyphstyled" file="font-sym.mkvi"> + <cd:arguments> + <cd:resolve name="argument-font"/> + <cd:keywords delimiters="braces"> + <cd:constant type="cd:text"/> + </cd:keywords> + </cd:arguments> + </cd:command> + + <cd:command name="resolvedglyphdirect" file="font-sym.mkvi"> + <cd:arguments> + <cd:resolve name="argument-font"/> + <cd:keywords delimiters="braces"> + <cd:constant type="cd:text"/> + </cd:keywords> + </cd:arguments> + </cd:command> + <cd:command name="setfont" file="font-sym.mkvi"> <cd:arguments> <cd:resolve name="string-font"/> diff --git a/Master/texmf-dist/tex/context/interface/mkiv/i-readme.pdf b/Master/texmf-dist/tex/context/interface/mkiv/i-readme.pdf Binary files differindex 9b3f5127dee..32a57f49721 100644 --- a/Master/texmf-dist/tex/context/interface/mkiv/i-readme.pdf +++ b/Master/texmf-dist/tex/context/interface/mkiv/i-readme.pdf diff --git a/Master/texmf-dist/tex/context/modules/mkiv/s-fonts-variable.lua b/Master/texmf-dist/tex/context/modules/mkiv/s-fonts-variable.lua index d4e3244a94a..2b2aa1dfc35 100644 --- a/Master/texmf-dist/tex/context/modules/mkiv/s-fonts-variable.lua +++ b/Master/texmf-dist/tex/context/modules/mkiv/s-fonts-variable.lua @@ -23,6 +23,7 @@ function moduledata.fonts.variable.showvariations(specification) specification = interfaces.checkedspecification(specification) local fontfile = specification.font + local maximum = tonumber(specification.max) or 0xFFFF local fontname = format("testfont-%s",i) local fontsize = tex.dimen.bodyfontsize if not fontfile then @@ -51,6 +52,10 @@ function moduledata.fonts.variable.showvariations(specification) -- return -- end +if not fontdata.shared.rawdata.metadata.fullname then + fontdata.shared.rawdata.metadata.fullname = fontdata.shared.rawdata.metadata.fontname +end + context.starttitle { title = fontdata.shared.rawdata.metadata.fullname } local parameters = fontdata.parameters @@ -224,16 +229,30 @@ function moduledata.fonts.variable.showvariations(specification) end context.stopsubject() + local sample = specification.sample + for i=1,#collected do local instance = collected[i] context.startsubject { title = instance } context.start() context.definedfont { "name:" .. instance .. "*default" } - context.input("zapf.tex") + if sample and sample ~= "" then + context(sample) + else + context.input("zapf.tex") + end context.par() context.stop() context.stopsubject() + + if i > maximum then + context.startsubject { title = "And so on" } + context("no more than %i instances are shown",maximum) + context.par() + context.stopsubject() + break + end end -- local function showregions(tag) diff --git a/Master/texmf-dist/tex/context/modules/mkiv/s-fonts-variable.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/s-fonts-variable.mkiv index 7779eb701b0..6b84c2ebb33 100644 --- a/Master/texmf-dist/tex/context/modules/mkiv/s-fonts-variable.mkiv +++ b/Master/texmf-dist/tex/context/modules/mkiv/s-fonts-variable.mkiv @@ -36,7 +36,29 @@ \starttext + \startbuffer[zycon] + \char008986\relax\quad + \char009728\relax\quad + \char010031\relax\quad + \char010143\relax\quad + \char011044\relax\quad + \char127773\relax\quad + \char127989\relax\quad + \char128008\relax\quad + \char128021\relax\quad + \char128034\relax\quad + \char128161\relax\quad + \char128274\relax\quad + \char128347\relax\quad + \char128400\relax\quad + \char128692\relax\quad + \char129417\relax\quad + \char129422\relax\quad + \char983040\relax\par + \stopbuffer + % \showfontkerns +% \showglyphs \showfontvariations [font=file:adobevfprototype.otf] @@ -44,23 +66,30 @@ \showfontvariations [font=file:avenirnextvariable.ttf] -% \showfontvariations -% [font=file:kairossansvariable.ttf] + \showfontvariations + [font=file:DecoVar-VF.ttf] + + \showfontvariations + [font=file:VotoSerifGX.ttf, + max=15] -% \showfontvariations -% [font=file:sourcecode-regular.otf] + \showfontvariations + [font=file:Selawik-Variable.ttf] -% \showfontvariations -% [font=file:AmstelvarAlpha-VF.ttf] + \showfontvariations + [font=file:LibreFranklinGX-Romans.ttf] \showfontvariations - [font=file:DecoVar-VF.ttf] + [font=file:Zycon.ttf, + sample={\getbuffer[zycon]}] - % This is Adam's version of noto .. has lots of instances so it takes a while - % the first time. Looks like I do somethign wrong (bad a's and widths). + % \showfontvariations + % [font=file:kairossansvariable.ttf] -% \showfontvariations -% [font=file:VotoSerifGX.ttf] + % \showfontvariations + % [font=file:sourcecode-regular.otf] + % \showfontvariations + % [font=file:AmstelvarAlpha-VF.ttf] \stoptext |