diff options
Diffstat (limited to 'tex/context')
-rw-r--r-- | tex/context/base/cont-new.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/context-version.pdf | bin | 2934 -> 4135 bytes | |||
-rw-r--r-- | tex/context/base/context.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/file-mod.mkvi | 23 | ||||
-rw-r--r-- | tex/context/base/font-pre.mkiv | 4 | ||||
-rw-r--r-- | tex/context/base/meta-ini.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/mlib-run.lua | 2 | ||||
-rw-r--r-- | tex/context/base/mult-ini.lua | 24 | ||||
-rw-r--r-- | tex/context/base/s-fonts-missing.lua | 101 | ||||
-rw-r--r-- | tex/context/base/s-fonts-missing.mkiv | 110 | ||||
-rw-r--r-- | tex/context/base/s-fonts-tables.lua | 26 | ||||
-rw-r--r-- | tex/context/base/s-fonts-tables.mkiv | 14 | ||||
-rw-r--r-- | tex/context/base/s-fonts-vectors.lua | 104 | ||||
-rw-r--r-- | tex/context/base/s-fonts-vectors.mkiv | 68 | ||||
-rw-r--r-- | tex/context/base/status-files.pdf | bin | 24700 -> 24691 bytes | |||
-rw-r--r-- | tex/context/base/status-lua.pdf | bin | 211726 -> 211603 bytes | |||
-rw-r--r-- | tex/context/base/status-mkiv.lua | 15 |
17 files changed, 368 insertions, 129 deletions
diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv index 754a1dc1b..00f23e8da 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.14 19:42} +\newcontextversion{2013.05.14 23:14} %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 Binary files differindex a1e2aa468..81f3a9c99 100644 --- a/tex/context/base/context-version.pdf +++ b/tex/context/base/context-version.pdf diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv index f6f4f2d1b..19bc5653d 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.14 19:42} +\edef\contextversion{2013.05.14 23:14} \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 92b8a8959..3140b35de 100644 --- a/tex/context/base/file-mod.mkvi +++ b/tex/context/base/file-mod.mkvi @@ -238,6 +238,29 @@ \unexpanded\def\doifolderversionelse#parent#child{\ctxcommand{doifolderversionelse("#parent","#child")}} \unexpanded\def\doifoldercontextelse #child{\ctxcommand{doifolderversionelse("#child")}} +%D Relatively new: + +\unexpanded\def\syst_modules_direct_lua#1% + {\ctxlua{#1()}} + +\unexpanded\def\syst_modules_single_lua#1% + {\edef\m_module_command_function{#1}% + \dosingleempty\syst_modules_single_lua_indeed} + +\def\syst_modules_single_lua_indeed[#1]% + {\ctxlua{\m_module_command_function(\!!bs#1\!!es)}} + +\unexpanded\def\syst_modules_double_lua#1% + {\edef\m_module_command_function{#1}% + \dodoubleempty\syst_modules_double_lua_indeed} + +\def\syst_modules_double_lua_indeed[#1][#2]% + {\ctxlua{\m_module_command_function(\!!bs#1\!!es,\!!bs#2\!!es)}} + +\def\installmodulecommandlua #1#2{\unexpanded\def#1{\syst_modules_direct_lua{#2}}} +\def\installmodulecommandluasingle#1#2{\unexpanded\def#1{\syst_modules_single_lua{#2}}} +\def\installmodulecommandluadouble#1#2{\unexpanded\def#1{\syst_modules_double_lua{#2}}} + % obsolete % % \def\documentresources{\@@erurl} diff --git a/tex/context/base/font-pre.mkiv b/tex/context/base/font-pre.mkiv index bd828df85..b03abed7d 100644 --- a/tex/context/base/font-pre.mkiv +++ b/tex/context/base/font-pre.mkiv @@ -191,6 +191,10 @@ % \definefontfeature[mathscript] [math-script] % \definefontfeature[mathscriptscript] [math-scriptscript] +\definefontfeature + [missing] + [missing=yes] + %D We define some colors that are used in tracing (for instance \OPENTYPE\ %D features). We cannot yet inherit because no colors are predefined. diff --git a/tex/context/base/meta-ini.mkiv b/tex/context/base/meta-ini.mkiv index 4281eef06..471798688 100644 --- a/tex/context/base/meta-ini.mkiv +++ b/tex/context/base/meta-ini.mkiv @@ -1179,7 +1179,7 @@ \stopMPextensions \startMPinitializations - PageFraction:=\lastpage>1:(\realfolio-1)/(\lastpage-1)else:1fi; + PageFraction := if \lastpage>1: (\realfolio-1)/(\lastpage-1) else: 1 fi ; \stopMPinitializations %D And some more. These are not really needed since we diff --git a/tex/context/base/mlib-run.lua b/tex/context/base/mlib-run.lua index 90a4a9195..1fc36dd80 100644 --- a/tex/context/base/mlib-run.lua +++ b/tex/context/base/mlib-run.lua @@ -117,7 +117,7 @@ local function i_finder(name,mode,ftype) -- fake message for mpost.map and metaf end local function o_finder(name,mode,ftype) - report_metapost("output file %a, mode %a, ftype %a",name,mode,ftype) + -- report_metapost("output file %a, mode %a, ftype %a",name,mode,ftype) return name end diff --git a/tex/context/base/mult-ini.lua b/tex/context/base/mult-ini.lua index 5571ee3b9..3b18738de 100644 --- a/tex/context/base/mult-ini.lua +++ b/tex/context/base/mult-ini.lua @@ -307,3 +307,27 @@ function commands.showassignerror(namespace,key,value,line) context.writestatus("setup",formatters["error in line %a, namespace %a, key %a"](line,namespace,key)) end end + +-- a simple helper + +local settings_to_hash = utilities.parsers.settings_to_hash + +local makesparse = function(t) + for k, v in next, t do + if not v or v == "" then + t[k] = nil + end + end + return t +end + +function interfaces.checkedspecification(specification) + local kind = type(specification) + if kind == "table" then + return makesparse(specification) + elseif kind == "string" and specification ~= "" then + return makesparse(settings_to_hash(specification)) + else + return { } + end +end diff --git a/tex/context/base/s-fonts-missing.lua b/tex/context/base/s-fonts-missing.lua new file mode 100644 index 000000000..0d409c3a6 --- /dev/null +++ b/tex/context/base/s-fonts-missing.lua @@ -0,0 +1,101 @@ +if not modules then modules = { } end modules ['s-fonts-missing'] = { + version = 1.001, + comment = "companion to s-fonts-missing.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.missing = moduledata.fonts.missing or { } + +local function legend(id) + local c = fonts.hashes.identifiers[id] + local privates = c.properties.privates + if privates then + local categories = table.swapped(fonts.loggers.category_to_placeholder) + -- context.starttabulate { "|l|c|c|l|" } + context.starttabulate { "|l|c|l|" } + context.HL() + context.NC() + context.bold("name") + context.NC() + context.bold("symbol") + context.NC() + -- context.bold("node") + -- context.NC() + context.bold("category") + context.NC() + context.NR() + context.HL() + for k, v in table.sortedhash(privates) do + local tag = characters.categorytags[categories[k]] + if tag and tag ~= "" then + context.NC() + context(k) + context.NC() + context.dontleavehmode() + context.char(v) + context.NC() + -- context.dontleavehmode() + -- commands.getprivatechar(k) + -- context.NC() + context(string.lower(tag)) + context.NC() + context.NR() + end + end + context.HL() + context.stoptabulate() + end +end + +function moduledata.fonts.missing.legend(specification) + specification = interfaces.checkedspecification(specification) + context.begingroup() + context.definedfont { "Mono*missing" } -- otherwise no privates added + context(function() legend(specification.id or font.current()) end) + context.endgroup() +end + +local function missings() + local collected = fonts.checkers.getmissing() + for filename, list in table.sortedhash(collected) do + if #list > 0 then + context.starttabulate { "|l|l|" } + context.NC() + context.bold("filename") + context.NC() + context(file.basename(filename)) + context.NC() + context.NR() + context.NC() + context.bold("missing") + context.NC() + context(#list) + context.NC() + context.NR() + context.stoptabulate() + context.starttabulate { "|l|c|l|" } + for i=1,#list do + local u = list[i] + context.NC() + context("%U",u) + context.NC() + context.char(u) + context.NC() + context(characters.data[u].description) + context.NC() + context.NR() + end + context.stoptabulate() + end + end +end + +function moduledata.fonts.missing.characters(specification) + context.begingroup() + context.definedfont { "Mono*missing" } -- otherwise no privates added + context(function() missings() end) + context.endgroup() +end diff --git a/tex/context/base/s-fonts-missing.mkiv b/tex/context/base/s-fonts-missing.mkiv index ec22e185b..a3bf33ddf 100644 --- a/tex/context/base/s-fonts-missing.mkiv +++ b/tex/context/base/s-fonts-missing.mkiv @@ -11,118 +11,30 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\startluacode - - moduledata.fonts = moduledata.fonts or { } - moduledata.fonts.missing = moduledata.fonts.missing or { } - - function moduledata.fonts.missing.legend(id) - local c = fonts.hashes.identifiers[id or font.current()] - local privates = c.properties.privates - if privates then - local categories = table.swapped(fonts.loggers.category_to_placeholder) - -- context.starttabulate { "|l|c|c|l|" } - context.starttabulate { "|l|c|l|" } - context.NC() - context.bold("name") - context.NC() - context.bold("symbol") - context.NC() - -- context.bold("node") - -- context.NC() - context.bold("category") - context.NC() - context.NR() - context.HL() - for k, v in table.sortedhash(privates) do - local tag = characters.categorytags[categories[k]] - if tag and tag ~= "" then - context.NC() - context(k) - context.NC() - context.dontleavehmode() - context.char(v) - context.NC() - -- context.dontleavehmode() - -- commands.getprivatechar(k) - -- context.NC() - context(string.lower(tag)) - context.NC() - context.NR() - end - end - context.stoptabulate() - end - end - - function moduledata.fonts.missing.characters() - local collected = fonts.checkers.getmissing() - for filename, list in table.sortedhash(collected) do - if #list > 0 then - context.starttabulate { "|l|l|" } - context.NC() - context.bold("filename") - context.NC() - context(file.basename(filename)) - context.NC() - context.NR() - context.NC() - context.bold("missing") - context.NC() - context(#list) - context.NC() - context.NR() - context.stoptabulate() - context.starttabulate { "|l|c|l|" } - for i=1,#list do - local u = list[i] - context.NC() - context("%U",u) - context.NC() - context.char(u) - context.NC() - context(characters.data[u].description) - context.NC() - context.NR() - end - context.stoptabulate() - end - end - end - -\stopluacode - -\definefontfeature[missing][missing=yes] - -\unexpanded\def\showmissingcharacterslegend - {\begingroup - \definedfont[Mono*missing]% else no privates added - \ctxlua{moduledata.fonts.missing.legend()}% - \endgroup} +\registerctxluafile{s-fonts-missing}{} -\unexpanded\def\showmissingcharacters - {\begingroup - \definedfont[Mono*missing]% else no privates added - \ctxlua{moduledata.fonts.missing.characters()}% - \endgroup} +\installmodulecommandluasingle \showmissingcharacterslegend {moduledata.fonts.missing.legend} +\installmodulecommandluasingle \showmissingcharacters {moduledata.fonts.missing.characters} \continueifinputfile{s-fonts-missing.mkiv} % the sooner, the more efficient, see log for details -% \enabletrackers[fonts.missing=replace] +\enabletrackers[fonts.missing=replace] % \definefontfeature[default][default][missing=yes] % automatically when enabled -% \usemodule[art-01] - \starttext + legend: \blank + \showmissingcharacterslegend \page - ½ ⅓ ¼ ⅕ ⅙ ⅛ + sample: \blank + + ½ ⅓ ¼ ⅕ ⅙ ⅛ {\bf ½ ⅓ ¼ ⅕ ⅙ ⅛} \blank \startluacode for i=1,1000 do @@ -136,9 +48,7 @@ \page - \bf ½ ⅓ ¼ ⅕ ⅙ ⅛ - - \page + characters: \blank \showmissingcharacters diff --git a/tex/context/base/s-fonts-tables.lua b/tex/context/base/s-fonts-tables.lua index 442fadfef..2849c0540 100644 --- a/tex/context/base/s-fonts-tables.lua +++ b/tex/context/base/s-fonts-tables.lua @@ -6,15 +6,15 @@ if not modules then modules = { } end modules ['s-fonts-tables'] = { license = "see context related readme files" } +moduledata.fonts = moduledata.fonts or { } +moduledata.fonts.tables = moduledata.fonts.tables or { } + local setmetatableindex = table.setmetatableindex local sortedhash = table.sortedhash local sortedkeys = table.sortedkeys local format = string.format local concat = table.concat -moduledata.fonts = moduledata.fonts or { } -moduledata.fonts.tables = moduledata.fonts.tables or { } - local tabletracers = moduledata.fonts.tables local digits = { @@ -186,11 +186,11 @@ function tabletracers.positionings() for feature, scripts in sortedhash(gpos) do for script, languages in sortedhash(scripts) do context.NC() - context(feature) + context(feature) context.NC() - context(script) + context(script) context.NC() - context(concat(sortedkeys(languages)," ")) + context(concat(sortedkeys(languages)," ")) context.NC() context.NR() end @@ -281,18 +281,12 @@ function tabletracers.substitutions() end end -function tabletracers.all(settings) -- not interfaced - - if type(settings) == "string" then - settings = utilities.parsers.settings_to_hash(settings) - end +function tabletracers.all(specification) -- not interfaced - local title = settings and settings.title or "" + specification = interfaces.checkedspecification(specification) - if title == "" then title = false end - - if title then - context.starttitle { title = title } + if specification.title then + context.starttitle { title = specification.title } end context.startsubject { title = "Properties" } diff --git a/tex/context/base/s-fonts-tables.mkiv b/tex/context/base/s-fonts-tables.mkiv index 07e80377c..75a422368 100644 --- a/tex/context/base/s-fonts-tables.mkiv +++ b/tex/context/base/s-fonts-tables.mkiv @@ -15,15 +15,11 @@ \registerctxluafile{s-fonts-tables}{} -\unexpanded\def\showfonttables[#1]% - {\begingroup - \ctxlua{moduledata.fonts.tables.all("#1")}% currently not interfaced - \endgroup} - -\unexpanded\def\showfontproperties {\ctxlua{moduledata.fonts.tables.properties ()}} -\unexpanded\def\showfontparameters {\ctxlua{moduledata.fonts.tables.parameters ()}} -\unexpanded\def\showfontpositionings {\ctxlua{moduledata.fonts.tables.positionings ()}} -\unexpanded\def\showfontsubstitutions{\ctxlua{moduledata.fonts.tables.substitutions()}} +\installmodulecommandluasingle \showfonttables {moduledata.fonts.tables.all} +\installmodulecommandluasingle \showfontproperties {moduledata.fonts.tables.properties} +\installmodulecommandluasingle \showfontparameters {moduledata.fonts.tables.parameters} +\installmodulecommandluasingle \showfontpositionings {moduledata.fonts.tables.positionings} +\installmodulecommandluasingle \showfontsubstitutions {moduledata.fonts.tables.substitutions} \continueifinputfile{s-fonts-tables.mkiv} diff --git a/tex/context/base/s-fonts-vectors.lua b/tex/context/base/s-fonts-vectors.lua new file mode 100644 index 000000000..1bac0ae8b --- /dev/null +++ b/tex/context/base/s-fonts-vectors.lua @@ -0,0 +1,104 @@ +if not modules then modules = { } end modules ['s-fonts-vectors'] = { + version = 1.001, + comment = "companion to s-fonts-vectors.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.protrusions = moduledata.fonts.protrusions or { } +moduledata.fonts.expansions = moduledata.fonts.expansions or { } + +local NC, NR = context.NC, context.NR + +local classes = fonts.protrusions.classes +local vectors = fonts.protrusions.vectors + +function moduledata.fonts.protrusions.showvector(specification) + specification = interfaces.checkedspecification(specification) + local vector = vectors[specification.name or "?"] + if vector then + context.blank() + context.startcolumns { n = specification.columns or 3 } + context.starttabulate { "|T||cw(.5em)||" } + for unicode, values in table.sortedhash(vector) do + NC() context("%U",unicode) + NC() context("%.02f",values[1]) + NC() context("%c",unicode) + NC() context("%.02f",values[2]) + NC() NR() + end + context.stoptabulate() + context.stopcolumns() + context.blank() + end +end + +function moduledata.fonts.protrusions.showclass(specification) + specification = interfaces.checkedspecification(specification) + local class = specification.name and classes[specification.name] + local classes = class and { class} or classes + context.starttabulate { "|l|l|r|r|r|" } + NC() context.bold("name") + NC() context.bold("vector") + NC() context.bold("factor") + NC() context.bold("left") + NC() context.bold("right") + NC() NR() + for name, class in table.sortedhash(classes) do + NC() context(name) + NC() context(class.vector) + NC() context("%.02f",class.factor) + NC() context("%.02f",class.left) + NC() context("%.02f",class.right) + NC() NR() + end + context.stoptabulate() +end + +local classes = fonts.expansions.classes +local vectors = fonts.expansions.vectors + +function moduledata.fonts.expansions.showvector(specification) + specification = interfaces.checkedspecification(specification) + local vector = vectors[specification.name or "?"] + if vector then + context.blank() + context.startcolumns { n = specification.columns or 3 } + context.starttabulate { "|T|cw(.5em)||" } + for unicode, value in table.sortedhash(vector) do + NC() context("%U",unicode) + NC() context("%c",unicode) + NC() context("%.02f",value) + NC() NR() + end + context.stoptabulate() + context.stopcolumns() + context.blank() + end +end + +function moduledata.fonts.expansions.showclass(specification) + specification = interfaces.checkedspecification(specification) + local class = specification.name and classes[specification.name] + local classes = class and { class} or classes + context.starttabulate { "|l|l|r|r|r|" } + NC() context.bold("name") + NC() context.bold("vector") + NC() context.bold("step") + NC() context.bold("factor") + NC() context.bold("stretch") + NC() context.bold("shrink") + NC() NR() + for name, class in table.sortedhash(classes) do + NC() context(name) + NC() context(class.vector) + NC() context("%.02f",class.step) + NC() context("%.02f",class.factor) + NC() context("% 2i",class.stretch) + NC() context("% 2i",class.shrink) + NC() NR() + end + context.stoptabulate() +end diff --git a/tex/context/base/s-fonts-vectors.mkiv b/tex/context/base/s-fonts-vectors.mkiv new file mode 100644 index 000000000..6e8b8eeea --- /dev/null +++ b/tex/context/base/s-fonts-vectors.mkiv @@ -0,0 +1,68 @@ +%D \module +%D [ file=s-fonts-vectors, % was s-fnt-51, +%D version=2012.11.27, +%D title=\CONTEXT\ Style File, +%D subtitle=Protrusion and Expansion, +%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 is used in the \MKIV\ fonts manual. + +\registerctxluafile{s-fonts-vectors}{} + +\installmodulecommandluasingle \showprotrusionclass {moduledata.fonts.protrusions.showclass} +\installmodulecommandluasingle \showprotrusionvector {moduledata.fonts.protrusions.showvector} +\installmodulecommandluasingle \showexpansionclass {moduledata.fonts.expansions.showclass} +\installmodulecommandluasingle \showexpansionvector {moduledata.fonts.expansions.showvector} + +\continueifinputfile{s-fonts-vectors.mkiv} + +\usemodule[art-01] + +\starttext + + \startsubject[title=protrusion] + + \startsubsubject[title=class] + \showprotrusionclass + \stopsubsubject + + \startsubsubject[title=vector pure] + \showprotrusionvector[name=pure] + \stopsubsubject + + \startsubsubject[title=vector punctuation] + \showprotrusionvector[name=punctuation] + \stopsubsubject + + \startsubsubject[title=vector alpha] + \showprotrusionvector[name=alpha] + \stopsubsubject + + \startsubsubject[title=vector quality] + \showprotrusionvector[name=quality] + \stopsubsubject + + \stopsubject + + \page + + \startsubject[title=expansion] + + \startsubsubject[title=class] + \showprotrusionclass + \stopsubsubject + + \startsubsubject[title=vector quality] + \showprotrusionvector[name=quality] + \stopsubsubject + + \stopsubject + +\stoptext + diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf Binary files differindex c01100bd3..1a1a0ba90 100644 --- a/tex/context/base/status-files.pdf +++ b/tex/context/base/status-files.pdf diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf Binary files differindex c6a58153f..4d3b9e771 100644 --- a/tex/context/base/status-lua.pdf +++ b/tex/context/base/status-lua.pdf diff --git a/tex/context/base/status-mkiv.lua b/tex/context/base/status-mkiv.lua index 8e8b59f29..cc1c86d56 100644 --- a/tex/context/base/status-mkiv.lua +++ b/tex/context/base/status-mkiv.lua @@ -4267,11 +4267,21 @@ return { }, { category = "lua", + filename = "s-fonts-missing", + status = "okay", + }, + { + category = "lua", filename = "s-fonts-tables", status = "okay", }, { category = "lua", + filename = "s-fonts-vectors", + status = "okay", + }, + { + category = "lua", filename = "s-pre-71", status = "todo", }, @@ -5320,6 +5330,11 @@ return { status = "okay", }, { + category = "mkiv", + filename = "s-fonts-vectors", + status = "okay", + }, + { category = "mkvi", filename = "s-inf-01", status = "okay", |