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 Mork0075 <mo...@googlemail.com> on 2007/08/21 08:01:43 UTC
Re: Automatic stretching
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 <mo...@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
Re: Automatic stretching
Posted by th...@kodak.com.
Hi Mork,
Mork0075 <mo...@googlemail.com> wrote on 08/21/2007 02:01:43 AM:
> 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.
The viewbox identifies what part of the local coordinate system of
the symbol element should be mapped to the width/height of the use
element at location 'x','y'.
Try reading:
http://www.w3.org/TR/SVG11/coords.html#ViewBoxAttribute
> 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.
Without the viewBox on the symbol it's impossible to know what part
of the symbols coordinate system should be mapped to the x/y width/height
of the use element.
Make a small document and play with the viewBox and the width/height
on the use elements.
> Thanks for your help
> Mark
>
> thomas.deweese@kodak.com schrieb:
> > Hi Mark,
> >
> > Mork0075 <mo...@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
>
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org