From 8d3701ff9eeacb5b724498029b61598114d8e37d Mon Sep 17 00:00:00 2001 From: Marius Date: Sat, 18 May 2013 02:00:21 +0300 Subject: beta 2013.05.18 00:46 --- tex/context/base/cont-fil.mkiv | 3 + tex/context/base/cont-new.mkiv | 2 +- tex/context/base/context-version.pdf | Bin 4133 -> 4127 bytes tex/context/base/context.mkiv | 2 +- tex/context/base/file-mod.mkvi | 13 + tex/context/base/font-con.lua | 2 +- tex/context/base/font-ctx.lua | 65 ++++- tex/context/base/font-otb.lua | 4 +- tex/context/base/l-pdfview.lua | 7 +- tex/context/base/l-table.lua | 2 +- tex/context/base/mult-low.lua | 2 +- tex/context/base/s-art-01.mkiv | 32 ++- tex/context/base/s-fnt-10.mkiv | 2 + tex/context/base/s-fnt-11.mkiv | 81 ------ tex/context/base/s-fnt-23.mkiv | 288 --------------------- tex/context/base/s-fnt-30.mkiv | 54 ---- tex/context/base/s-fonts-coverage.lua | 113 ++++++++ tex/context/base/s-fonts-coverage.mkiv | 131 ++++++++++ tex/context/base/s-fonts-features.lua | 89 ++++++- tex/context/base/s-fonts-features.mkiv | 57 +++- tex/context/base/s-fonts-shapes.lua | 268 +++++++++++++++++++ tex/context/base/s-fonts-shapes.mkiv | 75 +++++- tex/context/base/s-fonts-system.lua | 68 +++++ tex/context/base/s-fonts-system.mkiv | 39 +++ tex/context/base/s-math-coverage.lua | 98 +------ tex/context/base/s-math-coverage.mkiv | 106 +------- tex/context/base/status-files.pdf | Bin 24727 -> 24754 bytes tex/context/base/status-lua.pdf | Bin 211857 -> 211738 bytes tex/context/base/status-mkiv.lua | 28 +- tex/context/base/syst-aux.mkiv | 2 + tex/context/base/x-set-02.mkii | 2 +- tex/generic/context/luatex/luatex-fonts-merged.lua | 6 +- 32 files changed, 969 insertions(+), 672 deletions(-) delete mode 100644 tex/context/base/s-fnt-11.mkiv delete mode 100644 tex/context/base/s-fnt-23.mkiv delete mode 100644 tex/context/base/s-fnt-30.mkiv create mode 100644 tex/context/base/s-fonts-coverage.lua create mode 100644 tex/context/base/s-fonts-coverage.mkiv create mode 100644 tex/context/base/s-fonts-system.lua create mode 100644 tex/context/base/s-fonts-system.mkiv (limited to 'tex') diff --git a/tex/context/base/cont-fil.mkiv b/tex/context/base/cont-fil.mkiv index 93a135170..8e9be155b 100644 --- a/tex/context/base/cont-fil.mkiv +++ b/tex/context/base/cont-fil.mkiv @@ -111,7 +111,10 @@ \definefilesynonym [mat-20] [math-parameters] \definefilesynonym [fnt-25] [math-characters] \definefilesynonym [fnt-28] [fonts-goodies] +\definefilesynonym [fnt-31] [fonts-coverage] \definefilesynonym [mat-10] [math-characters] \definefilesynonym [mat-11] [math-characters] +\definefilesynonym [fnt-11] [fonts-system] +\definefilesynonym [fnt-23] [fonts-shapes] \endinput diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv index 8574253c9..192764258 100644 --- a/tex/context/base/cont-new.mkiv +++ b/tex/context/base/cont-new.mkiv @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2013.05.16 23:48} +\newcontextversion{2013.05.18 00:46} %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/context-version.pdf b/tex/context/base/context-version.pdf index aea5cbfaa..d70b95eb5 100644 Binary files a/tex/context/base/context-version.pdf and b/tex/context/base/context-version.pdf differ diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv index 93569d55d..5e2602f1d 100644 --- a/tex/context/base/context.mkiv +++ b/tex/context/base/context.mkiv @@ -25,7 +25,7 @@ %D up and the dependencies are more consistent. \edef\contextformat {\jobname} -\edef\contextversion{2013.05.16 23:48} +\edef\contextversion{2013.05.18 00:46} \edef\contextkind {beta} %D For those who want to use this: diff --git a/tex/context/base/file-mod.mkvi b/tex/context/base/file-mod.mkvi index cd7970292..0dbd14bdb 100644 --- a/tex/context/base/file-mod.mkvi +++ b/tex/context/base/file-mod.mkvi @@ -271,6 +271,19 @@ \def\installmodulecommandluasingle#1#2{\unexpanded\def#1{\normalexpanded{\syst_modules_single_lua{\strippedcsname#1}{#2}}}} \def\installmodulecommandluadouble#1#2{\unexpanded\def#1{\normalexpanded{\syst_modules_double_lua{\strippedcsname#1}{#2}}}} +\unexpanded\def\syst_modules_one_lua#1#2#3% + {\directsetup{module:#1:start}% + \ctxlua{#2(\!!bs#3\!!es)}% + \directsetup{module:#1:stop}} + +\unexpanded\def\syst_modules_two_lua#1#2#3#4% + {\directsetup{module:#1:start}% + \ctxlua{#2(\!!bs#3\!!es,\!!bs#4\!!es)}% + \directsetup{module:#1:stop}} + +\def\installmodulecommandluaone #1#2{\unexpanded\def#1{\normalexpanded{\syst_modules_one_lua {\strippedcsname#1}{#2}}}} +\def\installmodulecommandluatwo #1#2{\unexpanded\def#1{\normalexpanded{\syst_modules_two_lua {\strippedcsname#1}{#2}}}} + % obsolete % % \def\documentresources{\@@erurl} diff --git a/tex/context/base/font-con.lua b/tex/context/base/font-con.lua index 618bc8f28..790d4877a 100644 --- a/tex/context/base/font-con.lua +++ b/tex/context/base/font-con.lua @@ -203,7 +203,7 @@ wasted day but an experience richer.

