Skip to main content

Should drawGlyphVector() honour rendering hints?

6 replies [Last post]
qu0ll
Offline
Joined: 2006-12-09
Points: 0

Should the drawGlyphVector() method in Graphics2D honour any current rendering hints such as RenderingHints.KEY_TEXT_ANTIALIASING? It appears not to be doing this.

--
And loving it,

-Qu0ll (Rare, not extinct)
_________________________________________________
Qu0llSixFour@gmail.com
[Replace the "SixFour" with numbers to email me]

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Phil Race

java2d@JAVADESKTOP.ORG wrote:
> Should the drawGlyphVector() method in Graphics2D honour any current rendering hints such as RenderingHints.KEY_TEXT_ANTIALIASING? It appears not to be doing this.
>
>
It gets that particular hint from the FontRenderContext that is used to
create/layout the GlyphVector.

-phil.

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".

qu0ll
Offline
Joined: 2006-12-09
Points: 0

OK thanks Phil.

I have set the text antialiasing hint in the FontRenderContext to use LCD optimised antialiasing but the text doesn't appear anywhere near as crisp as when I use drawString() with the same rendering hints.

Is this a known limitation/feature of drawGlyphVector() or am I perhaps not using it correctly?

--
And loving it,

-Qu0ll (Rare, not extinct)
_________________________________________________
Qu0llSixFour@gmail.com
[Replace the "SixFour" with numbers to email me]

qu0ll
Offline
Joined: 2006-12-09
Points: 0

I should add that I am using JSE 6 Update 10 b28 on Vista.

--
And loving it,

-Qu0ll (Rare, not extinct)
_________________________________________________
Qu0llSixFour@gmail.com
[Replace the "SixFour" with numbers to email me]

trembovetski
Offline
Joined: 2003-12-31
Points: 0

How about a test case?

Dmitri

qu0ll
Offline
Joined: 2006-12-09
Points: 0

OK, I'll put one together. But, in general, should drawGlyphVector() produce output of the same quality as drawString()?

--
And loving it,

-Qu0ll (Rare, not extinct)
_________________________________________________
Qu0llSixFour@gmail.com
[Replace the "SixFour" with numbers to email me]

qu0ll
Offline
Joined: 2006-12-09
Points: 0

I have been unable to reproduce the problem in a test case which leads me to conclude that the code I have been looking at is doing something more than just drawing glyphs such as font scaling. I'll dig a bit further. Basically, I am trying to determine why the Batik SVG toolkit renders text so poorly, even with Java 6 Update 10.

The only differences I can see between the output of drawString() and drawGlyphVector() can be attributed to the LCD contrast settings which are not configurable when drawing the glyphs directly I believe.

If anyone can explain why text rendering in Batik is so poor I would love to hear from you.

--
And loving it,

-Qu0ll (Rare, not extinct)
_________________________________________________
Qu0llSixFour@gmail.com
[Replace the "SixFour" with numbers to email me]