Thanks Chris, but again I would like to put the stress on the fact that:
TextLayout.draw(..);
gives very different results from
g2d.draw(TextLayout.getOutline(..));
While the first one works very well, the second one gives different visual
results and the character shapes are badly spaced. It looks like they're
aligned to int coords. Please run the OutlineTest.java for a quick look.
That's the main reason why I can't overlay TextLayout.draw(..) over a
TextLayout.getOutline() without getting "spurious pixels" around the
characters.
Can you investigate ?
Mik
============================================================================
ClassX Development Italy Via Francesca, 368/I I-56030 S.M. a Monte (PI) <
Tel.(+39)-0587-705153 Fax.(+39)-0587-705153 WEB: http://www.classx.it <
============================================================================
----- Original Message -----
From: "Chris Campbell" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, November 13, 2006 4:52 PM
Subject: Re: [JAVA2D] AttributedString and Outline
Hi Mik,
You might also be able to glean some ideas from the SwingLabs team's
recent work on Painters. The basic approach is to paint text as an
outline (and shapes, images, etc) and then perform various effects on
each layer, for example:
http://weblogs.java.net/blog/joshy/archive/2006/09/introducing_pai_1.html
Chris
Phil Race wrote:
Vincent Hardy's book Java 2D API Graphics comes with
a GLF toolkit which supports many effects. There are
examples of embossed text and other effects.
I believe the toolkit is available for download.
Use your favourite search engine.
You can also take a look at the java 2D demo.
This does use outlines. Sounds like that isn't
exactly what you want but take a look anyway
Also note that you can set FOREGROUND and BACKGROUND
text attributes which can be a Paint, not just a Color.
-phil.
Michele Puccini wrote:
Hello,
I'm using TextLayouts made by AttributedStrings and I need to outline
(Stroke) the characters. Sadly I didn't find any Outline TextAttribute,
so I
would like to know how to implement it.
More generally it would be nice to implement virtually any kind of
TextAttribute i.e. Emboss, Shadow, etc.
Suggestions ?
Mik
--
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
of the message "signoff JAVA2D-INTEREST". For general help, send
email to
[EMAIL PROTECTED] and include in the body of the message "help".
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
of the message "signoff JAVA2D-INTEREST". For general help, send email
to
[EMAIL PROTECTED] and include in the body of the message "help".
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".