You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by "John C. Turnbull" <oz...@ozemail.com.au> on 2008/08/04 15:17:36 UTC

Batik 1.7 text rendering issues

I am looking at Batik for the first time and I have done a little bit of
experimentation with the "text-rendering" attribute yielding some puzzling
results.

 

I would have thought that the option "optimizeLegibility" would produce the
"nicest" text or at least the most readable but it seems that Batik does not
use anti-aliasing at all with this option set.  However, when I specify the
option "geometricPrecision" which I would have thought would result in
plainer text, I do see anti-aliasing and the text is much more readable
(although still not as readable or as clear as I would like it to be on an
LCD screen).

 

Is this is the intended behaviour or am I misreading this whole issue?  I am
using Java 6 Update 10 on Windows Vista.

 

Thanks,

 

-JCT


Re: Batik 1.7 text rendering issues

Posted by Joel Uckelman <uc...@nomic.net>.
Thus spake "Helder Magalhães":
> >    I don't have anything against this (as it's a fairly simple thing to
> > enable through reflection) but do you know how to determine which of the
> > 4 LCD dot patterns to use?
> 
> I'm not sure if this is even possible to determine automatically. If
> not, maybe one could be able to do this using a preference: possibly a
> new tab in Squiggle preferences, for example, where a canvas for each
> dot pattern was showed. Something like the "ClearType Tuner" applet
> [1] which allows tweaking Windows text smoothing. :-)
> 
> [1] http://www.microsoft.com/typography/ClearTypePowerToy.mspx

The fact that there's a "Rendering" section in the font configuration
dialog in GNOME makes me suspect that this is something you can't always
(ever?) read from the hardware. There is a correct answer to the question
of what the subpixel order is on an LCD screen---it's not as though some
people will prefer RGB and some BGR or VBGR rendering on the same panel.

-- 
J.

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: Batik 1.7 text rendering issues

Posted by Helder Magalhães <he...@gmail.com>.
>    I don't have anything against this (as it's a fairly simple thing to
> enable through reflection) but do you know how to determine which of the
> 4 LCD dot patterns to use?

I'm not sure if this is even possible to determine automatically. If
not, maybe one could be able to do this using a preference: possibly a
new tab in Squiggle preferences, for example, where a canvas for each
dot pattern was showed. Something like the "ClearType Tuner" applet
[1] which allows tweaking Windows text smoothing. :-)

[1] http://www.microsoft.com/typography/ClearTypePowerToy.mspx

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: Batik 1.7 text rendering issues

Posted by Joel Uckelman <uc...@ellipsis.cx>.
Thus spake "John C. Turnbull":
> Hi Cameron,
> 
> That property could be useful but how can it determine which type of =
> monitor is connected to the "Desktop"?  I think the optimal rendering =
> hints for text depend on the monitor and especially whether it's CRT vs. =
> LCD.
> 
> I think the only reliable option is, as has already been suggested, to =
> provide the user with a text tuning screen which displays text rendered =
> using the various hints and allows them to select the most legible one.
> 

The desktop environment should already have such a tuning dialog. If the
"awt.font.desktophints" property passes along those settings (I don't know
if it does) then reading them from the property would be much better than
building your own tuning dialog.

-- 
J.

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: Batik 1.7 text rendering issues

Posted by Cameron McCormack <ca...@mcc.id.au>.
Hi John.

John C. Turnbull:
> That property could be useful but how can it determine which type of
> monitor is connected to the "Desktop"? I think the optimal rendering
> hints for text depend on the monitor and especially whether it's CRT
> vs. LCD.

I think that it queries the OS for the settings (e.g. in the Gnome
Appearance Preferences window, or the Display control panel in Windows).
I don’t know whether particular OSes can get that infomration directly
from the monitor.

> I think the only reliable option is, as has already been suggested,
> to provide the user with a text tuning screen which displays text
> rendered using the various hints and allows them to select the most
> legible one.

If that information isn’t available via this desktop property, then yes,
that’s what would be needed.

-- 
Cameron McCormack ≝ http://mcc.id.au/

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


RE: Batik 1.7 text rendering issues

Posted by "John C. Turnbull" <oz...@ozemail.com.au>.
Hi Cameron,

That property could be useful but how can it determine which type of monitor is connected to the "Desktop"?  I think the optimal rendering hints for text depend on the monitor and especially whether it's CRT vs. LCD.

I think the only reliable option is, as has already been suggested, to provide the user with a text tuning screen which displays text rendered using the various hints and allows them to select the most legible one.

