bigcoord.frink

Download or view bigcoord.frink in plain text format


// This tests alignment of text in Frink's graphics package.

angle = 20 degrees
base = 1ee400 + 1/2

g = new graphics
g.font["SansSerif", 1.3]

g.color[0,0,1]
for x = base + 0 to base + 40 step 20
   for y=0 to 12 step 4
   {
      g.line[x-5,y,x+5,y]
      g.line[x,y-1,x,y+1]
   }

g.color[0,0,0]
g.text["H:left, V:top",        base+0, 12, "left",   "top"    , angle ]
g.text["H:left, V:bottom",     base+0, 0, "left",  "bottom"  , angle ]
g.text["H:left, V:baseline",   base+0, 4, "left", "baseline" , angle ]
g.text["H:left, V:center",     base+0, 8,"left", "center"   , angle ]

g.text["H:center, V:top",        base+20, 12, "center",   "top"    , angle ]
g.text["H:center, V:bottom",     base+20, 0, "center",  "bottom"  , angle ]
g.text["H:center, V:baseline",   base+20, 4, "center", "baseline" , angle ]
g.text["H:center, V:center",     base+20, 8,"center", "center"   , angle ]

g.text["H:right, V:top",        base+40, 12, "right",   "top"    , angle ]
g.text["H:right, V:bottom",     base+40, 0, "right",  "bottom"  , angle ]
g.text["H:right, V:baseline",   base+40, 4, "right", "baseline" , angle ]
g.text["H:right, V:center",     base+40, 8,"right", "center"   , angle ]


g.show[]
g.write["textAlignTest.svg", 1000, 500]
g.write["textAlignTest.jpg", 1000,500]
g.write["textAlignTest.png", 1000,500]



Download or view bigcoord.frink in plain text format


This is a program written in the programming language Frink.
For more information, view the Frink Documentation or see More Sample Frink Programs.

Alan Eliasen was born 20139 days, 6 hours, 35 minutes ago.