textAlignTest.frink

View or download textAlignTest.frink in plain text format


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

angle = 10 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, V:top",        0, 12, "left",   "top"    , angle ]
g.text["H:left, V:bottom",     0, 0, "left",  "bottom"  , angle ]
g.text["H:left, V:baseline",   0, 4, "left", "baseline" , angle ]
g.text["H:left, V:center",     0, 8,"left", "center"   , angle ]

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

g.text["H:right, V:top",        40, 12, "right",   "top"    , angle ]
g.text["H:right, V:bottom",     40, 0, "right",  "bottom"  , angle ]
g.text["H:right, V:baseline",   40, 4, "right", "baseline" , angle ]
g.text["H:right, V:center",     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]
g.write["textAlignTest.html", 1000,500]

browse["textAlignTest.html"]
browse["textAlignTest.svg"]


View or download textAlignTest.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 17590 days, 6 hours, 39 minutes ago.