From a1edc418e36206150ae285d16e492bceaacdb7fc Mon Sep 17 00:00:00 2001 From: Marius Date: Thu, 8 Sep 2011 22:40:15 +0300 Subject: beta 2011.09.08 21:29 --- tex/context/base/cont-new.mkii | 2 +- tex/context/base/cont-new.mkiv | 2 +- tex/context/base/context-version.pdf | Bin 4092 -> 4087 bytes tex/context/base/context-version.png | Bin 105777 -> 106215 bytes tex/context/base/context.mkii | 2 +- tex/context/base/context.mkiv | 2 +- tex/context/base/font-ini.mkiv | 69 ++-- tex/context/base/lpdf-ano.lua | 77 ++-- tex/context/base/math-ini.lua | 2 +- tex/context/base/math-map.lua | 31 ++ tex/context/base/mult-aux.lua | 7 + tex/context/base/mult-aux.mkiv | 5 +- tex/context/base/pack-box.mkii | 15 +- tex/context/base/pack-box.mkiv | 17 +- tex/context/base/pack-rul.mkiv | 2 +- tex/context/base/page-lay.mkiv | 16 +- tex/context/base/s-fnt-20.mkiv | 22 +- tex/context/base/s-fnt-25.mkiv | 263 -------------- tex/context/base/s-mat-10.mkiv | 245 +++++++++++++ tex/context/base/s-mat-11.mkiv | 106 ++++++ tex/context/base/s-mat-12.mkiv | 403 +++++++++++++++++++++ tex/context/base/scrn-fld.mkvi | 2 +- tex/context/base/status-files.pdf | Bin 23953 -> 23927 bytes tex/context/base/status-lua.pdf | Bin 162273 -> 162341 bytes tex/context/base/strc-itm.mkiv | 19 +- tex/context/base/strc-ref.lua | 32 +- tex/context/base/type-ini.mkiv | 4 +- tex/generic/context/luatex/luatex-fonts-merged.lua | 2 +- 28 files changed, 961 insertions(+), 386 deletions(-) delete mode 100644 tex/context/base/s-fnt-25.mkiv create mode 100644 tex/context/base/s-mat-10.mkiv create mode 100644 tex/context/base/s-mat-11.mkiv create mode 100644 tex/context/base/s-mat-12.mkiv diff --git a/tex/context/base/cont-new.mkii b/tex/context/base/cont-new.mkii index 786a54b79..9dc7755cc 100644 --- a/tex/context/base/cont-new.mkii +++ b/tex/context/base/cont-new.mkii @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2011.09.06 17:46} +\newcontextversion{2011.09.08 21:29} %D This file is loaded at runtime, thereby providing an %D excellent place for hacks, patches, extensions and new diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv index f3fa1ebf3..2bdc3fe67 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{2011.09.06 17:46} +\newcontextversion{2011.09.08 21:29} %D This file is loaded at runtime, thereby providing an %D excellent place for hacks, patches, extensions and new diff --git a/tex/context/base/context-version.pdf b/tex/context/base/context-version.pdf index a6f5b3ea2..0be1fa7e4 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-version.png b/tex/context/base/context-version.png index 796c6a21a..d431ee2e3 100644 Binary files a/tex/context/base/context-version.png and b/tex/context/base/context-version.png differ diff --git a/tex/context/base/context.mkii b/tex/context/base/context.mkii index 0c5b11a71..a9b01492d 100644 --- a/tex/context/base/context.mkii +++ b/tex/context/base/context.mkii @@ -20,7 +20,7 @@ %D your styles an modules. \edef\contextformat {\jobname} -\edef\contextversion{2011.09.06 17:46} +\edef\contextversion{2011.09.08 21:29} %D For those who want to use this: diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv index dc50a9492..fb22dd9b3 100644 --- a/tex/context/base/context.mkiv +++ b/tex/context/base/context.mkiv @@ -20,7 +20,7 @@ %D your styles an modules. \edef\contextformat {\jobname} -\edef\contextversion{2011.09.06 17:46} +\edef\contextversion{2011.09.08 21:29} %D For those who want to use this: diff --git a/tex/context/base/font-ini.mkiv b/tex/context/base/font-ini.mkiv index 67932657e..807b73647 100644 --- a/tex/context/base/font-ini.mkiv +++ b/tex/context/base/font-ini.mkiv @@ -1513,13 +1513,14 @@ \let\fontalternativelist\empty \let\fontstylelist \empty +\def\docheckfontnamecombinations#1% + {\def\dodocheckfontnamecombinations##1% + {\def\dododocheckfontnamecombinations####1{\checkbodyfont{####1}{##1}{#1}}% + \processcommacommand[\fontstylelist]\dododocheckfontnamecombinations}% + \processcommacommand[\fontalternativelist]\dodocheckfontnamecombinations} + \def\checkfontnamecombinations % we need to split math and text here ... todo (math only has mr and mb) - {\def\docommand##1% - {\def\dodocommand####1% - {\def\dododocommand########1{\checkbodyfont{########1}{####1}{##1}}% - \processcommacommand[\fontstylelist]\dododocommand}% - \processcommacommand[\fontalternativelist]\dodocommand}% - \processcommacommand[\fontsizelist]\docommand} + {\processcommacommand[\fontsizelist]\docheckfontnamecombinations} \unexpanded\def\definefontsize[#1]% sneller met toks {\addtocommalist{#1}\fontsizelist @@ -1708,7 +1709,7 @@ \the\everyendfontdef \fi} -%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%% todo: inheritance with parent \unexpanded\def\definebodyfontenvironment {\dotripleempty\dodefinebodyfontenvironment} @@ -1739,13 +1740,13 @@ \else % speeding this up saves 0.01 sec on a run (tested 20100817) % but some day we will clean this up anyway - \def\docommand##1% + \def\dodododefinebodyfontenvironment##1% {\scratchdimen\csname\??ft\s!default##1\endcsname\dimexpr#1\relax \edef\tempbodyfontsize{\thenormalizedbodyfontsize\scratchdimen}% \letvalue{\??ft#2#1##1}\tempbodyfontsize}% - \processcommacommand[\fontrelativesizelist]\docommand + \processcommacommand[\fontrelativesizelist]\dodododefinebodyfontenvironment \copyparameters - [\??ft#2#1][\??ft\s!default] + [\??ft#2#1][\??ft\s!default]% [\c!interlinespace,\c!em]% \fi \getparameters[\??ft#2#1][#3]% @@ -1802,18 +1803,19 @@ {\ifcsname\??ft #1\c!em\endcsname\else\docheckbodyfontenvironment\empty {#1}\fi \ifcsname\??ft\fontclass#1\c!em\endcsname\else\docheckbodyfontenvironment\fontclass{#1}\fi} +\def\dodocheckbodyfontenvironment#1#2% text script scriptscript x xx big small + {\setevalue{\??ft#1\tempbodyfontsize#2}% + {\thenormalizedbodyfontsize{\csname\??ft\s!default#2\endcsname\dimexpr\tempbodyfontsize\relax}}} + \def\docheckbodyfontenvironment#1#2% class size (simplified version of definebodyfontenvironment) {\@@beginfontdef \edef\tempbodyfontsize{\thenormalizedbodyfontsize{#2}}% \addtocommalist\tempbodyfontsize\bodyfontenvironmentlist - \def\docommand##1% text script scriptscript x xx big small - {\setevalue{\??ft#1\tempbodyfontsize##1}% - {\thenormalizedbodyfontsize{\csname\??ft\s!default##1\endcsname\dimexpr\tempbodyfontsize\relax}}}% - \processcommacommand[\fontrelativesizelist]\docommand + \processcommacommand[\fontrelativesizelist]{\dodocheckbodyfontenvironment{#1}}% \copyparameters % can inherit [\??ft#1\tempbodyfontsize][\??ft\s!default] [\c!interlinespace,\c!em]% -% \ifproductionrun + %\ifproductionrun \ifcsname\@size@\tempbodyfontsize\endcsname \else \letvalueempty{\@size@\tempbodyfontsize}% prevent loop \pushmacro\fontclass @@ -1821,7 +1823,7 @@ \normalexpanded{\defineunknownfont{\tempbodyfontsize}}% we can also inherit here \popmacro\fontclass \fi -% \fi + %\fi \setevalue{\@size@#1}{\noexpand\docompletefontswitch[#1]}% \@@endfontdef} @@ -2937,17 +2939,13 @@ %D \definefontstyle [sansserif,ss] [ss] %D \stoptyping +\def\dododefinefontstyle#1#2% + {\setvalue{\@shortstyle@#2}{#1}% + \setvalue{\@style@#2}{\csname#1\endcsname}} + \def\dodefinefontstyle[#1][#2]% - {\rawdoifinsetelse{#2}{\fontstylelist} - {%\debuggerinfo\m!fonts{unknown style #2}% - } - {%\debuggerinfo\m!fonts8{#2\space (#1)}% - \addtocommalist{#2}\fontstylelist}% - % check kan hier - \def\docommand##1% - {\setvalue{\@shortstyle@##1}{#2}% - \setvalue{\@style@##1}{\csname#2\endcsname}}% - \processcommalist[#1]\docommand} + {\rawdoifinsetelse{#2}{\fontstylelist}{}{\addtocommalist{#2}\fontstylelist}% + \processcommalist[#1]{\dododefinefontstyle{#2}}} \unexpanded\def\definefontstyle {\dodoubleargument\dodefinefontstyle} @@ -3330,8 +3328,8 @@ %D because \PLAIN\ \TEX\ is english anyway. \def\dodefinebodyfontswitch[#1][#2]% - {\def\docommand##1{\setvalue{##1}{\switchtobodyfont[#2]}}% - \processcommalist[#1]\docommand} + {\def\dododefinebodyfontswitch##1{\setvalue{##1}{\switchtobodyfont[#2]}}% + \processcommalist[#1]\dododefinebodyfontswitch} \unexpanded\def\definebodyfontswitch {\dodoubleargument\dodefinebodyfontswitch} @@ -3472,13 +3470,6 @@ %D text and headings, which is accomplished by assigning both %D arguments. -% \def\dodefinealternativestyle[#1][#2][#3]% -% {\def\docommand##1% -% {\ifcsname##1\endcsname\else\setuvalue{##1}{\groupedcommand{#2}{}}\fi -% \setvalue{\@letter@ ##1}{#2}% -% \setvalue{\@noletter@##1}{#3}}% -% \processcommalist[#1]\docommand} - \setnewconstant \currentalternativestyleindex \plusone \def\dododefinealternativestyle#1#2#3% @@ -4545,10 +4536,10 @@ \def\dodefinestylecollection[#1]% {\iffirstargument \setuvalue{#1}{\styleinstance[#1]}% - \def\docommand##1% - {\def\dodocommand####1{\letbeundefined{\??sx#1:##1:####1}}% - \processcommacommand[\fontalternativelist,\s!default]\dodocommand}% - \processcommacommand[\fontstylelist,\s!default]\docommand + \def\dododefinestylecollection##1% + {\def\dodododefinestylecollection####1{\letbeundefined{\??sx#1:##1:####1}}% + \processcommacommand[\fontalternativelist,\s!default]\dodododefinestylecollection}% + \processcommacommand[\fontstylelist,\s!default]\dododefinestylecollection \fi} \unexpanded\def\definestyleinstance diff --git a/tex/context/base/lpdf-ano.lua b/tex/context/base/lpdf-ano.lua index 9dfe42039..ece0f7de3 100644 --- a/tex/context/base/lpdf-ano.lua +++ b/tex/context/base/lpdf-ano.lua @@ -20,30 +20,31 @@ local report_reference = logs.reporter("backend","references") local report_destination = logs.reporter("backend","destinations") local report_bookmark = logs.reporter("backend","bookmarks") -local variables = interfaces.variables -local constants = interfaces.constants +local variables = interfaces.variables +local constants = interfaces.constants -local settings_to_array = utilities.parsers.settings_to_array +local settings_to_array = utilities.parsers.settings_to_array -local nodeinjections = backends.pdf.nodeinjections -local codeinjections = backends.pdf.codeinjections -local registrations = backends.pdf.registrations +local nodeinjections = backends.pdf.nodeinjections +local codeinjections = backends.pdf.codeinjections +local registrations = backends.pdf.registrations -local javascriptcode = interactions.javascripts.code +local javascriptcode = interactions.javascripts.code -local references = structures.references -local bookmarks = structures.bookmarks +local references = structures.references +local bookmarks = structures.bookmarks -local runners = references.runners -local specials = references.specials -local handlers = references.handlers -local executers = references.executers +local runners = references.runners +local specials = references.specials +local handlers = references.handlers +local executers = references.executers +local getinnermethod = references.getinnermethod -local nodepool = nodes.pool +local nodepool = nodes.pool -local pdfannotation_node = nodepool.pdfannotation -local pdfdestination_node = nodepool.pdfdestination -local latelua_node = nodepool.latelua +local pdfannotation_node = nodepool.pdfannotation +local pdfdestination_node = nodepool.pdfdestination +local latelua_node = nodepool.latelua local pdfdictionary = lpdf.dictionary local pdfarray = lpdf.array @@ -57,23 +58,21 @@ local pdfpagereference = lpdf.pagereference local pdfdelayedobject = lpdf.delayedobject local pdfregisterannotation = lpdf.registerannotation -local pdf_annot = pdfconstant("Annot") -local pdf_uri = pdfconstant("URI") -local pdf_gotor = pdfconstant("GoToR") -local pdf_goto = pdfconstant("GoTo") -local pdf_launch = pdfconstant("Launch") -local pdf_javascript = pdfconstant("JavaScript") -local pdf_link = pdfconstant("Link") -local pdf_n = pdfconstant("N") -local pdf_t = pdfconstant("T") -local pdf_fit = pdfconstant("Fit") -local pdf_named = pdfconstant("Named") - -- todo: 3dview -local pdf_border = pdfarray { 0, 0, 0 } +local pdf_annot = pdfconstant("Annot") +local pdf_uri = pdfconstant("URI") +local pdf_gotor = pdfconstant("GoToR") +local pdf_goto = pdfconstant("GoTo") +local pdf_launch = pdfconstant("Launch") +local pdf_javascript = pdfconstant("JavaScript") +local pdf_link = pdfconstant("Link") +local pdf_n = pdfconstant("N") +local pdf_t = pdfconstant("T") +local pdf_fit = pdfconstant("Fit") +local pdf_named = pdfconstant("Named") -local getinnermethod = references.getinnermethod +local pdf_border = pdfarray { 0, 0, 0 } local cache = { } @@ -454,6 +453,14 @@ function specials.userpage(var,actions) end end +function specials.deltapage(var,actions) + local p = tonumber(var.operation) + if p then + p = references.checkedrealpage(p + texcount.realpageno) + return link(nil,nil,nil,p,actions) + end +end + -- sections --~ function specials.section(var,actions) @@ -579,9 +586,11 @@ function executers.submitform(arguments) } end +local pdf_hide = pdfconstant("Hide") + function executers.hide(arguments) return pdfdictionary { - S = pdfconstant("Hide"), + S = pdf_hide, H = true, T = arguments, } @@ -589,7 +598,7 @@ end function executers.show(arguments) return pdfdictionary { - S = pdfconstant("Hide"), + S = pdf_hide, H = false, T = arguments, } @@ -633,7 +642,7 @@ function specials.action(var) end --~ entry.A = pdfdictionary { ---~ S = pdfconstant("GoTo"), +--~ S = pdf_goto, --~ D = .... --~ } diff --git a/tex/context/base/math-ini.lua b/tex/context/base/math-ini.lua index 6595dca3a..9d63cff5b 100644 --- a/tex/context/base/math-ini.lua +++ b/tex/context/base/math-ini.lua @@ -228,7 +228,7 @@ local function report(class,family,unicode,name) end end --- there will be a combined \(math)chardef +-- there will be a combined \(math)chardef (tracker) function mathematics.define(family) family = family or 0 diff --git a/tex/context/base/math-map.lua b/tex/context/base/math-map.lua index 49bfa74e2..3f3ef2a31 100644 --- a/tex/context/base/math-map.lua +++ b/tex/context/base/math-map.lua @@ -34,6 +34,37 @@ local report_remapping = logs.reporter("mathematics","remapping") mathematics = mathematics or { } local mathematics = mathematics +-- Unfortunately some alphabets have gaps (thereby troubling all applications that +-- need to deal with math). Somewhat strange considering all those weird symbols that +-- were added afterwards. + +mathematics.gaps = { + [0x1D455] = 0x0210E, -- H + [0x1D49D] = 0x0212C, -- script B + [0x1D4A0] = 0x02130, -- script E + [0x1D4A1] = 0x02131, -- script F + [0x1D4A3] = 0x0210B, -- script H + [0x1D4A4] = 0x02110, -- script I + [0x1D4A7] = 0x02112, -- script L + [0x1D4A8] = 0x02133, -- script M + [0x1D4AD] = 0x0211B, -- script R + [0x1D4BA] = 0x0212F, -- script e + [0x1D4BC] = 0x0210A, -- script g + [0x1D4C4] = 0x02134, -- script o + [0x1D506] = 0x0212D, -- fraktur C + [0x1D50B] = 0x0210C, -- fraktur H + [0x1D50C] = 0x02111, -- fraktur I + [0x1D515] = 0x0211C, -- fraktur R + [0x1D51D] = 0x02128, -- fraktur Z + [0x1D53A] = 0x02102, -- bb C + [0x1D53F] = 0x0210D, -- bb H + [0x1D545] = 0x02115, -- bb N + [0x1D547] = 0x02119, -- bb P + [0x1D548] = 0x0211A, -- bb Q + [0x1D549] = 0x0211D, -- bb R + [0x1D551] = 0x02124, -- bb Z +} + -- we could use one level less and have tf etc be tables directly but the -- following approach permits easier remapping of a-a, A-Z and 0-9 to -- fallbacks; symbols is currently mostly greek diff --git a/tex/context/base/mult-aux.lua b/tex/context/base/mult-aux.lua index cbecd2df1..1bf32cd9d 100644 --- a/tex/context/base/mult-aux.lua +++ b/tex/context/base/mult-aux.lua @@ -108,6 +108,13 @@ function namespaces.define(namespace,settings) report_namespaces("installing set/let/reset command for '%s' (multiple)",name) end end + local frame = ns.frame + if frame == v_yes then + context.installinheritedframed(name) + if trace_namespaces then + report_namespaces("installing framed command for '%s'",name) + end + end context.protect() end diff --git a/tex/context/base/mult-aux.mkiv b/tex/context/base/mult-aux.mkiv index 52dbf8966..01c186589 100644 --- a/tex/context/base/mult-aux.mkiv +++ b/tex/context/base/mult-aux.mkiv @@ -68,7 +68,7 @@ {\ifx#2\relax\let#2\empty\fi \def#3##1{\csname#4{#1#2}{##1}\endcsname}% \def#4##1##2{\ifcsname##1:##2\endcsname##1:##2\else\expandafter#5\csname##1:\s!parent\endcsname{##2}\fi}% - \def#5##1##2{\ifx##1\relax\s!empty\else#4{##1}{##2}\fi}% + \def#5##1##2{\ifx##1\relax\s!empty\else#4{##1}{##2}\fi}% is {} needed around ##1 ? \def#6##1##2{\csname#4{#1##1}{##2}\endcsname}% \def#7##1{\detokenize\expandafter\expandafter\expandafter{\csname#1:##1\endcsname}}% always root \def#8##1{\csname\ifcsname#1#2:##1\endcsname#1#2:##1\else\s!empty\fi\endcsname}} @@ -89,11 +89,10 @@ {\ifx#2\relax\let#2\empty\fi \def#3##1{#4{#1#2}{##1}:}% \def#4##1##2{\ifcsname##1:##2\endcsname##1\else\expandafter#5\csname##1:\s!parent\endcsname{##2}\fi}% - \def#5##1##2{\ifx##1\relax\else#4{##1}{##2}\fi}% + \def#5##1##2{\ifx##1\relax\else#4{##1}{##2}\fi}% is {} needed around ##1 ? \def#6{#1#2:}% \def#7##1{#1##1:}}% - \unexpanded\def\installparameterhashhandler#1#2% {\normalexpanded {\doinstallparameterhashhandler diff --git a/tex/context/base/pack-box.mkii b/tex/context/base/pack-box.mkii index 8e7700b21..1752e2b91 100644 --- a/tex/context/base/pack-box.mkii +++ b/tex/context/base/pack-box.mkii @@ -572,14 +572,17 @@ {\dowithnextbox{\setlayer[#1][#2]{\flushnextbox}}% \hbox\framed[#3]} +% \def\dosetlayerframedS[#1][#2][#3]% +% {\dowithnextbox +% {\setlayer[#1][\c!width=\nextboxwd,\c!height=\nextboxht,\c!offset=\!!zeropoint,#2]{\flushnextbox}}% +% \hbox\framed[\c!location=\v!normal,#2]} +% +% better (2011-09-06) + \def\dosetlayerframedS[#1][#2][#3]% {\dowithnextbox - {\setlayer - [#1] - [\c!width=\nextboxwd,\c!height=\nextboxht, - \c!offset=\!!zeropoint,#2] - {\flushnextbox}}% - \hbox\framed[\c!location=\v!normal,#2]} + {\setlayer[#1][\c!width=\nextboxwd,\c!height=\nextboxht,#2,\c!offset=\!!zeropoint]{\flushnextbox}}% + \hbox\framed[\c!location=\v!normal,#2]} \def\setlayertext {\dotripleempty\dosetlayertext} diff --git a/tex/context/base/pack-box.mkiv b/tex/context/base/pack-box.mkiv index b51a20448..7c755ee7f 100644 --- a/tex/context/base/pack-box.mkiv +++ b/tex/context/base/pack-box.mkiv @@ -78,7 +78,7 @@ \def\dodoanchorS[#1][#2][#3]% {\dodoanchorT[#1][#2][#2]} -\def\dodoanchorT[#1][#2][#3]% +\def\dodoanchorT[#1][#2][#3]% brrr: we need to apply offset only once .. a bit messy {\dowithnextbox {\bgroup \checktextbackgrounds @@ -571,10 +571,21 @@ {\dowithnextbox{\setlayer[#1][#2]{\flushnextbox}}% \hbox\framed[#3]} +% tricky: offsets apply to both the layer and the framed; it makes sense to +% only apply the offset to ... + +% \def\dosetlayerframedS[#1][#2][#3]% +% {\dowithnextbox % we could use a local setlayer command (no doif..empty) which also saves a nextbox +% {\setlayer[#1][\c!width=\nextboxwd,\c!height=\nextboxht,\c!offset=\!!zeropoint,#2]{\flushnextbox}}% +% \hbox\framed[\c!location=\v!normal,#2]}% could be a fast one +% +% better (2011-09-06) + \def\dosetlayerframedS[#1][#2][#3]% {\dowithnextbox % we could use a local setlayer command (no doif..empty) which also saves a nextbox - {\setlayer[#1][\c!width=\nextboxwd,\c!height=\nextboxht,\c!offset=\!!zeropoint,#2]{\flushnextbox}}% - \hbox\framed[\c!location=\v!normal,#2]} + {\setlayer[#1][\c!width=\nextboxwd,\c!height=\nextboxht,#2,\c!offset=\!!zeropoint]{\flushnextbox}}% +% \hbox\framed[\c!location=\v!normal,#2]}% could be a fast one (no #2,\c!offset=\defaultframeoffset) + \hbox\localframedwithsettings[][\c!location=\v!normal,#2]}% \def\setlayertext {\dotripleempty\dosetlayertext} diff --git a/tex/context/base/pack-rul.mkiv b/tex/context/base/pack-rul.mkiv index 6c1a3ca9f..face31209 100644 --- a/tex/context/base/pack-rul.mkiv +++ b/tex/context/base/pack-rul.mkiv @@ -773,7 +773,7 @@ \let\normalframedparameter \framedparameter \let\normalframedparameterhash\framedparameterhash -\def\doinitializeframed#1% +\def\doinitializeframed#1% will be inlined {\inframedtrue \edef\@@framed{#1}% \let\framedparameter \normalframedparameter diff --git a/tex/context/base/page-lay.mkiv b/tex/context/base/page-lay.mkiv index b04008f9a..f76a03727 100644 --- a/tex/context/base/page-lay.mkiv +++ b/tex/context/base/page-lay.mkiv @@ -1336,13 +1336,15 @@ %D a bunch of sizes with $4:3$ ratios. The \type {S6} size is %D nearly as wide as a sheet of \type {A4} paper. -\definepapersize [S3] [\c!width=300pt,\c!height=225pt] -\definepapersize [S4] [\c!width=400pt,\c!height=300pt] -\definepapersize [S5] [\c!width=500pt,\c!height=375pt] -\definepapersize [S6] [\c!width=600pt,\c!height=450pt] -\definepapersize [S8] [\c!width=800pt,\c!height=600pt] -\definepapersize [SW] [\c!width=800pt,\c!height=450pt] -\definepapersize [SM] [\c!width=720pt,\c!height=450pt] +\definepapersize [S3] [\c!width=300pt,\c!height=225pt] +\definepapersize [S4] [\c!width=400pt,\c!height=300pt] +\definepapersize [S5] [\c!width=500pt,\c!height=375pt] +\definepapersize [S6] [\c!width=600pt,\c!height=450pt] +\definepapersize [S8] [\c!width=800pt,\c!height=600pt] +\definepapersize [SW] [\c!width=800pt,\c!height=450pt] +\definepapersize [SM] [\c!width=720pt,\c!height=450pt] +\definepapersize [HD] [\c!width=1920pt,\c!height=1080pt] +\definepapersize [HD+] [\c!width=1920pt,\c!height=1200pt] %D These are handy too: diff --git a/tex/context/base/s-fnt-20.mkiv b/tex/context/base/s-fnt-20.mkiv index e4ba08869..5ea740c0a 100644 --- a/tex/context/base/s-fnt-20.mkiv +++ b/tex/context/base/s-fnt-20.mkiv @@ -21,7 +21,8 @@ % font=husayni, % sample={ببب بببب ببببب بببببب}] -\def\checkedfeature#1#2{\ifnum\featureattribute{#1}=\zerocount#2\else#1\fi} +\def\checkedotftrackerfeature #1{otftracker-\ifnum\featureattribute{otftracker-#1}=\zerocount default\else#1\fi} +\def\checkedotftrackerdirection#1{\csname otftracker-direction-\ifcsname otftracker-direction-#1\endcsname#1\else default\fi\endcsname} % we can consider adding a dir key to features @@ -49,7 +50,7 @@ \definefontfeature [otftracker-husayni] [analyze=yes,mode=node, - language=dflt,script=arab,ccmp=no, + language=dflt,script=arab, init=yes,medi=yes,fina=yes, rlig=yes, ccmp=yes, @@ -57,12 +58,13 @@ ss05=yes, % full Jiim stacking ss09=yes, % full Haa stacking ss10=yes, % partial dipped Miim - % ss11=yes, % full dipped Miim ss13=yes, % full stacked Miim ss15=yes, % full stacked Laam-on-Miim ss17=yes, % full stacked Ayn-on-Miim ss19=yes, % LM_im - ss24=yes,ss25=yes,ss26=yes, % BX, LH_im, full Yaa.final specials + ss24=yes, % BX specials + ss25=yes, % LH_im specials + ss26=yes, % full Yaa.final specials ss27=yes, % partial thin Miim.final ss31=yes, % partial Raa.final contexts ss34=yes, % partial Raa.final contexts @@ -73,10 +75,7 @@ ss39=yes, % high and low Baa strings ss40=yes, % diagonal entry ss41=yes, % initial alternates - % js06=yes,js08=yes,js10=yes,js11=yes,js17=yes, - % ttwl=yes, - mark=yes,mkmk=yes, - kern=yes,curs=yes] + mark=yes,mkmk=yes,kern=yes,curs=yes] \definefontfeature [otftracker-simplenaskhi] @@ -84,21 +83,22 @@ language=dflt,script=arab, init=yes,medi=yes,fina=yes,calt=yes, rlig=yes,liga=yes,dlig=yes, - mark=yes,mkmk=yes,curs=yes] + mark=yes,mkmk=yes,kern=yes,curs=yes] \setvalue{otftracker-direction-arabtype}{-1} \setvalue{otftracker-direction-husayni}{-1} \setvalue{otftracker-direction-simplenaskhi}{-1} +\setvalue{otftracker-direction-default}{0} \setvariables [otftracker] [font=Serif, - features=\checkedfeature{otftracker-\getvariable{otftracker}{font}}{otftracker-default}, + features=\checkedotftrackerfeature{\getvariable{otftracker}{font}}, + direction=\checkedotftrackerdirection{\getvariable{otftracker}{font}}, size=48pt, figure=, title=Feature Check, sample=no sample, - direction=\executeifdefined{otftracker-direction-\getvariable{otftracker}{font}}{0}, set=\setups{otftracker}] \setuplayout diff --git a/tex/context/base/s-fnt-25.mkiv b/tex/context/base/s-fnt-25.mkiv deleted file mode 100644 index ae19d2434..000000000 --- a/tex/context/base/s-fnt-25.mkiv +++ /dev/null @@ -1,263 +0,0 @@ -%D \module -%D [ file=s-fnt-25, -%D version=2009.01.25, -%D title=\CONTEXT\ Style File, -%D subtitle=Math Glyph Checking, -%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. - -\def\enableshowmathfontvirtual - {\ctxlua{fonts.constructors.autocleanup=false}} - -\def\showmathfontcharacters - {\dodoubleempty\doshowmathfontcharacters} - -\def\doshowmathfontcharacters[#1][#2]% - {\begingroup - \dontcomplain - \doifelsenothing{#1} - {\definedfont[MathRoman*math-text]} - {\definedfont[#1]}% - \doifelsenothing{#2} - {\ctxlua{document.showmathfont(font.current())}} - {\def\dodoshowmathfontcharacters##1{\ctxlua{document.showmathfont(font.current(),##1)}}% - \processcommalist[#2]\dodoshowmathfontcharacters}% - \endgroup} - -\def\startmathfontlist - {\startpacked} - -\def\stopmathfontlist - {\stoppacked} - -\def\startmathfontlistentry - {\blank - \begingroup} - -\def\stopmathfontlistentry - {\endgroup - \blank} - -\def\mathfontlistentryhexdectit#1#2#3% - {#1: \char#2\enspace\ruledhbox{\char#2}\enspace#3\par - \advance\leftskip 1em\relax} - -\def\mathfontlistentrywdhtdpic#1#2#3#4% - {width: #1, height: #2, depth: #3, italic: #4\par} - -\def\mathfontlistentryresource#1% - {virtual: #1\par} - -\def\mathfontlistentrynext#1#2% - {#1~\ruledhbox{\char#2}} - -\def\mathfontlistentrynextlist#1% - {next: #1\par} - -\def\fontlistentryvariants#1#2% - {#1~\ruledhbox{\char#2}} - -\def\mathfontlistentryvariantslist#1% - {variants: #1\par} - -\def\mathfontlistentrynextvariantslist#1#2% - {next: #1 => variants: #2\par} - -\def\mathfontlistentryclassname#1#2% - {mathclass: #1, mathname: #2\par} - -\def\mathfontlistentrysymbol#1#2% - {mathsymbol: #1~\ruledhbox{\char#2}\par} - -\def\startmathfontlookupvariants - {lookupvariants: } - -\def\stopmathfontlookupvariants - {\par} - -\def\mathfontlookupvariant#1#2% - {#1:~\char#2} - -\startluacode -local concat = table.concat -local format, lower = string.format, string.lower -local utfchar = utf.char - -local fontdata = fonts.hashes.identifiers - -function document.showmathfont(id,slot) - local data = characters.data - local tfmdata = fontdata[id] - local characters = tfmdata.characters - local descriptions = tfmdata.descriptions - local resources = tfmdata.resources - local lookuptypes = resources.lookuptypes - local sorted = (slot and { slot }) or table.sortedkeys(characters) - local virtual, names = tfmdata.properties.virtualized, { } - if virtual then - for k, v in ipairs(tfmdata.fonts) do - local id = v.id - local name = fontdata[id].properties.name - names[k] = (name and file.basename(name)) or id - end - end - local round = math.round - local limited = true - for _, s in next, sorted do - if not limited or s < 0xF0000 then - local char = characters[s] - local desc = descriptions[s] - if char then - local info = data[s] - local cnext, cvert_variants, choriz_variants = char.next, char.vert_variants, char.horiz_variants - context.startmathfontlistentry() - context.mathfontlistentryhexdectit(format("U+%05X",s),s,lower(info.description or "no description, private to font")) - context.mathfontlistentrywdhtdpic(round(char.width or 0),round(char.height or 0),round(char.depth or 0),round(char.italic or 0)) - if virtual then - local commands = char.commands - if commands then - local t = { } - for i=1,#commands do - local ci = commands[i] - if ci[1] == "slot" then - local fnt, idx = ci[2], ci[3] - t[#t+1] = format("%s/%0X",names[fnt] or fnt,idx) - end - end - if #t > 0 then - context.mathfontlistentryresource(concat(t,", ")) - end - end - end - if info.mathclass then - context.mathfontlistentryclassname(info.mathclass,info.mathname or "no name") - end - if info.mathspec then - for i=1,#info.mathspec do - context.mathfontlistentryclassname(info.mathspec[i].class,info.mathspec[i].name or "no name") - end - end - if info.mathsymbol then - context.mathfontlistentrysymbol(format("U+%05X",info.mathsymbol),info.mathsymbol) - end - if cnext then - local t, done = { }, { } - while cnext do - if done[cnext] then - t[#t+1] = "CYCLE" - break - else - done[cnext] = true - t[#t+1] = context.nested.mathfontlistentrynext(format("U+%05X",cnext),cnext) - cnext = characters[cnext] - cvert_variants = cnext.vert_variants or cvert_variants - choriz_variants = cnext.horiz_variants or choriz_variants - if cnext then - cnext = cnext.next - end - end - end - cnext = t - end - if cvert_variants then - local t = { } - for k, v in next, cvert_variants do - t[#t+1] = context.nested.fontlistentryvariants(format("U+%05X",v.glyph),v.glyph) - end - cvert_variants = t - end - if choriz_variants then - local t = { } - for k, v in next, choriz_variants do - t[#t+1] = context.nested.fontlistentryvariants(format("U+%05X",v.glyph),v.glyph) - end - choriz_variants = t - end - local cvariants = choriz_variants or cvert_variants - if cvariants and cnext then - context.mathfontlistentrynextvariantslist(concat(cnext," => "),concat(cvariants," => ")) - else - if cnext then - context.mathfontlistentrynextlist(concat(cnext," => ")) - end - if cvariants then - context.mathfontlistentryvariantslist(concat(cvariants," ")) - end - end - local slookups = desc.slookups - local mlookups = desc.mlookups - if slookups or mlookups then - local variants = { } - if slookups then - for lookupname, lookupdata in next, slookups do - local lookuptype = lookuptypes[lookupname] - if lookuptype == "substitution" then - variants[lookupdata] = true - elseif lookuptype == "alternate" then - for i=1,#lookupdata do - variants[lookupdata[i]] = true - end - end - end - end - if mlookups then - for lookupname, lookuplist in next, mlookups do - local lookuptype = lookuptypes[lookupname] - for i=1,#lookuplist do - local lookupdata = lookuplist[i] - local lookuptype = lookuptypes[lookupname] - if lookuptype == "substitution" then - variants[lookupdata] = true - elseif lookuptype == "alternate" then - for i=1,#lookupdata do - variants[lookupdata[i]] = true - end - end - end - end - end - variants = table.sortedkeys(variants) - context.startmathfontlookupvariants() - for i=1,#variants do - local variant = variants[i] - context.mathfontlookupvariant(format("U+%05X",variant),variant) - end - context.stopmathfontlookupvariants() - end - context.stopmathfontlistentry() - end - end - end -end -\stopluacode - -\continueifinputfile{s-fnt-25.mkiv} % \doifnotmode{demo}\endinput - -\setuplayout - [width=middle, - height=middle, - topspace=15mm, - backspace=15mm, - bottomspace=15mm, - header=1cm, - headerdistance=0.5cm, - footer=0pt] - -\starttext -% \setupbodyfont[cambria, 12pt] \showmathfontcharacters -% \setupbodyfont[lmvirtual,12pt] \showmathfontcharacters -% \setupbodyfont[pxvirtual,12pt] \showmathfontcharacters -% \setupbodyfont[txvirtual,12pt] \showmathfontcharacters -% \setupbodyfont[palatino, 10pt] \showmathfontcharacters -% \setupbodyfont[mathtimes,12pt] \showmathfontcharacters -% \setupbodyfont[stix, 12pt] \showmathfontcharacters - \setupbodyfont[xits, 12pt] \showmathfontcharacters -% \setupbodyfont[lucida, 12pt] \showmathfontcharacters -% \setupbodyfont[lucida-nova, 12pt] \showmathfontcharacters -\stoptext - diff --git a/tex/context/base/s-mat-10.mkiv b/tex/context/base/s-mat-10.mkiv new file mode 100644 index 000000000..5fb020765 --- /dev/null +++ b/tex/context/base/s-mat-10.mkiv @@ -0,0 +1,245 @@ +%D \module +%D [ file=s-mat-10.mkiv, % was: s-fnt-25 +%D version=2009.01.25, +%D title=\CONTEXT\ Style File, +%D subtitle=Math Glyph Checking, +%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 base module will be cleaned up and extended. + +\def\enableshowmathfontvirtual + {\ctxlua{fonts.constructors.autocleanup=false}} + +\def\showmathfontcharacters + {\dodoubleempty\doshowmathfontcharacters} + +\def\doshowmathfontcharacters[#1][#2]% + {\begingroup + \dontcomplain + \doifelsenothing{#1} + {\definedfont[MathRoman*math-text]} + {\definedfont[#1]}% + \doifelsenothing{#2} + {\ctxlua{document.showmathfont(font.current())}} + {\def\dodoshowmathfontcharacters##1{\ctxlua{document.showmathfont(font.current(),##1)}}% + \processcommalist[#2]\dodoshowmathfontcharacters}% + \endgroup} + +% the interface might (and will) change + +\let\startmathfontlist \relax +\let\stopmathfontlist \relax +\let\mathfontlistreference \gobbleoneargument +\let\startmathfontlistentry \relax +\let\stopmathfontlistentry \relax +\let\mathfontlistentryhexdectit \gobblethreearguments +\let\mathfontlistentrywdhtdpic \gobblefourarguments +\let\mathfontlistentryresource \gobbleoneargument +\let\startmathfontlistnext \relax +\let\mathfontlistnextentry \gobblethreearguments +\let\mathfontlistnextcycle \gobbleonearguments +\let\stopmathfontlistnext \relax +\let\startmathfontlisthvariants \relax +\let\mathfontlisthvariantsentry \gobblethreearguments +\let\stopmathfontlisthvariants \relax +\let\startmathfontlistvvariants \startmathfontlisthvariants +\let\mathfontlistvvariantsentry \mathfontlisthvariantsentry +\let\stopmathfontlistvvariants \stopmathfontlisthvariants +\let\mathfontlistbetweennextandvariants\relax +\let\startmathfontlistentryclassspec \relax +\let\stopmathfontlistentryclassspec \relax +\let\mathfontlistentryclassname \gobbletwoarguments +\let\mathfontlistentrysymbol \gobbletwoarguments +\let\startmathfontlookupvariants \relax +\let\stopmathfontlookupvariants \relax +\let\mathfontlookupvariant \gobblefourarguments + +\startluacode +local concat = table.concat +local format, lower = string.format, string.lower +local utfchar = utf.char +local round = math.round + +local fontdata = fonts.hashes.identifiers +local chardata = characters.data + +local no_description = "no description, private to font" + +local limited = true +local fillinthegaps = true +local upperlimit = 0x000FF +local upperlimit = 0xF0000 + +function document.showmathfont(id,slot) + local tfmdata = fontdata[id] + local characters = tfmdata.characters + local descriptions = tfmdata.descriptions + local resources = tfmdata.resources + local lookuptypes = resources.lookuptypes + local virtual = tfmdata.properties.virtualized + local names = { } + local gaps = mathematics.gaps + local sorted = { } + if slot then + sorted = { slot } + elseif fillinthegaps then + sorted = table.keys(characters) + for k, v in next, gaps do + if characters[v] then + sorted[#sorted+1] = k + end + end + table.sort(sorted) + else + sorted = table.sortedkeys(characters) + end + if virtual then + for k, v in ipairs(tfmdata.fonts) do + local id = v.id + local name = fontdata[id].properties.name + names[k] = (name and file.basename(name)) or id + end + end + context.startmathfontlist() + for _, unicode in next, sorted do + if not limited or unicode < upperlimit then + local code = gaps[unicode] or unicode + local char = characters[code] + local desc = descriptions[code] + local info = chardata[code] + if char then + local next_sizes = char.next + local v_variants = char.vert_variants + local h_variants = char.horiz_variants + local commands = char.commands + local slookups = desc.slookups + local mlookups = desc.mlookups + local mathclass = info.mathclass + local mathspec = info.mathspec + local mathsymbol = info.mathsymbol + local description = info.description or no_description + context.startmathfontlistentry() + context.mathfontlistreference(format("U+%05X",unicode)) + context.mathfontlistentryhexdectit(format("U+%05X",code),code,lower(description)) + context.mathfontlistentrywdhtdpic(round(char.width or 0),round(char.height or 0),round(char.depth or 0),round(char.italic or 0)) + if virtual and commands then + local t = { } + for i=1,#commands do + local ci = commands[i] + if ci[1] == "slot" then + local fnt, idx = ci[2], ci[3] + t[#t+1] = format("%s/%0X",names[fnt] or fnt,idx) + end + end + if #t > 0 then + context.mathfontlistentryresource(concat(t,", ")) + end + end + if mathclass or mathspec then + context.startmathfontlistentryclassspec() + if mathclass then + context.mathfontlistentryclassname(mathclass,info.mathname or "no name") + end + if mathspec then + for i=1,#mathspec do + local mi = mathspec[i] + context.mathfontlistentryclassname(mi.class,mi.name or "no name") + end + end + context.stopmathfontlistentryclassspec() + end + if mathsymbol then + context.mathfontlistentrysymbol(format("U+%05X",mathsymbol),mathsymbol) + end + if next_sizes then + local n, done = 0, { } + context.startmathfontlistnext() + while next_sizes do + n = n + 1 + if done[next_sizes] then + context.mathfontlistnextcycle(n) + break + else + done[next_sizes] = true + context.mathfontlistnextentry(n,format("U+%05X",next_sizes),next_sizes) + next_sizes = characters[next_sizes] + v_variants = next_sizes.vert_variants or v_variants + h_variants = next_sizes.horiz_variants or h_variants + if next_sizes then + next_sizes = next_sizes.next + end + end + end + context.stopmathfontlistnext() + if h_variants or v_variants then + context.mathfontlistbetweennextandvariants() + end + end + if h_variants then + context.startmathfontlisthvariants() + for i=1,#h_variants do -- we might go top-down in the original + local vi = h_variants[i] + context.mathfontlisthvariantsentry(i,format("U+%05X",vi.glyph),vi.glyph) + end + context.stopmathfontlisthvariants() + elseif v_variants then + context.startmathfontlistvvariants() + for i=1,#v_variants do + local vi = v_variants[#v_variants-i+1] + context.mathfontlistvvariantsentry(i,format("U+%05X",vi.glyph),vi.glyph) + end + context.stopmathfontlistvvariants() + end + if slookups or mlookups then + local variants = { } + if slookups then + for lookupname, lookupdata in next, slookups do + local lookuptype = lookuptypes[lookupname] + if lookuptype == "substitution" then + variants[lookupdata] = "sub" + elseif lookuptype == "alternate" then + for i=1,#lookupdata do + variants[lookupdata[i]] = "alt" + end + end + end + end + if mlookups then + for lookupname, lookuplist in next, mlookups do + local lookuptype = lookuptypes[lookupname] + for i=1,#lookuplist do + local lookupdata = lookuplist[i] + local lookuptype = lookuptypes[lookupname] + if lookuptype == "substitution" then + variants[lookupdata] = "sub" + elseif lookuptype == "alternate" then + for i=1,#lookupdata do + variants[lookupdata[i]] = "alt" + end + end + end + end + end + context.startmathfontlookupvariants() + local i = 0 + for variant, lookuptype in table.sortedpairs(variants) do + i = i + 1 + context.mathfontlookupvariant(i,format("U+%05X",variant),variant,lookuptype) + end + context.stopmathfontlookupvariants() + end + context.stopmathfontlistentry() + end + end + end + context.stopmathfontlist() +end +\stopluacode + +\endinput diff --git a/tex/context/base/s-mat-11.mkiv b/tex/context/base/s-mat-11.mkiv new file mode 100644 index 000000000..3939e9f22 --- /dev/null +++ b/tex/context/base/s-mat-11.mkiv @@ -0,0 +1,106 @@ +\usemodule[s][mat-10] + +% layout + +\setuplayout + [width=middle, + height=middle, + topspace=15mm, + backspace=15mm, + bottomspace=15mm, + header=1cm, + headerdistance=0.5cm, + footer=0pt] + +% rendering + +\def\startmathfontlist + {} + +\def\stopmathfontlist + {} + +\def\startmathfontlistentry + {\blank + \begingroup} + +\def\stopmathfontlistentry + {\endgroup + \blank} + +\def\mathfontlistentryhexdectit#1#2#3% + {#1: \char#2\enspace\ruledhbox{\char#2}\enspace#3\par + \advance\leftskip 1em\relax} + +\def\mathfontlistentrywdhtdpic#1#2#3#4% + {width: #1, height: #2, depth: #3, italic: #4\par} + +\def\mathfontlistentryresource#1% + {virtual: #1\par} + +\def\startmathfontlistnext + {next: } + +\def\mathfontlistnextentry#1#2#3% + {\ifnum#1>1 \space=>\space\fi#2~\ruledhbox{\char#3}} + +\def\mathfontlistnextcycle#1% + {\ifnum#1>1 \space=>\space\fi cycle} + +\def\stopmathfontlistnext + {\par} + +\def\startmathfontlisthvariants + {variants: } + +\def\mathfontlisthvariantsentry#1#2#3% + {\ifnum#1>1 \space=>\space\fi#2~\ruledhbox{\char#3}} + +\def\stopmathfontlisthvariants + {\par} + +\def\startmathfontlistvvariants{\startmathfontlisthvariants} +\def\mathfontlistvvariantsentry{\mathfontlisthvariantsentry} +\def\stopmathfontlistvvariants {\stopmathfontlisthvariants } + +\def\mathfontlistbetweennextandvariants + {\space=>\space} + +\def\startmathfontlistentryclassspec + {} + +\def\stopmathfontlistentryclassspec + {} + +\def\mathfontlistentryclassname#1#2% + {mathclass: #1, mathname: #2\par} + +\def\mathfontlistentrysymbol#1#2% + {mathsymbol: #1~\ruledhbox{\char#2}\par} + +\def\startmathfontlookupvariants + {lookupvariants: } + +\def\stopmathfontlookupvariants + {\par} + +\def\mathfontlookupvariant#1#2#3#4% + {\ifnum#1>1 ,\space\fi#2:~\char#3 (#4)} + +% done + +\continueifinputfile{s-mat-11.mkiv} + +\starttext +% \setupbodyfont[cambria, 12pt] \showmathfontcharacters +% \setupbodyfont[lmvirtual,12pt] \showmathfontcharacters +% \setupbodyfont[pxvirtual,12pt] \showmathfontcharacters +% \setupbodyfont[txvirtual,12pt] \showmathfontcharacters +% \setupbodyfont[palatino, 10pt] \showmathfontcharacters +% \setupbodyfont[mathtimes,12pt] \showmathfontcharacters +% \setupbodyfont[stix, 12pt] \showmathfontcharacters +% \setupbodyfont[xits, 12pt] \showmathfontcharacters +% \setupbodyfont[lucida, 12pt] \showmathfontcharacters + \setupbodyfont[lucidanova, 12pt] \showmathfontcharacters +\stoptext + diff --git a/tex/context/base/s-mat-12.mkiv b/tex/context/base/s-mat-12.mkiv new file mode 100644 index 000000000..06f3fee10 --- /dev/null +++ b/tex/context/base/s-mat-12.mkiv @@ -0,0 +1,403 @@ +\usemodule[s][mat-10] + +% todo: mode for screen +% todo: variant for HD with one menu at the right (with include menu) + +% layout + +\definecolor[backgroundcolor] [r=.6,g=.6] +\definecolor[backgroundcolorx][r=.6] +\definecolor[backgroundcolory][g=.6] +\definecolor[baselinecolor] [a=1,t=.5,s=.6] +\definecolor[charactercolor] [b=.6] +\definecolor[pagecolor] [s=.1] +\definecolor[nonecolor] [s=.5] +\definecolor[textcolor] [s=.9] + +% \setuppapersize[HD] +% +% \setuplayout +% [page] + +\setuppapersize[HD+] + +\setuplayout + [backspace=0pt, + topspace=0pt, + bottomspace=120pt, %1200-1080 + bottom=24pt, + bottomdistance=5mm, + header=0pt, + footer=0pt, + width=middle, + height=middle] + +\definelayer + [page] + +\setuplayer + [page] + [width=\textwidth, + height=\textheight] + +\setupbackgrounds + [page] + [background=color, + backgroundcolor=pagecolor] + +\setupbackgrounds + [text][text] + [bottomframe=on,framecolor=textcolor,rulethickness=0.025ex] + +\setupmakeup + [standard] + [pagestate=start] + +\setupinteraction + [state=start, + menu=on] + +\defineinteractionmenu + [ALPHABETS] + [bottom] + +\defineinteractionmenu + [alphabets] + [bottom] + +\defineinteractionmenu + [symbols] + [bottom] + +\setupinteractionmenu + [bottom] + [before=\vfill, + after=\vfill, + left=\hfill, + right=\hfill, + style=\tt\bf, + distance=0pt, + color=textcolor, + contrastcolor=nonecolor] + +\startinteractionmenu[bottom] + \startgot [firstpage] first \stopgot \quad + \startgot [deltapage(-100)] -100 \stopgot \quad + \startgot [deltapage(-10)] -10 \stopgot \quad + \startgot [previouspage] previous \stopgot \quad + \startgot [nextpage] next \stopgot \quad + \startgot [deltapage(+10)] +10 \stopgot \quad + \startgot [deltapage(+100)] +100 \stopgot \quad + \startgot [lastpage] last \stopgot +\stopinteractionmenu + +\startinteractionmenu[ALPHABETS] + \startgot [U+00041] NORMAL \stopgot \quad + \startgot [U+1D400] BOLD \stopgot \quad + \startgot [U+1D434] ITALIC \stopgot \quad + \startgot [U+1D468] BOLDITALIC \stopgot \quad + \startgot [U+1D49C] SCRIPT \stopgot \quad + \startgot [U+1D4D0] BOLDSCRIPT \stopgot \quad + \startgot [U+1D504] FRAKTUR \stopgot \quad + \startgot [U+1D538] DOUBLESTRUCK \stopgot \quad + \startgot [U+1D56C] BOLDFRAKTUR \stopgot \quad + \startgot [U+1D5A0] SS NORMAL \stopgot \quad + \startgot [U+1D5D4] SS BOLD \stopgot \quad + \startgot [U+1D608] SS ITALIC \stopgot \quad + \startgot [U+1D63C] SS BOLDITALIC \stopgot \quad + \startgot [U+1D670] MONOSPACE \stopgot \quad + \startgot [U+00391] GRK NORMAL \stopgot \quad + \startgot [U+1D6A8] GRK BOLD \stopgot \quad + \startgot [U+1D6E2] GRK ITALIC \stopgot \quad + \startgot [U+1D71C] GRK BOLDITALIC \stopgot \quad + \startgot [U+1D756] GRK SS BOLD \stopgot \quad + \startgot [U+1D790] GRK SS BOLDITALIC \stopgot +\stopinteractionmenu + +\startinteractionmenu[alphabets] + \startgot [U+00061] normal \stopgot \quad + \startgot [U+1D41A] bold \stopgot \quad + \startgot [U+1D44E] italic \stopgot \quad + \startgot [U+1D482] bolditalic \stopgot \quad + \startgot [U+1D4B6] script \stopgot \quad + \startgot [U+1D4EA] boldscript \stopgot \quad + \startgot [U+1D51E] fraktur \stopgot \quad + \startgot [U+1D552] doublestruck \stopgot \quad + \startgot [U+1D586] boldfraktur \stopgot \quad + \startgot [U+1D5BA] ss normal \stopgot \quad + \startgot [U+1D5EE] ss bold \stopgot \quad + \startgot [U+1D622] ss italic \stopgot \quad + \startgot [U+1D656] ss bolditalic \stopgot \quad + \startgot [U+1D68A] monospace \stopgot \quad + \startgot [U+003B1] grk normal \stopgot \quad + \startgot [U+1D6C2] grk bold \stopgot \quad + \startgot [U+1D6FC] grk italic \stopgot \quad + \startgot [U+1D736] grk bolditalic \stopgot \quad + \startgot [U+1D770] grk ss bold \stopgot \quad + \startgot [U+1D7AA] grk ss bolditalic \stopgot +\stopinteractionmenu + +\startinteractionmenu[symbols] + \startgot [U+00030] dig normal \stopgot \quad + \startgot [U+1D7CE] dig bold \stopgot \quad + \startgot [U+1D7D8] dig doublestruck \stopgot \quad + \startgot [U+1D7E2] dig ss normal \stopgot \quad + \startgot [U+1D7EC] dig ss bold \stopgot \quad + \startgot [U+1D7F6] dig monospace \stopgot \quad + \startgot [U+02200] operators \stopgot \quad + \startgot [U+02701] symbols a \stopgot \quad + \startgot [U+02901] symbols b \stopgot \quad + \startgot [U+02A00] supplemental \stopgot \quad +% \startgot [U+02070] superscripts \stopgot \quad +% \startgot [U+02070] subscripts \stopgot +\stopinteractionmenu + +\defineframed + [somedata] + [background=color, + backgroundcolor=textcolor, + %framecolor=charactercolor, + %rulethickness=1pt, + frame=off, + offset=1ex] + +% helpers + +\def\mathfontlisttxt#1% + {{\tttf#1}} + +\def\mathfontlistchr#1#2% + {\iffontchar\font#2\relax + \scale + [sx=#1,sy=#1] + {\dontleavehmode + \begingroup + \setbox\scratchbox\hbox{\charactercolor\char#2}% + \scratchdimen\wd\scratchbox + \ifdim\scratchdimen>\zeropoint + \backgroundline[backgroundcolor]{\box\scratchbox}% + \else\ifdim\scratchdimen<\zeropoint + \scratchdimen-\scratchdimen + \setbox\scratchbox\hbox to \scratchdimen{\hss\charactercolor\char#2}% + \backgroundline[backgroundcolorx]{\box\scratchbox}% + \else + \setbox\scratchbox\hbox to 1em{\hss\charactercolor\char#2}% + \scratchdimen\wd\scratchbox + \backgroundline[backgroundcolory]{\box\scratchbox}% + \fi\fi + \hskip-\scratchdimen + \baselinecolor\vrule width \scratchdimen height .05ex depth .05ex + \endgroup}% + \fi} + +\def\mathfontlistmth#1#2% + {\setbox\scratchbox\hbox{\mathfontlistchr{#1}{#2}}% + \ht\scratchbox\strutht + \dp\scratchbox\strutdp + \box\scratchbox} + +\let\mathfontlistbodyfonts\empty + +\def\mathfontlistbodyfontentry#1#2% + {\somedata + [align={none,middle},background=,height=5cm] + {\begingroup + \switchtobodyfont[#2,12pt]% + \definedfont[MathRoman*math-text]% + \mathfontlistmth{10}{#1}% + \endgroup + \vfilll + \strut\textcolor\mathfontlisttxt{#2}}% + \hskip1ex} + +\def\setmathfontlistbodyfonts#1% + {\edef\mathfontlistbodyfonts{#1}% + \def\dosetmathfontlistbodyfonts##1% + {\setupbodyfont[##1,12pt]}% + \processcommacommand[\mathfontlistbodyfonts]\dosetmathfontlistbodyfonts} + +\def\mathfontlistbodyfontschars#1% + {\processcommacommand[\mathfontlistbodyfonts]{\mathfontlistbodyfontentry{#1}}} + +% main + +\def\startmathfontlist + {\starttext + \startstandardmakeup % we use baselinecolor so that we have a transparency on page 1 + \setupalign[middle] + \vfil + \dontleavehmode \scale[height=.3\textheight]{\strut\color[textcolor]{\fontclass}} + \vfil + \dontleavehmode \scale[height=.1\textheight]{\strut\color[baselinecolor]{\currentdate}} + \vfil + \vfil + \stopstandardmakeup} + +\def\stopmathfontlist + {\stoptext} + +% entry + +\def\startmathfontlistentry + {\startstandardmakeup} + +\def\stopmathfontlistentry + {\tightlayer[page] + \stopstandardmakeup} + +\def\mathfontlistreference#1% + {\setlayer[page]{\pagereference[#1]}} + +\def\mathfontlistentryhexdectit#1#2#3% + {\setlayer + [page] + [preset=middletop,voffset=5mm] + {\somedata[height=1cm]{\mathfontlisttxt{#1}}} + \setlayer + [page] + [preset=middle,y=2cm] + {\mathfontlistmth{25}{#2}} + \setlayer + [page] + [preset=righttop,offset=5mm] + {\somedata[height=1cm]{\mathfontlisttxt{#3}}} + \doifsomething\mathfontlistbodyfonts + {\setlayer + [page] + [preset=middlebottom,voffset=5mm] + {\mathfontlistbodyfontschars{#2}}}} + +% dimensions + +\def\mathfontlistentrywdhtdpic#1#2#3#4% + {\setlayer + [page] + [preset=leftbottom,offset=5mm] + {\somedata[align=normal,width=5cm] + {\strut width \hfill \the\dimexpr#1sp\par + \strut height\hfill \the\dimexpr#2sp\par + \strut depth \hfill \the\dimexpr#3sp\par + \strut italic\hfill \the\dimexpr#4sp}}} + +\def\mathfontlistentryresource#1% + {} % {virtual: #1\par} + +% next + +\def\startmathfontlistnext + {\setlayer + [page] + [preset=middleleft,hoffset=5mm] + \bgroup\vbox\bgroup} + +\def\stopmathfontlistnext + {\egroup\egroup} + +\def\mathfontlistnextentry#1#2#3% + {\ifnum#1>1 \vskip1ex \fi + \dontleavehmode\somedata + [align=normal,width=4cm] + {\strut\mathfontlisttxt{#2}\hfill\mathfontlistchr{2}{#3}}\par} + +\def\mathfontlistnextcycle#1% + {\ifnum#1>1 \vskip1ex \fi + \dontleavehmode\somedata + [align=normal,width=4cm] + {\strut\mathfontlisttxt{cycle}}\par} + +% variants + +\def\startmathfontlistvvariants + {\setlayer + [page] + [preset=lefttop,offset=5mm] + \bgroup\vbox\bgroup} + +\def\startmathfontlisthvariants + {\setlayer + [page] + [preset=lefttop,offset=5mm] + \bgroup\hbox\bgroup} + +\def\mathfontlistvvariantsentry#1#2#3% + {\ifnum#1>1 \vskip1ex \fi + \dontleavehmode\somedata + [align=middle,width=4cm] + {\strut\mathfontlisttxt{#2}\hfilll\mathfontlistchr{2}{#3}}} + +\def\mathfontlisthvariantsentry#1#2#3% + {\ifnum#1>1 \hskip1ex \else \dontleavehmode \fi + \somedata + [align={none,middle},height=2cm] + {\strut\mathfontlisttxt{#2}\vfilll\mathfontlistchr{2}{#3}}} + +\def\stopmathfontlistvvariants + {\egroup\egroup} + +\def\stopmathfontlisthvariants + {\egroup\egroup} + +\def\mathfontlistbetweennextandvariants + {} + +% classes + +\def\startmathfontlistentryclassspec + {\setlayer + [page] + [preset=rightbottom,offset=5mm] + \bgroup\somedata[align=normal,width=8cm]\bgroup} + +\def\stopmathfontlistentryclassspec + {\egroup\egroup} + +\def\mathfontlistentryclassname#1#2% + {\strut{\mathfontlisttxt#1}\hfill\mathfontlisttxt{#2}\par} + +% symbols + +\def\mathfontlistentrysymbol#1#2% + {\setlayer + [page] + [preset=leftbottom,hoffset=5mm,voffset=50mm] + {\somedata + [align=normal,width=5cm] + {\mathfontlisttxt{#1}\hfill\mathfontlistchr{4}{#2}}}} + +% alternates + +\def\startmathfontlookupvariants + {\setlayer + [page] + [preset=middleright,hoffset=5mm] + \bgroup\vbox\bgroup} + +\def\stopmathfontlookupvariants + {\egroup\egroup} + +\def\mathfontlookupvariant#1#2#3#4% + {\ifnum#1>1 \vskip1ex \fi + \somedata + [align=normal,width=7cm] + {\mathfontlisttxt{#4:} \mathfontlisttxt{#2}\hfill\mathfontlistchr{4}{#3}}} + +% done + +\continueifinputfile{s-mat-12.mkiv} + +\setmathfontlistbodyfonts{lucidanova,cambria,xits,modern} + +\starttext +% \setupbodyfont[cambria, 12pt] \showmathfontcharacters +% \setupbodyfont[modern, 12pt] \showmathfontcharacters +% \setupbodyfont[lmvirtual,12pt] \showmathfontcharacters +% \setupbodyfont[pxvirtual,12pt] \showmathfontcharacters +% \setupbodyfont[txvirtual,12pt] \showmathfontcharacters +% \setupbodyfont[palatino, 10pt] \showmathfontcharacters +% \setupbodyfont[mathtimes,12pt] \showmathfontcharacters +% \setupbodyfont[stix, 12pt] \showmathfontcharacters +% \setupbodyfont[xits, 12pt] \showmathfontcharacters +% \setupbodyfont[lucida, 12pt] \showmathfontcharacters + \setupbodyfont[lucidanova, 12pt] \showmathfontcharacters +\stoptext + diff --git a/tex/context/base/scrn-fld.mkvi b/tex/context/base/scrn-fld.mkvi index c786f3832..4a8ece692 100644 --- a/tex/context/base/scrn-fld.mkvi +++ b/tex/context/base/scrn-fld.mkvi @@ -751,7 +751,7 @@ \def\scrn_fieldstack_add#tag#settings#symbol% {\advance\scratchcounter\plusone \edef\currentfieldstackname{#tag:\number\scratchcounter}% - \ifnum\scratchcounter=\@@fdstart\relax + \ifnum\scratchcounter=\ifnum\scratchcounter=\fieldcategoryparameter\c!start\relax \definefieldbody[\currentfieldstackname][\c!type=check,\c!values={#symbol,\empty},\c!default={#symbol}]% \else \definefieldbody[\currentfieldstackname][\c!type=check,\c!values={#symbol,\empty},\c!default=]% diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf index 7638971e5..dd9d4527a 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 4af2b8652..db18aa1e8 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/strc-itm.mkiv b/tex/context/base/strc-itm.mkiv index 1f582a6b4..14bfd75fa 100644 --- a/tex/context/base/strc-itm.mkiv +++ b/tex/context/base/strc-itm.mkiv @@ -209,6 +209,9 @@ \setxvalue{\??op\currentitemgroup\number#1\s!parent}{\??op\currentitemgroup}% \fi} +\let\currentitemconversionset\empty +\def\currentitemsymbol {n} + \unexpanded\def\defineitemgroup {\dotripleempty\dodefineitemgroup} @@ -226,6 +229,7 @@ {\getparameters[\??op#1][\s!parent=\??op#2,#3]}}% \dorecurse{\itemparameter\empty\c!levels}{\initializeitemgrouplevel\recurselevel}% \definestructurecounter[itemgroup:#1]% + \definestructureconversionset[itemgroup:#1][\currentitemconversionset][\currentitemsymbol]% \popmacro\currentitemgroup}} \newtoks\everysetupitemgroup @@ -443,14 +447,10 @@ \c!numberorder=\ifconditional\reverselistitem\v!reverse\else\v!normal\fi, \c!numberstopper=\expdoif{\getitemparameter\currentitemlevel\c!placestopper}\v!yes{\getitemparameter\currentitemlevel\c!stopper}, %\c!numberseparatorset=, - %\c!numberconversionset=, - \c!numberconversion=\currentitemsymbol, + \c!numberconversionset=itemgroup:\currentitemgroup, + %\c!numberconversion=\currentitemsymbol, \c!numbersegments=\ifx\currentrepeatstart\empty\else\currentrepeatstart:\fi\number\currentitemlevel]% - \ifconditional\reverselistitem - \convertedstructurecounter[\currentitemgroupcounter]% [\number\currentitemlevel]% - \else - \convertedstructurecounter[\currentitemgroupcounter]% [\number\currentitemlevel]% - \fi + \convertedstructurecounter[\currentitemgroupcounter]% [\number\currentitemlevel]% \dohandleitemreference \endgroup} @@ -742,6 +742,11 @@ \advance\leftskip\itemgrouplistwidth\relax \fi \fi + \ifx\currentrepeatstart\empty + \let\currentitemconversionset\currentitemsymbol + \else + \edef\currentitemconversionset{\currentitemconversionset,\currentitemsymbol}% + \fi \startcollectitems} % test / example diff --git a/tex/context/base/strc-ref.lua b/tex/context/base/strc-ref.lua index cc7e4799d..d117d3c32 100644 --- a/tex/context/base/strc-ref.lua +++ b/tex/context/base/strc-ref.lua @@ -1542,22 +1542,39 @@ function commands.referencepagestate(actions) end end -local plist +local plist, nofrealpages local function realpageofpage(p) if not plist then local pages = structures.pages.collected + nofrealpages = #pages plist = { } - for rp=1,#pages do + for rp=1,nofrealpages do plist[pages[rp].number] = rp end + references.nofrealpages = nofrealpages end return plist[p] end references.realpageofpage = realpageofpage --- +function references.checkedrealpage(r) + if not plist then + realpageofpage(r) -- just initialize + end + if not r then + return texcount.realpageno + elseif r < 1 then + return 1 + elseif r > nofrealpages then + return nofrealpages + else + return r + end +end + +-- use local ? local pages = allocate { [variables.firstpage] = function() return counters.record("realpage")["first"] end, @@ -1637,6 +1654,15 @@ function specials.userpage(var,actions) end end +function specials.deltapage(var,actions) + local p = tonumber(var.operation) + if p then + p = references.checkedrealpage(p + texcount.realpageno) + var.r = p + actions.realpage = actions.realpage or p -- first wins + end +end + function specials.section(var,actions) local sectionname = var.arguments local destination = var.operation diff --git a/tex/context/base/type-ini.mkiv b/tex/context/base/type-ini.mkiv index 22a487831..9bd4d367f 100644 --- a/tex/context/base/type-ini.mkiv +++ b/tex/context/base/type-ini.mkiv @@ -479,8 +479,8 @@ {\doinherittypeface[#1][\c!rm,\c!ss,\c!tt,\c!mm][\fontclass]} {\doifnot{#1}{#3} {\global\let\checkfontclass\docheckfontclass - \def\docommand##1{\setevalue{#1-##1}{#3}}% - \processcommalist[#2]\docommand}}} + \def\dodoinherittypeface##1{\setevalue{#1-##1}{#3}}% + \processcommalist[#2]\dodoinherittypeface}}} %D This hooks into the font mechanism with: diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index b33e232ea..2e504be39 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 : 09/06/11 17:46:31 +-- merge date : 09/08/11 21:29:31 do -- begin closure to overcome local limits and interference -- cgit v1.2.3