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 Christian Convey <ch...@gmail.com> on 2011/04/15 17:49:22 UTC

font size question

A few months ago I found that Firefox and Chromium were rendering my
Batik-generated SVG files differently.  Someone on this list kindly
pointed out the problem: My font size (in the .svg file) was listed as
"10", not "10px".  (See example below.)

Any suggestions for what I do in Java to make the "px" suffix appear
in my svg file's font size(s)?

Thanks,
Christian


<?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; stroke:black;
text-rendering:auto; stroke-linecap:square; stroke-miterlimit:10;
stroke-opacity:1; shape-rendering:auto; fill:black;
stroke-dasharray:none; font-weight:normal; stroke-width:1;
font-family:&apos;Dialog&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:monospace; font-size:10;"
   ><rect x="0" y="0" width="86.2256" style="fill:none;" rx="2.5"
ry="2.5" height="64.9219"
     /><text x="10" xml:space="preserve" y="21.6406" style="stroke:none;"
     >AAddH</text
     ><text x="10" xml:space="preserve" y="38.2812" style="stroke:none;"
     >123</text
     ><text x="10" xml:space="preserve" y="54.9219" style="stroke:none;"
     >Foo.if1(42)</text
   ></g
 ></g
></svg
>

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


Re: font size question

Posted by Cameron McCormack <ca...@mcc.id.au>.
Martin Gainty:
> usually font characteristics are handled by css will batik read css?

Yes, Batik processes <style> elements and style="" attributes.  Passing
in `useCSS = false` to one of the stream() methods on SVGGraphics2D just
means that it will generate presentation attributes:

  <svg ... font-size="12" font-family="Whatever">

instead of style="" attributes:

  <svg ... style="font-size: 12; font-family: Whatever">

-- 
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: font size question

Posted by Martin Gainty <mg...@hotmail.com>.
usually font characteristics are handled by css
will batik read css?

Martin Gainty 
______________________________________________ 
Jogi és Bizalmassági kinyilatkoztatás/Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 Ez az
üzenet bizalmas.  Ha nem ön az akinek szánva volt, akkor kérjük, hogy
jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának
készítése nem megengedett.  Ez az üzenet csak ismeret cserét szolgál és
semmiféle jogi alkalmazhatósága sincs.  Mivel az electronikus üzenetek
könnyen megváltoztathatóak, ezért minket semmi felelöség nem terhelhet
ezen üzenet tartalma miatt.

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.




> Date: Mon, 18 Apr 2011 13:45:40 +1200
> From: cam@mcc.id.au
> To: batik-users@xmlgraphics.apache.org
> Subject: Re: font size question
> 
> Christian Convey:
> > Thanks very much.  Any idea when a new Batik release will come out
> > that contains this fix?
> 
> That is a good question.  I feel like we have enough bug fixes, and it
> has been long enough since the last release, that it is worth making a
> 1.8 release.  We would just need to find a developer who has the time to
> manage the release.
> 
> -- 
> 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: font size question

Posted by Cameron McCormack <ca...@mcc.id.au>.
Christian Convey:
> Thanks very much.  Any idea when a new Batik release will come out
> that contains this fix?

That is a good question.  I feel like we have enough bug fixes, and it
has been long enough since the last release, that it is worth making a
1.8 release.  We would just need to find a developer who has the time to
manage the release.

-- 
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: font size question

Posted by Christian Convey <ch...@gmail.com>.
Thanks very much.  Any idea when a new Batik release will come out
that contains this fix?

On Sun, Apr 17, 2011 at 8:15 PM, Cameron McCormack <ca...@mcc.id.au> wrote:
> Hi Christian.
>
> Christian Convey:
>> A few months ago I found that Firefox and Chromium were rendering my
>> Batik-generated SVG files differently.  Someone on this list kindly
>> pointed out the problem: My font size (in the .svg file) was listed as
>> "10", not "10px".  (See example below.)
>>
>> Any suggestions for what I do in Java to make the "px" suffix appear
>> in my svg file's font size(s)?
>
> This is https://issues.apache.org/bugzilla/show_bug.cgi?id=50100, which
> was fixed a couple of months ago.  You’ll need to grab the source from
> Subversion to have this fix.  If you can’t get the latest code from
> Subversion, you can work around this issue by setting useCss to false to
> make SVGGraphics2D use presentation attributes instead of the style=""
> attribute; presentation attributes are allowed to omit units from
> lengths, so browsers will be happy with them.
>
> --
> 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: font size question

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

Christian Convey:
> A few months ago I found that Firefox and Chromium were rendering my
> Batik-generated SVG files differently.  Someone on this list kindly
> pointed out the problem: My font size (in the .svg file) was listed as
> "10", not "10px".  (See example below.)
> 
> Any suggestions for what I do in Java to make the "px" suffix appear
> in my svg file's font size(s)?

This is https://issues.apache.org/bugzilla/show_bug.cgi?id=50100, which
was fixed a couple of months ago.  You’ll need to grab the source from
Subversion to have this fix.  If you can’t get the latest code from
Subversion, you can work around this issue by setting useCss to false to
make SVGGraphics2D use presentation attributes instead of the style=""
attribute; presentation attributes are allowed to omit units from
lengths, so browsers will be happy with them.

-- 
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