Hi Abraham,

"Abraham Rodriguez Mota" <[EMAIL PROTECTED]> wrote on 04/07/2008 
01:30:02 PM:

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

   Well your code is asking for the font-size on the group
but your stylesheet is setting the font size on text elements.
So if you want/need to know the font size on a text element 
then you need to ask the CSS engine for the font size on that 
text element.

Thomas DeWeese | CDG Advanced Development | 
Eastman Kodak Company | 343 State Street | Rochester, NY 14650-0128 | 
[EMAIL PROTECTED] | 585 781-9059 | 
www.kodak.com 



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

<<image/gif>>

Reply via email to