xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas DeWeese <Thomas.DeWe...@Kodak.com>
Subject Re: Convert element to curves
Date Tue, 13 Sep 2005 19:37:49 GMT
Hi Angel,

Ing. Angel Monticelli wrote:

> I'm trying this code but I can't make it works... Please gime a hand! :D
> 
> Shape shapTxt;
> TextLayout txtTl = new TextLayout("Hello World!", new
> Font("BernhardFashion BT", 1, 96), new FontRenderContext(null, false,
> false));
> 
> ... And then?? How can I use 	GraphicsNode???

   There is no SVG here, so there is no use of GraphicsNode.
Tonny was talking about getting the outline of a complex SVG
text element.

   If you want to turn Java2D text into outlines you can use
TextLayout.getOutline, however this has nothing to do with Batik:

shapTxt = txtTl.getOutline();

   If you want to output this to SVG then you will want to
look at the batik.svggen.SVGGraphics2D class where you
can draw your outlines as Java2D shapes and it will generate
appropriate SVG 'path' element(s).

> Thank you!
> Oh, by the way, do you know any way to apply 2D effects like
> perspective? Thanks again!

    Perspective is not a 2D effect, it is a 3D effect.  It is
difficult to apply Perspective and other weird effects to
complex geometry and keep the geometry as 'curves' because the
effects do not map spline to spline.  If you are willing to
flatten the data then this becomes a simple matter of mapping
points.


> 
> Angel
> 
> -----Mensaje original-----
> De: Tonny Kohar [mailto:tonny@kiyut.com] 
> Enviado el: martes, 13 de septiembre de 2005 14:21
> Para: batik-users@xmlgraphics.apache.org
> Asunto: Re: Convert element to curves
> 
> 
> Hi,
> 
> On Tue, 2005-09-13 at 11:16 -0300, Ing. Angel Monticelli wrote:
> 
>>Hi everyone!
>> 
>>I've trying to use Batik lib to convert text to path (text to curves 
>>transformation), but I can't do it. I need some help of experienced 
>>users please!
> 
> 
> If you do not mind using Batik GVT part instead of pure SVG DOM, you
> could convert text,rect,circle,etc to path by eg:
> 
> GraphicsNode gvtNode = bridgeContext.getGraphicsNode(txtElement);
> Shape s = gvtNode.getOutline();
> 
> Regards
> Tonny Kohar


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


Mime
View raw message