Are there any nice libraries to render text in an image for Java?
Java has a 2d text library, http://java.sun.com/docs/books/tutorial/2d/text/index.html but not sure if theres a better library to use.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It depends on what you want to do. Java2D is a fairly rich environment for text, as seen in the
Fontstab of the demo, located in thedemo/jfc/Java2Dfolder of the Demos and Samples; source code for the font demos may be found in the enclosedsrc.zip. Building on this foundation, I’ve had good results using the text utilities inJCommon, now part ofJFreeChart 1.5. As you are annotating images, a basic example is shown here, and you may want to look into usingAlphaComposite, also previewed in the Java2D demo.