From fb5cf714f7ccb76de609cd7f0c04bcad94ad001f Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Thu, 16 May 2013 00:29:00 +0200 Subject: beta 2013.05.16 00:29 --- tex/context/base/cont-fil.mkiv | 8 +- tex/context/base/cont-new.mkiv | 2 +- tex/context/base/context-version.pdf | Bin 4135 -> 4126 bytes tex/context/base/context.mkiv | 7 +- tex/context/base/font-ctx.lua | 8 +- tex/context/base/font-otf.lua | 2 +- tex/context/base/font-ott.lua | 2 +- tex/context/base/l-file.lua | 18 +- tex/context/base/s-art-01.mkiv | 2 +- tex/context/base/s-fonts-features.lua | 74 ++++ tex/context/base/s-fonts-features.mkiv | 27 ++ tex/context/base/s-mat-12.mkiv | 406 ------------------- tex/context/base/s-mat-20.mkiv | 161 -------- tex/context/base/s-math-coverage.lua | 143 +++++++ tex/context/base/s-math-coverage.mkiv | 37 ++ tex/context/base/s-math-parameters.lua | 135 +++++++ tex/context/base/s-math-parameters.mkiv | 37 ++ tex/context/base/s-math-repertoire.mkiv | 432 +++++++++++++++++++++ tex/context/base/scrp-cjk.lua | 30 +- tex/context/base/scrp-eth.lua | 12 +- tex/context/base/scrp-ini.lua | 74 +++- tex/context/base/scrp-ini.mkiv | 25 +- tex/context/base/status-files.pdf | Bin 24695 -> 24732 bytes tex/context/base/status-lua.pdf | Bin 211639 -> 211818 bytes tex/context/base/status-mkiv.lua | 42 +- tex/context/base/task-ini.lua | 5 +- tex/context/base/type-imp-texgyre.mkiv | 15 +- tex/context/fonts/texgyre.lfg | 6 + tex/generic/context/luatex/luatex-basics-gen.lua | 19 +- tex/generic/context/luatex/luatex-fonts-merged.lua | 30 +- 30 files changed, 1119 insertions(+), 640 deletions(-) create mode 100644 tex/context/base/s-fonts-features.lua create mode 100644 tex/context/base/s-fonts-features.mkiv delete mode 100644 tex/context/base/s-mat-12.mkiv delete mode 100644 tex/context/base/s-mat-20.mkiv create mode 100644 tex/context/base/s-math-coverage.lua create mode 100644 tex/context/base/s-math-coverage.mkiv create mode 100644 tex/context/base/s-math-parameters.lua create mode 100644 tex/context/base/s-math-parameters.mkiv create mode 100644 tex/context/base/s-math-repertoire.mkiv (limited to 'tex') diff --git a/tex/context/base/cont-fil.mkiv b/tex/context/base/cont-fil.mkiv index 0b239a977..b0eff65ff 100644 --- a/tex/context/base/cont-fil.mkiv +++ b/tex/context/base/cont-fil.mkiv @@ -73,8 +73,6 @@ \definefilesynonym [pre-cycle] [pre-22] \definefilesynonym [pre-super] [pre-23] -\definefilesynonym [pre-41] [present-tiles] - %definefilesynonym [pre-more] [pre-24] %definefilesynonym [pre-more] [pre-25] \definefilesynonym [pre-more] [pre-26] @@ -104,4 +102,10 @@ \definefilesynonym [memo] [cor-02] \definefilesynonym [resume] [cor-03] +% downward compatible mapping: + +\definefilesynonym [pre-41] [present-tiles] +\definefilesynonym [fnt-33] [math-coverage] +\definefilesynonym [mat-20] [math-parameters] + \endinput diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv index 2fd5325d7..9be65f061 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.15 09:58} +\newcontextversion{2013.05.16 00:29} %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 e80a39ade..152b4c095 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 8e8304ef3..1b457ac5e 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.15 09:58} +\edef\contextversion{2013.05.16 00:29} \edef\contextkind {beta} %D For those who want to use this: @@ -198,8 +198,6 @@ \loadmarkfile{lang-mis} \loadmarkfile{lang-url} \loadmarkfile{lang-def} -\loadmarkfile{lang-wrd} % can be optional -%loadmarkfile{lang-rep} % can be optional (will be added after the 2013 code freeze, maybe nice for a ctx 2013 presentation) \loadmkvifile{file-job} % why so late? @@ -393,6 +391,9 @@ \loadmarkfile{scrp-ini} +\loadmarkfile{lang-wrd} % can be optional (discussion with mm sideeffect) +%loadmarkfile{lang-rep} % can be optional (bt 2013 side effect) + \loadmarkfile{prop-ini} % only for downward compatibility \loadmarkfile{mlib-ctx} diff --git a/tex/context/base/font-ctx.lua b/tex/context/base/font-ctx.lua index c894660d5..ae42ed18e 100644 --- a/tex/context/base/font-ctx.lua +++ b/tex/context/base/font-ctx.lua @@ -68,7 +68,9 @@ local lastmathids = hashes.lastmathids local designsizefilename = fontgoodies.designsizes.filename -local otffeatures = handlers.otf.features +local otffeatures = otf.features +local otftables = otf.tables + local registerotffeature = otffeatures.register local baseprocessors = otffeatures.processors.base local baseinitializers = otffeatures.initializers.base @@ -159,7 +161,9 @@ local needsnodemode = { gpos_mark2ligature = true, } -fonts.handlers.otf.tables.scripts.auto = "automatic fallback to latn when no dflt present" +otftables.scripts.auto = "automatic fallback to latn when no dflt present" + +-- setmetatableindex(otffeatures.descriptions,otftables.features) local privatefeatures = { tlig = true, diff --git a/tex/context/base/font-otf.lua b/tex/context/base/font-otf.lua index 6f4a54309..c1f2f14fc 100644 --- a/tex/context/base/font-otf.lua +++ b/tex/context/base/font-otf.lua @@ -2065,7 +2065,7 @@ end registerotffeature { name = "mathsize", - description = "apply mathsize as specified in the font", + description = "apply mathsize specified in the font", initializers = { base = checkmathsize, node = checkmathsize, diff --git a/tex/context/base/font-ott.lua b/tex/context/base/font-ott.lua index 8a5579c02..e3aacd0d1 100644 --- a/tex/context/base/font-ott.lua +++ b/tex/context/base/font-ott.lua @@ -771,7 +771,7 @@ local function resolve(t,k) end end end - return "dflt" + return k -- "dflt" end setmetatableindex(features, resolve) diff --git a/tex/context/base/l-file.lua b/tex/context/base/l-file.lua index acb4216b0..f25490749 100644 --- a/tex/context/base/l-file.lua +++ b/tex/context/base/l-file.lua @@ -62,7 +62,7 @@ elseif not lfs.isfile then end local insert, concat = table.insert, table.concat -local match, find = string.match, string.find +local match, find, gmatch = string.match, string.find, string.gmatch local lpegmatch = lpeg.match local getcurrentdir, attributes = lfs.currentdir, lfs.attributes local checkedsplit = string.checkedsplit @@ -572,3 +572,19 @@ end -- return f(...) -- end -- end + +-- a goodie: a dumb version of mkdirs: + +function lfs.mkdirs(path) + local full + for sub in gmatch(path,"([^\\/]+)") do + if full then + full = full .. "/" .. sub + else + full = sub + end + if not lfs.isdir(full) then + lfs.mkdir(full) + end + end +end diff --git a/tex/context/base/s-art-01.mkiv b/tex/context/base/s-art-01.mkiv index 046c35cc1..5ef53ebe0 100644 --- a/tex/context/base/s-art-01.mkiv +++ b/tex/context/base/s-art-01.mkiv @@ -12,7 +12,7 @@ \c!footer=0pt] \setupbodyfont - [dejavu] + [dejavu,10pt] % 12pt is just to large and we use this for all kind of demos \setupwhitespace [\v!big] diff --git a/tex/context/base/s-fonts-features.lua b/tex/context/base/s-fonts-features.lua new file mode 100644 index 000000000..4ee143204 --- /dev/null +++ b/tex/context/base/s-fonts-features.lua @@ -0,0 +1,74 @@ +if not modules then modules = { } end modules ['s-fonts-features'] = { + version = 1.001, + comment = "companion to s-fonts-features.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.features = moduledata.fonts.features or { } + +-- for the moment only otf + +local NC, NR, bold = context.NC, context.NR, context.bold + +function moduledata.fonts.features.showused(specification) + + specification = interfaces.checkedspecification(specification) + + -- local list = utilities.parsers.settings_to_set(specification.list or "all") + + context.starttabulate { "|T|T|T|T|T|" } + + context.HL() + + NC() bold("feature") + NC() + NC() bold("description") + NC() bold("value") + NC() bold("internal") + NC() NR() + + context.HL() + + local usedfeatures = fonts.handlers.otf.statistics.usedfeatures + local features = fonts.handlers.otf.tables.features + local descriptions = fonts.handlers.otf.features.descriptions + + for feature, keys in table.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 + if done then + NC() + NC() + NC() + elseif rawget(descriptions,feature) then + NC() context(feature) + NC() context("+") -- extra + NC() context(descriptions[feature]) + done = true + elseif rawget(features,feature) then + NC() context(feature) + NC() -- otf + NC() context(features[feature]) + done = true + else + NC() context(feature) + NC() context("-") -- unknown + NC() + done = true + end + NC() context(k) + NC() context(tostring(v)) + NC() NR() + end + -- end + end + + context.HL() + + context.stoptabulate() + +end diff --git a/tex/context/base/s-fonts-features.mkiv b/tex/context/base/s-fonts-features.mkiv new file mode 100644 index 000000000..410bc13d3 --- /dev/null +++ b/tex/context/base/s-fonts-features.mkiv @@ -0,0 +1,27 @@ +%D \module +%D [ file=s-fonts-features, % was s-fnt-41, +%D version=2012.11.27, % older probably +%D title=\CONTEXT\ Style File, +%D subtitle=Features, +%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. + +\registerctxluafile{s-fonts-features}{} + +\installmodulecommandluasingle \showusedfeatures {moduledata.fonts.features.showused} + +\continueifinputfile{s-fonts-features.mkiv} + +\usemodule + [art-01] + +\starttext + + \showusedfeatures + +\stoptext diff --git a/tex/context/base/s-mat-12.mkiv b/tex/context/base/s-mat-12.mkiv deleted file mode 100644 index deb28975c..000000000 --- a/tex/context/base/s-mat-12.mkiv +++ /dev/null @@ -1,406 +0,0 @@ -\usemodule[s][mat-10] - -% \enabletrackers[pages.timing] - -% 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 -\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 - \doifmodeelse{crosslink} - {\goto{\strut\textcolor\mathfontlisttxt{#2}}[#2::#1]}% - {\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,pagella} - -\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 - \setupbodyfont[pagella, 12pt] \showmathfontcharacters -\stoptext - diff --git a/tex/context/base/s-mat-20.mkiv b/tex/context/base/s-mat-20.mkiv deleted file mode 100644 index 544612fec..000000000 --- a/tex/context/base/s-mat-20.mkiv +++ /dev/null @@ -1,161 +0,0 @@ -%D \module -%D [ file=s-mat-20.mkiv, -%D version=2012.12.05, -%D title=\CONTEXT\ Style File, -%D subtitle=Math Tracing Macros, -%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 - -local tables = utilities.tables.definedtable("math","tracing","spacing","tables") - -tables.styleaxis = { - "ord", "op", "bin", "rel", "open", "close", "punct", "inner", -} - -tables.parameters = { - "quad", "axis", "operatorsize", - "overbarkern", "overbarrule", "overbarvgap", - "underbarkern", "underbarrule", "underbarvgap", - "radicalkern", "radicalrule", "radicalvgap", - "radicaldegreebefore", "radicaldegreeafter", "radicaldegreeraise", - "stackvgap", "stacknumup", "stackdenomdown", - "fractionrule", "fractionnumvgap", "fractionnumup", - "fractiondenomvgap", "fractiondenomdown", "fractiondelsize", - "limitabovevgap", "limitabovebgap", "limitabovekern", - "limitbelowvgap", "limitbelowbgap", "limitbelowkern", - "underdelimitervgap", "underdelimiterbgap", - "overdelimitervgap", "overdelimiterbgap", - "subshiftdrop", "supshiftdrop", "subshiftdown", - "subsupshiftdown", "subtopmax", "supshiftup", - "supbottommin", "supsubbottommax", "subsupvgap", - "spaceafterscript", "connectoroverlapmin", -} - -tables.styles = { - "display", - "text", - "script", - "scriptscript", -} - -function tables.stripmu(str) - str = string.gsub(str,"mu","") - str = string.gsub(str," ","") - str = string.gsub(str,"plus","+") - str = string.gsub(str,"minus","-") - return str -end - -function tables.strippt(old) - local new = string.gsub(old,"pt","") - if new ~= old then - new = string.format("%0.4f",tonumber(new)) - end - return new -end - -function tables.showspacing() - - local styles = tables.styles - local styleaxis = tables.styleaxis - - context.starttabulate { "|Tl|Tl|" .. string.rep("Tc|",(#styles*2)) } - context.HL() - context.NC() - context.NC() - context.NC() - for i=1,#styles do - context.bold(styles[i]) - context.NC() - context.bold("(cramped)") - context.NC() - end - context.NR() - context.HL() - for i=1,#styleaxis do - -- print(key,tex.getmath(key,"text")) - local one = styleaxis[i] - for j=1,#styleaxis do - local two = styleaxis[j] - context.NC() - if j == 1 then - context.bold(one) - end - context.NC() - context.bold(two) - context.NC() - for i=1,#styles do - context("\\ctxlua{context(math.tracing.spacing.tables.stripmu('\\the\\Umath%s%sspacing\\%sstyle'))}",one,two,styles[i]) - context.NC() - context("\\ctxlua{context(math.tracing.spacing.tables.stripmu('\\the\\Umath%s%sspacing\\cramped%sstyle'))}",one,two,styles[i]) - context.NC() - end - context.NR() - end - end - context.stoptabulate() -end - -function tables.showparameters() - - local styles = tables.styles - local parameters = tables.parameters - - context.starttabulate { "|l|" .. string.rep("Tc|",(#styles*2)) } - context.HL() - context.NC() - context.NC() - for i=1,#styles do - context.bold(styles[i]) - context.NC() - context.bold("(cramped)") - context.NC() - end - context.NR() - context.HL() - for i=1,#parameters do - local parameter = parameters[i] - -- print(parameter,tex.getmath(parameter,"text")) - context.NC() - context.type(parameter) - context.NC() - for i=1,#styles do - context("\\ctxlua{context(math.tracing.spacing.tables.strippt('\\the\\Umath%s\\%sstyle'))}",parameter,styles[i]) - context.NC() - context("\\ctxlua{context(math.tracing.spacing.tables.strippt('\\the\\Umath%s\\cramped%sstyle'))}",parameter,styles[i]) - context.NC() - end - context.NR() - end - context.stoptabulate() - -end - -\stopluacode - -\continueifinputfile{s-mat-20.mkiv} - -\setuplayout - [width=middle, - height=middle, - backspace=1cm, - topspace=1cm, - footer=0pt, - header=0pt] - -\setupbodyfont - [dejavu,8pt] - -\starttext - - \ctxlua{math.tracing.spacing.tables.showspacing()} - % \ctxlua{math.tracing.spacing.tables.showparameters()} - -\stoptext diff --git a/tex/context/base/s-math-coverage.lua b/tex/context/base/s-math-coverage.lua new file mode 100644 index 000000000..05a311ee6 --- /dev/null +++ b/tex/context/base/s-math-coverage.lua @@ -0,0 +1,143 @@ +if not modules then modules = { } end modules ['s-math-coverage'] = { + version = 1.001, + comment = "companion to s-math-coverage.mkiv", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +moduledata.math = moduledata.math or { } +moduledata.math.coverage = moduledata.math.coverage or { } + +local utfchar, utfbyte = utf.char, utf.byte + +local ucgreek = { + 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, + 0x0396, 0x0397, 0x0398, 0x0399, 0x039A, + 0x039B, 0x039C, 0x039D, 0x039E, 0x039F, + 0x03A0, 0x03A1, 0x03A3, 0x03A4, 0x03A5, + 0x03A6, 0x03A7, 0x03A8, 0x03A9 +} + +local lcgreek = { + 0x03B1, 0x03B2, 0x03B3, 0x03B4, 0x03B5, + 0x03B6, 0x03B7, 0x03B8, 0x03B9, 0x03BA, + 0x03BB, 0x03BC, 0x03BD, 0x03BE, 0x03BF, + 0x03C0, 0x03C1, 0x03C2, 0x03C3, 0x03C4, + 0x03C5, 0x03C6, 0x03C7, 0x03C8, 0x03C9, + 0x03D1, 0x03D5, 0x03D6, 0x03F0, 0x03F1, + 0x03F4, 0x03F5 +} + +local ucletters = { + 0x00041, 0x00042, 0x00043, 0x00044, 0x00045, + 0x00046, 0x00047, 0x00048, 0x00049, 0x0004A, + 0x0004B, 0x0004C, 0x0004D, 0x0004E, 0x0004F, + 0x00050, 0x00051, 0x00052, 0x00053, 0x00054, + 0x00055, 0x00056, 0x00057, 0x00058, 0x00059, + 0x0005A, +} + +local lcletters = { + 0x00061, 0x00062, 0x00063, 0x00064, 0x00065, + 0x00066, 0x00067, 0x00068, 0x00069, 0x0006A, + 0x0006B, 0x0006C, 0x0006D, 0x0006E, 0x0006F, + 0x00070, 0x00071, 0x00072, 0x00073, 0x00074, + 0x00075, 0x00076, 0x00077, 0x00078, 0x00079, + 0x0007A, +} + +local digits = { + 0x00030, 0x00031, 0x00032, 0x00033, 0x00034, + 0x00035, 0x00036, 0x00037, 0x00038, 0x00039, +} + +local styles = { + "regular", "sansserif", "monospaced", "fraktur", "script", "blackboard" +} + +local alternatives = { + "normal", "bold", "italic", "bolditalic" +} + +local alphabets = { + ucletters, lcletters, ucgreek, lcgreek, digits, +} + +local getboth = mathematics.getboth +local remapalphabets = mathematics.remapalphabets + +function moduledata.math.coverage.showalphabets() + context.starttabulate { "|lT|l|Tl|" } + for i=1,#styles do + local style = styles[i] + for i=1,#alternatives do + local alternative = alternatives[i] + for i=1,#alphabets do + local alphabet = alphabets[i] + context.NC() + if i == 1 then + context("%s %s",style,alternative) + end + context.NC() + context.startimath() + context.setmathattribute(style,alternative) + for i=1,#alphabet do + local letter = alphabet[i] + local id = getboth(style,alternative) + local unicode = remapalphabets(letter,id) + if not unicode then + context.underbar(utfchar(letter)) + elseif unicode == letter then + context(utfchar(unicode)) + else + context(utfchar(unicode)) + end + end + context.stopimath() + context.NC() + local first = alphabet[1] + local last = alphabet[#alphabet] + local id = getboth(style,alternative) + local f_unicode = remapalphabets(first,id) or utfbyte(first) + local l_unicode = remapalphabets(last,id) or utfbyte(last) + context("%05X - %05X",f_unicode,l_unicode) + context.NC() + context.NR() + end + end + end + context.stoptabulate() +end + +function moduledata.math.coverage.showcharacters() + local NC, NR, getglyph, concat = context.NC, context.NR, context.getglyph, table.concat + context.startcolumns() + context.setupalign { "nothyphenated" } + context.starttabulate { "|T|i2|Tpl|" } + for u, d in table.sortedpairs(characters.data) do + local mathclass = d.mathclass + local mathspec = d.mathspec + if mathclass or mathspec then + NC() + context("%05X",u) + NC() + getglyph("MathRoman",u) + NC() + if mathspec then + local t = { } + for i=1,#mathspec do + t[mathspec[i].class] = true + end + t = table.sortedkeys(t) + context(concat(t," ")) + else + context(mathclass) + end + NC() + NR() + end + end + context.stoptabulate() + context.stopcolumns() +end diff --git a/tex/context/base/s-math-coverage.mkiv b/tex/context/base/s-math-coverage.mkiv new file mode 100644 index 000000000..cbac318ee --- /dev/null +++ b/tex/context/base/s-math-coverage.mkiv @@ -0,0 +1,37 @@ +%D \module +%D [ file=s-math-coverage, % s-fnt-33, +%D version=2011.05.10, % about then +%D title=\CONTEXT\ Style File, +%D subtitle=Show Math 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. + +\registerctxluafile{s-math-coverage}{} + +\installmodulecommandluasingle \showmathalphabets {moduledata.math.coverage.showalphabets} +\installmodulecommandluasingle \showmathcharacters {moduledata.math.coverage.showcharacters} + +\continueifinputfile{s-math-coverage.mkiv} + +\setupbodyfont + [modern] + +\setuplayout + [backspace=1cm, + topspace=1cm, + header=1cm, + footer=1cm, + width=middle, + height=middle] + +\starttext + + \showmathalphabets \page + \showmathcharacters \page + +\stoptext diff --git a/tex/context/base/s-math-parameters.lua b/tex/context/base/s-math-parameters.lua new file mode 100644 index 000000000..8e8c15a2d --- /dev/null +++ b/tex/context/base/s-math-parameters.lua @@ -0,0 +1,135 @@ +if not modules then modules = { } end modules ['s-math-coverage'] = { + version = 1.001, + comment = "companion to s-math-coverage.mkiv", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +moduledata.math = moduledata.math or { } +moduledata.math.parameters = moduledata.math.parameters or { } + +local tables = utilities.tables.definedtable("math","tracing","spacing","tables") + +tables.styleaxis = { + "ord", "op", "bin", "rel", "open", "close", "punct", "inner", +} + +tables.parameters = { + "quad", "axis", "operatorsize", + "overbarkern", "overbarrule", "overbarvgap", + "underbarkern", "underbarrule", "underbarvgap", + "radicalkern", "radicalrule", "radicalvgap", + "radicaldegreebefore", "radicaldegreeafter", "radicaldegreeraise", + "stackvgap", "stacknumup", "stackdenomdown", + "fractionrule", "fractionnumvgap", "fractionnumup", + "fractiondenomvgap", "fractiondenomdown", "fractiondelsize", + "limitabovevgap", "limitabovebgap", "limitabovekern", + "limitbelowvgap", "limitbelowbgap", "limitbelowkern", + "underdelimitervgap", "underdelimiterbgap", + "overdelimitervgap", "overdelimiterbgap", + "subshiftdrop", "supshiftdrop", "subshiftdown", + "subsupshiftdown", "subtopmax", "supshiftup", + "supbottommin", "supsubbottommax", "subsupvgap", + "spaceafterscript", "connectoroverlapmin", +} + +tables.styles = { + "display", + "text", + "script", + "scriptscript", +} + +function tables.stripmu(str) + str = string.gsub(str,"mu","") + str = string.gsub(str," ","") + str = string.gsub(str,"plus","+") + str = string.gsub(str,"minus","-") + return str +end + +function tables.strippt(old) + local new = string.gsub(old,"pt","") + if new ~= old then + new = string.format("%0.4f",tonumber(new)) + end + return new +end + +function moduledata.math.parameters.showspacing() + + local styles = tables.styles + local styleaxis = tables.styleaxis + + context.starttabulate { "|Tl|Tl|" .. string.rep("Tc|",(#styles*2)) } + context.HL() + context.NC() + context.NC() + context.NC() + for i=1,#styles do + context.bold(styles[i]) + context.NC() + context.bold("(cramped)") + context.NC() + end + context.NR() + context.HL() + for i=1,#styleaxis do + -- print(key,tex.getmath(key,"text")) + local one = styleaxis[i] + for j=1,#styleaxis do + local two = styleaxis[j] + context.NC() + if j == 1 then + context.bold(one) + end + context.NC() + context.bold(two) + context.NC() + for i=1,#styles do + context("\\ctxlua{context(math.tracing.spacing.tables.stripmu('\\the\\Umath%s%sspacing\\%sstyle'))}",one,two,styles[i]) + context.NC() + context("\\ctxlua{context(math.tracing.spacing.tables.stripmu('\\the\\Umath%s%sspacing\\cramped%sstyle'))}",one,two,styles[i]) + context.NC() + end + context.NR() + end + end + context.stoptabulate() +end + +function moduledata.math.parameters.showparameters() + + local styles = tables.styles + local parameters = tables.parameters + + context.starttabulate { "|l|" .. string.rep("Tc|",(#styles*2)) } + context.HL() + context.NC() + context.NC() + for i=1,#styles do + context.bold(styles[i]) + context.NC() + context.bold("(cramped)") + context.NC() + end + context.NR() + context.HL() + for i=1,#parameters do + local parameter = parameters[i] + -- print(parameter,tex.getmath(parameter,"text")) + context.NC() + context.type(parameter) + context.NC() + for i=1,#styles do + context("\\ctxlua{context(math.tracing.spacing.tables.strippt('\\the\\Umath%s\\%sstyle'))}",parameter,styles[i]) + context.NC() + context("\\ctxlua{context(math.tracing.spacing.tables.strippt('\\the\\Umath%s\\cramped%sstyle'))}",parameter,styles[i]) + context.NC() + end + context.NR() + end + context.stoptabulate() + +end diff --git a/tex/context/base/s-math-parameters.mkiv b/tex/context/base/s-math-parameters.mkiv new file mode 100644 index 000000000..3b9089f84 --- /dev/null +++ b/tex/context/base/s-math-parameters.mkiv @@ -0,0 +1,37 @@ +%D \module +%D [ file=s-math-parameters.mkiv, +%D version=2012.12.05, +%D title=\CONTEXT\ Style File, +%D subtitle=Show Math Parameters, +%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. + +\registerctxluafile{s-math-parameters}{} + +\installmodulecommandluasingle \showmathspacing {moduledata.math.parameters.showspacing} +\installmodulecommandluasingle \showmathparameters {moduledata.math.parameters.showparameters} + +\continueifinputfile{s-math-parameters.mkiv} + +\setuplayout + [width=middle, + height=middle, + backspace=1cm, + topspace=1cm, + footer=0pt, + header=0pt] + +\setupbodyfont + [dejavu,8pt] + +\starttext + + \showmathspacing \page + \showmathparameters \page + +\stoptext diff --git a/tex/context/base/s-math-repertoire.mkiv b/tex/context/base/s-math-repertoire.mkiv new file mode 100644 index 000000000..5c9a3e8a3 --- /dev/null +++ b/tex/context/base/s-math-repertoire.mkiv @@ -0,0 +1,432 @@ +%D \module +%D [ file=s-math-parameters.mkiv, % was s-mat-12.mkiv +%D version=2012.06.06, % whatever, probably a bit earlier +%D title=\CONTEXT\ Style File, +%D subtitle=Show Math Character Repertoire, +%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. + +\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 +\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 + \doifmodeelse{crosslink} + {\goto{\strut\textcolor\mathfontlisttxt{#2}}[#2::#1]}% + {\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-math-repertoire.mkiv} + +\setmathfontlistbodyfonts{lucidanova,cambria,xits,modern,pagella,termes,bonum} + +\starttext + + \doifelse {\getdocumentargument{bodyfont}} {} { + + \setupbodyfont[cambria, 12pt] + % \setupbodyfont[modern, 12pt] + % \setupbodyfont[lmvirtual, 12pt] + % \setupbodyfont[pxvirtual, 12pt] + % \setupbodyfont[txvirtual, 12pt] + % \setupbodyfont[palatino, 10pt] + % \setupbodyfont[mathtimes, 12pt] + % \setupbodyfont[stix, 12pt] + % \setupbodyfont[xits, 12pt] + % \setupbodyfont[lucida, 12pt] + % \setupbodyfont[lucidanova,12pt] + % \setupbodyfont[pagella, 12pt] + % \setupbodyfont[bonum, 12pt] + + } { + + \normalexpanded{\setupbodyfont[\getdocumentargument{bodyfont},12pt]} + + } + + \showmathfontcharacters + +\stoptext + diff --git a/tex/context/base/scrp-cjk.lua b/tex/context/base/scrp-cjk.lua index 487d5a267..f7167b45c 100644 --- a/tex/context/base/scrp-cjk.lua +++ b/tex/context/base/scrp-cjk.lua @@ -31,8 +31,8 @@ local glyph_code = nodecodes.glyph local glue_code = nodecodes.glue local userskip_code = skipcodes.userskip -local a_prestat = attributes.private('prestat') -local a_preproc = attributes.private('preproc') +local a_scriptstatus = attributes.private('scriptstatus') +local a_scriptinjection = attributes.private('scriptinjection') local categorytonumber = scripts.categorytonumber local numbertocategory = scripts.numbertocategory @@ -425,7 +425,7 @@ local function process(head,first,last) while true do local upcoming, id = first.next, first.id if id == glyph_code then - local a = first[a_prestat] + local a = first[a_scriptstatus] local current = numbertocategory[a] local action = injectors[previous] if action then @@ -434,7 +434,7 @@ local function process(head,first,last) local font = first.font if font ~= lastfont then lastfont = font - set_parameters(font,numbertodataset[first[a_preproc]]) + set_parameters(font,numbertodataset[first[a_scriptinjection]]) end action(head,first) end @@ -445,7 +445,7 @@ local function process(head,first,last) if p and n then local pid, nid = p.id, n.id if pid == glyph_code and nid == glyph_code then - local pa, na = p[a_prestat], n[a_prestat] + local pa, na = p[a_scriptstatus], n[a_scriptstatus] local pcjk, ncjk = pa and numbertocategory[pa], na and numbertocategory[na] if not pcjk or not ncjk or pcjk == "korean" or ncjk == "korean" @@ -476,7 +476,7 @@ end scripts.installmethod { name = "hangul", - process = process, + injector = process, datasets = { -- todo: metatables default = { inter_char_shrink_factor = 0.50, -- of quad @@ -646,7 +646,7 @@ local function process(head,first,last) while true do local upcoming, id = first.next, first.id if id == glyph_code then - local a = first[a_prestat] + local a = first[a_scriptstatus] local current = numbertocategory[a] local action = injectors[previous] if action then @@ -655,7 +655,7 @@ local function process(head,first,last) local font = first.font if font ~= lastfont then lastfont = font - set_parameters(font,numbertodataset[first[a_preproc]]) + set_parameters(font,numbertodataset[first[a_scriptinjection]]) end action(head,first) end @@ -666,7 +666,7 @@ local function process(head,first,last) if p and n then local pid, nid = p.id, n.id if pid == glyph_code and nid == glyph_code then - local pa, na = p[a_prestat], n[a_prestat] + local pa, na = p[a_scriptstatus], n[a_scriptstatus] local pcjk, ncjk = pa and numbertocategory[pa], na and numbertocategory[na] if not pcjk or not ncjk or pcjk == "korean" or ncjk == "korean" @@ -698,7 +698,7 @@ end scripts.installmethod { name = "hanzi", - process = process, + injector = process, datasets = { default = { inter_char_shrink_factor = 0.50, -- of quad @@ -868,7 +868,7 @@ local function process(head,first,last) while true do local upcoming, id = first.next, first.id if id == glyph_code then - local a = first[a_prestat] + local a = first[a_scriptstatus] local current = numbertocategory[a] local action = injectors[previous] if action then @@ -877,7 +877,7 @@ local function process(head,first,last) local font = first.font if font ~= lastfont then lastfont = font - set_parameters(font,numbertodataset[first[a_preproc]]) + set_parameters(font,numbertodataset[first[a_scriptinjection]]) end action(head,first) end @@ -893,7 +893,7 @@ local function process(head,first,last) if p and n then local pid, nid = p.id, n.id if pid == glyph_code and nid == glyph_code then - local pa, na = p[a_prestat], n[a_prestat] + local pa, na = p[a_scriptstatus], n[a_scriptstatus] local pcjk, ncjk = pa and numbertocategory[pa], na and numbertocategory[na] if not pcjk or not ncjk or pcjk == "korean" or ncjk == "korean" @@ -902,7 +902,7 @@ local function process(head,first,last) or pcjk == "half_width_close" or ncjk == "half_width_open" then -- extra compared to korean previous = "start" else -- if head ~= first then -if id == glue_code and first.subtype == userskip_code then -- also prestat check? +if id == glue_code and first.subtype == userskip_code then -- also scriptstatus check? -- for the moment no distinction possible between space and userskip local w = first.spec.width local s = spacedata[p.font] @@ -935,7 +935,7 @@ end scripts.installmethod { name = "nihongo", -- what name to use? - process = process, + injector = process, datasets = { default = { inter_char_shrink_factor = 0.50, -- of quad diff --git a/tex/context/base/scrp-eth.lua b/tex/context/base/scrp-eth.lua index e1b8df432..597afa1b5 100644 --- a/tex/context/base/scrp-eth.lua +++ b/tex/context/base/scrp-eth.lua @@ -19,8 +19,8 @@ local new_penalty = nodepool.penalty local nodecodes = nodes.nodecodes local glyph_code = nodecodes.glyph -local a_prestat = attributes.private('prestat') -local a_preproc = attributes.private('preproc') +local a_scriptstatus = attributes.private('scriptstatus') +local a_scriptinjection = attributes.private('scriptinjection') local categorytonumber = scripts.categorytonumber local numbertocategory = scripts.numbertocategory @@ -37,7 +37,7 @@ local inter_character_stretch_factor = 1 local inter_character_shrink_factor = 1 local function space_glue(current) - local data = numbertodataset[current[a_preproc]] + local data = numbertodataset[current[a_scriptinjection]] if data then inter_character_space_factor = data.inter_character_space_factor or 1 inter_character_stretch_factor = data.inter_character_stretch_factor or 1 @@ -106,8 +106,8 @@ local function process(head,first,last) while current do local id = current.id if id == glyph_code then - local prestat = current[a_prestat] - local category = numbertocategory[prestat] + local scriptstatus = current[a_scriptstatus] + local category = numbertocategory[scriptstatus] if injector then local action = injector[category] if action then @@ -129,7 +129,7 @@ end scripts.installmethod { name = "ethiopic", - process = process, + injector = process, datasets = { default = { inter_character_space_factor = 1, diff --git a/tex/context/base/scrp-ini.lua b/tex/context/base/scrp-ini.lua index c375e2ec3..18f86475f 100644 --- a/tex/context/base/scrp-ini.lua +++ b/tex/context/base/scrp-ini.lua @@ -29,14 +29,18 @@ local unsetvalue = attributes.unsetvalue local glyph_code = nodecodes.glyph local glue_code = nodecodes.glue -local a_preproc = attributes.private('preproc') -local a_prestat = attributes.private('prestat') +local a_scriptinjection = attributes.private('scriptinjection') +local a_scriptsplitting = attributes.private('scriptsplitting') +local a_scriptstatus = attributes.private('scriptstatus') local fontdata = fonts.hashes.identifiers local allocate = utilities.storage.allocate local setnodecolor = nodes.tracers.colors.set local setmetatableindex = table.setmetatableindex +local enableaction = nodes.tasks.enableaction +local disableaction = nodes.tasks.disableaction + scripts = scripts or { } local scripts = scripts @@ -46,6 +50,12 @@ local hash = scripts.hash local handlers = allocate() scripts.handlers = handlers +local injectors = allocate() +scripts.injectors = handlers + +local splitters = allocate() +scripts.splitters = splitters + local hash = { -- we could put these presets in char-def.lua -- -- half width opening parenthesis @@ -198,8 +208,10 @@ local numbertohandler = allocate() --~ storage.register("scripts/hash", hash, "scripts.hash") scripts.numbertodataset = numbertodataset +scripts.numbertohandler = numbertohandler local defaults = { + inter_char_shrink_factor = 0, inter_char_shrink_factor = 0, inter_char_stretch_factor = 0, inter_char_half_shrink_factor = 0, @@ -207,6 +219,8 @@ local defaults = { inter_char_quarter_shrink_factor = 0, inter_char_quarter_stretch_factor = 0, inter_char_hangul_penalty = 0, + + inter_word_stretch_factor = 0, } scripts.defaults = defaults -- so we can add more @@ -283,13 +297,39 @@ function scripts.installdataset(specification) -- global overload end end +local injectorenabled = false +local splitterenabled = false + function scripts.set(name,method,preset) local handler = handlers[method] - texsetattribute(a_preproc,handler and handler.attributes[preset] or unsetvalue) + if handler then + if handler.injector then + if not injectorenabled then + enableaction("processors","scripts.injectors.handler") + injectorenabled = true + end + texsetattribute(a_scriptinjection,handler.attributes[preset] or unsetvalue) + end + if handler.splitter then + if not splitterenabled then + enableaction("processors","scripts.splitters.handler") + splitterenabled = true + end + texsetattribute(a_scriptsplitting,handler.attributes[preset] or unsetvalue) + end + if handler.initializer then + handler.initializer(handler) + handler.initializer = nil + end + else + texsetattribute(a_scriptinjection,unsetvalue) + texsetattribute(a_scriptsplitting,unsetvalue) + end end function scripts.reset() - texsetattribute(handler.attributes[preset]) + texsetattribute(a_scriptinjection,unsetvalue) + texsetattribute(a_scriptsplitting,unsetvalue) end -- the following tables will become a proper installer (move to cjk/eth) @@ -345,7 +385,7 @@ scripts.numbertocategory = numbertocategory local function colorize(start,stop) for n in traverse_id(glyph_code,start) do - local kind = numbertocategory[n[a_prestat]] + local kind = numbertocategory[n[a_scriptstatus]] if kind then local ac = scriptcolors[kind] if ac then @@ -376,7 +416,7 @@ end -- we can have a fonts.hashes.originals -function scripts.preprocess(head) +function scripts.injectors.handler(head) local start = first_glyph(head) -- we already have glyphs here (subtype 1) if not start then return head, false @@ -386,7 +426,7 @@ function scripts.preprocess(head) while start do local id = start.id if id == glyph_code then - local a = start[a_preproc] + local a = start[a_scriptinjection] if a then if a ~= last_a then if first then @@ -405,7 +445,7 @@ function scripts.preprocess(head) end last_a = a local handler = numbertohandler[a] - normal_process = handler.process + normal_process = handler.injector end if normal_process then local f = start.font @@ -424,7 +464,7 @@ function scripts.preprocess(head) end local h = hash[c] if h then - start[a_prestat] = categorytonumber[h] + start[a_scriptstatus] = categorytonumber[h] if not first then first, last = start, start else @@ -502,6 +542,10 @@ function scripts.preprocess(head) end end +function scripts.splitters.handler(head) + return head, false +end + -- new plugin: local registercontext = fonts.specifiers.registercontext @@ -526,14 +570,14 @@ setmetatableindex(cache_nop,function(t,k) local v = { } t[k] = v return v end) -- -- we can consider merging this in handlers.characters(head) at some point as there -- already check for the dynamic attribute so it saves a pass, however, then we also --- need to check for a_preproc there which nils the benefit +-- need to check for a_scriptinjection there which nils the benefit -- -- we can consider cheating: set all glyphs in a word as the first one but it's not -- playing nice function autofontfeature.handler(head) for n in traverse_id(glyph_code,head) do - -- if n[a_preproc] then + -- if n[a_scriptinjection] then -- -- already tagged by script feature, maybe some day adapt -- else local char = n.char @@ -553,7 +597,7 @@ function autofontfeature.handler(head) end if attr ~= 0 then n[0] = attr - -- maybe set preproc when associated + -- maybe set scriptinjection when associated end else local slot = cache_nop[font] @@ -567,7 +611,7 @@ function autofontfeature.handler(head) end if attr ~= 0 then n[0] = attr - -- maybe set preproc when associated + -- maybe set scriptinjection when associated end end end @@ -578,12 +622,12 @@ end function autofontfeature.enable() report_scripts("globally enabled") - nodes.tasks.enableaction("processors","scripts.autofontfeature.handler") + enableaction("processors","scripts.autofontfeature.handler") end function autofontfeature.disable() report_scripts("globally disabled") - nodes.tasks.disableaction("processors","scripts.autofontfeature.handler") + disableaction("processors","scripts.autofontfeature.handler") end commands.enableautofontscript = autofontfeature.enable diff --git a/tex/context/base/scrp-ini.mkiv b/tex/context/base/scrp-ini.mkiv index bf8b580c7..289409933 100644 --- a/tex/context/base/scrp-ini.mkiv +++ b/tex/context/base/scrp-ini.mkiv @@ -17,8 +17,9 @@ \registerctxluafile{scrp-cjk}{1.001} \registerctxluafile{scrp-eth}{1.001} -\definesystemattribute[preproc][public] -\definesystemattribute[prestat][public] +\definesystemattribute[scriptinjection][public] +\definesystemattribute[scriptsplitting][public] +\definesystemattribute[scriptstatus] [public] %D Since scripts need specific \LUA\ code we use hard coded attribute %D values, but we might have more tricks at some time, so we use a @@ -56,15 +57,23 @@ \unexpanded\def\stopscript {\endgroup} -% \setscript[hangul] \hangul \startscript[hangul] +% % todo: +% +% \unexpanded\def\setscriptsplitterlist +% {\dodoubleargument\scripts_basics_set_splitter_list} +% +% \def\scripts_basics_set_splitter_list[#1][#2]% +% {\ctxcommand{setscriptsplitterlist("#1","#2")} -\definescript[hangul] [\c!method=hangul] -\definescript[hanzi] [\c!method=hanzi] -\definescript[nihongo] [\c!method=nihongo] +% \setscript[hangul] \hangul \startscript[hangul] -\definescript[ethiopic][\c!method=ethiopic] +\definescript [hangul] [\c!method=hangul] +\definescript [hanzi] [\c!method=hanzi] +\definescript [nihongo] [\c!method=nihongo] +\definescript [ethiopic] [\c!method=ethiopic] +\definescript [thai] [\c!method=thai] -\definescript[latin] [\c!method=] % resets the attribute (also currentscript) +\definescript [latin] [\c!method=] % resets the attribute (also currentscript) % a new trick (at some point we will predefine more scripts and consider a link with the above) diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf index b8adb2829..57208daf8 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 af5f201ca..3be798898 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 cc1c86d56..320ea0d17 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-features", + status = "okay", + }, { category = "lua", filename = "s-fonts-missing", @@ -4280,6 +4285,21 @@ return { filename = "s-fonts-vectors", status = "okay", }, + { + category = "lua", + filename = "s-math-extensibles", + status = "okay", + }, + { + category = "lua", + filename = "s-math-coverage", + status = "okay", + }, + { + category = "lua", + filename = "s-math-parameters", + status = "okay", + }, { category = "lua", filename = "s-pre-71", @@ -5319,6 +5339,11 @@ return { filename = "s-fnt-32", status = "todo", }, + { + category = "mkiv", + filename = "s-fonts-features", + status = "okay", + }, { category = "mkiv", filename = "s-fonts-missing", @@ -5386,22 +5411,27 @@ return { }, { category = "mkiv", - filename = "s-mat-20", + filename = "s-mat-11", + status = "todo", + }, + { + category = "mkiv", + filename = "s-math-repertoire", status = "okay", }, { category = "mkiv", - filename = "s-mat-11", - status = "todo", + filename = "s-math-extensibles", + status = "okay", }, { category = "mkiv", - filename = "s-mat-12", - status = "todo", + filename = "s-math-coverage", + status = "okay", }, { category = "mkiv", - filename = "s-math-extensibles", + filename = "s-math-parameters", status = "okay", }, { diff --git a/tex/context/base/task-ini.lua b/tex/context/base/task-ini.lua index 011ed50ca..0f477cb6e 100644 --- a/tex/context/base/task-ini.lua +++ b/tex/context/base/task-ini.lua @@ -24,11 +24,12 @@ appendaction("processors", "normalizers", "fonts.collections.process") appendaction("processors", "normalizers", "fonts.checkers.missing") -- disabled appendaction("processors", "characters", "scripts.autofontfeature.handler") +appendaction("processors", "characters", "scripts.splitters.handler") -- disabled appendaction("processors", "characters", "typesetters.cleaners.handler") -- disabled appendaction("processors", "characters", "typesetters.directions.handler") -- disabled appendaction("processors", "characters", "typesetters.cases.handler") -- disabled appendaction("processors", "characters", "typesetters.breakpoints.handler") -- disabled -appendaction("processors", "characters", "scripts.preprocess") +appendaction("processors", "characters", "scripts.injectors.handler") -- disabled appendaction("processors", "words", "builders.kernel.hyphenation") -- always on appendaction("processors", "words", "languages.words.check") -- disabled @@ -108,6 +109,8 @@ appendaction("vboxbuilders","normalizers","typesetters.checkers.handler") -- speedup: only kick in when used disableaction("processors", "scripts.autofontfeature.handler") +disableaction("processors", "scripts.splitters.handler") +disableaction("processors", "scripts.injectors.handler") -- was enabled disableaction("processors", "fonts.collections.process") disableaction("processors", "fonts.checkers.missing") disableaction("processors", "chars.handle_breakpoints") diff --git a/tex/context/base/type-imp-texgyre.mkiv b/tex/context/base/type-imp-texgyre.mkiv index b1e1e3cc0..24185f41d 100644 --- a/tex/context/base/type-imp-texgyre.mkiv +++ b/tex/context/base/type-imp-texgyre.mkiv @@ -177,7 +177,7 @@ \definetypeface [\typescriptone] [\s!rm] [\s!serif] [\typescriptone] [\s!default] \definetypeface [\typescriptone] [\s!ss] [\s!sans] [modern] [\s!default] [\s!rscale=1.1] \definetypeface [\typescriptone] [\s!tt] [\s!mono] [modern] [\s!default] [\s!rscale=1.1] - \definetypeface [\typescriptone] [\s!mm] [\s!math] [modern] [\s!default] [\s!rscale=1.1] + \definetypeface [\typescriptone] [\s!mm] [\s!math] [bonum] [\s!default] \quittypescriptscanning \stoptypescript @@ -244,7 +244,7 @@ \startmode[pxmath] - \starttypescriptcollection[texgyre-math] + \starttypescriptcollection[texgyre-math-pagella] \starttypescript [\s!math][palatino,pagella][\s!all] \loadfontgoodies[px-math] @@ -258,7 +258,7 @@ \startnotmode[pxmath] - \starttypescriptcollection[texgyre-math] + \starttypescriptcollection[texgyre-math-pagella] \starttypescript [\s!math][palatino,pagella][\s!all] \loadfontgoodies[texgyre] @@ -268,3 +268,12 @@ \stoptypescriptcollection \stopnotmode + +\starttypescriptcollection[texgyre-math-bonum] + + \starttypescript [\s!math][bookman,bonum][\s!all] + \loadfontgoodies[texgyre] + \definefontsynonym[\s!MathRoman][file:texgyre-bonum-math-regular.otf][\s!features=\s!math\mathsizesuffix] + \stoptypescript + +\stoptypescriptcollection diff --git a/tex/context/fonts/texgyre.lfg b/tex/context/fonts/texgyre.lfg index 953692232..7782aa509 100644 --- a/tex/context/fonts/texgyre.lfg +++ b/tex/context/fonts/texgyre.lfg @@ -20,5 +20,11 @@ return { "tgtermesmath-regular.otf", "tgtermes-math.otf", }, + ["texgyre-bonum-math-regular.otf"] = { + "texgyrebonum-math.otf", -- beta + "texgyrebonummath-regular.otf", + "tgbonummath-regular.otf", + "tgbonum-math.otf", + }, }, } diff --git a/tex/generic/context/luatex/luatex-basics-gen.lua b/tex/generic/context/luatex/luatex-basics-gen.lua index 1c4357fbc..0561778b4 100644 --- a/tex/generic/context/luatex/luatex-basics-gen.lua +++ b/tex/generic/context/luatex/luatex-basics-gen.lua @@ -145,16 +145,24 @@ end do + -- standard context tree setup + local cachepaths = kpse.expand_path('$TEXMFCACHE') or "" + -- quite like tex live or so + if cachepaths == "" then cachepaths = kpse.expand_path('$TEXMFVAR') end + -- this also happened to be used + if cachepaths == "" then cachepaths = kpse.expand_path('$VARTEXMF') end + -- and this is a last resort + if cachepaths == "" then cachepaths = "." end @@ -162,8 +170,15 @@ do cachepaths = string.split(cachepaths,os.type == "windows" and ";" or ":") for i=1,#cachepaths do - if file.is_writable(cachepaths[i]) then - writable = file.join(cachepaths[i],"luatex-cache") + local cachepath = cachepaths[i] + if not lfs.isdir(cachepath) then + lfs.mkdirs(cachepath) -- needed for texlive and latex + if lfs.isdir(cachepath) then + texio.write(string.format("(created cache path: %s)",cachepath)) + end + end + if file.is_writable(cachepath) then + writable = file.join(cachepath,"luatex-cache") lfs.mkdir(writable) writable = file.join(writable,caches.namespace) lfs.mkdir(writable) diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index 37775d1f5..ffb001601 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/15/13 09:58:43 +-- merge date : 05/16/13 00:29:34 do -- begin closure to overcome local limits and interference @@ -1986,7 +1986,7 @@ elseif not lfs.isfile then end end local insert,concat=table.insert,table.concat -local match,find=string.match,string.find +local match,find,gmatch=string.match,string.find,string.gmatch local lpegmatch=lpeg.match local getcurrentdir,attributes=lfs.currentdir,lfs.attributes local checkedsplit=string.checkedsplit @@ -2299,6 +2299,19 @@ function file.strip(name,dir) return a~="" and a or name end end +function lfs.mkdirs(path) + local full + for sub in gmatch(path,"([^\\/]+)") do + if full then + full=full.."/"..sub + else + full=sub + end + if not lfs.isdir(full) then + lfs.mkdir(full) + end + end +end end -- closure @@ -3006,8 +3019,15 @@ do end cachepaths=string.split(cachepaths,os.type=="windows" and ";" or ":") for i=1,#cachepaths do - if file.is_writable(cachepaths[i]) then - writable=file.join(cachepaths[i],"luatex-cache") + local cachepath=cachepaths[i] + if not lfs.isdir(cachepath) then + lfs.mkdirs(cachepath) + if lfs.isdir(cachepath) then + texio.write(string.format("(created cache path: %s)",cachepath)) + end + end + if file.is_writable(cachepath) then + writable=file.join(cachepath,"luatex-cache") lfs.mkdir(writable) writable=file.join(writable,caches.namespace) lfs.mkdir(writable) @@ -6809,7 +6829,7 @@ local function checkmathsize(tfmdata,mathsize) end registerotffeature { name="mathsize", - description="apply mathsize as specified in the font", + description="apply mathsize specified in the font", initializers={ base=checkmathsize, node=checkmathsize, -- cgit v1.2.3