-JCT

> -----Original Message-----
> From: Cameron McCormack [mailto:cam@mcc.id.au]
> Sent: Thursday, 7 August 2008 15:54
> To: batik-users@xmlgraphics.apache.org
> Subject: Re: Batik 1.7 text rendering issues
> 
> Cameron McCormack:
> > > [enabling subpixel antialiasing]
> 
> Thomas DeWeese:
> >    I don't have anything against this (as it's a fairly simple thing
> to
> > enable through reflection) but do you know how to determine which of
> the
> > 4 LCD dot patterns to use?
> 
> I’m not sure, but perhaps the awt.font.desktophints desktop property
> can
> provide this information:
> 
>   http://java.sun.com/javase/6/docs/api/java/awt/doc-
> files/DesktopProperties.html
> 
> --
> Cameron McCormack ≝ http://mcc.id.au/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-
> help@xmlgraphics.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: Batik 1.7 text rendering issues

Posted by Cameron McCormack <ca...@mcc.id.au>.
Cameron McCormack:
> > [enabling subpixel antialiasing]

Thomas DeWeese:
>    I don't have anything against this (as it's a fairly simple thing to
> enable through reflection) but do you know how to determine which of the 
> 4 LCD dot patterns to use?

I’m not sure, but perhaps the awt.font.desktophints desktop property can
provide this information:

  http://java.sun.com/javase/6/docs/api/java/awt/doc-files/DesktopProperties.html

-- 
Cameron McCormack ≝ http://mcc.id.au/

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: Batik 1.7 text rendering issues

Posted by th...@kodak.com.
Hi Cam,

Cameron McCormack <ca...@mcc.id.au> wrote on 08/05/2008 08:42:06 AM:

> John C. Turnbull:
> > Thanks Thomas, making the change you suggested works just great J And
> > I think it makes a big difference too.
> 
> It may be worth using reflection to enable this for 1.6, while still
> maintaining support for ≤ 1.5.

   I don't have anything against this (as it's a fairly simple thing to
enable through reflection) but do you know how to determine which of the 
4 LCD dot patterns to use?


Re: Batik 1.7 text rendering issues

Posted by Cameron McCormack <ca...@mcc.id.au>.
John C. Turnbull:
> Thanks Thomas, making the change you suggested works just great J And
> I think it makes a big difference too.

It may be worth using reflection to enable this for 1.6, while still
maintaining support for ≤ 1.5.

-- 
Cameron McCormack ≝ http://mcc.id.au/

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


RE: Batik 1.7 text rendering issues

Posted by "John C. Turnbull" <oz...@ozemail.com.au>.
Thanks Thomas, making the change you suggested works just great J  And I
think it makes a big difference too.

 

John

 

From: thomas.deweese@kodak.com [mailto:thomas.deweese@kodak.com] 
Sent: Tuesday, 5 August 2008 21:08
To: batik-users@xmlgraphics.apache.org
Cc: batik-users@xmlgraphics.apache.org
Subject: RE: Batik 1.7 text rendering issues

 


Hi John,

"John C. Turnbull" <oz...@ozemail.com.au> wrote on 08/05/2008 06:23:41 AM:

> What would be involved in getting Batik to take advantage of the 
> sub-pixel antialiasing in Java 6 for better font rendering?  Is it a
> big change?  I'd like to implement it, at least in my local copy. 

   It's a fairly small change, I think.   Simply modify the 
function batik.bridge.CSSUtilities.convertTextRendering 
To set the java.awt.RenderingHints.KEY_TEXT_ANTIALIASING to 
one of the values of VALUE_TEXT_ANTIALIAS_LCD_*.  I'm not 
sure how to determine the proper LCD_* value to use other 
than querying the user. 

> Also, what is the status of development of Batik?  Is it still 
> actively being developed and/or enhanced? 

   I would say that development is fairly passive right now. 
Important bugs and bugs with clear fixes are fixed regularly 
but we aren't adding many new features.  Part of the reason 
we aren't adding new features is because our coverage of the 
SVG specification is pretty good. 

   BTW our base JDK is currently 1.4 so I'm not sure we would 
add this anyway (especially given the complication of trying 
to figure out what LCD setting should be used). 

