xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Shaw <hertzsprrr...@btopenworld.com>
Subject Re: Obtaining glyph bounding box
Date Wed, 02 Feb 2005 21:19:48 GMT
Thomas DeWeese wrote:

> Hi James,
>
> You will need to build the GVT tree (which is what the
> JSVGCanvas calls do except you aren't waiting for the build
> events, you are also not making the canvas ALWAYS_DYNAMIC
> so for a simple document it won't link the DOM to graphics).
>
> The code to build the graphics tree for the DOM explicitly
> rather than relying on the JSVGCanvas (which is kinda ugly):
>
> UserAgent userAgent = new UserAgentAdapter();
> DocumentLoader loader = new DocumentLoader(userAgent);
> BridgeContext ctx = new BridgeContext(userAgent,loader);
> ctx.setDynamicState(BridgeContext.DYNAMIC);
> GVTBuilder builder = new GVTBuilder();
> builder.build(ctx, document);
>
> Most of the classes are from the bridge package.
>
Wow, it works! Thanks so much!
James Shaw

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


Mime
View raw message