Hi Thomas,

I tried to calculate the positions getting the value of the font-size from
the SVG DOM document, but I get a value that is different from the one set
on the style sheet. Any advice on how to get consistent values?
Here are the snippets of the java and CSS code:

        //Cast from DOM to DocumentView
       DocumentView docView=(DocumentView)singleProject.getDocument();
        AbstractView abstractView=docView.getDefaultView();
       //cast from AbstractView to ViewCSS
        ViewCSS viewCSS=(ViewCSS)abstractView;
        //Read font-size from the CurrenBlock element
       //currentBlock is a group <g> containing text elements
        CSSStyleDeclaration
cssDeclaration=viewCSS.getComputedStyle(currentBlock,null);
        System.out.println("font-size");
        System.out.println(cssDeclaration.getPropertyCSSValue("font-size"));
        System.out.println(cssDeclaration.getPropertyValue("font-size"));

The output is:
font-size
[EMAIL PROTECTED]
12

But the CSS is:
text{
font-size:10pt;
}



Thanks in advance

Abraham

On Wed, Apr 2, 2008 at 11:18 AM, <[EMAIL PROTECTED]> wrote:

> Hi Abraham
>
> "Abraham Rodriguez Mota" <[EMAIL PROTECTED]> wrote on 04/01/2008
> 11:08:10 AM:
>
> > I tried to do the maths, but because I didn't find an exact
> > calculation , after a series of adding and removing tasks big gaps
> > of empty space appears on the boxes. Do you have any advice about it?
>
>     size in 'px' = size in 'em' * font-size.
>     You can get the font-size for an element with the
> getComputedStyle and getPropertyValue methods.
>
>
>
> > On Fri, Mar 14, 2008 at 3:56 AM, Tonny Kohar <[EMAIL PROTECTED]>
> wrote:
> > Hi,
> >
> > On Fri, Mar 14, 2008 at 3:55 AM, Abraham Rodriguez Mota
> > <[EMAIL PROTECTED]> wrote:
> >
> > Did you try to calculate the equivalent of translate unit to px value ?
> >
> > Cheers
> > Tonny Kohar
> > --
> > Citra FX Photo Effects
> > imagine, design, create ...
> > http://www.kiyut.com
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
>

Reply via email to