Converting from svg format to javafx css svg

Gerrit Grunwald han.solo at
Sat Dec 14 15:47:00 PST 2013

Hi Pedro,

If I got you right you have scaling problems with the -fx-shape in css right? So if you use
-fx-scale-shape: false; 
the svg path should be exactly the same size as the original path from Illustrator and if you would like to scale the shape to the size of the Region you just set it to true and set the size if the Region to the size you need the svg path.
If your svg path has a certain aspect-ratio you should take care about it by resizing the Region correctly. That is the way I use it everywhere and it works really nicely. I usually don't use the padding for the svg path in css to resize it.

Just my 0.02€...



> Am 14.12.2013 um 22:00 schrieb Pedro Duque Vieira <pedro.duquevieira at>:
> Hi,
> While working in JMetro (Metro like controls for javafx) I have the
> following process for creating svg graphics using javafx css:
> 1- I create the vector graphics in Adobe Illustrator
> 2- save the file in svg format
> 3- get the svg path notation from the svg file and use it with javafx
> -fx-shape css property
> The thing that I haven't still mastered is how does the size of the vector
> graphics in Illustrastor translate to the size I have to input in the
> -fx-padding css property. I know I have to enter half the value of width
> for the left and right and half the value of the height for the top and
> bottom but still that doesn't seem to work. It's still more of a process of
> trial and error for me.
> Thanks in advance.
> -- 
> Pedro Duque Vieira

More information about the openjfx-dev mailing list