summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/meta-imp-txt.mkiv
diff options
context:
space:
mode:
authorMojca Miklavec <mojca.miklavec@gmail.com>2014-05-05 20:29:55 +0000
committerMojca Miklavec <mojca.miklavec@gmail.com>2014-05-05 20:29:55 +0000
commitba9a57343987f1c2c72396e7c38f1fa30352c24c (patch)
tree66a8b12cdf67427ce96770fd0e9e581759aade1c /Master/texmf-dist/tex/context/base/meta-imp-txt.mkiv
parent15242121b8ddf7d4a041fb3998d295dd8232e1eb (diff)
ConTeXt 2014.04.28 23:24
git-svn-id: svn://tug.org/texlive/trunk@33856 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/base/meta-imp-txt.mkiv')
-rw-r--r--Master/texmf-dist/tex/context/base/meta-imp-txt.mkiv44
1 files changed, 38 insertions, 6 deletions
diff --git a/Master/texmf-dist/tex/context/base/meta-imp-txt.mkiv b/Master/texmf-dist/tex/context/base/meta-imp-txt.mkiv
index 3a9ad5927f8..bcfc5513fbe 100644
--- a/Master/texmf-dist/tex/context/base/meta-imp-txt.mkiv
+++ b/Master/texmf-dist/tex/context/base/meta-imp-txt.mkiv
@@ -170,12 +170,12 @@
% we default to nothing
\stopuseMPgraphic
-\unexpanded\def\followtokens#1%
+\unexpanded\def\dofollowtokens#1#2%
{\vbox\bgroup
\forgetall
\dontcomplain
\startMPenvironment
- \doifundefined{RotFont}{\definefont[RotFont][RegularBold]}
+ \doifundefined{RotFont}{\definefont[RotFont][RegularBold]}%
\stopMPenvironment
\MPtoks\emptytoks
\resetMPdrawing
@@ -183,13 +183,13 @@
\includeMPgraphic{followtokens} ;
picture pic[] ; numeric len[], n ; n := 0 ;
\stopMPdrawing
- \handletokens#1\with\processfollowingtoken
+ \handletokens#2\with\processfollowingtoken
\startMPdrawing
if unknown RotPath : path RotPath ; RotPath := origin ; fi ;
if unknown RotColor : color RotColor ; RotColor := black ; fi ;
if unknown TraceRot : boolean TraceRot ; TraceRot := false ; fi ;
if unknown ExtraRot : numeric ExtraRot ; ExtraRot := 0 ; fi ;
- numeric al, at, pl, wid, pos ; pair ap, ad ;
+ numeric al, at, pl, pc, wid, pos ; pair ap, ad ;
al := arclength RotPath ;
if al=0 :
al := len[n] + ExtraRot ;
@@ -199,13 +199,19 @@
RotPath := RotPath scaled ((len[n]+ExtraRot)/al) ;
al := arclength RotPath ;
fi ;
- pl := (al-len[n])/(if n>1 : (n-1) else : 1 fi) ;
+ if \number#1 = 1 :
+ pl := (al-len[n])/(if n>1 : (n-1) else : 1 fi) ;
+ pc := 0 ;
+ else : % centered / MP
+ pl := 0 ;
+ pc := arclength RotPath/2 - len[n]/2 ;
+ fi ;
if TraceRot :
draw RotPath withpen pencircle scaled 1pt withcolor blue ;
fi ;
for i=1 upto n :
wid := abs(xpart urcorner pic[i] - xpart llcorner pic[i]) ;
- pos := len[i]-wid/2 + (i-1)*pl ;
+ pos := len[i]-wid/2 + (i-1)*pl + pc ;
at := arctime pos of RotPath ;
ap := point at of RotPath ;
ad := direction at of RotPath ;
@@ -225,6 +231,11 @@
\resetMPdrawing
\egroup}
+\unexpanded\def\followtokens {\dofollowtokens1}
+\unexpanded\def\followtokenscentered{\dofollowtokens0}
+
+% stretched variant:
+%
% \followtokens
% {This is just a dummy text, kerned by T{\kern
% -.1667em\lower .5ex\hbox {E}}{\kern -.125emX} and typeset
@@ -232,6 +243,27 @@
% E}{\setMFPfont T}{\setMFPfont A}{\setMFPfont
% P}{\setMFPfont O}{\setMFPfont S}{\setMFPfont T}.\quad}
+% centered variant:
+%
+% \def\followtokengraphicscale#1{%%
+% \startuseMPgraphic {followtokens}
+% path RotPath; RotPath := reverse halfcircle scaled #1 ;
+% draw RotPath ;
+% setbounds currentpicture to boundingbox fullcircle scaled 12cm ;
+% \stopuseMPgraphic}
+%
+% \startoverlay
+% {\followtokengraphicscale{12cm}%%
+% \followtokenscentered{There was question on the list about this kind of graphics.}}
+% {\followtokengraphicscale{10cm}%%
+% \followtokenscentered{And Marco patched followingtokens to handle a centered text.}}
+% {\followtokengraphicscale{8cm}%%
+% \followtokenscentered{That ended up as variant branch in the main macro.}}
+% {\followtokengraphicscale{6cm}%%
+% \followtokenscentered{So now we have two commands.}}
+% \stopoverlay
+
+
\startuseMPgraphic{fuzzycount}
begingroup
save height, span, drift, d, cp ;