diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/modules/mkxl')
7 files changed, 1462 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/context/modules/mkxl/s-characters-combinations.lmt b/Master/texmf-dist/tex/context/modules/mkxl/s-characters-combinations.lmt new file mode 100644 index 00000000000..be318eb38bf --- /dev/null +++ b/Master/texmf-dist/tex/context/modules/mkxl/s-characters-combinations.lmt @@ -0,0 +1,30 @@ +if not modules then modules = { } end modules ['s-characters-properties'] = { + version = 1.001, + comment = "companion to s-characters-properties.mkiv", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +moduledata.characters = moduledata.characters or { } +moduledata.characters.combinations = moduledata.characters.combinations or { } + +local context = context +local ctx_NC = context.NC +local ctx_NR = context.NR +local ctx_MR = context.MR +local ctx_ML = context.ML + +function moduledata.characters.combinations.showcombinations(settings) + context.starttabulate { "|l|T|cTw(1em)|T|" } + for k, v in table.sortedhash(characters.verbosemarks) do + local m = "with" .. string.gsub(k," ","") + ctx_NC() context(k) + ctx_NC() context("%U",v) + ctx_NC() context("%s",v) + ctx_NC() if token.is_defined(m) then context("\\string\\%s",m) end + ctx_NC() ctx_NR() + end + context.stoptabulate() +end + diff --git a/Master/texmf-dist/tex/context/modules/mkxl/s-characters-combinations.mkxl b/Master/texmf-dist/tex/context/modules/mkxl/s-characters-combinations.mkxl new file mode 100644 index 00000000000..aef466f8484 --- /dev/null +++ b/Master/texmf-dist/tex/context/modules/mkxl/s-characters-combinations.mkxl @@ -0,0 +1,61 @@ +%D \module +%D [ file=s-characters-combinations, +%D version=2021.02.08 +%D title=\CONTEXT\ Style File, +%D subtitle=Character combinations, +%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. + +\startmodule[characters-combinations] + +\registerctxluafile{s-characters-combinations}{autosuffix} + +\installmodulecommandluasingle \showcharactercombinations {moduledata.characters.combinations.showcombinations} + +\stopmodule + +\continueifinputfile{s-characters-combinations.mkxl} + +\usemodule[art-01] + +\setupbodyfont[dejavu] + +\starttext + + \showcharactercombinations + + \page + + \startlines + \chr {a acute } á \withacute a + \chr {o double acute } ő \withdoubleacute o + \chr {a grave } à \withgrave a + \chr {o double grave } ȍ \withdoublegrave o + \chr {a circumflex } â \withcircumflex a + \chr {e circumflex below} ḙ \withcircumflexbelow e + \chr {a diaeresis } ä \withdiaeresis a + \chr {a tilde } ã \withtilde a + \chr {i tilde below } ḭ \withtildebelow i + \chr {a macron } ā \withmacron a + \chr {k line below } ḵ \withlinebelow k + \chr {c cedilla } ç \withcedilla c + \chr {s comma below } ş \withcommabelow s + \chr {z hook below } ȥ \withhookbelow z + \chr {a hook } ả \withhook a + \chr {a ring } å \withring a + \chr {a ring below } ḁ \withringbelow a + \chr {m dot } ṁ \withdot m + \chr {l middle dot } ŀ \withmiddledot l + \chr {m dot below } ṃ \withdotbelow m + \chr {a breve } ă \withbreve a + \chr {a inverted breve } ȃ \withinvertedbreve a + \chr {k caron } ǩ \withcaron k + \chr {o stroke } ø \withstroke o + \stoplines + +\stoptext diff --git a/Master/texmf-dist/tex/context/modules/mkxl/s-colors-show.mkxl b/Master/texmf-dist/tex/context/modules/mkxl/s-colors-show.mkxl new file mode 100644 index 00000000000..aa0e3227eb6 --- /dev/null +++ b/Master/texmf-dist/tex/context/modules/mkxl/s-colors-show.mkxl @@ -0,0 +1,276 @@ +%D \module +%D [ file=colo-run, +%D version=1997.04.01, +%D title=\CONTEXT\ Color Macros, +%D subtitle=Runtime loaded commands, +%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{colo-run}{} + +\unprotect + +%D Colors + +%D These are nicer in \LUA\ code than in \TEX\ code but not more efficient. + +\permanent\protected\gdef\showcolorbar[#1]% + {\backgroundline[#1]{\strut\enspace\color[white]{white}\enspace\color[black]{black}\enspace}} + +\permanent\protected\tolerant\gdef\showcolorset[#1]% + {\ctxcommand{showcolorset("#1")}} + +\permanent\protected\tolerant\gdef\showcolorcomponents[#1]% + {\ctxcommand{showcolorcomponents("#1")}} + +\permanent\protected\tolerant\gdef\showcolor[#1]% + {\ifparameter#1\or + \usecolors [#1]% delayed and we can only ask for the set if + \showcolorset[#1]% loading has happened + \fi} + +%D The rest might also be done in \LUA\ although there is not much beauty to gain +%D here (too much typesetting specific). Also, these macros are pretty old and +%D hardly used so best keep them as they are. But we keep them because they always +%D worked and it doesn't hurt to see some \MKII|-|code every now and then. + +%D Palets + +\permanent\protected\tolerant\gdef\showpalet[#1]#*[#2]% + {\doifelsecolorpalet{#1} + {\doifelseinset\v!vertical{#2}\colo_palets_show_vertical\colo_palets_show_horizontal{#1}{#2}}% + {}} + +\gdef\colo_palets_show_vertical#1#2% + {\begingroup + \forgetall + \setlocalhsize + \hsize\localhsize + \offinterlineskip + \setuppalet[#1] + \tabskip\zeropoint + \def\colo_palets_show_palet##1% + {\doifelseinset\v!number{#2}{##1\hskip.5\emwidth}{}% + \aligntab + \color [##1]{\vrule\s!width3\emwidth\s!height\strutht\s!depth\strutdp}% + \graycolor[##1]{\vrule\s!width3\emwidth\s!height\strutht\s!depth\strutdp}% + \aligntab + \doifinset\v!value{#2}{\hskip.5\emwidth\colorvalue{##1}}% + \crcr} + \halign + {\hss\alignmark\alignmark\aligntab\hss\alignmark\alignmark\hss\aligntab\alignmark\alignmark\cr + \aligntab\doifinset\v!name{#2}{\strut#1}\aligntab\cr + \colo_palets_process[#1]\colo_palets_show_palet\crcr}% + \endgroup} + +\gdef\colo_palets_show_horizontal#1#2% todo: bTABLE etc + {\vbox + {\forgetall + \setlocalhsize + \hsize\localhsize + \offinterlineskip + \setuppalet[#1] + \tabskip\zeropoint + \scratchwidth\zeropoint + \doifinset\v!number{#2} + {\def\colo_palets_show_palet##1% + {\setbox\scratchbox\hbox{##1}% + \ifdim\scratchwidth<\wd\scratchbox + \scratchwidth\wd\scratchbox + \fi}% + \colo_palets_process[#1]\colo_palets_show_palet}% + \advance\scratchwidth\emwidth + \ifdim\scratchwidth<5\emwidth + \scratchwidth5\emwidth + \fi + \halign + {\alignmark\alignmark\aligntab\aligntab\hbox to \scratchwidth{\hss\alignmark\alignmark\hss}\cr + \doifinset\v!number{#2} + {\def\colo_palets_show_palet##1{\aligntab\strut##1}% + \colo_palets_process[#1]\colo_palets_show_palet}\cr + \doifinset\v!name{#2}{#1\hskip.5\emwidth}% + \def\colo_palets_show_palet##1% + {\aligntab\strut\color[##1]{\vrule\s!width\scratchwidth\s!height\strutht\s!depth\zeropoint}}% + \colo_palets_process[#1]\colo_palets_show_palet\crcr + \noalign{\vskip-\strutdepth}% + \def\colo_palets_show_palet##1% + {\aligntab\graycolor[##1]{\vrule\s!width\scratchwidth\s!height\zeropoint\s!depth\strutdp}}% + \colo_palets_process[#1]\colo_palets_show_palet\crcr + \doifinset\v!value{#2} + {\def\colo_palets_show_palet##1% + {\aligntab\vbox + {\hsize\scratchwidth + \vskip.25\exheight + \everypar{\strut} + \veryraggedcenter + \let\colorformatseparator\endgraf + \colorvalue{##1}}}% + \colo_palets_process[#1]\colo_palets_show_palet}% + \crcr}}} + +\gdef\colo_palets_process[#1]% + {\getpaletlist[#1]% + \normalexpanded{\globalprocesscommalist[\paletlist]}} + +\permanent\protected\tolerant\gdef\comparepalet[#1]% + {\doifelsecolorpalet{#1}% + {\hbox + {\colo_palets_compare_indeed\color{#1}% + \quad + \colo_palets_compare_indeed\graycolor{#1}}}% + {}} + +\gdef\colo_palets_compare_indeed#1#2% + {\vbox + {\forgetall + \setlocalhsize + \hsize\localhsize + \offinterlineskip + \setuppalet[#2] + \getpaletsize[#2]% + \getpaletlist[#2]% + \scratchwidth2\emwidth\relax + \hsize\paletsize\scratchwidth + \def\colo_palets_compare##1% + {\hbox + {\setbox0\hbox + {#1[##1]{\vrule\s!width\hsize\s!height3ex}}% + \wd0\zeropoint + \box0 + \hbox to \hsize + {\def\colo_palets_compare####1% + {\hbox to \scratchwidth + {\hss#1[####1]{\vrule\s!width.5\scratchwidth\s!height2.25\exheight\s!depth-.75\exheight}\hss}}% + \processcommacommand[\paletlist]\colo_palets_compare}} + \endgraf} + \processcommacommand[\paletlist]\colo_palets_compare}} + +%D Groups + +\permanent\protected\tolerant\gdef\showcolorgroup[#1]#*[#2]% + {\doifcolor{#1:1} + {\doifelseinset\v!vertical{#2}\colo_groups_show_vertical\colo_groups_show_horizontal{#1}{#2}}} + +\gdef\colo_groups_show_horizontal#1#2% + {\vbox + {\forgetall + \setlocalhsize + \hsize\localhsize + \offinterlineskip + \setuppalet + \tabskip\zeropoint + \def\colorformatseparator{\strut\cr} + \def\colo_groups_show_group##1% + {\doifcolor{#1:##1}{\vbox + {\halign + {\hss\alignmark\alignmark\alignmark\alignmark\hss\cr + \doifinset\v!number{#2}{\strut##1}\cr + \color [#1:##1]{\vrule\s!width4\emwidth\s!height\strutht \s!depth\zeropoint}\cr + \graycolor[#1:##1]{\vrule\s!width4\emwidth\s!height\zeropoint\s!depth\strutdp }\cr + \doifinset\v!value{#2}{\colorvalue{#1:##1}\strut}\crcr}}}}% + \hbox + {\doifinset\v!name{#2} + {\strut + \doifelseinset\v!value{#2} + {\raise3\lineheight\hbox{#1\hskip.5\emwidth}} + {#1}% + \hskip.5\emwidth}% + \colo_groups_show_group1\colo_groups_show_group2\colo_groups_show_group3\colo_groups_show_group4% + \colo_groups_show_group5\colo_groups_show_group6\colo_groups_show_group7\colo_groups_show_group8}}} + +\gdef\colo_groups_show_vertical#1#2% + {\vbox + {\forgetall + \setlocalhsize + \hsize\localhsize + \offinterlineskip + \setuppalet + \tabskip\zeropoint + \def\colo_groups_show_group##1% + {\doifcolor{#1:##1} + {\doifinset\v!number{#2} + {##1\hskip.5\emwidth}% + \aligntab + \color [#1:##1]{\vrule\s!width2.5\emwidth\s!height\strutht\s!depth\strutdp}% + \graycolor[#1:##1]{\vrule\s!width2.5\emwidth\s!height\strutht\s!depth\strutdp} + \aligntab + \doifinset\v!value{#2}{\hskip.5\emwidth\colorvalue{#1:##1}}% + \crcr}}% + \halign + {\hss\alignmark\alignmark\aligntab\hss\alignmark\alignmark\hss\aligntab\alignmark\alignmark\hss\cr + \aligntab\doifinset\v!name{#2}{\strut#1}\aligntab\crcr + \colo_groups_show_group1\colo_groups_show_group2\colo_groups_show_group3\colo_groups_show_group4% + \colo_groups_show_group5\colo_groups_show_group6\colo_groups_show_group7\colo_groups_show_group8}}} + +\permanent\protected\tolerant\gdef\comparecolorgroup[#1]% + {\doifcolor{#1:1} + {\hbox + {\colo_groups_compare_indeed\color {#1}\quad + \colo_groups_compare_indeed\graycolor{#1}}}} + +\gdef\colo_groups_compare_indeed#1#2% + {\vbox + {\forgetall + \setlocalhsize + \hsize\localhsize + \scratchcounter\zerocount + \dorecurse{15}{\doifcolor{#2:\recurselevel}{\advance\scratchcounter\plusone}} + \scratchwidth2\emwidth\relax + \hsize\scratchcounter\scratchwidth + \dorecurse\scratchcounter{\colo_groups_compare_step{#1}{#2}\recurselevel}}} + +\def\colo_groups_compare_step#1#2#3% + {\hbox to \hsize + {\setbox\scratchbox\hbox + {#1[#2:#3]{\vrule\s!width\hsize\s!height3\exheight}}% + \wd\scratchbox\zeropoint + \box\scratchbox + \hbox to \hsize + {\hss + \dorecurse\scratchcounter + {#1[#2:\recurselevel]{\vrule\s!width.5\scratchwidth\s!height2.25\exheight\s!depth-.75\exheight}% + \hss}}} + \endgraf} + +\protect + +\continueifinputfile{s-colors-show.mkxl} + +\setupwhitespace[big] + +\usecolors[dem] + +\starttext + +\startsubject[title=\type{\showpalet}] + \showpalet [alfa] [horizontal,name,number,value] +\stopsubject + +\startsubject[title=\type{\showcolorcomponents}] + \showcolorcomponents[red,green,blue] +\stopsubject + +\startsubject[title=\type{\comparepalet}] + \comparepalet[alfa] +\stopsubject + +\startsubject[title=\type{\showcolor}] + \showcolor[rgb] +\stopsubject + +\startsubject[title=\type{\showcolorgroup}] + \showcolorgroup[magenta] + \showcolorgroup[cyan] + \showcolorgroup[yellow] +\stopsubject + +\startsubject[title=\type{\comparecolorgroup}] + \comparecolorgroup[magenta] +\stopsubject + +\stoptext diff --git a/Master/texmf-dist/tex/context/modules/mkxl/s-fonts-show.mkxl b/Master/texmf-dist/tex/context/modules/mkxl/s-fonts-show.mkxl new file mode 100644 index 00000000000..42b5af125f7 --- /dev/null +++ b/Master/texmf-dist/tex/context/modules/mkxl/s-fonts-show.mkxl @@ -0,0 +1,658 @@ +%D \module +%D [ file=font-run, +%D version=1998.09.11, % (second) +%D version=2001.02.20, % (third) +%D title=\CONTEXT\ Font Macros, +%D subtitle=Runtime 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. + +%D [This code is hooked into the core macros and saves some format +%D space. It needs a cleanup as it's real old derioved \MKII\ code] +%D +%D Better use \type{\bTABLE...\eTABLE}. + +\unprotect + +\gdef\module_fonts_show_prepare#1% + {\iftok{#1}\emptytoks + \edef\m_module_fonts_show_title{\the\bodyfontsize}% + \else + \switchtobodyfont[#1]% + \edef\m_module_fonts_show_title{#1}% + \fi + \ifempty\fontclass + \edef\m_module_fonts_show_title{[\m_module_fonts_show_title]}% + \orelse\ifx\fontclass\m_module_fonts_show_title + \edef\m_module_fonts_show_title{[\m_module_fonts_show_title]}% + \else + \edef\m_module_fonts_show_title{[\fontclass]\space[\m_module_fonts_show_title]}% + \fi} + +\permanent\protected\tolerant\gdef\showbodyfont[#1]% + {\ifinsidefloat\else\startbaselinecorrection\fi + \vbox + {\module_fonts_show_prepare{#1}% + \def\next##1##2##3##4% + {\bTR + \bTD{##4}\type{##1}\eTD + \bTD{##4}##1##3{\tf ##2}\eTD + \bTD{##4}##1##3{\tf ##2}\eTD + \bTD{##4}##1##3{\bf ##2}\eTD + \bTD{##4}##1##3{\sl ##2}\eTD + \bTD{##4}##1##3{\it ##2}\eTD + \bTD{##4}##1##3{\bs ##2}\eTD + \bTD{##4}##1##3{\bi ##2}\eTD + \bTD{##4}##1##3{\tfx ##2}\eTD + \bTD{##4}##1##3{\tfxx ##2}\eTD + \bTD{##4}##1##3{\tfa ##2}\eTD + \bTD{##4}##1##3{\tfb ##2}\eTD + \bTD{##4}##1##3{\tfc ##2}\eTD + \bTD{##4}##1##3{\tfd ##2}\eTD + \eTR}% + \bTABLE[\c!align=\v!middle,\c!loffset=.5ex,\c!roffset=.5ex] + \bTR\bTD[\c!nx=14,\c!offset=1ex]\tttf{\m_module_fonts_show_title}\eTD\eTR + \next{}{}\type{}% + \next\rm{\languageparameter\c!text}\relax{\tfd\setstrut\strut}% + \next\ss{\languageparameter\c!text}\relax{\tfd\setstrut\strut}% + \next\tt{\languageparameter\c!text}\relax{\tfd\setstrut\strut}% + \next\mr{\languageparameter\c!text}\mathematics{\tfd\setstrut\strut}% + \eTABLE}% + \ifinsidefloat\else\stopbaselinecorrection\fi} + +\permanent\protected\tolerant\gdef\showbodyfontenvironment[#1]% + {\ifinsidefloat\else\startbaselinecorrection\fi + \vbox + {\module_fonts_show_prepare{#1}% + \def\next##1##2% + {\bTR + \bTD##1\bodyfontsizevariable{##2}\s!text\eTD + \bTD##1\bodyfontsizevariable{##2}\s!script\eTD + \bTD##1\bodyfontsizevariable{##2}\s!scriptscript\eTD + \bTD##1\bodyfontsizevariable{##2}\s!x\eTD + \bTD##1\bodyfontsizevariable{##2}\s!xx\eTD + \bTD##1\bodyfontsizevariable{##2}\v!small\eTD + \bTD##1\bodyfontsizevariable{##2}\v!big\eTD + %\bTD##1\bodyfontsizevariable{##2}\c!interlinespace\eTD + \eTR}% + \def\nextone{\next\relax}% + \bTABLE[\c!align=\v!middle,\c!loffset=.5ex,\c!roffset=.5ex] + \bTR\bTD[\c!nx=7,\c!offset=1ex]\tttf{\m_module_fonts_show_title}\eTD\eTR + \next{\tttf\thirdofthreearguments}\relax + \processbodyfontenvironmentlist{nextone} + \eTABLE}% + \ifinsidefloat\else\stopbaselinecorrection\fi} + +\permanent\protected\tolerant\gdef\showfont[#1]#*[#2]% + {\bgroup + \iftok{#1}\emptytoks\else + \definedfont[#1]% + \ifdim40\emwidth>\hsize + \glyphscale750\relax + \fi + \fi + \integerdef\c_module_fonts_font_id\fontid\font + \doifelsenothing{#2} + {\module_fonts_show_font_indeed{#1}\zerocount} + {\doifelse{#2}\v!all + {\dostepwiserecurse\zerocount{255}\plusone + {\scratchcounterone \recurselevel + \scratchcountertwo \numexpr\scratchcounterone*256\relax + \scratchcounterthree\numexpr\scratchcountertwo+255\relax + \doloop + {\iffontchar\font\scratchcountertwo + \module_fonts_show_font_indeed{#1}\scratchcounterone + \exitloop + \orelse\ifnum\scratchcountertwo=\scratchcounterthree + \exitloop + \else + \advance\scratchcountertwo\plusone + \fi}}} + {\processcommalist[#2]{\module_fonts_show_font_indeed{#1}}}}% + \egroup} + +\gdef\module_fonts_show_font_indeed#1#2% made some 50% faster but still slow + {\bgroup + \ifinsidefloat\else\startbaselinecorrection\fi + \vbox\bgroup + \scratchdimenone 2.5\emwidth + \scratchdimentwo 2.4\emwidth + \scratchdimenthree2.3\emwidth + \scratchcounterfour#2\relax + \forgetall + \startoverlay % easier in cld + {\vbox + {\tf + \setstrut + \setfontid\c_module_fonts_font_id + \offinterlineskip + \unexpanded\def\wrapbox##1% + {\vpack to \scratchdimenone + {\vss + \hpack to \scratchdimenone + {\setfontid\c_module_fonts_font_id + \ifzeropt\interwordspace + \setbox##1\hpack{\raise.5\dp##1\hpack{\lower.5\ht##1\copy##1}}% + \ht##1\zeropoint + \dp##1\zeropoint + \else + \ht##1\strutht + \dp##1\strutdp + \strut + \fi + \hss\copy##1\hss} + \vss}}% + \unexpanded\def\textbox##1% + {\vpack to \scratchdimentwo + {\hsize\scratchdimenthree + ##1% + \par}}% + \unexpanded\def\scratchnum + {\blue + \tinyfont + \hfill + \number\scratchcounter + \vfill + \octnumber\scratchcounter + \hfill + \lchexnumbers\scratchcounter}% + \setbox\scratchboxone\hpack{\tf\textbox{}}% + \setbox\scratchboxtwo\hpack{\tf\gray\vrule\s!width\exheight\s!height.5\exheight\s!depth.5\exheight}% + \setbox\scratchboxtwo\wrapbox\scratchboxtwo + \setbox\scratchboxthree\hpack + {\startoverlay + {\box\scratchboxtwo} + {\box\scratchboxone} + \stopoverlay}% + \dostepwiserecurse\zerocount{15}\plusone + {\scratchcounterone\recurselevel + \hpack + {\dostepwiserecurse\zerocount{15}\plusone + {\scratchcountertwo \recurselevel + \scratchcounterthree\numexpr\scratchcounterone*16+\scratchcountertwo\relax + \scratchcounterthree\numexpr\scratchcounterfour*256+\scratchcounterthree\relax + \iffontchar\font\scratchcounterthree + \setbox\scratchbox\ruledhpack{\char\scratchcounterthree}% + \bgroup + \tf + \startoverlay + {\wrapbox\scratchbox} + {\textbox\scratchnum} + \stopoverlay + \egroup + \else + \copy\scratchboxthree + \fi}}}% + \par}} + {\tf\basegrid[\c!nx=16,\c!ny=16,\c!dx=2.5,\c!dy=2.5,\c!unit=em]} + \stopoverlay + \nointerlineskip + \vskip2\points + % the \noexpand before \blank is needed for non etex + \edef\theshowfontspecs{name: {\noexpand\black\fontname\font}\quad plane: \the\scratchcounterfour\enspace"\hexnumber\scratchcounterfour}% + \tf % also sets em + \hbox to 40\emwidth{\blue\hfill\tinyfont\setstrut\strut\theshowfontspecs} + \egroup + \ifinsidefloat\else\stopbaselinecorrection\fi + \egroup} + +% \showfontstyle[modern][rm][tf][all] % #2, #3 and #4 can be 'all' +% +% no lists any more, so no 'all' any longer +% no need to clean this up + +\permanent\protected\tolerant\gdef\showfontstyle[#1]#*[#2]#*[#3]#*[#4] + {\bgroup + \edef\m_module_fonts_show_styles {\iftok{#2}\emptytoks\s!rm,\s!ss,\s!tt,\s!mm\else#2\fi}% + \edef\m_module_fonts_show_alternatives{\iftok{#3}\emptytoks\s!tf,\s!bf,\s!it,\s!sl,\s!bs,\s!bi\else#3\fi}% + \iftok{#1}\emptytoks\else + \switchtobodyfont[#1] + \fi + \raggedright + \protected\def\dododocommand##1% + {\dostepwiserecurse\zerocount{255}\plusone + {\scratchcounter\numexpr##1*256+\recurselevel\relax + \iffontchar\font\scratchcounter\relax + \char\scratchcounter + \space + \fi}}% + \protected\def\dodocommand##1##2% + {\starttextrule{\tttf #1 ##1 ##2} + \nobreak\getvalue{##2}% + \doifelsenothing{#4} + {\dododocommand\zerocount} + {\doifelse{#4}\v!all + {\dostepwiserecurse\zerocount{255}\plusone{\normalexpanded{\dododocommand{\recurselevel}}}} + {\processcommalist[#4]{\dododocommand}}}% + \par \nobreak + \stoptextrule} + \protected\def\docommand##1% + {\getvalue{##1}% + \processcommacommand[\m_module_fonts_show_alternatives]{\dodocommand{##1}}} + \processcommacommand[\m_module_fonts_show_styles]\docommand + \egroup} + +\permanent\protected\gdef\showligature#1% + {\hbox{\type{#1}\enspace\showglyphs#1}} + +\permanent\protected\tolerant\gdef\showligatures[#1]% we keep it around for compatibility reasons + {\bgroup + \def\module_fonts_show_ligature##1{\hbox{\showglyphs##1}}% + \doifsomething{#1}{\definedfont[#1*default]}% + \starttabulate[|*{7}{c|}] + \NC\type{ff} + \NC\type{fi} + \NC\type{fl} + \NC\type{ffi} + \NC\type{ffl} + \NC\type{--} + \NC\type{---} + \NC\NR + \NC\module_fonts_show_ligature{ff} + \NC\module_fonts_show_ligature{fi} + \NC\module_fonts_show_ligature{fl} + \NC\module_fonts_show_ligature{ffi} + \NC\module_fonts_show_ligature{ffl} + \NC\module_fonts_show_ligature{--} + \NC\module_fonts_show_ligature{---} + \NC\NR + \stoptabulate + \egroup} + +\permanent\protected\gdef\showkerning + {\groupedcommandcs\showfontkerns\relax} + +\permanent\gdef\module_fonts_char_ratio#1#2% + {\ifzeropt\nextboxhtdp\else + \cldcontext{\number#1/\number\nextboxhtdp}% + \fi} + +\permanent\protected\gdef\showcharratio + {\dowithnextboxcontent + {\switchtobodyfont[10pt]}% + {\starttabulate[|l|l|l|] + \NC height \NC \the\nextboxht \NC \module_fonts_char_ratio\nextboxht \NC \NR + \NC depth \NC \the\nextboxdp \NC \module_fonts_char_ratio\nextboxdp \NC \NR + \stoptabulate} + \hbox} + +\permanent\protected\gdef\showfontparameters + {\starttabulate[|tl|l|] + \NC \type {\slantperpoint} \NC \the\fontslantperpoint \font \NC\NR + \NC \type {\interwordspace} \NC \the\fontinterwordspace \font \NC\NR + \NC \type {\interwordstretch} \NC \the\fontinterwordstretch\font \NC\NR + \NC \type {\interwordshrink} \NC \the\fontinterwordshrink \font \NC\NR + \NC \type {\exheight} \NC \the\fontexheight \font \NC\NR + \NC \type {\emwidth} \NC \the\fontemwidth \font \NC\NR + \NC \type {\extraspace} \NC \the\fontextraspace \font \NC\NR + \stoptabulate} + +\unexpanded\gdef\module_fonts_show_minimal_baseline#1% to be used in a 10 column tabulate + {\setbox\scratchbox\ruledhbox{#1}% + \normalexpanded { + \NC \ruledhbox{#1}% + \NC -> + \NC \the\htdp\scratchbox + \NC = + \NC \the\ht\scratchbox + \NC + + \NC \the\dp\scratchbox + \NC \ifcmpdim\htdp\scratchbox\baselineskip <\or=\or>\fi + \NC \the\baselineskip + \NC (\ifdim\htdp\scratchbox>\baselineskip not \fi ok) + \NC \NR}} + +\permanent\protected\gdef\showminimalbaseline + {\starttabulate[|l|T|T|T|T|T|T|T|T|T|] + \module_fonts_show_minimal_baseline{\hbox to \emwidth{\hss\showstruts\strut\hss}}% + \module_fonts_show_minimal_baseline{(/)}% + \module_fonts_show_minimal_baseline{\normalstartimath\frac{1}{2}x\normalsuperscript2\normalsubscript3\normalstopimath} + \stoptabulate} + +\permanent\protected\tolerant\gdef\showfontstrip[#1]% + {\bgroup + \def\module_fonts_show_strip_a##1##2% + {\tttf\string##1} + \def\module_fonts_show_strip_b##1##2% + {\ruledhbox{\switchtobodyfont[#1]##1{##2}}} + \def\module_fonts_show_strip_c##1##2% + {\setbox\scratchbox\hbox{\switchtobodyfont[#1]##1{##2}}% + \tt\tfx\the\ht\scratchbox}% + \def\module_fonts_show_strip_d##1##2% + {\setbox\scratchbox\hbox{\switchtobodyfont[#1]##1{##2}}% + \tt\tfx\the\wd\scratchbox}% + \def\module_fonts_show_strip_indeed##1##2##3% + {\NC##2\rm{##3}\NC + ##2\ss{##3}\NC + ##2\tt{##3}\NC + ##2\mathematics{##3}\NC + \tttf##1\NR} + \starttabulate[|c|c|c|c|c|] + \module_fonts_show_strip_indeed\relax\module_fonts_show_strip_a\empty + \TB + \module_fonts_show_strip_indeed\relax\module_fonts_show_strip_b{xxxx} + \module_fonts_show_strip_indeed\relax\module_fonts_show_strip_b{12345} + \module_fonts_show_strip_indeed\relax\module_fonts_show_strip_b{(Agw)} + \TB + \module_fonts_show_strip_indeed{(x height)}\module_fonts_show_strip_c{x} + \module_fonts_show_strip_indeed{(m width)}\module_fonts_show_strip_d{m} + \stoptabulate + \egroup} + +%D This is now moved here as there is no reason to have it in the core. Some of +%D the helpers might move to a more protected namespace. + +\newbox\otfcollector + +\permanent\protected\gdef\startotfcollecting{\ctxlua{nodes.tracers.steppers.start()}} +\permanent\protected\gdef\stopotfcollecting {\ctxlua{nodes.tracers.steppers.stop()}} +\permanent\protected\gdef\resetotfcollecting{\ctxlua{nodes.tracers.steppers.reset()}} + +% \page \showotfcomposition{arabtype*arab-default at 48pt}{-1}{الضَّرَّ} \page +% \page \showotfcomposition{arabtype*arab-default at 48pt}{-1}{لِلّٰهِ} \page + +\permanent\protected\gdef\showotfstepglyphs#1% + {\ctxlua{nodes.tracers.steppers.glyphs(\number\otfcollector,#1)}% + \unhbox\otfcollector} + +\permanent\protected\gdef\otfstepspace + {\removeunwantedspaces + \hskip.5\emwidth \s!plus .125\emwidth \s!minus .125\emwidth\relax} + +\permanent\protected\gdef\otfstepcharcommand#1#2#3% font char class + {\otfstepspace + \doif{#3}{mark}{\underbar}{U+\hexnumber{#2}}:% + \setbox\scratchbox\hbox{\ctxlua{nodes.tracers.fontchar(#1,#2)}}% + \ifzeropt\wd\scratchbox + \scratchwidth.125\onepoint + \scratchdistance\dimexpr(\emwidth/2-\scratchwidth)\relax + \kern\scratchdistance + \ruledhbox to \scratchwidth{\hss\box\scratchbox\hss}% + \kern-\scratchwidth + \hskip\scratchdistance + \else + \ruledhbox{\box\scratchbox}% + \fi + \otfstepspace} + +\permanent\protected\gdef\otfstepfontcommand#1#2#3% id font size + {\begingroup + \tttf #1: #2 @ \the\dimexpr#3\scaledpoint\relax + \endgroup} + +\permanent\protected\gdef\otfstepmessagecommand#1#2% + {\begingroup + \tttf\language\minusone + \veryraggedright + \forgetparindent + \forgeteverypar + \hangindent\emwidth + \hangafter\plusone + \dontleavehmode\detokenize{#1}\removeunwantedspaces + \doifsomething{#2}{,\space\detokenize{#2}}\endgraf + \endgroup + \blank} + +\permanent\protected\gdef\showotfstepfont + {\ctxlua{nodes.tracers.steppers.font("otfstepfontcommand")}} + +\permanent\protected\gdef\showotfstepchars#1% + {\ctxlua{nodes.tracers.steppers.codes(#1,"otfstepcharcommand","otfstepspace")}} + +\permanent\protected\gdef\showotfstepmessages#1% + {\ctxlua{nodes.tracers.steppers.messages(#1,"otfstepmessagecommand",true)}} + +\permanent\protected\gdef\showotfstepfeatures + {\ctxlua{nodes.tracers.steppers.features()}} + +\permanent\protected\gdef\otfnoffeaturesteps + {\ctxlua{nodes.tracers.steppers.nofsteps()}} + +\newconstant\showotfstepsmode \showotfstepsmode\plusfour + +\protected\gdef\showotfsteps_n + {\blank + \begingroup + \advance\leftskip6\emwidth + \showotfstepmessages\recurselevel + \par + \endgroup + \blank + \dontleavehmode + \hbox to \hsize \bgroup + \hbox to 6\emwidth \bgroup + \bf + \ifnum\recurselevel=\scratchcounter result\else step \recurselevel\fi + \hss + \egroup + \vtop \bgroup + \hsize\dimexpr\hsize-6\emwidth\relax + \resetallattributes + \lefttoright + \dontleavehmode + \ifnum\recurselevel=\scratchcounter + \ruledhbox{\box\otfcompositionbox}% + \else + \ruledhbox{\showotfstepglyphs\recurselevel}% + \fi + \quad + \showotfstepchars\recurselevel + \hfill + \par + \egroup + \egroup + \blank} + +\permanent\protected\gdef\showotfsteps + {\begingroup + \veryraggedright + \forgetparindent + \forgeteverypar + \tt + \lefttoright + \hbox to \hsize \bgroup + \hbox to 6\emwidth{\bf font\hss}% + \vtop \bgroup + \hsize\dimexpr\hsize-6\emwidth\relax + \language\minusone + \bf + \showotfstepfont + \egroup + \egroup + \blank + \hbox to \hsize \bgroup + \hbox to 6\emwidth{\bf features\hss}% + \vtop \bgroup + \hsize\dimexpr\hsize-6\emwidth\relax + \language\minusone + \showotfstepfeatures + \egroup + \egroup + \blank + \scratchcounter\otfnoffeaturesteps\relax + \dorecurse\scratchcounter + {\ifcase\showotfstepsmode + \or % 1 = only first + \ifnum\recurselevel=\plusone + \showotfsteps_n + \fi + \or % 2 = only last + \ifnum\recurselevel=\scratchcounter + \showotfsteps_n + \fi + \or % 3 = first and last + \ifnum\recurselevel=\plusone + \showotfsteps_n + \orelse\ifnum\recurselevel=\scratchcounter + \showotfsteps_n + \fi + \else % everything + \showotfsteps_n + \fi}% + \endgroup} + +\permanent\protected\gdef\startotfsample + {\enabletrackers[otf.sample.silent]% beware, kind of global + \startotfcollecting + \begingroup + \veryraggedright + \forgetparindent + \forgeteverypar} + +\permanent\protected\gdef\stopotfsample + {\endgroup + \stopotfcollecting + \disabletrackers[otf.sample]% beware, kind of global: otf.sample + \showotfsteps + \resetotfcollecting} + +\newbox\otfcompositionbox + +% this should go in spac-ali: + +\installcorenamespace{otfcompositiondir} + +\gletcsname\??otfcompositiondir -1\endcsname\righttoleft +\gletcsname\??otfcompositiondir r2l\endcsname\righttoleft +\gletcsname\??otfcompositiondir l2r\endcsname\lefttoright +\gletcsname\??otfcompositiondir +1\endcsname\lefttoright +\gletcsname\??otfcompositiondir 1\endcsname\lefttoright + +\permanent\protected\gdef\setotfcompositiondirection#1% + {\begincsname\??otfcompositiondir#1\endcsname} + +\permanent\protected\gdef\showotfcomposition#1#2#3% {font*features at size}, rl=-1, text + {\begingroup + \forgetparindent + \forgeteverypar + % \setupcolors[\c!state=\v!start]% + \setupalign[\v!verytolerant,\v!flushleft]% + \startotfsample + \nohyphens + \global\setbox\otfcompositionbox\hbox{\definedfont[#1]\relax\setotfcompositiondirection{#2}\relax#3}% + \stopotfsample + \endgroup} + +%D \startbuffer +%D \startotfcompositionlist{Serif*default @ 11pt}{l2r}% +%D \showotfcompositionsample{effe} +%D \stopotfcompositionlist +%D \stopbuffer +%D +%D \typebuffer \getbuffer + +\permanent\protected\gdef\showotfcompositionlist#1#2#3% + {\begingroup + \definedfont[#1]% + \setbox\scratchbox\hbox\bgroup + \setotfcompositiondirection{#2}% + #3% + \egroup + \strut + \def|##1|{\kern\onepoint\string|\kern\onepoint##1\kern\onepoint\string|\kern\onepoint}% + \cldcontext{nodes.listtoutf(tex.box[\number\scratchbox].list,"{\\kern\\onepoint}",true)}% + \endgroup} + +\mutable\glet\showotfcompositionsample\gobbleoneargument + +\permanent\protected\gdef\startotfcompositionlist#1#2#3\stopotfcompositionlist + {\begingroup + \protected\def\showotfcompositionsample##1% + {\NC\type{##1}% + \NC\showotfcompositionlist{Mono}{#2}{##1}% + \NC\showotfcompositionlist{#1}{#2}{##1}% + \NC\definedfont[#1]##1% + \NC\NR}% + \starttabulate[|||||]% + #3% + \stoptabulate + \endgroup} + +\aliased\glet\stopotfcompositionlist\relax + +%D Till here. + +\permanent\protected\def\showbodyfontstate + {\dontleavehmode + \start + \infofont + [fontclass: \fontclass,\space + fontbody: \fontbody ,\space + fontface: \fontface ,\space + fontsize: \fontsize ]% + \stop} + +\protect + +\continueifinputfile{s-fonts-show.mkxl} + +\setupwhitespace[big] + +\dontcomplain + +\starttext + +\startsubject[title=\type{\showkerning}] + \showkerning{Just a small sentence with hopefully some kerns.} +\stopsubject + +\startsubject[title=\type{\showcharratio}] + \showcharratio{testg} +\stopsubject + +\startsubject[title=\type{\showfontparameters}] + \showfontparameters +\stopsubject + +\startsubject[title=\type{\showminimalbaseline}] + \showminimalbaseline +\stopsubject + +\startsubject[title=\type{\showfontstrip}] + \showfontstrip +\stopsubject + +\startsubject[title=\type{\showbodyfont}] + \showbodyfont +\stopsubject + +\startsubject[title=\type{\showbodyfontenvironment}] + \showbodyfontenvironment +\stopsubject + +\startsubject[title=\type{\showligature}] + \showligature{fi} + \showligature{fx} +\stopsubject + +\startsubject[title=\type{\showligatures}] + \showligatures +\stopsubject + +\startsubject[title=\type{\showfontstyle}] + \showfontstyle[][rm][tf][all] +\stopsubject + +\startsubject[title=\type{\showfont}] + \showfont +\stopsubject + +\startsubject[title=\type{\showbodyfontstate}] + \showbodyfontstate +\stopsubject + +\page + +\startsubject[title=\type{\showotfcomposition}] + \showotfcomposition{arabtype*arabic at 48pt}{-1}{الضَّرَّ} + \page + \showotfcomposition{arabtype*arabic at 48pt}{-1}{لِلّٰهِ} + \page +\stopsubject + +\stoptext diff --git a/Master/texmf-dist/tex/context/modules/mkxl/s-layout-show.mkxl b/Master/texmf-dist/tex/context/modules/mkxl/s-layout-show.mkxl new file mode 100644 index 00000000000..95a6d3371c1 --- /dev/null +++ b/Master/texmf-dist/tex/context/modules/mkxl/s-layout-show.mkxl @@ -0,0 +1,243 @@ +%D \module +%D [ file=page-run, +%D version=2000.10.20, +%D title=\CONTEXT\ Page Macros, +%D subtitle=Runtime 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. + +\writestatus{loading}{ConTeXt Page Macros / Runtime Macros} + +\registerctxluafile{page-run}{} % maybe rename this one + +\unprotect + +\permanent\protected\tolerant\gdef\showprint[#1]#*[#2]#*[#3]% only english + {\setbuffer[crap]% + \unprotect + \definepapersize[X][\c!width=4em, \c!height=6em] + \definepapersize[Y][\c!width=12em,\c!height=14em] + \setuppapersize[X,#1][Y,#2] + \setuplayout[#3] + \setuplayout[\v!page] + \framed + [\c!offset=\v!overlay,\c!strut=\v!no, + \c!width=\paperwidth,\c!height=\paperheight] + {\ss ABC\par DEF}% + \protect + \endbuffer + \framed[\c!offset=\v!overlay,\c!strut=\v!no]{\typesetbuffer[crap]}} + +% \switchtobodyfont[8pt] +% +% \startcombination[4*4] +% {\showprint} {\strut} +% {\showprint[][][location=middle]} {\type{location=middle}} +% {\showprint[][][location=middle,marking=on]} {\type{markering=aan}\break\type{location=middle}} +% {\showprint[][][location=middle,marking=on,nx=2]} {\type{markering=aan}\break\type{location=middle}\break\type{nx=2}} +% {\showprint[][][location=left]} {\type{location=left}} +% {\showprint[][][location=right]} {\type{location=right}} +% {\showprint[][][location={left,bottom}]} {\type{location={left,bottom}}} +% {\showprint[][][location={right,bottom}]} {\type{location={right,bottom}}} +% {\showprint[][][nx=2,ny=1]} {\type{nx=2,ny=1}} +% {\showprint[][][nx=1,ny=2]} {\type{nx=1,ny=2}} +% {\showprint[][][nx=2,ny=2]} {\type{nx=2,ny=2}} +% {\showprint[][][nx=2,ny=2,location=middle]} {\type{nx=2,ny=2}\break\type{location=middle}} +% {\showprint[][][backoffset=3pt]} {\type{rugoffset=.5cm}} +% {\showprint[][][topoffset=3pt]} {\type{kopoffset=.5cm}} +% {\showprint[][][scale=1.5]} {\type{schaal=1.5}} +% {\showprint[][][scale=0.8]} {\type{schaal=0.8}} +% \stopcombination +% +% \startcombination[3*4] +% {\showprint[landscape][] [location=middle]} {\type{landscape}} +% {\showprint[] [landscape][location=middle]} {\strut\break\type{landscape}} +% {\showprint[landscape][landscape][location=middle]} {\type{landscape}\break\type{landscape}} +% {\showprint[90] [] [location=middle]} {\type{90}} +% {\showprint[] [90] [location=middle]} {\strut\break\type{90}} +% {\showprint[90] [90] [location=middle]} {\type{90}\break\type{90}} +% {\showprint[180] [] [location=middle]} {\type{180}} +% {\showprint[] [180] [location=middle]} {\strut\break\type{180}} +% {\showprint[180] [180] [location=middle]} {\type{180}\break\type{180}} +% {\showprint[mirrored] [] [location=middle]} {\type{mirrored}} +% {\showprint[] [mirrored] [location=middle]} {\strut\break\type{mirrored}} +% {\showprint[mirrored] [mirrored] [location=middle]} {\type{mirrored}\break\type{mirrored}} +% \stopcombination + +\permanent\protected\tolerant\gdef\showframe[#1]#*[#2]% + {\ifarguments + \showframe + [\v!top,\v!header, + \v!text, + \v!footer,\v!bottom] + [\v!leftedge,\v!leftmargin, + \v!text, + \v!rightmargin,\v!rightedge] + \or + \showframe + [\v!header,\v!text,\v!footer] + [#1] + \or + \setupbackgrounds + [\v!page] + [\c!frame=\v!on, + \c!corner=\v!rectangular, + \c!frameoffset=\zeropoint, + \c!framedepth=\zeropoint, + \c!framecolor=layout:page] + \setupbackgrounds + [#1][#2] + [\c!background=, + \c!frame=\v!on, + \c!corner=\v!rectangular, + \c!frameoffset=\zeropoint, + \c!framedepth=\zeropoint, + \c!framecolor=] + \fi + \setupbackgrounds + [\c!state=\v!repeat]} + +\permanent\protected\tolerant\gdef\showsetups[#1]% + {\ctxcommand{showlayoutvariables("#1")}} + +\permanent\protected\tolerant\gdef\showlayout[#1]% + {\ctxcommand{showlayout("#1")}} + +\permanent\protected\gdef\showmargins + {\starttabulate + \NC asynchrone \NC \doifelseoddpage {odd} {even} \NC \NR + \NC synchrone \NC \doifelserightpage {right} {left} \NC \NR + \NC right margin \NC \the\rightmarginwidth \NC \NR + \NC left margin \NC \the\leftmarginwidth \NC \NR + \NC outer margin \NC \the\outermarginwidth \NC \NR + \NC inner margin \NC \the\innermarginwidth \NC \NR + \stoptabulate} + +%D Page grids: + +\newconstant\c_page_grids_location +\newconstant\c_page_grids_line_mode +\newconstant\c_page_grids_lineno_mode +\newconstant\c_page_grids_columns_mode + +\permanent\protected\tolerant\gdef\showgrid[#1]% + {\c_page_grids_location \plusone % downward compatible default + \c_page_grids_line_mode \plusone + \c_page_grids_lineno_mode \plusone + \c_page_grids_columns_mode\plusone + \processallactionsinset + [#1]% + [ \v!reset=>\c_page_grids_location \zerocount + \c_page_grids_columns_mode\zerocount, + \v!bottom=>\c_page_grids_location \plusone, + \v!top=>\c_page_grids_location \plustwo, + \v!none=>\c_page_grids_line_mode \zerocount, + \v!all=>\c_page_grids_line_mode \plusone, + \v!lines=>\c_page_grids_line_mode \plustwo, + \v!frame=>\c_page_grids_line_mode \plusthree, + \v!nonumber=>\c_page_grids_lineno_mode \zerocount, + \v!right=>\c_page_grids_lineno_mode \plusone, + \v!left=>\c_page_grids_lineno_mode \plustwo, + \v!outer=>\c_page_grids_lineno_mode \plusthree, + \v!inner=>\c_page_grids_lineno_mode \plusfour, + \v!columns=>\c_page_grids_columns_mode\plusone]% new option + \ifcase\c_page_grids_location + \let\page_grids_add_to_box\gobbleoneargument + \else % 1=bottom 2=top + \let\page_grids_add_to_box\page_grids_add_to_box_indeed + \fi + \ifcase\c_page_grids_columns_mode + \let\page_grids_add_to_one\gobbleoneargument + \let\page_grids_add_to_mix\gobbleoneargument + \else + \let\page_grids_add_to_one\page_grids_add_to_one_indeed + \let\page_grids_add_to_mix\page_grids_add_to_mix_indeed + \fi} + +% if really needed for speed we can cache the grid + +\glet\page_grids_add_to_box\gobbleoneargument +\glet\page_grids_add_to_one\gobbleoneargument +\glet\page_grids_add_to_mix\gobbleoneargument + +\gdef\page_grids_add_to_box_indeed#1% to be checked for color and layer ..... use mp + {\startcolor[layout:grid]% + \resetvisualizers + \gridboxlinemode \c_page_grids_line_mode + \gridboxlinenomode\c_page_grids_lineno_mode + \setgridbox\scratchbox\makeupwidth\textheight % todo: check color + \global\setbox#1\hpack % global ? + {\ifcase\c_page_grids_location\or\or\box#1\hskip-\makeupwidth\fi + \begingroup % color + \ifcase\layoutcolumns\else + \gray + \setlayoutcomponentattribute{\v!grid:\v!columns}% + \hpack \layoutcomponentboxattribute to \makeupwidth + {\dorecurse\layoutcolumns + {\hskip\layoutcolumnwidth + \ifnum\recurselevel<\layoutcolumns + \vrule + \s!height\ht\scratchbox + \s!depth \dp\scratchbox + \s!width \layoutcolumndistance + \fi}}% + \hskip-\makeupwidth + \fi + \setlayoutcomponentattribute{\v!grid:\v!lines}% + \hpack \layoutcomponentboxattribute{\box\scratchbox}% + \endgroup + \ifcase\c_page_grids_location\or\hskip-\makeupwidth\box#1\fi}% + \stopcolor} + +\gdef\page_grids_add_to_one_indeed#1% + {\begingroup + \resetvisualizers + \global\setbox#1\vpack{\noindent\backgroundline[layout:one]{\box#1}}% + \endgroup} + +\gdef\page_grids_add_to_mix_indeed#1% + {\begingroup + \resetvisualizers + \global\setbox#1\vpack{\noindent\backgroundline[layout:mix]{\box#1}}% + \endgroup} + +\protect + +\continueifinputfile{s-layout-show.mkxl} + +\setupwhitespace[big] + +\setuphead[section][page=yes] + +\starttext + +\startsubject[title=\type{\showprint}] + \showprint +\stopsubject + +\startsubject[title=\type{\showframe}] + \showframe +\stopsubject + +\startsubject[title=\type{\showlayout}] + \showlayout +\stopsubject + +\startsubject[title=\type{\showsetups}] + \showsetups +\stopsubject + +\startsubject[title=\type{\showmargins}] + \showmargins +\stopsubject + +\startsubject[title=\type{\showgrid}] + \showgrid +\stopsubject + +\stoptext diff --git a/Master/texmf-dist/tex/context/modules/mkxl/s-publications-show.mkxl b/Master/texmf-dist/tex/context/modules/mkxl/s-publications-show.mkxl new file mode 100644 index 00000000000..9f4098489ae --- /dev/null +++ b/Master/texmf-dist/tex/context/modules/mkxl/s-publications-show.mkxl @@ -0,0 +1,84 @@ +%D \module +%D [ file=publ-tra, +%D version=2013.12.24, +%D title=\CONTEXT\ Publication Support, +%D subtitle=Tracing, +%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. + +% todo: make this a runtime module +% todo: use the module interface + +\writestatus{loading}{ConTeXt Publication Support / Tracing} + +\registerctxluafile{publ-tra}{} + +\unprotect + +\permanent\protected\gdef\showbtxdatasetfields {\publ_show_dataset_whatever{showbtxdatasetfields}} +\permanent\protected\gdef\showbtxdatasetcompleteness{\publ_show_dataset_whatever{showbtxdatasetcompleteness}} +\permanent\protected\gdef\showbtxdatasetauthors {\publ_show_dataset_whatever{showbtxdatasetauthors}} + +\tolerant\gdef\publ_show_dataset_whatever#1[#2]% + {\begingroup + \letdummyparameter\c!specification\currentbtxspecification + \setdummyparameter\c!dataset {\currentbtxdataset}% + \letdummyparameter\c!field \empty + \ifparameter#2\or + \ifhastok={#2}% + \getdummyparameters[#2]% + \else + \setdummyparameter\c!dataset{#2}% + \fi + \fi + \ctxcommand{#1{ + dataset = "\dummyparameter\c!dataset", + specification = "\dummyparameter\c!specification", + field = "\dummyparameter\c!field", + }}% + \endgroup} + +\permanent\tolerant\protected\gdef\showbtxfields[#1]% + {\begingroup + \setdummyparameter\c!rotation{90}% + \ifparameter#1\or + \ifhastok={#1}% + \letdummyparameter\c!specification\currentbtxspecification + \getdummyparameters[#1]% + \else + \setdummyparameter\c!specification{#1}% + \fi + \else + \letdummyparameter\c!specification\currentbtxspecification + \fi + \ctxcommand{showbtxfields{ + rotation = "\dummyparameter\c!rotation", + specification = "\dummyparameter\c!specification" + }}% + \endgroup} + +\permanent\tolerant\protected\gdef\showbtxtables[#1]% + {\begingroup + \ctxcommand{showbtxtables{}}% + \endgroup} + +\permanent\tolerant\protected\gdef\showbtxhashedauthors[#1]% + {\ctxcommand{showbtxhashedauthors{}}} + +\protect + +\continueifinputfile{s-publications-show.mkxl} + +\starttext + + \showbtxfields[rotation=85] \page + \showbtxfields[rotation=90] \page + + \showbtxtables \page + +\stoptext diff --git a/Master/texmf-dist/tex/context/modules/mkxl/s-symbols-show.mkxl b/Master/texmf-dist/tex/context/modules/mkxl/s-symbols-show.mkxl new file mode 100644 index 00000000000..37d42fe0079 --- /dev/null +++ b/Master/texmf-dist/tex/context/modules/mkxl/s-symbols-show.mkxl @@ -0,0 +1,110 @@ +%D \module +%D [ file=symb-run, +%D version=2010.12.08, % 1998.07.20, +%D title=\CONTEXT\ Symbol Libraries, +%D subtitle=Runtime 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. + +% todo: implementor + +\startluacode + function commands.showsymbolset(collection,symbols,fontid) + if type(symbols) == "string" then + symbols = utilities.parsers.settings_to_array(symbols) + end + local options = { framecolor = "orange", rulethickness = ".8pt", offset = interfaces.variables.overlay } + local list = table.tohash(symbols) + local alsofont = fontid > 0 + local defined = #symbols > 0 + local byname = false + if alsofont then + local is_symbol = characters.is_symbol + local chardata = characters.data + local resources = fonts.hashes.resources [fontid] + local characters = fonts.hashes.characters[fontid] + if resources and characters then + local unicodes = resources.unicodes + if unicodes then + for name, unicode in next, unicodes do + if not list[name] and name ~= ".notdef" then + local c = rawget(chardata,unicode) + if not c or is_symbol[c.category] then + list[name] = false + byname = true + end + end + end + end + end + end + local detail = defined and byname + context.start() + context.setupsymbolset { collection } + context.starttabulate { detail and "|lT|l|l|lT|" or "|lT|l|l|"} + for symbol, how in table.sortedhash(list) do + if detail and how then + context.BC() + else + context.NC() + end + context(symbol) + context.NC() + context.symbol(symbol) + context.NC() + context.framed(options,context.nested.symbol(symbol)) + if detail and how then + context.BC() + context("defined") + else + context.NC() + end + context.NC() + context.NR() + end + context.stoptabulate() + context.stop() + end +\stopluacode + +\unprotect + +\permanent\protected\tolerant\gdef\showsymbolset[#1]% + {\begingroup + \edef\p_font{\begincsname\??symboldefault#1\endcsname}% + \begingroup + \ifx\p_font\empty + \global\globalscratchcounter\zerocount + \else + \definedfont[\p_font]% + \global\globalscratchcounter\fontid\font\relax + \fi + \endgroup + \ctxcommand { + showsymbolset ( + "#1", + "\symbolset{#1}", + \the\globalscratchcounter + ) }% + \endgroup} + +\protect + +\continueifinputfile{s-symbols-show.mkxl} + +\usesymbols[cc] + +\starttext + + \showsymbolset[cc] + + \symbol[cc][cc-by-sa-nc] + +\stoptext + + |