greenhouse
a creative coding toolkit for spatial interfaces

Text

A text rendered in 3D space.

  • Text ()
  • SetFont ()
  • SetFontSize ()
  • String ()
  • SetString ()
  • Width ()
  • Height ()

Example

#include "Greenhouse.h"

void Setup ()
{ Text *t = new Text ("Hello, world!");
  t -> SlapOnFeld ();

  //set the font, requires "Mac Core Fonts"
  t -> SetFont ("/Library/Fonts/Courier New Bold.ttf");
  // On Ubuntu, set the font, requires package "ttf-mscorefonts-installer"
  // t -> SetFont ("/usr/share/fonts/truetype/msttcorefonts/Courier_New.ttf");

  t -> SetFontSize (Feld () -> Height () / 12.0);   // in mm

  t -> SetString ("Hello, SetString ()");

  INFORM ("t's width is " + ToStr (t -> Width ()) +
          "and height is " + ToStr (t -> Height ()));
}