532

Building text shapes
Text3D example code

  • Build 3D text that says "Hello!", starting with a 2D font and extrusion to build a 3D font
    Font my2DFont = new Font(
        "Arial",     // font name
        Font.PLAIN,  // font style
        1 );         // font size
    FontExtrusion myExtrude = new FontExtrusion( );
    Font3D my3DFont = new Font3D( my2DFont, myExtrude );
  • Then build 3D text geometry using the font
    Text3D myText = new Text3D( );
    myText.setFont3D( my3DFont );
    myText.setString( "Hello!" );
  • Assemble the shape
    Shape3D myShape = new Shape3D( myText, myAppear );