xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas E Deweese <thomas.dewe...@kodak.com>
Subject Text Problems
Date Wed, 10 Oct 2001 11:54:58 GMT
>>>>> "CB" == cbornste  <cbornste@tietronix.com> writes:

CB> In the javadoc for org.apache.batik.gvt.GraphicsNode there is the
CB> following caveat: "Note: The boundaries of some nodes (notably,
CB> text element nodes) cannot be precisely determined independent of
CB> their GraphicsNodeRenderContext"

    This note is a bit out of date but the essence is correct.  The
GraphicsNodeRenderContext object no longer exists but it use to hold a
FontRenderContext (or some such object).  This object was intended to
be paired with the device the content was to be rendered for (this is
now associated with a TextNode when the GVT tree is built).  See the
problem is that the exact details of platform fonts varies depending
on the output device.  So for example the exact details of the font
you get for Times will likely be slightly different for a Mac display
a Win32 display or an X11 display (in fact for X11 the font may change
depending on what 'display' you are going to, along the same lines it
is also quite possible for the exact metrics to change from PC to PC
or Mac to Mac, if 'non-standard' or additional fonts have been

    This is on top of well know issues about the differences in screen
fonts and printer fonts.

CB> What exactly does this mean? Does it mean that I can not
CB> know precisely the bounds of a text element?

    It means that you can only know precisely the bounds of a text
element if you know precisely what font it will be rendered with.

    This is where the term 'platform' font comes in.  In SVG you can
use SVG to describe your font in this case you _can_ know exactly what
font will be used to render the content, and hence virtually all
uncertanty in the resultant display can be removed.

CB> Also, if I want to render SVG which has a text element should I
CB> use a TextNode instead of a GraphicsNode? Are there any examples
CB> using TextNode?  I have been following the DOM API examples and am
CB> having no luck getting text to render properly.

    I'm a bit confused since you talk about the DOM api but all the
classes you mention are GVT classes which is our 'view' of the DOM
'model' (in MVC).  If you are talking about GVT classes then the
answer is clearly yes, you should be using TextNodes to hold your

CB> Thanks

    Hope it helps.

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

View raw message