@Test
@Ignore
public void testTextStyling2()
                        throws Exception {

    BufferedImage img = new BufferedImage( 1000, 1000, TYPE_INT_ARGB );
    long time = currentTimeMillis();
    Graphics2D g = img.createGraphics();
    GeometryFactory geomFac = new GeometryFactory();
    Java2DRenderer r2d = new Java2DRenderer( g, img.getWidth(), img.getHeight(),
                                             geomFac.createEnvelope( new double[] { 0, 0 },
                                                                     new double[] { 5000d, 5000d }, mapcs ) );
    Java2DTextRenderer r = new Java2DTextRenderer( r2d );
    LinkedList<Curve> curves = new LinkedList<Curve>();
    for ( int y = 0; y < 4; ++y ) {
        for ( int i = 0; i < 6; ++i ) {
            //curves.add( randomCurve( 700, i * 800, 4100 - 800 * y ) );
            curves.add( testCurve( 200+ i * 800, 4100 - 1200 * y, 300, 600 ) );
        }
    }
    LineStyling lineStyle = new LineStyling();
    lineStyle.stroke.width = 20;
    lineStyle.stroke.linecap = BUTT;
    String text = "5th Street";
    TextStyling styling = new TextStyling();
    styling.linePlacement = new LinePlacement();
    styling.font.fontSize = 25;
    styling.font.fontFamily.add( "Courier" );
    r2d.render( lineStyle, curves.peek() );
    r.render( styling, text, curves.poll() );
    styling.linePlacement.repeat = true;
    r2d.render( lineStyle, curves.peek() );
    r.render( styling, text, curves.poll() );
    r2d.render( lineStyle, curves.peek() );
    r.render( styling, text, curves.poll() );
    r2d.render( lineStyle, curves.peek() );
    r.render( styling, text, curves.poll() );
    r2d.render( lineStyle, curves.peek() );
    r.render( styling, text, curves.poll() );
    r2d.render( lineStyle, curves.peek() );
    r.render( styling, text, curves.poll() );
    styling.linePlacement.perpendicularOffset = 17.5;
    r2d.render( lineStyle, curves.peek() );
    r.render( styling, text, curves.poll() );
    r2d.render( lineStyle, curves.peek() );
    r.render( styling, text, curves.poll() );
    r2d.render( lineStyle, curves.peek() );
    r.render( styling, text, curves.poll() );
    r2d.render( lineStyle, curves.peek() );
    r.render( styling, text, curves.poll() );
    r2d.render( lineStyle, curves.peek() );
    r.render( styling, text, curves.poll() );
    r2d.render( lineStyle, curves.peek() );
    r.render( styling, text, curves.poll() );
    styling.linePlacement.perpendicularOffset = 0;
    styling.linePlacement.initialGap = 20;
    r2d.render( lineStyle, curves.peek() );
    r.render( styling, text, curves.poll() );
    r2d.render( lineStyle, curves.peek() );
    r.render( styling, text, curves.poll() );
    r2d.render( lineStyle, curves.peek() );
    r.render( styling, text, curves.poll() );
    r2d.render( lineStyle, curves.peek() );
    r.render( styling, text, curves.poll() );
    r2d.render( lineStyle, curves.peek() );
    r.render( styling, text, curves.poll() );
    r2d.render( lineStyle, curves.peek() );
    r.render( styling, text, curves.poll() );
    styling.linePlacement.gap = 10;
    styling.font.fontSize = 12;
    r2d.render( lineStyle, curves.peek() );
    r.render( styling, text, curves.poll() );
    r2d.render( lineStyle, curves.peek() );
    r.render( styling, text, curves.poll() );
    r2d.render( lineStyle, curves.peek() );
    r.render( styling, text, curves.poll() );
    r2d.render( lineStyle, curves.peek() );
    r.render( styling, text, curves.poll() );
    r2d.render( lineStyle, curves.peek() );
    r.render( styling, text, curves.poll() );
    r2d.render( lineStyle, curves.peek() );
    r.render( styling, text, curves.poll() );
    g.dispose();
    long time2 = currentTimeMillis();
    List<String> texts = new LinkedList<String>();
    texts.add( "Note: this text may not produce good tests every time (it depends on the length of the random line strings)." );
    texts.add( "Run the test again to see if the mentioned features cannot be found." );
    texts.add( "There is also a word wise text rendering and a character wise rendering." );
    texts.add( "The word wise rendering is only applied if possible, ie, if the words fit properly on the lines." );
    texts.add( "first line: renders gray lines width 20, inside a text with size 15." );
    texts.add( "Text should start immediately inside the line. First geometry should include" );
    texts.add( "the text once, the others repeated." );
    texts.add( "second line: renders the same text directly above the gray line (perpendicular offset)" );
    texts.add( "third line: renders with initial gap of 20" );
    texts.add( "fourth line: renders with initial gap of 20 and gap of 10 (with text size 12)" );
    validateImage( img, time2 - time, "textstyling2" );
}