Hello, Answering my own post, for the record.
In a book called Java 2D API Graphics, Vincent Hardy proposed a TextStroke class, which is simply a Stroke that writes a text. It seems like an excellent idea (compared to mine anyway) and it works quite well. You can download the source code for this class on the book's homepage: http://developer.java.sun.com/developer/Books/2dgraphics/ Best Regards, David Garnier Le dim 02/02/2003 � 21:31, David Garnier a �crit : > Hello, > > I'd like to wrap a text label around an arbitrary shape. > > I'm working on a server-side Java-based cartographic application. In > short it generates road maps. It's working quite well, but now I would > like to display the name of each road, and I need them to wrap around > the shape of the road, like in any good mapping app like MapQuest. > > At first, I though of computing the orientation and the length of each > road segment and calling drawstring with an adequate substring of the > name. But after a good look at the APIs and online examples, I thinking > that I might be better off using a custom GlyphVector. What do you think > ? > > Or maybe there is an open-source project with this functionnality? > > Best Regards,
signature.asc
Description: PGP signature
