Re: [JAVA2D] Poor quality rotated text

2008-03-05 Thread java2d
I tested image rotation with bicubic interpolation. The results with nearest 
neighbour are terrible, but not a surprise.
[Message sent by forum member 'mthornton' (mthornton)]

http://forums.java.net/jive/thread.jspa?messageID=262431

===
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".


Re: [JAVA2D] Poor quality rotated text

2008-03-04 Thread Jim Graham
Just a suggestion about techniques - make sure you use some sort of 
interpolation filtering hint when you try to rotate an image like this. 
 The default algorithm NEAREST_NEIGHBOR is the fastest, but you'd get 
better quality with BILINEAR filtering.  I'm not sure that BICUBIC 
(slower still) would be necessary for this application.


http://java.sun.com/javase/6/docs/api/java/awt/RenderingHints.html#KEY_INTERPOLATION

Having said that, I wouldn't expect any better quality than rotating the 
outline (but YMMV), so if you are happy with the current solution of 
rotating the outline (quality and performance) then I'd say stick with 
that...


...jim

[EMAIL PROTECTED] wrote:

I think this is a consequence of trying to position
each glyph at the 
closest point its projection

on to the theoretical baseline on a relatively
low-res device.

Indeed. I get very nicely rendered characters with odd looking positions.


printer resolutions. Whilst rotating an image would
help the baseline I 
don't think you'd be

happy with the appearance of the glyphs.

True. I wrote a little test program and the glyph quality is worse. Overall the 
effect is a little better, at least to my eyes. I was going to try it with a 
higher resolution image, but will instead try ...


Your best option for quality is likely to get the
outline of the text 

Thanks very much I will try that approach.

Mark
[Message sent by forum member 'mthornton' (mthornton)]

http://forums.java.net/jive/thread.jspa?messageID=262249

===
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".


Re: [JAVA2D] Poor quality rotated text

2008-03-04 Thread Bill Casselman
and I guess I'd go for the two girls at the beach for the review,
continuing the theme.

===
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".


Re: [JAVA2D] Poor quality rotated text

2008-03-04 Thread java2d
I can now confirm that rotating the outline produces excellent results.
Thanks.
[Message sent by forum member 'mthornton' (mthornton)]

http://forums.java.net/jive/thread.jspa?messageID=262257

===
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".


Re: [JAVA2D] Poor quality rotated text

2008-03-04 Thread java2d
> I think this is a consequence of trying to position
> each glyph at the 
> closest point its projection
> on to the theoretical baseline on a relatively
> low-res device.
Indeed. I get very nicely rendered characters with odd looking positions.

> printer resolutions. Whilst rotating an image would
> help the baseline I 
> don't think you'd be
> happy with the appearance of the glyphs.
True. I wrote a little test program and the glyph quality is worse. Overall the 
effect is a little better, at least to my eyes. I was going to try it with a 
higher resolution image, but will instead try ...

> Your best option for quality is likely to get the
> outline of the text 
Thanks very much I will try that approach.

Mark
[Message sent by forum member 'mthornton' (mthornton)]

http://forums.java.net/jive/thread.jspa?messageID=262249

===
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".


Re: [JAVA2D] Poor quality rotated text

2008-03-04 Thread Phil Race
I think this is a consequence of trying to position each glyph at the 
closest point its projection
on to the theoretical baseline on a relatively low-res device. I suspect 
it would look fine at
printer resolutions. Whilst rotating an image would help the baseline I 
don't think you'd be

happy with the appearance of the glyphs.

Your best option for quality is likely to get the outline of the text 
and use
Graphics2d.fill(Shape). You'll also want to set ANTIALIAS_ON (that's the 
graphics
AA flag not the text one since here you are rendering a shape, not a 
text primitive).


The most robust way to get the outline of the text is by calling 
TextLayout.getOutline(..);


-phil.

[EMAIL PROTECTED] wrote:

When rotated at some angles the position of characters relative to the baseline 
is a bit erratic (by a pixel or so). This still occurs with text antialiassing 
and/or fractional metric hints enabled. I'm using jre6_u04.
I was wondering if it would be better to render the text (horizontally) into a 
bitmap (possibly at higher resolution) and then rotate and draw the resulting 
bitmap.
Performance is not a great concern as the result is cached.

Any suggestions?
[Message sent by forum member 'mthornton' (mthornton)]

http://forums.java.net/jive/thread.jspa?messageID=262205

===
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".


[JAVA2D] Poor quality rotated text

2008-03-04 Thread java2d
When rotated at some angles the position of characters relative to the baseline 
is a bit erratic (by a pixel or so). This still occurs with text antialiassing 
and/or fractional metric hints enabled. I'm using jre6_u04.
I was wondering if it would be better to render the text (horizontally) into a 
bitmap (possibly at higher resolution) and then rotate and draw the resulting 
bitmap.
Performance is not a great concern as the result is cached.

Any suggestions?
[Message sent by forum member 'mthornton' (mthornton)]

http://forums.java.net/jive/thread.jspa?messageID=262205

===
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".