textAlignTest2.frink

Download or view textAlignTest2.frink in plain text format


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

angle = 20 degrees

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

g.color[0,0,1]
for x = 0 to 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\nV:bottom",     0, 0, "left",  "bottom"  , angle ]
g.text["H:left\nV:baseline",   0, 4, "left", "baseline" , angle ]
g.text["H:left\nV:center",     0, 8,"left", "center"   , angle ]
g.text["H:left\nV:top",        0, 12, "left",   "top"    , angle ]

g.text["H:center\nV:bottom",     20, 0, "center",  "bottom"  , angle ]
g.text["H:center\nV:baseline",   20, 4, "center", "baseline" , angle ]
g.text["H:center\nV:center",     20, 8,"center", "center"   , angle ]
g.text["H:center\nV:top",        20, 12, "center",   "top"    , angle ]

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


g.show[]
g.write["textAlignTest2.svg", 1000, 500]
g.write["textAlignTest2.svgz", 1000, 500]
g.write["textAlignTest2.jpg", 1000,500]
g.write["textAlignTest2.png", 1000,500]
g.write["textAlignTest2.html", 1000,500]
browse["textAlignTest2.html"]
browse["textAlignTest2.svg"]


Download or view textAlignTest2.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 20143 days, 11 hours, 52 minutes ago.