xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mork0075 <mork0...@googlemail.com>
Subject Re: Automatic stretching
Date Tue, 21 Aug 2007 06:01:43 GMT
Hello,

i jumped into svg last days but one thing is not that clear to me,
perhaps someone can explain.

I dont understand what viewBox does. I created a svg document, where i
define one symbol and also four use tags, where i try to devide the A4
sheet into 4 cells like this:
------
|   |   |
------
|   |   |
-------

I defined for every <use> the x,y, width and height attribut which
correspond to the left upper corner of every cell and it height and
width. now i want that the symbol is fitted into each cell where ratio
is preserved.

my concrete question is: i dont understand Thomas remark, why to define
a viewBox on the symbol and whats the difference between the viewBox
attribut and the x,y,height,width attributes.

Thanks for your help
Mark

thomas.deweese@kodak.com schrieb:
> Hi Mark,
>
> Mork0075 <mork0075@googlemail.com> wrote on 07/26/2007 05:11:00 AM:
>
>   
>> I would like the label to fit in/strechting automatically in the certain
>> layout cell. Because of the scaleable in the word SVG, i think this is
>> possible. Can someone give me a hint how to realise that? :) Hints for
>> further googling are also welcome.
>>     
>
>     I think if you define your label content with a <symbol> and
> provide a viewBox, then you can use the 'use' element in your template
> with a x/y (to position it) and width/height define the area to fill.
>
>     Then you can control the way the viewBox on the symbol fills the
> use area, with the preserveAspectRatio attribute.
>
>     This should be fairly simple and do what you want.  Knowing
> the appropriate viewBox for the symbol might be tricky but you can
> use Batik to calculate the bounding box of the label content (getBBox)
> which is likely a good start.
>
>
> ---------------------------------------------------------------------
> 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


Mime
View raw message