Difference between revisions of "textext positioning"

From Wiki
Jump to navigation Jump to search
Line 41: Line 41:
 
    
 
    
 
draw textext.d("D-" & MonTexte) shifted PC;
 
draw textext.d("D-" & MonTexte) shifted PC;
 
  
 
draw PC withpen pencircle scaled 1.5mm  withcolor red;
 
draw PC withpen pencircle scaled 1.5mm  withcolor red;

Revision as of 08:19, 29 January 2021

\starttext

\setupMPinstance
  [metafun]
  [textstyle={\definedfont[name:dejavusans*default at 25pt]\ignorespaces}]
  
\startMPpage

string MonTexte ; 
MonTexte := "Aujourd'hui";

draw (0cm,0cm)--(20cm,0cm)--(20cm,20cm)--(0cm,20cm)--cycle
  withpen pencircle
  scaled 0.5mm
  withcolor red;

%------------------------------------------------------------------------------

pair PA ;  PA := (10cm,16cm) ;
  
draw textext.urt ("URT-"  & MonTexte) shifted PA;
draw textext.ulft("ULFT-" & MonTexte) shifted PA;
draw textext.llft("LLFT-" & MonTexte) shifted PA;
draw textext.lrt ("LRT-"  & MonTexte) shifted PA;

draw PA withpen pencircle scaled 1.5mm  withcolor red;

%------------------------------------------------------------------------------

pair PB ;  PB := PA shifted (0cm,-2cm) ;
  
draw textext.drt ("DRT-"  & MonTexte) shifted PB;
%draw textext.dlft("DLFT-" & MonTexte) shifted PB;

draw PB withpen pencircle scaled 1.5mm  withcolor red;

%------------------------------------------------------------------------------

pair PC ;  PC := PB shifted (0cm,-2cm) ;
  
draw textext.d("D-" & MonTexte) shifted PC;

draw PC withpen pencircle scaled 1.5mm  withcolor red;

%------------------------------------------------------------------------------

pair PD ;  PD := PC shifted (0cm,-2cm) ;
  
draw textext.bot("BOT-" & MonTexte) shifted PD;
draw textext.top("TOP-" & MonTexte) shifted PD;

draw PD withpen pencircle scaled 1.5mm  withcolor red;

%------------------------------------------------------------------------------

pair PE ;  PE := PD shifted (0cm,-2cm) ;
  
draw textext.lft("LFT-" & MonTexte) shifted PE;
draw textext.rt("RT-" & MonTexte)   shifted PE;

draw PE withpen pencircle scaled 1.5mm  withcolor red;

%------------------------------------------------------------------------------

pair PF ;  PF := PE shifted (0cm,-2cm) ;
  
draw textext(MonTexte) shifted PF;

draw PF withpen pencircle scaled 1.5mm  withcolor red;

%------------------------------------------------------------------------------

pair PG ;  PG := PF shifted (0cm,-2cm) ;
  
draw textext.origin("ORIGIN-" & MonTexte) shifted PG;

draw PG withpen pencircle scaled 1.5mm  withcolor red;

%------------------------------------------------------------------------------

pair PH ;  PH := PG shifted (0cm,-2cm) ;
  
draw textext.raw("RAW-" & MonTexte) shifted PH;

draw PH withpen pencircle scaled 1.5mm  withcolor red;

%------------------------------------------------------------------------------

\stopMPpage

\stoptext