> From: thomas.deweese@kodak.com [mailto:thomas.deweese@kodak.com] 
> Sent: Tuesday, 5 August 2008 20:12
> To: batik-users@xmlgraphics.apache.org
> Cc: batik-users@xmlgraphics.apache.org
> Subject: Re: Batik 1.7 text rendering issues 
>   
> 
> Hi John,
> 
> "John C. Turnbull" <oz...@ozemail.com.au> wrote on 08/04/2008 09:17:36
AM:
> 
> > I am looking at Batik for the first time and I have done a little 
> > bit of experimentation with the "text-rendering" attribute yielding 
> > some puzzling results. 
> >   
> > I would have thought that the option "optimizeLegibility" would 
> > produce the "nicest" text or at least the most readable but it seems
> > that Batik does not use anti-aliasing at all with this option set.  
> 
>    Right, when you use optimizeLegibility we render the text relying 
> on the font hinting to improve legibility at small font sizes. 
> The level/quality of the hinting varies a bit from font to font so 
> it may not be ideal. 
> 
> > However, when I specify the option "geometricPrecision" which I 
> > would have thought would result in plainer text, I do see anti-
> > aliasing and the text is much more readable 
> 
>    Setting 'geometricPrecision' means that the rendered text should follow

> the raw geometry of the text as closely as possible (hinting 
> effectively distorts the outlines of the text to align it with the 
> pixel grid).  It also means that we can't take advantage of 
> cached glyphs in most cases since a glyph at x="10.1" will render 
> differently from a glyph at x="10.6" due to anti-aliasing. 
> 
> >(although still not as readable or as clear as I would like it 
> > to be on an LCD screen). 
>     
>    The very latest versions of the JDK offer options to do 
> 'sub pixel' rendering, however currently Batik doesn't try to 
> make use of them. 
> 
> > Is this is the intended behavior or am I misreading this whole 
> > issue?  I am using Java 6 Update 10 on Windows Vista. 
> 
>    AFAIK Batik's behavior is correct with respect to the 
> SVG specification. 


RE: Batik 1.7 text rendering issues

Posted by th...@kodak.com.
Hi John,

"John C. Turnbull" <oz...@ozemail.com.au> wrote on 08/05/2008 06:23:41 
AM:

> What would be involved in getting Batik to take advantage of the 
> sub-pixel antialiasing in Java 6 for better font rendering?  Is it a
> big change?  I?d like to implement it, at least in my local copy.

   It's a fairly small change, I think.   Simply modify the
function batik.bridge.CSSUtilities.convertTextRendering
To set the java.awt.RenderingHints.KEY_TEXT_ANTIALIASING to 
one of the values of VALUE_TEXT_ANTIALIAS_LCD_*.  I'm not
sure how to determine the proper LCD_* value to use other
than querying the user.

> Also, what is the status of development of Batik?  Is it still 
> actively being developed and/or enhanced?

   I would say that development is fairly passive right now.
Important bugs and bugs with clear fixes are fixed regularly
but we aren't adding many new features.  Part of the reason
we aren't adding new features is because our coverage of the
SVG specification is pretty good.

   BTW our base JDK is currently 1.4 so I'm not sure we would
add this anyway (especially given the complication of trying
to figure out what LCD setting should be used).

> From: thomas.deweese@kodak.com [mailto:thomas.deweese@kodak.com] 
> Sent: Tuesday, 5 August 2008 20:12
> To: batik-users@xmlgraphics.apache.org
> Cc: batik-users@xmlgraphics.apache.org
> Subject: Re: Batik 1.7 text rendering issues
> 
> 
> Hi John,
> 
> "John C. Turnbull" <oz...@ozemail.com.au> wrote on 08/04/2008 09:17:36 
AM:
> 
> > I am looking at Batik for the first time and I have done a little 
> > bit of experimentation with the ?text-rendering? attribute yielding 
> > some puzzling results. 
> > 
> > I would have thought that the option ?optimizeLegibility? would 
> > produce the ?nicest? text or at least the most readable but it seems
> > that Batik does not use anti-aliasing at all with this option set. 
> 
>    Right, when you use optimizeLegibility we render the text relying 
> on the font hinting to improve legibility at small font sizes. 
> The level/quality of the hinting varies a bit from font to font so 
> it may not be ideal. 
> 
> > However, when I specify the option ?geometricPrecision? which I 
> > would have thought would result in plainer text, I do see anti-
> > aliasing and the text is much more readable 
> 
>    Setting 'geometricPrecision' means that the rendered text should 
follow 
> the raw geometry of the text as closely as possible (hinting 
> effectively distorts the outlines of the text to align it with the 
> pixel grid).  It also means that we can't take advantage of 
> cached glyphs in most cases since a glyph at x="10.1" will render 
> differently from a glyph at x="10.6" due to anti-aliasing. 
> 
> >(although still not as readable or as clear as I would like it 
> > to be on an LCD screen). 
> 
>    The very latest versions of the JDK offer options to do 
> 'sub pixel' rendering, however currently Batik doesn't try to 
> make use of them. 
> 
> > Is this is the intended behavior or am I misreading this whole 
> > issue?  I am using Java 6 Update 10 on Windows Vista. 
> 
>    AFAIK Batik's behavior is correct with respect to the 
> SVG specification. 

