Changes

Jump to navigation Jump to search
1,946 bytes removed ,  14:31, 5 September 2021
m
no edit summary
Note: * With MkIV, be careful to use {{code|textext.dflt}} which means DeFauLT.* With LMTX, be careful to use {{code|textext.dlft}}) for LeFT, like {{code|textext.ulft}}) and {{code|textext.llft}}) ** ({{code|textext.dflt}} does not work with LMTX). <context source="yes" mode="lmtx">
\starttext
\setupMPinstance
[metafun]
[textstyle={\definedfont[name:dejavusans*default at 25pt15pt]\ignorespaces}]
\startMPpage
MonTexte := "Aujourd'hui";
draw (0cm,0cm)--(20cm15cm,0cm)--(20cm15cm,20cm15cm)--(0cm,20cm15cm)--cycle
withpen pencircle
scaled 0.5mm
withcolor red;
 
pair decal ; decal := (0.0cm,-1.8cm) ;
%------------------------------------------------------------------------------
pair PA ; PA := (10cm7.5cm,16cm13.5cm) ;
draw textext.urt ("URT-" & MonTexte) shifted PA;
%------------------------------------------------------------------------------
pair PB ; PB := PA shifted (0cm,-2cm) decal ;
draw textext.drt ("DRT-" & MonTexte) shifted PB;
%draw textext.dlftdflt("DLFT-" & MonTexte) shifted PB;
draw PB withpen pencircle scaled 1.5mm withcolor red;
%------------------------------------------------------------------------------
pair PC ; PC := PB shifted (0cm,-2cm) decal ;
draw textext.d("D-" & MonTexte) shifted PC;
 
draw PC withpen pencircle scaled 1.5mm withcolor red;
%------------------------------------------------------------------------------
pair PD ; PD := PC shifted (0cm,-2cm) decal ;
draw textext.bot("BOT-" & MonTexte) shifted PD;
%------------------------------------------------------------------------------
pair PE ; PE := PD shifted (0cm,-2cm) decal ;
draw textext.lft("LFT-" & MonTexte) shifted PE;
%------------------------------------------------------------------------------
pair PF ; PF := PE shifted (0cm,-2cm) decal ;
draw textext(MonTexte) shifted PF;
%------------------------------------------------------------------------------
pair PG ; PG := PF shifted (0cm,-2cm) decal ;
draw textext.origin("ORIGIN-" & MonTexte) shifted PG;
%------------------------------------------------------------------------------
pair PH ; PH := PG shifted (0cm,-2cm) decal ;
draw textext.raw("RAW-" & MonTexte) shifted PH;
%------------------------------------------------------------------------------
 
\stopMPpage
 
 
%==============================================================================
%==============================================================================
%==============================================================================
 
\setupMPinstance
[metafun]
[textstyle={\definedfont[name:dejavusans*default at 50pt]\ignorespaces}]
 
\startMPpage
 
string MonTexte ;
MonTexte := "\ruledhbox{Aujourd'hui}";
 
draw (0cm,0cm)--(20cm,0cm)--(20cm,20cm)--(0cm,20cm)--cycle
withpen pencircle
scaled 0.5mm
withcolor red;
 
%------------------------------------------------------------------------------
 
picture PictA ;
 
pair PA ; PA := (5cm,12cm) ;
 
PictA := textext.urt(MonTexte) shifted PA;
draw PictA;
 
%------------------------------------------------------------------------------
 
draw (llcorner PictA) withpen pencircle scaled 3mm withcolor green;
draw (lrcorner PictA) withpen pencircle scaled 3mm withcolor yellow;
draw (urcorner PictA) withpen pencircle scaled 3mm withcolor blue;
draw (ulcorner PictA) withpen pencircle scaled 3mm withcolor cyan;
 
%------------------------------------------------------------------------------
 
picture PictB, PictC ;
 
pair PB ; PB := PA shifted (0cm,-4cm) ;
 
def givedecalage(text temptext) = ( (llcorner textext.urt(temptext)) -
(llcorner textext.drt(temptext)) ) enddef;
 
 
PictB := textext.urt(MonTexte) shifted PB;
 
pair decalage ;
decalage := givedecalage(MonTexte) ;
 
%------------------------------------------------------------------------------
 
draw PictB;
draw (center PictB) withpen pencircle scaled 3mm withcolor green;
 
draw (PB shifted decalage) withpen pencircle scaled 3mm withcolor yellow;
 
draw (PB shifted (decalage shifted (bbwidth PictB / 2,0mm)))
withpen pencircle scaled 3mm withcolor blue;
draw (PB shifted (decalage shifted (bbwidth PictB,0mm)))
withpen pencircle scaled 3mm withcolor cyan;
 
%------------------------------------------------------------------------------
draw PA withpen pencircle scaled 1.5mm withcolor red;
 
\stopMPpage

Navigation menu