xmlgraphics-batik-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vincent Hardy <vincent.ha...@sun.com>
Subject Re: svggen - Float font size?
Date Tue, 19 Feb 2002 09:46:11 GMT
Vladislav,

Thanks for reporting this. You actually found what can be fairly 
described as a bug. The generator uses the font.getSize() method
where it should be using the font.getSize2D() method.

I am going to add a bug in Bugzilla and I'll try to fix it ASAP. 
Cheers,
Vincent.

> Hello,
>  
> Is it possible to generate SVG with float font size?
>  
> I modified method paint () of TestSVGGen example from http://xml.apache.org/batik/svggen.html
>  
> public void paint(Graphics2D g2d) {
> 
> Font font=new Font("Arial", Font.PLAIN, 1);
> 
> font=font.deriveFont(15.5f);
> 
> g2d.setFont(font);
> 
> g2d.drawString("Hello Java 2D to SVG", 40, 40);
> 
> }
> 
> It produces such output:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> 
> <!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.0//EN' 'http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd'>
> 
> <svg xmlns:xlink="http://www.w3.org/1999/xlink" style="fill-opacity:1; color-rendering:auto;
color-interpolation:auto; text-rendering:auto; stroke:black; stroke-linecap:square; stroke-miterlimit:10;
> shape-rendering:auto; stroke-opacity:1; fill:black; stroke-dasharray:none; font-weight:normal;
stroke-width:1; font-family:&apos;sansserif&apos;; font-style:normal; stroke-linejoin:miter;
font-size:12;
> stroke-dashoffset:0; image-rendering:auto;" xmlns="http://www.w3.org/2000/svg">
> 
> <!--Generated by the Batik Graphics2D SVG Generator-->
> 
> <defs id="genericDefs" />
> 
> <g>
> 
> <g style="font-family:&apos;Arial&apos;; font-size:16;">
> 
> <text xml:space="preserve" x="40" y="40" style="stroke:none;">Hello Java 2D to
SVG
> 
> </text>
> 
> </g>
> 
> </g>
> 
> </svg>
> 
>  
>  
>  
> Thank you,
> Vladislav
>

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


Mime
View raw message