Navigation
Synopsis Text.
Function Figure text(str s, FProperty props...)
Description Creates a text string. The following properties are relevant for text:
  • font: determines the name of the font to be used. The default font is "Helvetica".
  • fontSize: determines the point size (in typographic points) of the font. Default is 12.
  • fontColor: determines the color of the font. Default is "Black",
  • textAngle: determines the angle (in degrees) at which text is draw (also see Angles). Default is 0.
Examples
render(text("Rascal"));
text 1

render(text("Rascal", fontSize(20), fontColor("blue")));
text 2

render(box(text("Rascal", fontSize(20), fontColor("blue")), grow(2.0)));
text 3

t1 = text("Rascal", fontSize(20), fontColor("black"));
t2 = text("Rascal", fontSize(40), fontColor("blue"));
t3 = text("Rascal", fontSize(60), fontColor("red"));
render(box(hcat([t1, t2, t3]), gap(10)));
text 4

render(text("Rascal", fontSize(60), fontColor("red"), textAngle(90)));
text 5
Is this page unclear, or have you spotted an error? Please add a comment below and help us to improve it. For all other questions and remarks, visit ask.rascal-mpl.org.