RE: Batik 1.7 text rendering issues

Posted by "John C. Turnbull" <oz...@ozemail.com.au>.
Thanks for the info Thomas.

 

What would be involved in getting Batik to take advantage of the sub-pixel
antialiasing in Java 6 for better font rendering?  Is it a big change?  I'd
like to implement it, at least in my local copy.

 

Also, what is the status of development of Batik?  Is it still actively
being developed and/or enhanced?

 

Thanks,

 

-JCT

 

From: thomas.deweese@kodak.com [mailto:thomas.deweese@kodak.com] 
Sent: Tuesday, 5 August 2008 20:12
To: batik-users@xmlgraphics.apache.org
Cc: batik-users@xmlgraphics.apache.org
Subject: Re: Batik 1.7 text rendering issues

 


Hi John,

"John C. Turnbull" <oz...@ozemail.com.au> wrote on 08/04/2008 09:17:36 AM:

> I am looking at Batik for the first time and I have done a little 
> bit of experimentation with the "text-rendering" attribute yielding 
> some puzzling results. 
>   
> I would have thought that the option "optimizeLegibility" would 
> produce the "nicest" text or at least the most readable but it seems
> that Batik does not use anti-aliasing at all with this option set.  

   Right, when you use optimizeLegibility we render the text relying 
on the font hinting to improve legibility at small font sizes. 
The level/quality of the hinting varies a bit from font to font so 
it may not be ideal. 

> However, when I specify the option "geometricPrecision" which I 
> would have thought would result in plainer text, I do see anti-
> aliasing and the text is much more readable 

   Setting 'geometricPrecision' means that the rendered text should follow 
the raw geometry of the text as closely as possible (hinting 
effectively distorts the outlines of the text to align it with the 
pixel grid).  It also means that we can't take advantage of 
cached glyphs in most cases since a glyph at x="10.1" will render 
differently from a glyph at x="10.6" due to anti-aliasing. 

>(although still not as readable or as clear as I would like it 
> to be on an LCD screen). 
    
   The very latest versions of the JDK offer options to do 
'sub pixel' rendering, however currently Batik doesn't try to 
make use of them. 

> Is this is the intended behavior or am I misreading this whole 
> issue?  I am using Java 6 Update 10 on Windows Vista. 

   AFAIK Batik's behavior is correct with respect to the 
SVG specification. 


Re: Batik 1.7 text rendering issues

Posted by th...@kodak.com.
Hi John,

"John C. Turnbull" <oz...@ozemail.com.au> wrote on 08/04/2008 09:17:36 
AM:

> I am looking at Batik for the first time and I have done a little 
> bit of experimentation with the ?text-rendering? attribute yielding 
> some puzzling results.
> 
> I would have thought that the option ?optimizeLegibility? would 
> produce the ?nicest? text or at least the most readable but it seems
> that Batik does not use anti-aliasing at all with this option set. 

   Right, when you use optimizeLegibility we render the text relying
on the font hinting to improve legibility at small font sizes.
The level/quality of the hinting varies a bit from font to font so
it may not be ideal.

> However, when I specify the option ?geometricPrecision? which I 
> would have thought would result in plainer text, I do see anti-
> aliasing and the text is much more readable 

   Setting 'geometricPrecision' means that the rendered text should follow
the raw geometry of the text as closely as possible (hinting 
effectively distorts the outlines of the text to align it with the 
pixel grid).  It also means that we can't take advantage of 
cached glyphs in most cases since a glyph at x="10.1" will render
differently from a glyph at x="10.6" due to anti-aliasing.

>(although still not as readable or as clear as I would like it 
> to be on an LCD screen).
 
   The very latest versions of the JDK offer options to do
'sub pixel' rendering, however currently Batik doesn't try to
make use of them.

> Is this is the intended behavior or am I misreading this whole 
> issue?  I am using Java 6 Update 10 on Windows Vista.

   AFAIK Batik's behavior is correct with respect to the
SVG specification.