xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thomas.dewe...@kodak.com
Subject Re: Automatic stretching
Date Tue, 21 Aug 2007 10:16:46 GMT
Hi Mork,

Mork0075 <mork0075@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 <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
> 


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