-- we can get rid of the tfm instance when we have fast access to the -- scaled character dimensions at the tex end, e.g. a fontobject.width --- actually we already have soem of that now as virtual keys in glyphs +-- actually we already have some of that now as virtual keys in glyphs -- -- flushing the kern and ligature tables from memory saves a lot (only -- base mode) but it complicates vf building where the new characters diff --git a/tex/context/base/font-ctx.lua b/tex/context/base/font-ctx.lua index ae42ed18e..8ae74435f 100644 --- a/tex/context/base/font-ctx.lua +++ b/tex/context/base/font-ctx.lua @@ -21,8 +21,9 @@ local sortedhash, sortedkeys, sequenced = table.sortedhash, table.sortedkeys, ta local settings_to_hash, hash_to_string = utilities.parsers.settings_to_hash, utilities.parsers.hash_to_string local formatcolumns = utilities.formatters.formatcolumns local mergehashes = utilities.parsers.mergehashes +local formatters = string.formatters -local tostring, next, type, rawget = tostring, next, type, rawget +local tostring, next, type, rawget, tonumber = tostring, next, type, rawget, tonumber local utfchar, utfbyte = utf.char, utf.byte local round = math.round @@ -56,6 +57,7 @@ local helpers = fonts.helpers local hashes = fonts.hashes local currentfont = font.current local texattribute = tex.attribute +local texdimen = tex.dimen local fontdata = hashes.identifiers local characters = hashes.chardata @@ -112,8 +114,8 @@ end -- this will move elsewhere ... -utilities.strings.formatters.add(string.formatters,"font:name", [["'"..file.basename(%s.properties.name).."'"]]) -utilities.strings.formatters.add(string.formatters,"font:features",[["'"..table.sequenced(%s," ",true).."'"]]) +utilities.strings.formatters.add(formatters,"font:name", [["'"..file.basename(%s.properties.name).."'"]]) +utilities.strings.formatters.add(formatters,"font:features",[["'"..table.sequenced(%s," ",true).."'"]]) -- ... like font-sfm or so @@ -1038,7 +1040,9 @@ function definers.define(specification) -- -- we don't care about mathsize textsize goodies fallbacks -- - if specification.cs == "" then + local cs = specification.cs + if cs == "" then + cs = nil specification.cs = nil specification.global = false elseif specification.global == nil then @@ -1049,16 +1053,18 @@ function definers.define(specification) if not tfmdata then return -1, nil elseif type(tfmdata) == "number" then - if specification.cs then - tex.definefont(specification.global,specification.cs,tfmdata) + if cs then + tex.definefont(specification.global,cs,tfmdata) + csnames[tfmdata] = cs end return tfmdata, fontdata[tfmdata] else local id = font.define(tfmdata) tfmdata.properties.id = id definers.register(tfmdata,id) - if specification.cs then - tex.definefont(specification.global,specification.cs,id) + if cs then + tex.definefont(specification.global,cs,id) + csnames[id] = cs end constructors.cleanuptable(tfmdata) constructors.finalize(tfmdata) @@ -1068,6 +1074,39 @@ function definers.define(specification) end end +-- local id, cs = fonts.definers.internal { } +-- local id, cs = fonts.definers.internal { number = 2 } +-- local id, cs = fonts.definers.internal { name = "dejavusans" } + +local n = 0 + +function definers.internal(specification) + specification = specification or { } + local name = specification.name + local size = specification.size and number.todimen(specification.size) or texdimen.bodyfontsize + local number = tonumber(specification.number) + local id = nil + if number then + id = number + elseif name and name ~= "" then + local cs = specification.cs + if not cs then + n = n + 1 -- beware ... there can be many and they are often used once + -- cs = formatters["internal font %s"](n) + cs = "internal font " .. n + end + id = definers.define { + name = name, + size = size, + cs = cs, + } + end + if not id then + id = currentfont() + end + return id, csnames[id] +end + local enable_auto_r_scale = false experiments.register("fonts.autorscale", function(v) @@ -1125,7 +1164,7 @@ function definers.resolve(specification) -- overload function in font-con.lua elseif not normal.goodies then local g = normal.goodies if g and g ~= "" then - normal.goodies = format("%s,%s",g,goodies) + normal.goodies = formatters["%s,%s"](g,goodies) else normal.goodies = goodies end @@ -1345,16 +1384,16 @@ function commands.doifelsecurrentfonthasfeature(name) -- can be made faster with commands.doifelse(f and (f.gpos[name] or f.gsub[name])) end -local p, f = 1, "%0.1fpt" -- normally this value is changed only once +local p, f = 1, formatters["%0.1fpt"] -- normally this value is changed only once local stripper = lpeg.patterns.stripzeros function commands.nbfs(amount,precision) if precision ~= p then p = precision - f = "%0." .. p .. "fpt" + f = formatters["%0." .. p .. "fpt"] end - context(lpegmatch(stripper,format(f,amount/65536))) + context(lpegmatch(stripper,f(amount/65536))) end function commands.featureattribute(tag) @@ -1516,8 +1555,6 @@ end local quads = hashes.quads local xheights = hashes.xheights -local currentfont = font.current -local texdimen = tex.dimen setmetatableindex(number.dimenfactors, function(t,k) if k == "ex" then diff --git a/tex/context/base/font-otb.lua b/tex/context/base/font-otb.lua index 6abe7c6f4..2a7b821ea 100644 --- a/tex/context/base/font-otb.lua +++ b/tex/context/base/font-otb.lua @@ -617,8 +617,8 @@ local function featuresinitializer(tfmdata,value) end end end - if basepositions then - for feature, data in next, basepositions do + if basepositionings then + for feature, data in next, basepositionings do local value = features[feature] if value then local validlookups, lookuplist = collectlookups(rawdata,feature,script,language) diff --git a/tex/context/base/l-pdfview.lua b/tex/context/base/l-pdfview.lua index e42462a3d..49c6a8c48 100644 --- a/tex/context/base/l-pdfview.lua +++ b/tex/context/base/l-pdfview.lua @@ -25,17 +25,22 @@ if os.type == "windows" then ['default'] = "pdfopen --rxi --file", ['acrobat'] = "pdfopen --rxi --file", ['fullacrobat'] = "pdfopen --axi --file", - ['okular'] = 'start "test" "c:/data/system/kde/bin/okular.exe" --unique' -- todo! + ['okular'] = 'start "test" "c:/data/system/kde/bin/okular.exe" --unique', -- todo! + ['sumatra'] = 'start "test" "c:/data/system/sumatrapdf/sumatrapdf.exe" -reuse-instance', + ['okular'] = 'start "test" "okular.exe" --unique', + ['sumatra'] = 'start "test" "sumatrapdf.exe" -reuse-instance', } closecalls= { ['default'] = "pdfclose --file", ['acrobat'] = "pdfclose --file", ['okular'] = false, + ['sumatra'] = false, } allcalls = { ['default'] = "pdfclose --all", ['acrobat'] = "pdfclose --all", ['okular'] = false, + ['sumatra'] = false, } pdfview.method = "acrobat" diff --git a/tex/context/base/l-table.lua b/tex/context/base/l-table.lua index e57abe854..9a1b97fff 100644 --- a/tex/context/base/l-table.lua +++ b/tex/context/base/l-table.lua @@ -120,7 +120,7 @@ local function sortedhash(t,cmp) if t then local s if cmp then - -- it would be nice if teh sort function would accept a third argument (or nicer, an optional first) + -- it would be nice if the sort function would accept a third argument (or nicer, an optional first) s = sortedhashkeys(t,function(a,b) return cmp(t,a,b) end) else s = sortedkeys(t) -- the robust one diff --git a/tex/context/base/mult-low.lua b/tex/context/base/mult-low.lua index 867235b33..47e31978b 100644 --- a/tex/context/base/mult-low.lua +++ b/tex/context/base/mult-low.lua @@ -239,7 +239,7 @@ return { -- "installcorenamespace", -- - "getvalue", "setvalue", "setevalue", "setgvalue", "setxvalue", "letvalue", "letgvalue", + "getvalue", "getuvalue", "setvalue", "setevalue", "setgvalue", "setxvalue", "letvalue", "letgvalue", "resetvalue", "undefinevalue", "ignorevalue", "setuvalue", "setuevalue", "setugvalue", "setuxvalue", -- diff --git a/tex/context/base/s-art-01.mkiv b/tex/context/base/s-art-01.mkiv index 34bc8c590..e2584a357 100644 --- a/tex/context/base/s-art-01.mkiv +++ b/tex/context/base/s-art-01.mkiv @@ -1,15 +1,33 @@ +\unprotect + \startmodule[art-01] -% \showframe +\definemeasure [article:margin] [\paperheight/15] +\definemeasure [overview:margin] [\paperheight/30] -\unprotect +\definelayout + [article] + [\c!topspace=\measure{article:margin}, + \c!bottomspace=\measure{article:margin}, + \c!backspace=\measure{article:margin}, + \c!header=\measure{overview:margin}, + \c!footer=0pt, + \c!width=\v!middle, + \c!height=\v!middle] -\setuplayout - [\c!topspace=2cm, - \c!bottomspace=2.5cm, + +\definelayout + [overview] + [\c!topspace=\measure{overview:margin}, + \c!bottomspace=\measure{overview:margin}, + \c!backspace=\measure{overview:margin}, + \c!header=\measure{overview:margin}, + \c!footer=0pt, \c!width=\v!middle, - \c!height=\v!middle, - \c!footer=0pt] + \c!height=\v!middle] + +\setuplayout + [article] \setupbodyfont [dejavu,10pt] % 12pt is just to large and we use this for all kind of demos diff --git a/tex/context/base/s-fnt-10.mkiv b/tex/context/base/s-fnt-10.mkiv index 0edb19120..9b6211c2b 100644 --- a/tex/context/base/s-fnt-10.mkiv +++ b/tex/context/base/s-fnt-10.mkiv @@ -11,6 +11,8 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. +% sort of obsolete + \startluacode local fontdata = fonts.hashes.identifiers diff --git a/tex/context/base/s-fnt-11.mkiv b/tex/context/base/s-fnt-11.mkiv deleted file mode 100644 index db803eefc..000000000 --- a/tex/context/base/s-fnt-11.mkiv +++ /dev/null @@ -1,81 +0,0 @@ -%D \module -%D [ file=s-fnt-11, -%D version=2006.02.01, % or so -%D title=\CONTEXT\ Style File, -%D subtitle=Listing Installed Fonts, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D This code usd to be in the kernel but since it's hardly used -%D it's now a module. -%D -%D \starttyping -%D \showinstalledfonts[officinasans.*][all] -%D \showinstalledfonts[officinaserif.*][all] -%D \showinstalledfonts[officina.*itc.*][all] -%D -%D \showinstalledfonts[officina.*itc.*][all,new] -%D \stoptyping - -\startluacode -function fonts.names.table(pattern,reload,all) - local t = fonts.names.list(pattern,reload) - if t then - local NC, NR, HL = context.NC, context.NR, context.HL - context.start() - context.nonknuthmode() - context.starttabulate { "|T|T|T|T|T|" } - NC(false,hashname) - NC(false,type) - NC(false,fontname) - NC(false,filename) - NC() NR() HL() - for v,tv in table.sortedpairs(t) do - local kind, name, file = tv[1], tv[2], tv[3] - if all or v == string.lower(name) then - if kind and name and file then - NC(false,v) - NC(false,kind) - NC(false,name) - NC(false,file) - NC() NR() - else - logs.report("font table", "skipping %s", v) - end - end - end - context.stoptabulate() - context.stop() - end -end -\stopluacode - -\unprotect - -\def\showinstalledfonts - {\dodoubleempty\doshowinstalledfonts} - -\def\doshowinstalledfonts[#1][#2]% - {\bgroup - \def\pattern{#1}% - \def\all{false}% - \def\reload{false}% - \doifnothing\pattern{\def\pattern{.*}}% - \processallactionsinset[#2][\v!new=>\def\reload{true},\v!all=>\def\all{true}]% - \ctxlua{fonts.names.table("#1",\reload,\all)}% - \egroup} - -\protect - -\continueifinputfile{s-fnt-11.mkiv} - -\starttext - -\showinstalledfonts - -\stoptext diff --git a/tex/context/base/s-fnt-23.mkiv b/tex/context/base/s-fnt-23.mkiv deleted file mode 100644 index 283f751ea..000000000 --- a/tex/context/base/s-fnt-23.mkiv +++ /dev/null @@ -1,288 +0,0 @@ -%D \module -%D [ file=s-fnt-23, -%D version=2009.03.04, -%D title=\CONTEXT\ Style File, -%D subtitle=Tracing Feature Application (3), -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\startluacode - moduledata.fonts = moduledata.fonts or { } - - local fontdata = fonts.hashes.identifiers - - local last_data = nil -- still relevant - local format = string.format - - function moduledata.fonts.show_shape(n) - local tfmdata = fontdata[font.current()] - -- local _, tfmdata = fonts.definers.define { name = fontname, size = fontsize } - last_data = tfmdata - local charnum = tonumber(n) - if not charnum then - -- charnum = tfmdata.unicodes[n] - charnum = fonts.helpers.nametoslot(n) - end - local c = tfmdata.characters[charnum] - local d = tfmdata.descriptions[charnum] - local parameters = tfmdata.parameters - if d then - local factor = (parameters.size/parameters.units)*((7200/7227)/65536) - local llx, lly, urx, ury = unpack(d.boundingbox) - llx, lly, urx, ury = llx*factor, lly*factor, urx*factor, ury*factor - local width, italic = (d.width or 0)*factor, (d.italic or 0)*factor - local top_accent, bot_accent = (d.top_accent or 0)*factor, (d.bot_accent or 0)*factor - local anchors, math = d.anchors, d.math - context.startMPcode() - context("pickup pencircle scaled .25bp ; ") - context('picture p ; p := image(draw textext.drt("\\gray\\char%s");); draw p ;',charnum) - context('draw (%s,%s)--(%s,%s)--(%s,%s)--(%s,%s)--cycle withcolor green ;',llx,lly,urx,lly,urx,ury,llx,ury) - context('draw (%s,%s)--(%s,%s) withcolor green ;',llx,0,urx,0) - context('draw boundingbox p withcolor .2white withpen pencircle scaled .065bp ;') - context("defaultscale := 0.05 ; ") - -- inefficient but non critical - local function slant_1(v,dx,dy,txt,xsign,ysign,loc,labloc) - if #v > 0 then - local l = { } - for kk, vv in ipairs(v) do - local h, k = vv.height, vv.kern - if h and k then - l[#l+1] = format("((%s,%s) shifted (%s,%s))",xsign*k*factor,ysign*h*factor,dx,dy) - end - end - context("draw ((%s,%s) shifted (%s,%s))--%s dashed (evenly scaled .25) withcolor .5white;", xsign*v[1].kern*factor,lly,dx,dy,l[1]) - context("draw laddered (%s) withcolor .5white ;",table.concat(l,"..")) - context("draw ((%s,%s) shifted (%s,%s))--%s dashed (evenly scaled .25) withcolor .5white;", xsign*v[#v].kern*factor,ury,dx,dy,l[#l]) - for k, v in ipairs(l) do - context("draw %s withcolor blue withpen pencircle scaled 1bp;",v) - end - end - end - local function slant_2(v,dx,dy,txt,xsign,ysign,loc,labloc) - if #v > 0 then - local l = { } - for kk, vv in ipairs(v) do - local h, k = vv.height, vv.kern - if h and k then - l[#l+1] = format("((%s,%s) shifted (%s,%s))",xsign*k*factor,ysign*h*factor,dx,dy) - end - end - if loc == "top" then - context('label.%s("\\type{%s}",%s shifted (0,-1bp)) ;',loc,txt,l[#l]) - else - context('label.%s("\\type{%s}",%s shifted (0,2bp)) ;',loc,txt,l[1]) - end - for kk, vv in ipairs(v) do - local h, k = vv.height, vv.kern - if h and k then - context('label.top("(%s,%s)",%s shifted (0,-2bp));',k,h,l[kk]) - end - end - end - end - if math then - local kerns = math.kerns - if kerns then - for _, slant in ipairs { slant_1, slant_2 } do - for k,v in pairs(kerns) do - if k == "top_right" then - slant(v,width+italic,0,k,1,1,"top","ulft") - elseif k == "bottom_right" then - slant(v,width,0,k,1,1,"bot","lrt") - elseif k == "top_left" then - slant(v,0,0,k,-1,1,"top","ulft") - elseif k == "bottom_left" then - slant(v,0,0,k,-1,1,"bot","lrt") - end - end - end - end - end - local function show(x,y,txt) - local xx, yy = x*factor, y*factor - context("draw (%s,%s) withcolor blue withpen pencircle scaled 1bp;",xx,yy) - context('label.top("\\type{%s}",(%s,%s-2bp)) ;',txt,xx,yy) - context('label.bot("(%s,%s)",(%s,%s+2bp)) ;',x,y,xx,yy) - end - if anchors then - local a = anchors.baselig - if a then - for k, v in pairs(a) do - for kk, vv in ipairs(v) do - show(vv[1],vv[2],k .. ":" .. kk) - end - end - end - local a = anchors.mark - if a then - for k, v in pairs(a) do - show(v[1],v[2],k) - end - end - local a = anchors.basechar - if a then - for k, v in pairs(a) do - show(v[1],v[2],k) - end - end - local ba = anchors.centry - if a then - for k, v in pairs(a) do - show(v[1],v[2],k) - end - end - local a = anchors.cexit - if a then - for k, v in pairs(a) do - show(v[1],v[2],k) - end - end - end - if italic ~= 0 then - context('draw (%s,%s-1bp)--(%s,%s-0.5bp) withcolor blue;',width,ury,width,ury) - context('draw (%s,%s-1bp)--(%s,%s-0.5bp) withcolor blue;',width+italic,ury,width+italic,ury) - context('draw (%s,%s-1bp)--(%s,%s-1bp) withcolor blue;',width,ury,width+italic,ury) - context('label.lft("\\type{%s}",(%s+2bp,%s-1bp));',"italic",width,ury) - context('label.rt("%s",(%s-2bp,%s-1bp));',d.italic,width+italic,ury) - end - if top_accent ~= 0 then - context('draw (%s,%s+1bp)--(%s,%s-1bp) withcolor blue;',top_accent,ury,top_accent,ury) - context('label.bot("\\type{%s}",(%s,%s+1bp));',"top_accent",top_accent,ury) - context('label.top("%s",(%s,%s-1bp));',d.top_accent,top_accent,ury) - end - if bot_accent ~= 0 then - context('draw (%s,%s+1bp)--(%s,%s-1bp) withcolor blue;',bot_accent,lly,bot_accent,lly) - context('label.top("\\type{%s}",(%s,%s-1bp));',"bot_accent",top_accent,ury) - context('label.bot("%s",(%s,%s+1bp));',d.bot_accent,bot_accent,lly) - end - context('draw origin withcolor red withpen pencircle scaled 1bp;') - context("setbounds currentpicture to boundingbox currentpicture enlarged 1bp ;") - context("currentpicture := currentpicture scaled 8 ;") - context.stopMPcode() - elseif c then - local factor = (7200/7227)/65536 - context.startMPcode() - context("pickup pencircle scaled .25bp ; ") - context('picture p ; p := image(draw textext.drt("\\gray\\char%s");); draw p ;',charnum) - context('draw boundingbox p withcolor .2white withpen pencircle scaled .065bp ;') - context("defaultscale := 0.05 ; ") - local italic, top_accent, bot_accent = (c.italic or 0)*factor, (c.top_accent or 0)*factor, (c.bot_accent or 0)*factor - local width, height, depth = (c.width or 0)*factor, (c.height or 0)*factor, (c.depth or 0)*factor - local ury = height - if italic ~= 0 then - context('draw (%s,%s-1bp)--(%s,%s-0.5bp) withcolor blue;',width,ury,width,ury) - context('draw (%s,%s-1bp)--(%s,%s-0.5bp) withcolor blue;',width+italic,ury,width+italic,ury) - context('draw (%s,%s-1bp)--(%s,%s-1bp) withcolor blue;',width,ury,width+italic,height) - context('label.lft("\\type{%s}",(%s+2bp,%s-1bp));',"italic",width,height) - context('label.rt("%6.3f bp",(%s-2bp,%s-1bp));',italic,width+italic,height) - end - if top_accent ~= 0 then - context('draw (%s,%s+1bp)--(%s,%s-1bp) withcolor blue;',top_accent,ury,top_accent,height) - context('label.bot("\\type{%s}",(%s,%s+1bp));',"top_accent",top_accent,height) - context('label.top("%6.3f bp",(%s,%s-1bp));',top_accent,top_accent,height) - end - if bot_accent ~= 0 then - context('draw (%s,%s+1bp)--(%s,%s-1bp) withcolor blue;',bot_accent,lly,bot_accent,height) - context('label.top("\\type{%s}",(%s,%s-1bp));',"bot_accent",top_accent,height) - context('label.bot("%6.3f bp",(%s,%s+1bp));',bot_accent,bot_accent,height) - end - context('draw origin withcolor red withpen pencircle scaled 1bp;') - context("setbounds currentpicture to boundingbox currentpicture enlarged 1bp ;") - context("currentpicture := currentpicture scaled 8 ;") - context.stopMPcode() - else - context("no such shape: %s",n) - end - end - - function moduledata.fonts.show_all_shapes() - local tfmdata = fontdata[font.current()] - -- local _, tfmdata = fonts.definers.define { name = fontname, size = fontsize } - last_data = tfmdata - local unicodes, descriptions = tfmdata.unicodes, tfmdata.descriptions - for unicode, description in fonts.iterators.descriptions(tfmdata) do - local name = description.name - context.StartShowGlyphShape(unicode) - moduledata.fonts.show_shape(unicode) - context.StopShowGlyphShape() - end - end - - function moduledata.fonts.show_shape_field(unicode,name) - local tfmdata = last_data or fontdata[font.current()] - -- local _, tfmdata = fonts.definers.define { name = fontname, size = fontsize } - local d = tfmdata.descriptions[unicode] - if d then - if name == "unicode" then - context("U+%04X",unicode) - else - d = d[name] - if d then - context(d) - end - end - end - end -\stopluacode - -% we can move all to lua (cld) - -\def\GetGlyphField#1#2% - {\ctxlua{moduledata.fonts.show_shape_field(#1,"#2")}} - -\def\StartShowGlyphShape#1% - {\startTEXpage - \def\GlyphUnicode{#1}} - -\def\StopShowGlyphShape - {\par - \midaligned{\tttf\setstrut\strut\GetGlyphField\GlyphUnicode{unicode}: \GetGlyphField\GlyphUnicode{name}}% - \stopTEXpage} - -\def\ShowGlyphShape#1#2#3% name size glyph - {\begingroup - \definedfont[#1 at #2]% - \obeyMPboxdepth - \ctxlua{moduledata.fonts.show_shape("#3")}% - \endgroup} - -\def\ShowAllGlyphShapes#1#2% name size - {\begingroup - \definedfont[#1 at #2]% - \ctxlua{moduledata.fonts.show_all_shapes()}% - \endgroup} - -\setupcolors - [state=start] - -\continueifinputfile{s-fnt-23.mkiv} - -\starttext - -% \startTEXpage \ShowGlyphShape{simplenaskhi}{100bp}{0x62A} \stopTEXpage -% \startTEXpage \ShowGlyphShape{simplenaskhi}{100bp}{0x2004} \stopTEXpage -% \startTEXpage \ShowGlyphShape{simplenaskhi}{100bp}{0xF0299} \stopTEXpage -% \startTEXpage \ShowGlyphShape{simplenaskhi}{100bp}{NameMe.1190} \stopTEXpage - -% \ShowAllGlyphShapes{simplenaskhi}{100bp} -% \ShowAllGlyphShapes{xits}{100bp} - -\switchtobodyfont[cambria,10pt] - -\startTEXpage[offset=0pt]\ShowGlyphShape{name:cambria-math} {40bp}{0x00066}\stopTEXpage -\startTEXpage[offset=0pt]\ShowGlyphShape{name:cambria-math} {40bp}{0x1D453}\stopTEXpage -\startTEXpage[offset=0pt]\ShowGlyphShape{name:cambria-math} {40bp}{0x1D43F}\stopTEXpage -\startTEXpage[offset=0pt]\ShowGlyphShape{name:cambria-math}{100bp}{0x1D444}\stopTEXpage -\startTEXpage[offset=0pt]\ShowGlyphShape{name:cambria-math}{100bp}{0x1D447}\stopTEXpage -\startTEXpage[offset=0pt]\ShowGlyphShape{name:cambria-math}{100bp}{0x02112}\stopTEXpage -\startTEXpage[offset=0pt]\ShowGlyphShape{name:cambria-math}{100bp}{0x1D432}\stopTEXpage -\startTEXpage[offset=0pt]\ShowGlyphShape{name:cambria-math}{100bp}{0x1D43D}\stopTEXpage -\startTEXpage[offset=0pt]\ShowGlyphShape{name:cambria-math}{100bp}{0x1D44A}\stopTEXpage -\startTEXpage[offset=0pt]\ShowGlyphShape{name:cambria-math}{100bp}{0x1D45D}\stopTEXpage - -\stoptext diff --git a/tex/context/base/s-fnt-30.mkiv b/tex/context/base/s-fnt-30.mkiv deleted file mode 100644 index 1de27aed3..000000000 --- a/tex/context/base/s-fnt-30.mkiv +++ /dev/null @@ -1,54 +0,0 @@ -%D \module -%D [ file=s-fnt-30, -%D version=2006.05.10, % abou tthen, quite old already -%D title=\CONTEXT\ Style File, -%D subtitle=Showing Character Data, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -% begin info -% -% title : show character data -% -% comment : show some info about characters in the character database -% status : experimental, used for luatex testing -% -% end info - -\startluacode -function document.show_character_data(n) - local n = characters.number(n) - local d = characters.data[n] - local NC, NR = context.NC, context.NR - if d then - local function entry(label,name) - NC() context(label) - NC() context(d[name]) - NC() NR() - end - context.starttabulate { "|Tl|Tl|]" } - entry("unicode index" , "unicodeslot") - entry("context name" , "contextname") - entry("adobe name" , "adobename") - entry("category" , "category") - entry("description" , "description") - entry("uppercase code", "uccode") - entry("lowercase code", "lccode") - entry("specials" , "specials") - context.stoptabulate() - end -end -\stopluacode - -\def\ShowCharacterData#1% - {\ctxlua{document.show_character_data(#1)}} - -% \ShowCharacterData{123} -% \ShowCharacterData{0x7B} - -% \dostepwiserecurse{`A}{`Z}{1}{\ShowCharacterData{#1}} diff --git a/tex/context/base/s-fonts-coverage.lua b/tex/context/base/s-fonts-coverage.lua new file mode 100644 index 000000000..db47e57c4 --- /dev/null +++ b/tex/context/base/s-fonts-coverage.lua @@ -0,0 +1,113 @@ +if not modules then modules = { } end modules ['s-fonts-coverage'] = { + version = 1.001, + comment = "companion to s-fonts-coverage.mkiv", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +moduledata.fonts = moduledata.fonts or { } +moduledata.fonts.coverage = moduledata.fonts.coverage or { } + +local upper, format = string.upper, string.format +local lpegmatch = lpeg.match +local concat = table.concat + +local context = context +local NC, NR, HL = context.NC, context.NR, context.HL +local char, bold, getvalue = context.char, context.bold, context.getvalue + +local chardata = characters.data + +function moduledata.fonts.coverage.showcomparison(specification) + + specification = interfaces.checkedspecification(specification) + + local fontfiles = utilities.parsers.settings_to_array(specification.list or "") + local pattern = upper(specification.pattern or "") + + local present = { } + local names = { } + local files = { } + + if not pattern then + -- skip + elseif pattern == "" then + pattern = nil + elseif tonumber(pattern) then + pattern = tonumber(pattern) + else + pattern = lpeg.oneof(utilities.parsers.settings_to_array(pattern)) + pattern = (1-pattern)^0 * pattern + end + + for i=1,#fontfiles do + local fontname = format("testfont-%s",i) + local fontfile = fontfiles[i] + local fontsize = tex.dimen.bodyfontsize + local id, fontdata = fonts.definers.define { + name = fontfile, + size = fontsize, + cs = fontname, + } + if id and fontdata then + for k, v in next, fontdata.characters do + present[k] = true + end + names[#names+1] = fontname + files[#files+1] = fontfile + end + end + + local t = { } + + context.starttabulate { "|Tr" .. string.rep("|l",#names) .. "|" } + for i=1,#files do + local file = files[i] + t[#t+1] = i .. "=" .. file + NC() + context(i) + NC() + context(file) + NC() + NR() + end + context.stoptabulate() + + context.setupfootertexts { + table.concat(t," ") + } + + context.starttabulate { "|Tl" .. string.rep("|c",#names) .. "|Tl|" } + NC() + bold("unicode") + NC() + for i=1,#names do + bold(i) + NC() + end + bold("description") + NC() + NR() + HL() + for k, v in table.sortedpairs(present) do + if k > 0 then + local description = chardata[k].description + if not pattern or (pattern == k) or (description and lpegmatch(pattern,description)) then + NC() + context("%05X",k) + NC() + for i=1,#names do + getvalue(names[i]) + char(k) + NC() + end + context(description) + NC() + NR() + end + end + end + context.stoptabulate() + +end diff --git a/tex/context/base/s-fonts-coverage.mkiv b/tex/context/base/s-fonts-coverage.mkiv new file mode 100644 index 000000000..c09d943bc --- /dev/null +++ b/tex/context/base/s-fonts-coverage.mkiv @@ -0,0 +1,131 @@ +%D \module +%D [ file=s-fonts-coverage, % s-fnt-31 +%D version=2011.01.02, +%D title=\CONTEXT\ Style File, +%D subtitle=Show Fonts Coverage, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +% begin info +% +% title : compare glyphs in fonts +% +% comment : show glyphs in several fonts alongside in order to to compare coverage +% status : experimental, used for luatex testing +% +% end info + +\startmodule[fonts-coverage] + +\registerctxluafile{s-fonts-coverage}{} + +\installmodulecommandluasingle \showfontcomparison {moduledata.fonts.coverage.showcomparison} + +\stopmodule + +\continueifinputfile{s-fonts-coverage.mkiv} + +\usemodule[art-01] + +\starttext + + \showfontcomparison + [list={texgyrepagella-regular.otf,texgyretermes-regular.otf,texgyrebonum-regular.otf}, + pattern=ogonek] + + \page + + % $e=mc²$ ${}²$ $²$ $x²ᶞ$ $x⁽²⁺²⁼²⁺²⁾$ $x²⁺²⁼²⁺²$ $x₅²$ $x²₅²$ + + % \startluacode + % moduledata.fonts.coverage.showcomparison { + % list = { + % "texgyrepagella-math.otf", + % "texgyretermes-math.otf", + % "texgyrebonum-math.otf", + % } + % } + % \stopluacode + + % \startluacode + % moduledata.fonts.coverage.showcomparison { + % list = "pirat.ttf", + % } + % \stopluacode + + % \startluacode + % moduledata.fonts.coverage.showcomparison { + % list = { + % "lucidabrightot.otf", + % "cambria.ttf", + % "iwona-regular.otf", + % "texgyrepagella-regular.otf", + % "texgyretermes-regular.otf", + % "texgyrebonum-regular.otf", + % "antpolt-regular.otf", + % }, + % pattern = "OGONEK" + % } + % \stopluacode + + % \loadfontgoodies[lucida-math] + % \loadfontgoodies[lm-math] + % + % \startluacode + % moduledata.fonts.coverage.showcomparison { + % list = { + % "LucidaBrightRegular.ttf", + % "LucidaBrightOne@lucida-math", + % "cambria.ttc(Cambria Math)", + % "xits-math.otf", + % "LMMath10-Regular@lmroman10-math", + % }, + % } + % \stopluacode + + % \loadfontgoodies[px-math] + % \loadfontgoodies[lm-math] + % + % \startluacode + % moduledata.fonts.coverage.showcomparison { + % list = { + % "cambria.ttc(Cambria Math)", + % "xits-math.otf", + % -- "stixmath-regular.otf", + % "latinmodern-math.otf", + % -- "lucidabrightmathot.otf", + % -- "lucidabrightmathot-demi.otf", + % "texgyrepagella-math.otf", + % "texgyretermes-math.otf", + % "texgyrebonum-math.otf", + % -- "LMMath10-Regular@lmroman10-math", + % -- "pxmath@px-math", + % -- "txmath@tx-math", + % }, + % } + % \stopluacode + + % \startluacode + % moduledata.fonts.coverage.showcomparison { + % list = { + % "dejavuserif.ttf", + % "dejavusans.ttf", + % "dejavusansmono.ttf", + % "lucidabrightot.otf", + % "cambria.ttf", + % "iwona-regular.otf", + % "texgyrepagella-regular.otf", + % "texgyretermes-regular.otf", + % "texgyrebonum-regular.otf", + % "antpolt-regular.otf", + % }, + % pattern = "CELSIUS,FAHRENHEIT" + % } + % \stopluacode + +\stoptext diff --git a/tex/context/base/s-fonts-features.lua b/tex/context/base/s-fonts-features.lua index 4ee143204..3f4d95096 100644 --- a/tex/context/base/s-fonts-features.lua +++ b/tex/context/base/s-fonts-features.lua @@ -11,6 +11,8 @@ moduledata.fonts.features = moduledata.fonts.features or { } -- for the moment only otf +local sortedhash = table.sortedhash + local NC, NR, bold = context.NC, context.NR, context.bold function moduledata.fonts.features.showused(specification) @@ -36,10 +38,10 @@ function moduledata.fonts.features.showused(specification) local features = fonts.handlers.otf.tables.features local descriptions = fonts.handlers.otf.features.descriptions - for feature, keys in table.sortedhash(usedfeatures) do + for feature, keys in sortedhash(usedfeatures) do -- if list.all or (list.otf and rawget(features,feature)) or (list.extra and rawget(descriptions,feature)) then local done = false - for k, v in table.sortedhash(keys) do + for k, v in sortedhash(keys) do if done then NC() NC() @@ -72,3 +74,86 @@ function moduledata.fonts.features.showused(specification) context.stoptabulate() end + +local function collectkerns(tfmdata,feature) + local combinations = { } + local resources = tfmdata.resources + local characters = tfmdata.characters + local sequences = resources.sequences + local lookuphash = resources.lookuphash + local feature = feature or "kern" + if sequences then + for i=1,#sequences do + local sequence = sequences[i] + if sequence.features and sequence.features[feature] then + local lookuplist = sequence.subtables + if lookuplist then + for l=1,#lookuplist do + local lookupname = lookuplist[l] + local lookupdata = lookuphash[lookupname] + for unicode, data in next, lookupdata do + local kerns = combinations[unicode] + if not kerns then + kerns = { } + combinations[unicode] = kerns + end + for otherunicode, kern in next, data do + if not kerns[otherunicode] and kern ~= 0 then + kerns[otherunicode] = kern + end + end + end + end + end + end + end + end + return combinations +end + +local showkernpair = context.showkernpair + +function moduledata.fonts.features.showbasekerns(specification) + -- assumes that the font is loaded in base mode + local id = tonumber(specification.number) + local tfmdata = fonts.hashes.identifiers[id or font.current()] + local done = false + for unicode, character in sortedhash(tfmdata.characters) do + local kerns = character.kerns + if kerns then + context.par() + for othercode, kern in sortedhash(kerns) do + showkernpair(unicode,kern,othercode) + end + context.par() + done = true + end + end + if not done then + context("no kern pairs found") + context.par() + end +end + +function moduledata.fonts.features.showallkerns(specification) + local id = tonumber(specification.number) + local tfmdata = fonts.hashes.identifiers[id or font.current()] + local allkerns = collectkerns(tfmdata) + local characters = tfmdata.characters + if next(allkerns) then + for first, pairs in sortedhash(allkerns) do + context.par() + for second, kern in sortedhash(pairs) do + -- local kerns = characters[first].kerns + -- if not kerns and pairs[second] then + -- -- weird + -- end + showkernpair(first,kern,second,0) + end + context.par() + end + else + context("no kern pairs found") + context.par() + end +end diff --git a/tex/context/base/s-fonts-features.mkiv b/tex/context/base/s-fonts-features.mkiv index 7dd5f9b95..8982f7347 100644 --- a/tex/context/base/s-fonts-features.mkiv +++ b/tex/context/base/s-fonts-features.mkiv @@ -1,6 +1,6 @@ %D \module -%D [ file=s-fonts-features, % was s-fnt-41, -%D version=2012.11.27, % older probably +%D [ file=s-fonts-features, % was s-fnt-41, s-fnt-27 +%D version=2012.11.27, % 2010.02.22 %D title=\CONTEXT\ Style File, %D subtitle=Features, %D author=Hans Hagen, @@ -16,6 +16,43 @@ \registerctxluafile{s-fonts-features}{} \installmodulecommandluasingle \showusedfeatures {moduledata.fonts.features.showused} +\installmodulecommandluasingle \showallkerns {moduledata.fonts.features.showallkerns} +\installmodulecommandluasingle \showbasekerns {moduledata.fonts.features.showbasekerns} + +\def\kernpairheight{\strutheight} +\def\kernpairdepth {\strutdepth} +\def\kernpairwidth {\onepoint} + +\unexpanded\def\showkernpair#1#2#3% first second kern + {\dontleavehmode + \hbox \bgroup + \scratchdimen#2\scaledpoint + \kern\fontcharwd\font#1\relax + \ifdim\scratchdimen>\zeropoint + \bgroup + \darkgreen + \vrule width \scratchdimen height \kernpairheight depth \kernpairdepth + \egroup + \kern-\scratchdimen + \else\ifdim\scratchdimen<\zeropoint + \kern\scratchdimen + \bgroup + \darkred + \vrule width -\scratchdimen height \kernpairheight depth \kernpairdepth + \egroup + \else + \kern-.5\dimexpr\kernpairwidth\relax + \bgroup + \darkblue + \vrule width \kernpairwidth height \kernpairheight depth \kernpairdepth + \egroup + \kern-.5\dimexpr\kernpairwidth\relax + \fi\fi + \kern-\fontcharwd\font#1\relax + \char#1\relax + \char#3\relax + \egroup + \space} \stopmodule @@ -26,6 +63,20 @@ \starttext - \showusedfeatures + \showusedfeatures \page + + \definefontfeature[default-base][default][mode=base] + + \start + \definedfont[Serif*default-base] + \showbasekerns + \page + \stop + + \start + \bf + \showallkerns + \page + \stop \stoptext diff --git a/tex/context/base/s-fonts-shapes.lua b/tex/context/base/s-fonts-shapes.lua index e0c1262c5..0fddfa01a 100644 --- a/tex/context/base/s-fonts-shapes.lua +++ b/tex/context/base/s-fonts-shapes.lua @@ -13,6 +13,7 @@ local fontdata = fonts.hashes.identifiers local NC, NR = context.NC, context.NR local space, dontleavehmode, glyph = context.space, context.dontleavehmode, context.glyph +local formatters = string.formatters function moduledata.fonts.shapes.showlist(specification) -- todo: ranges specification = interfaces.checkedspecification(specification) @@ -60,3 +61,270 @@ function moduledata.fonts.shapes.showlist(specification) -- todo: ranges context.stoptabulate() context.endgroup() end + +function moduledata.fonts.shapes.showlist(specification) -- todo: ranges + specification = interfaces.checkedspecification(specification) + local id = tonumber(specification.number) or font.current() + local chrs = fontdata[id].characters + function char(k) + dontleavehmode() + glyph(id,k) + end + local function special(v) + local specials = v.specials + if specials and #specials > 1 then + context("%s:",specials[1]) + for i=2,#specials do + space() + char(specials[i]) + end + end + end + context.begingroup() + context.tt() + context.starttabulate { "|l|c|c|c|c|l|l|" } + context.FL() + NC() context.bold("unicode") + NC() context.bold("glyph") + NC() context.bold("shape") + NC() context.bold("lower") + NC() context.bold("upper") + NC() context.bold("specials") + NC() context.bold("description") + NC() NR() + context.TL() + for k, v in next, characters.data do + if chrs[k] then + NC() context("0x%05X",k) + NC() char(k) + NC() char(v.shcode) + NC() char(v.lccode or k) + NC() char(v.uccode or k) + NC() special(v) + NC() context.tx(v.description) + NC() NR() + end + end + context.stoptabulate() + context.endgroup() +end + +local descriptions = nil +local characters = nil + +local function showglyphshape(specification) + specification = interfaces.checkedspecification(specification) + specification.cs = "showglyphshape:font" + local id, cs = fonts.definers.internal(specification) + local tfmdata = fontdata[id] + local charnum = tonumber(specification.character) + if not charnum then + charnum = fonts.helpers.nametoslot(n) + end +-- print(id,cs,charnum) + context.start() + context.dontleavehmode() + context.obeyMPboxdepth() + local characters = tfmdata.characters + local descriptions = tfmdata.descriptions + local parameters = tfmdata.parameters + local c = characters[charnum] + local d = descriptions[charnum] + if d then + local factor = (parameters.size/parameters.units)*((7200/7227)/65536) + local llx, lly, urx, ury = unpack(d.boundingbox) + llx, lly, urx, ury = llx*factor, lly*factor, urx*factor, ury*factor + local width, italic = (d.width or 0)*factor, (d.italic or 0)*factor + local top_accent, bot_accent = (d.top_accent or 0)*factor, (d.bot_accent or 0)*factor + local anchors, math = d.anchors, d.math + context.startMPcode() + context("pickup pencircle scaled .25bp ;") + context('picture p ; p := image(draw textext.drt("\\getuvalue{%s}\\gray\\char%s");); draw p ;',cs,charnum) + context('draw (%s,%s)--(%s,%s)--(%s,%s)--(%s,%s)--cycle withcolor green ;',llx,lly,urx,lly,urx,ury,llx,ury) + context('draw (%s,%s)--(%s,%s) withcolor green ;',llx,0,urx,0) + context('draw boundingbox p withcolor .2white withpen pencircle scaled .065bp ;') + context("defaultscale := 0.05 ; ") + -- inefficient but non critical + local function slant_1(v,dx,dy,txt,xsign,ysign,loc,labloc) + if #v > 0 then + local l = { } + for kk, vv in ipairs(v) do + local h, k = vv.height, vv.kern + if h and k then + l[#l+1] = formatters["((%s,%s) shifted (%s,%s))"](xsign*k*factor,ysign*h*factor,dx,dy) + end + end + context("draw ((%s,%s) shifted (%s,%s))--%s dashed (evenly scaled .25) withcolor .5white;", xsign*v[1].kern*factor,lly,dx,dy,l[1]) + context("draw laddered (%s) withcolor .5white ;",table.concat(l,"..")) + context("draw ((%s,%s) shifted (%s,%s))--%s dashed (evenly scaled .25) withcolor .5white;", xsign*v[#v].kern*factor,ury,dx,dy,l[#l]) + for k, v in ipairs(l) do + context("draw %s withcolor blue withpen pencircle scaled 1bp;",v) + end + end + end + local function slant_2(v,dx,dy,txt,xsign,ysign,loc,labloc) + if #v > 0 then + local l = { } + for kk, vv in ipairs(v) do + local h, k = vv.height, vv.kern + if h and k then + l[#l+1] = formatters["((%s,%s) shifted (%s,%s))"](xsign*k*factor,ysign*h*factor,dx,dy) + end + end + if loc == "top" then + context('label.%s("\\type{%s}",%s shifted (0,-1bp)) ;',loc,txt,l[#l]) + else + context('label.%s("\\type{%s}",%s shifted (0,2bp)) ;',loc,txt,l[1]) + end + for kk, vv in ipairs(v) do + local h, k = vv.height, vv.kern + if h and k then + context('label.top("(%s,%s)",%s shifted (0,-2bp));',k,h,l[kk]) + end + end + end + end + if math then + local kerns = math.kerns + if kerns then + for _, slant in ipairs { slant_1, slant_2 } do + for k,v in pairs(kerns) do + if k == "top_right" then + slant(v,width+italic,0,k,1,1,"top","ulft") + elseif k == "bottom_right" then + slant(v,width,0,k,1,1,"bot","lrt") + elseif k == "top_left" then + slant(v,0,0,k,-1,1,"top","ulft") + elseif k == "bottom_left" then + slant(v,0,0,k,-1,1,"bot","lrt") + end + end + end + end + end + local function show(x,y,txt) + local xx, yy = x*factor, y*factor + context("draw (%s,%s) withcolor blue withpen pencircle scaled 1bp;",xx,yy) + context('label.top("\\type{%s}",(%s,%s-2bp)) ;',txt,xx,yy) + context('label.bot("(%s,%s)",(%s,%s+2bp)) ;',x,y,xx,yy) + end + if anchors then + local a = anchors.baselig + if a then + for k, v in pairs(a) do + for kk, vv in ipairs(v) do + show(vv[1],vv[2],k .. ":" .. kk) + end + end + end + local a = anchors.mark + if a then + for k, v in pairs(a) do + show(v[1],v[2],k) + end + end + local a = anchors.basechar + if a then + for k, v in pairs(a) do + show(v[1],v[2],k) + end + end + local ba = anchors.centry + if a then + for k, v in pairs(a) do + show(v[1],v[2],k) + end + end + local a = anchors.cexit + if a then + for k, v in pairs(a) do + show(v[1],v[2],k) + end + end + end + if italic ~= 0 then + context('draw (%s,%s-1bp)--(%s,%s-0.5bp) withcolor blue;',width,ury,width,ury) + context('draw (%s,%s-1bp)--(%s,%s-0.5bp) withcolor blue;',width+italic,ury,width+italic,ury) + context('draw (%s,%s-1bp)--(%s,%s-1bp) withcolor blue;',width,ury,width+italic,ury) + context('label.lft("\\type{%s}",(%s+2bp,%s-1bp));',"italic",width,ury) + context('label.rt("%s",(%s-2bp,%s-1bp));',d.italic,width+italic,ury) + end + if top_accent ~= 0 then + context('draw (%s,%s+1bp)--(%s,%s-1bp) withcolor blue;',top_accent,ury,top_accent,ury) + context('label.bot("\\type{%s}",(%s,%s+1bp));',"top_accent",top_accent,ury) + context('label.top("%s",(%s,%s-1bp));',d.top_accent,top_accent,ury) + end + if bot_accent ~= 0 then + context('draw (%s,%s+1bp)--(%s,%s-1bp) withcolor blue;',bot_accent,lly,bot_accent,lly) + context('label.top("\\type{%s}",(%s,%s-1bp));',"bot_accent",top_accent,ury) + context('label.bot("%s",(%s,%s+1bp));',d.bot_accent,bot_accent,lly) + end + context('draw origin withcolor red withpen pencircle scaled 1bp;') + context("setbounds currentpicture to boundingbox currentpicture enlarged 1bp ;") + context("currentpicture := currentpicture scaled 8 ;") + context.stopMPcode() + -- elseif c then + -- lastdata, lastunicode = nil, nil + -- local factor = (7200/7227)/65536 + -- context.startMPcode() + -- context("pickup pencircle scaled .25bp ; ") + -- context('picture p ; p := image(draw textext.drt("\\gray\\char%s");); draw p ;',charnum) + -- context('draw boundingbox p withcolor .2white withpen pencircle scaled .065bp ;') + -- context("defaultscale := 0.05 ; ") + -- local italic, top_accent, bot_accent = (c.italic or 0)*factor, (c.top_accent or 0)*factor, (c.bot_accent or 0)*factor + -- local width, height, depth = (c.width or 0)*factor, (c.height or 0)*factor, (c.depth or 0)*factor + -- local ury = height + -- if italic ~= 0 then + -- context('draw (%s,%s-1bp)--(%s,%s-0.5bp) withcolor blue;',width,ury,width,ury) + -- context('draw (%s,%s-1bp)--(%s,%s-0.5bp) withcolor blue;',width+italic,ury,width+italic,ury) + -- context('draw (%s,%s-1bp)--(%s,%s-1bp) withcolor blue;',width,ury,width+italic,height) + -- context('label.lft("\\type{%s}",(%s+2bp,%s-1bp));',"italic",width,height) + -- context('label.rt("%6.3f bp",(%s-2bp,%s-1bp));',italic,width+italic,height) + -- end + -- if top_accent ~= 0 then + -- context('draw (%s,%s+1bp)--(%s,%s-1bp) withcolor blue;',top_accent,ury,top_accent,height) + -- context('label.bot("\\type{%s}",(%s,%s+1bp));',"top_accent",top_accent,height) + -- context('label.top("%6.3f bp",(%s,%s-1bp));',top_accent,top_accent,height) + -- end + -- if bot_accent ~= 0 then + -- context('draw (%s,%s+1bp)--(%s,%s-1bp) withcolor blue;',bot_accent,lly,bot_accent,height) + -- context('label.top("\\type{%s}",(%s,%s-1bp));',"bot_accent",top_accent,height) + -- context('label.bot("%6.3f bp",(%s,%s+1bp));',bot_accent,bot_accent,height) + -- end + -- context('draw origin withcolor red withpen pencircle scaled 1bp;') + -- context("setbounds currentpicture to boundingbox currentpicture enlarged 1bp ;") + -- context("currentpicture := currentpicture scaled 8 ;") + -- context.stopMPcode() + else + lastdata, lastunicode = nil, nil + context("no such shape: 0x%05X",charnum) + end + context.stop() +end + +moduledata.fonts.shapes.showglyphshape = showglyphshape + +function moduledata.fonts.shapes.showallglypshapes(specification) + specification = interfaces.checkedspecification(specification) + specification.cs = "showglyphshape:font" + local id, cs = fonts.definers.internal(specification) + local descriptions = fontdata[id].descriptions + for unicode, description in fonts.iterators.descriptions(tfmdata) do + context.modulefontsstartshowglyphshape(unicode,description.name) + showglyphshape { number = id, character = unicode } + context.modulefontsstopshowglyphshape() + end +end + +function moduledata.fonts.shapes.showlastglyphshapefield(unicode,name) + if not descriptions then + -- bad news + elseif name == "unicode" then + context("U+%05X",descriptions.unicode) + else + local d = descriptions[name] + if d then + context(d) + end + end +end diff --git a/tex/context/base/s-fonts-shapes.mkiv b/tex/context/base/s-fonts-shapes.mkiv index 257a18fba..5651bdad9 100644 --- a/tex/context/base/s-fonts-shapes.mkiv +++ b/tex/context/base/s-fonts-shapes.mkiv @@ -15,7 +15,50 @@ \registerctxluafile{s-fonts-shapes}{} -\installmodulecommandluasingle \showfontshapes {moduledata.fonts.shapes.showlist} +\installmodulecommandluasingle \showfontshapes {moduledata.fonts.shapes.showlist} +\installmodulecommandluasingle \showglyphshape {moduledata.fonts.shapes.showglypshape} +\installmodulecommandluatwo \showlastglyphshapefield {moduledata.fonts.shapes.showlastglyphshapefield} +\installmodulecommandluasingle \showallglyphshapes {moduledata.fonts.shapes.showallglypshapes} + +\let\modulefontsstartshowglyphshape\relax +\let\modulefontsstopshowglyphshape \relax + +\unprotect + +\startsetups module:showallglyphshapes:start + + \def\modulefontsstartshowglyphshape##1##2{ + \startTEXpage[\c!offset=\exheight] + \edef\lastshownglyphshapefieldunicode{##1}% + \edef\lastshownglyphshapefieldname {##2}% + \raggedcenter + } + + \def\modulefontsstopshowglyphshape { + \par + \doifsomething {\lastshownglyphshapefieldunicode} { + \begingroup + \dontleavehmode + \tttf + \setstrut + \strut + 0x\uchexnumbers\lastshownglyphshapefieldunicode + :\space + \lastshownglyphshapefieldname + \par + \endgroup + } + \stopTEXpage + } + +\stopsetups + +\protect + +% downward compatibility: + +\unexpanded\def\ShowGlyphShape#1#2#3% name size glyph + {\ctxlua{moduledata.fonts.shapes.showglyphshape { name = "#1", size = "#2", character = "#3" } }} \stopmodule @@ -41,4 +84,34 @@ \showfontshapes[number=\saveddefinedfontid] + \page + + \showfontshapes[name=BoldItalic*default] + + \page + + % \startTEXpage \ShowGlyphShape{simplenaskhi}{100bp}{0x62A} \stopTEXpage + % \startTEXpage \ShowGlyphShape{simplenaskhi}{100bp}{0x2004} \stopTEXpage + % \startTEXpage \ShowGlyphShape{simplenaskhi}{100bp}{0xF0299} \stopTEXpage + % \startTEXpage \ShowGlyphShape{simplenaskhi}{100bp}{NameMe.1190} \stopTEXpage + + \startTEXpage[offset=0pt]\ShowGlyphShape{name:cambria-math} {40bp}{0x00066}\stopTEXpage + \startTEXpage[offset=0pt]\ShowGlyphShape{name:cambria-math} {40bp}{0x1D453}\stopTEXpage + \startTEXpage[offset=0pt]\ShowGlyphShape{name:cambria-math} {40bp}{0x1D43F}\stopTEXpage + \startTEXpage[offset=0pt]\ShowGlyphShape{name:cambria-math}{100bp}{0x1D444}\stopTEXpage + \startTEXpage[offset=0pt]\ShowGlyphShape{name:cambria-math}{100bp}{0x1D447}\stopTEXpage + \startTEXpage[offset=0pt]\ShowGlyphShape{name:cambria-math}{100bp}{0x02112}\stopTEXpage + \startTEXpage[offset=0pt]\ShowGlyphShape{name:cambria-math}{100bp}{0x1D432}\stopTEXpage + \startTEXpage[offset=0pt]\ShowGlyphShape{name:cambria-math}{100bp}{0x1D43D}\stopTEXpage + \startTEXpage[offset=0pt]\ShowGlyphShape{name:cambria-math}{100bp}{0x1D44A}\stopTEXpage + \startTEXpage[offset=0pt]\ShowGlyphShape{name:cambria-math}{100bp}{0x1D45D}\stopTEXpage + + \page + + % \showallglyphshapes[name=name:cambria-math,size=100bp] + \showallglyphshapes[name=name:dejavuserif,size=100bp] + +\stoptext + + \stoptext diff --git a/tex/context/base/s-fonts-system.lua b/tex/context/base/s-fonts-system.lua new file mode 100644 index 000000000..0c0ad4d86 --- /dev/null +++ b/tex/context/base/s-fonts-system.lua @@ -0,0 +1,68 @@ +if not modules then modules = { } end modules ['s-fonts-system'] = { + version = 1.001, + comment = "companion to s-fonts-system.mkiv", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +-- ["zapfinoforteltpro"]={ +-- ["designsize"]=0, +-- ["familyname"]="zapfinoforteltpro", +-- ["filename"]="zapfinoforteltpro.otf", +-- ["fontname"]="zapfinoforteltpro", +-- ["fontweight"]="regular", +-- ["format"]="otf", +-- ["fullname"]="zapfinoforteltpro", +-- ["maxsize"]=0, +-- ["minsize"]=0, +-- ["modification"]=1105543074, +-- ["modifiers"]="regular", +-- ["rawname"]="ZapfinoForteLTPro", +-- ["style"]="normal", +-- ["subfamily"]="regular", +-- ["variant"]="normal", +-- ["weight"]="normal", +-- ["width"]="normal", +-- } + +moduledata.fonts = moduledata.fonts or { } +moduledata.fonts.system = moduledata.fonts.system or { } + +local lower = string.lower + +local context = context +local NC, NR, HL = context.NC, context.NR, context.HL +local bold = context.bold + +function moduledata.fonts.system.showinstalled(specification) + specification = interfaces.checkedspecification(specification) + local pattern = lower(specification.pattern or "") + local list = fonts.names.list(pattern,false,true) + if list then + local files = { } + for k, v in next, list do + files[file.basename(string.lower(v.filename))] = v + end + context.starttabulate { "|Tl|Tl|Tl|Tl|Tl|Tl|" } + HL() + NC() bold("filename") + NC() bold("fontname") + NC() bold("subfamily") + NC() bold("variant") + NC() bold("weight") + NC() bold("width") + NC() NR() + HL() + for filename, data in table.sortedpairs(files) do + NC() context(filename) + NC() context(data.fontname) + NC() context(data.subfamily) + NC() context(data.variant) + NC() context(data.weight) + NC() context(data.width) + NC() NR() + end + context.stoptabulate() + end +end diff --git a/tex/context/base/s-fonts-system.mkiv b/tex/context/base/s-fonts-system.mkiv new file mode 100644 index 000000000..6d9082a6b --- /dev/null +++ b/tex/context/base/s-fonts-system.mkiv @@ -0,0 +1,39 @@ +%D \module +%D [ file=s-fonts0system, % s-fnt-11, +%D version=2006.02.01, % or so +%D title=\CONTEXT\ Style File, +%D subtitle=Listing Installed Fonts, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D This code usd to be in the kernel but since it's hardly used +%D it's now a module. +%D +%D \starttyping +%D \showinstalledfonts[pattern={officinasans.*}] +%D \showinstalledfonts[pattern={officinaserif.*}] +%D \showinstalledfonts[pattern={officina.*itc.*}] +%D \stoptyping + +\startmodule[fonts-system] + +\registerctxluafile{s-fonts-system}{} + +\installmodulecommandluasingle \showinstalledfonts {moduledata.fonts.system.showinstalled} + +\stopmodule + +\continueifinputfile{s-fonts-system.mkiv} + +\usemodule[art-01] \setuplayout[overview] \setupbodyfont[7pt] + +\starttext + + \showinstalledfonts + +\stoptext diff --git a/tex/context/base/s-math-coverage.lua b/tex/context/base/s-math-coverage.lua index c06f14b11..258019c9d 100644 --- a/tex/context/base/s-math-coverage.lua +++ b/tex/context/base/s-math-coverage.lua @@ -10,13 +10,12 @@ moduledata.math = moduledata.math or { } moduledata.math.coverage = moduledata.math.coverage or { } local utfchar, utfbyte = utf.char, utf.byte -local formatters, lower, upper, find, format = string.formatters, string.lower, string.upper, string.find, string.format -local lpegmatch = lpeg.match +local formatters, lower = string.formatters, string.lower local concat = table.concat local context = context local NC, NR, HL = context.NC, context.NR, context.HL -local char, getglyph, bold, getvalue = context.char, context.getglyph, context.bold, context.getvalue +local char, getglyph, bold = context.char, context.getglyph, context.bold local ucgreek = { 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, @@ -179,96 +178,3 @@ function moduledata.math.coverage.showscripts() end context.stoptabulate() end - -function moduledata.math.coverage.showcomparison(specification) - - specification = interfaces.checkedspecification(specification) - - local fontfiles = utilities.parsers.settings_to_array(specification.list or "") - local pattern = upper(specification.pattern or "") - - local present = { } - local names = { } - local files = { } - - if not pattern then - -- skip - elseif pattern == "" then - pattern = nil - elseif tonumber(pattern) then - pattern = tonumber(pattern) - else - pattern = lpeg.oneof(utilities.parsers.settings_to_array(pattern)) - pattern = (1-pattern)^0 * pattern - end - - for i=1,#fontfiles do - local fontname = format("testfont-%s",i) - local fontfile = fontfiles[i] - local fontsize = tex.dimen.bodyfontsize - local id, fontdata = fonts.definers.define { - name = fontfile, - size = fontsize, - cs = fontname, - } - if id and fontdata then - for k, v in next, fontdata.characters do - present[k] = true - end - names[#names+1] = fontname - files[#files+1] = fontfile - end - end - - local t = { } - - context.starttabulate { "|Tr" .. string.rep("|l",#names) .. "|" } - for i=1,#files do - local file = files[i] - t[#t+1] = i .. "=" .. file - NC() - context(i) - NC() - context(file) - NC() - NR() - end - context.stoptabulate() - - context.setupfootertexts { - table.concat(t," ") - } - - context.starttabulate { "|Tl" .. string.rep("|c",#names) .. "|Tl|" } - NC() - bold("unicode") - NC() - for i=1,#names do - bold(i) - NC() - end - bold("description") - NC() - NR() - HL() - for k, v in table.sortedpairs(present) do - if k > 0 then - local description = chardata[k].description - if not pattern or (pattern == k) or (description and lpegmatch(pattern,description)) then - NC() - context("%05X",k) - NC() - for i=1,#names do - getvalue(names[i]) - char(k) - NC() - end - context(description) - NC() - NR() - end - end - end - context.stoptabulate() - -end diff --git a/tex/context/base/s-math-coverage.mkiv b/tex/context/base/s-math-coverage.mkiv index 185c382d6..d68ffe587 100644 --- a/tex/context/base/s-math-coverage.mkiv +++ b/tex/context/base/s-math-coverage.mkiv @@ -1,5 +1,5 @@ %D \module -%D [ file=s-math-coverage, % s-fnt-33, s-fnt-32, s-fnt-31 +%D [ file=s-math-coverage, % s-fnt-33, s-fnt-32 %D version=2011.05.10, % and older %D title=\CONTEXT\ Style File, %D subtitle=Show Math Coverage, @@ -11,15 +11,6 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -% begin info -% -% title : compare glyphs in fonts -% -% comment : show glyphs in several fonts alongside in order to to compare coverage -% status : experimental, used for luatex testing -% -% end info - \startmodule[math-coverage] \registerctxluafile{s-math-coverage}{} @@ -27,7 +18,6 @@ \installmodulecommandluasingle \showmathalphabets {moduledata.math.coverage.showalphabets} \installmodulecommandluasingle \showmathcharacters {moduledata.math.coverage.showcharacters} \installmodulecommandluasingle \showmathscripts {moduledata.math.coverage.showscripts} -\installmodulecommandluasingle \showmathcomparison {moduledata.math.coverage.showcomparison} \stopmodule @@ -41,98 +31,4 @@ \showmathcharacters \page \showmathscripts \page - \showmathcomparison - [list={texgyrepagella-regular.otf,texgyretermes-regular.otf,texgyrebonum-regular.otf}, - pattern=ogonek] - - \page - - % $e=mc²$ ${}²$ $²$ $x²ᶞ$ $x⁽²⁺²⁼²⁺²⁾$ $x²⁺²⁼²⁺²$ $x₅²$ $x²₅²$ - - % \startluacode - % moduledata.math.coverage.showcomparison { - % list = { - % "texgyrepagella-math.otf", - % "texgyretermes-math.otf", - % "texgyrebonum-math.otf", - % } - % } - % \stopluacode - - % \startluacode - % moduledata.math.coverage.showcomparison { - % list = "pirat.ttf", - % } - % \stopluacode - - % \startluacode - % moduledata.math.coverage.showcomparison { - % list = { - % "lucidabrightot.otf", - % "cambria.ttf", - % "iwona-regular.otf", - % "texgyrepagella-regular.otf", - % "texgyretermes-regular.otf", - % "texgyrebonum-regular.otf", - % "antpolt-regular.otf", - % }, - % pattern = "OGONEK" - % } - % \stopluacode - - % \loadfontgoodies[lucida-math] - % \loadfontgoodies[lm-math] - % - % \startluacode - % moduledata.math.coverage.showcomparison { - % list = { - % "LucidaBrightRegular.ttf", - % "LucidaBrightOne@lucida-math", - % "cambria.ttc(Cambria Math)", - % "xits-math.otf", - % "LMMath10-Regular@lmroman10-math", - % }, - % } - % \stopluacode - - % \loadfontgoodies[px-math] - % \loadfontgoodies[lm-math] - % - % \startluacode - % moduledata.math.coverage.showcomparison { - % list = { - % "cambria.ttc(Cambria Math)", - % "xits-math.otf", - % -- "stixmath-regular.otf", - % "latinmodern-math.otf", - % -- "lucidabrightmathot.otf", - % -- "lucidabrightmathot-demi.otf", - % "texgyrepagella-math.otf", - % "texgyretermes-math.otf", - % "texgyrebonum-math.otf", - % -- "LMMath10-Regular@lmroman10-math", - % -- "pxmath@px-math", - % -- "txmath@tx-math", - % }, - % } - % \stopluacode - - % \startluacode - % moduledata.math.coverage.showcomparison { - % list = { - % "dejavuserif.ttf", - % "dejavusans.ttf", - % "dejavusansmono.ttf", - % "lucidabrightot.otf", - % "cambria.ttf", - % "iwona-regular.otf", - % "texgyrepagella-regular.otf", - % "texgyretermes-regular.otf", - % "texgyrebonum-regular.otf", - % "antpolt-regular.otf", - % }, - % pattern = "CELSIUS,FAHRENHEIT" - % } - % \stopluacode - \stoptext diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf index 6266ba72d..02e1255d8 100644 Binary files a/tex/context/base/status-files.pdf and b/tex/context/base/status-files.pdf differ diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf index 90f5b1bd4..3f9c1b392 100644 Binary files a/tex/context/base/status-lua.pdf and b/tex/context/base/status-lua.pdf differ diff --git a/tex/context/base/status-mkiv.lua b/tex/context/base/status-mkiv.lua index 75db1b910..de35a4c0a 100644 --- a/tex/context/base/status-mkiv.lua +++ b/tex/context/base/status-mkiv.lua @@ -4265,6 +4265,11 @@ return { loading = "regi-ini", status = "okay", }, + { + category = "lua", + filename = "s-fonts-coverage", + status = "okay", + }, { category = "lua", filename = "s-fonts-features", @@ -4280,6 +4285,11 @@ return { filename = "s-fonts-shapes", status = "okay", }, + { + category = "lua", + filename = "s-fonts-system", + status = "okay", + }, { category = "lua", filename = "s-fonts-tables", @@ -5299,11 +5309,6 @@ return { filename = "s-fnt-10", status = "todo", }, - { - category = "mkiv", - filename = "s-fnt-11", - status = "todo", - }, { category = "mkiv", filename = "s-fnt-20", @@ -5316,18 +5321,18 @@ return { }, { category = "mkiv", - filename = "s-fnt-23", + filename = "s-fnt-24", status = "todo", }, { category = "mkiv", - filename = "s-fnt-24", + filename = "s-fnt-30", status = "todo", }, { category = "mkiv", - filename = "s-fnt-30", - status = "todo", + filename = "s-fonts-coverage", + status = "okay", }, { category = "mkiv", @@ -5349,6 +5354,11 @@ return { filename = "s-fonts-shapes", status = "okay", }, + { + category = "mkiv", + filename = "s-fonts-system", + status = "okay", + }, { category = "mkiv", filename = "s-fonts-tables", diff --git a/tex/context/base/syst-aux.mkiv b/tex/context/base/syst-aux.mkiv index a590d0b65..542b132ae 100644 --- a/tex/context/base/syst-aux.mkiv +++ b/tex/context/base/syst-aux.mkiv @@ -470,6 +470,8 @@ \def\setugvalue #1{\normalprotected\expandafter\gdef\csname#1\endcsname} \def\setuxvalue #1{\normalprotected\expandafter\xdef\csname#1\endcsname} +\unexpanded\def\getuvalue#1{\csname#1\endcsname} + %D \macros %D {globallet,glet} %D diff --git a/tex/context/base/x-set-02.mkii b/tex/context/base/x-set-02.mkii index 8af98c412..7a2cd7701 100644 --- a/tex/context/base/x-set-02.mkii +++ b/tex/context/base/x-set-02.mkii @@ -25,6 +25,6 @@ \def\setinterfaceelement {\setinterfacecomponent{string}} % element \def\setinterfacecommand {\setinterfacecomponent{string}} % command -\input mult-\userinterfacetag +\input mult-\userinterfacetag.mkii \egroup \protect \endinput diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index e4e1e1e5d..9b7f60406 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 : luatex-fonts-merged.lua -- parent file : luatex-fonts.lua --- merge date : 05/16/13 23:48:12 +-- merge date : 05/18/13 00:46:06 do -- begin closure to overcome local limits and interference @@ -7434,8 +7434,8 @@ local function featuresinitializer(tfmdata,value) end end end - if basepositions then - for feature,data in next,basepositions do + if basepositionings then + for feature,data in next,basepositionings do local value=features[feature] if value then local validlookups,lookuplist=collectlookups(rawdata,feature,script,language) -- cgit v1.2.3