Difference between revisions of "textext positioning"

From Wiki
Jump to navigation Jump to search
m
Line 4: Line 4:
 
\setupMPinstance
 
\setupMPinstance
 
   [metafun]
 
   [metafun]
   [textstyle={\definedfont[name:dejavusans*default at 20pt]\ignorespaces}]
+
   [textstyle={\definedfont[name:dejavusans*default at 15pt]\ignorespaces}]
 
    
 
    
 
\startMPpage
 
\startMPpage
Line 15: Line 15:
 
   scaled 0.5mm
 
   scaled 0.5mm
 
   withcolor red;
 
   withcolor red;
 +
 +
pair decal ;  decal := (0.0cm,-1.5cm) ;
  
 
%------------------------------------------------------------------------------
 
%------------------------------------------------------------------------------
  
pair PA ;  PA := (7.5cm,15cm) ;
+
pair PA ;  PA := (7.5cm,14cm) ;
 
    
 
    
 
draw textext.urt ("URT-"  & MonTexte) shifted PA;
 
draw textext.urt ("URT-"  & MonTexte) shifted PA;
Line 29: Line 31:
 
%------------------------------------------------------------------------------
 
%------------------------------------------------------------------------------
  
pair PB ;  PB := PA shifted (0cm,-2cm) ;
+
pair PB ;  PB := PA shifted decal ;
 
    
 
    
 
draw textext.drt ("DRT-"  & MonTexte) shifted PB;
 
draw textext.drt ("DRT-"  & MonTexte) shifted PB;
Line 38: Line 40:
 
%------------------------------------------------------------------------------
 
%------------------------------------------------------------------------------
  
pair PC ;  PC := PB shifted (0cm,-2cm) ;
+
pair PC ;  PC := PB shifted decal ;
 
    
 
    
 
draw textext.d("D-" & MonTexte) shifted PC;
 
draw textext.d("D-" & MonTexte) shifted PC;
Line 46: Line 48:
 
%------------------------------------------------------------------------------
 
%------------------------------------------------------------------------------
  
pair PD ;  PD := PC shifted (0cm,-2cm) ;
+
pair PD ;  PD := PC shifted decal ;
 
    
 
    
 
draw textext.bot("BOT-" & MonTexte) shifted PD;
 
draw textext.bot("BOT-" & MonTexte) shifted PD;
Line 55: Line 57:
 
%------------------------------------------------------------------------------
 
%------------------------------------------------------------------------------
  
pair PE ;  PE := PD shifted (0cm,-2cm) ;
+
pair PE ;  PE := PD shifted decal ;
 
    
 
    
 
draw textext.lft("LFT-" & MonTexte) shifted PE;
 
draw textext.lft("LFT-" & MonTexte) shifted PE;
Line 64: Line 66:
 
%------------------------------------------------------------------------------
 
%------------------------------------------------------------------------------
  
pair PF ;  PF := PE shifted (0cm,-2cm) ;
+
pair PF ;  PF := PE shifted decal ;
 
    
 
    
 
draw textext(MonTexte) shifted PF;
 
draw textext(MonTexte) shifted PF;
Line 72: Line 74:
 
%------------------------------------------------------------------------------
 
%------------------------------------------------------------------------------
  
pair PG ;  PG := PF shifted (0cm,-2cm) ;
+
pair PG ;  PG := PF shifted decal ;
 
    
 
    
 
draw textext.origin("ORIGIN-" & MonTexte) shifted PG;
 
draw textext.origin("ORIGIN-" & MonTexte) shifted PG;
Line 80: Line 82:
 
%------------------------------------------------------------------------------
 
%------------------------------------------------------------------------------
  
pair PH ;  PH := PG shifted (0cm,-2cm) ;
+
pair PH ;  PH := PG shifted decal ;
 
    
 
    
 
draw textext.raw("RAW-" & MonTexte) shifted PH;
 
draw textext.raw("RAW-" & MonTexte) shifted PH;

Revision as of 08:21, 29 January 2021

\starttext

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

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

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

pair decal ;  decal := (0.0cm,-1.5cm) ;

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

pair PA ;  PA := (7.5cm,14cm) ;
  
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 decal ;
  
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 decal ;
  
draw textext.d("D-" & MonTexte) shifted PC;

draw PC withpen pencircle scaled 1.5mm  withcolor red;

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

pair PD ;  PD := PC shifted decal ;
  
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 decal ;
  
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 decal ;
  
draw textext(MonTexte) shifted PF;

draw PF withpen pencircle scaled 1.5mm  withcolor red;

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

pair PG ;  PG := PF shifted decal ;
  
draw textext.origin("ORIGIN-" & MonTexte) shifted PG;

draw PG withpen pencircle scaled 1.5mm  withcolor red;

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

pair PH ;  PH := PG shifted decal ;
  
draw textext.raw("RAW-" & MonTexte) shifted PH;

draw PH withpen pencircle scaled 1.5mm  withcolor red;

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

\stopMPpage

\stoptext