protected void drawFollow(Graphics g,Point2D[] pts,boolean reverse){
  LinkedList points=new LinkedList();
  if (reverse) {
    for (int i=pts.length - 1; i >= 0; i--)     points.add(pts[i]);
  }
 else {
    for (int i=0; i < pts.length; i++)     points.add(pts[i]);
  }
  LinkedList polysegment=new LinkedList();
  int l, x1, y1, x2, y2;
  String c;
  Point2D p1, p2;
  double angle;
  for (int i=0; i < text.length(); i++) {
    c=text.substring(i,i + 1);
    l=metrics.stringWidth(c);
    if (points.isEmpty())     break;
    LineUtil.retrievePoints(l,points,polysegment);
    p1=(Point2D)polysegment.getFirst();
    x1=(int)p1.getX();
    y1=(int)p1.getY();
    p2=(Point2D)polysegment.getLast();
    x2=(int)p2.getX();
    y2=(int)p2.getY();
    angle=Math.atan2(y2 - y1,x2 - x1);
    drawAngledString(g,c,x1,y1,angle);
  }
}

protected void drawFollow ( Graphics g , Point2D [ ] pts , boolean reverse ) { LinkedList points = new LinkedList ( ) ; if ( reverse ) { for ( int i = pts . length - 1 ; i >= 0 ; i -- ) points . add ( pts [ i ] ) ; } else { for ( int i = 0 ; i < pts . length ; i ++ ) points . add ( pts [ i ] ) ; } LinkedList polysegment = new LinkedList ( ) ; int l , x1 , y1 , x2 , y2 ; String c ; Point2D p1 , p2 ; double angle ; for ( int i = 0 ; i < text . length ( ) ; i ++ ) { c = text . substring ( i , i + 1 ) ; l = metrics . stringWidth ( c ) ; if ( points . isEmpty ( ) ) break ; LineUtil . retrievePoints ( l , points , polysegment ) ; p1 = ( Point2D ) polysegment . getFirst ( ) ; x1 = ( int ) p1 . getX ( ) ; y1 = ( int ) p1 . getY ( ) ; p2 = ( Point2D ) polysegment . getLast ( ) ; x2 = ( int ) p2 . getX ( ) ; y2 = ( int ) p2 . getY ( ) ; angle = Math . atan2 ( y2 - y1 , x2 - x1 ) ; drawAngledString ( g , c , x1 , y1 , angle ) ; } }
draws the text character per character to follow the polyline
