Inkscape Export to "JavaFX 1.0 FXD/FXZ Content file" format
Hi, all
Last year Sun Microsystems released JavaFX Production Suite (together with JavaFX 1.0) which have Adobe Photoshop CS3 and Adobe Illustrator CS3 plugins for exporting graphical assets into JavaFX format. The output (.fxz) is a ZIP archive containing 'content.fxd' file representing vector graphics picture in JavaFX format. Optionally, this archive may contain images and fonts referenced by the 'content.fxd' file. The content file can be viewed in netbeans IDE (JavaFX plugin should be installed!). The netbeans has UIStub generator for building a JavaFX class based on content.fxd and users may manipulate graphic objects by changing object properties, moving them, animating, making them visible/invisible and so on. The objects you want to control in JavaFX should have special prefix in naming of Inkscape "id" attribute like "jfx:object_name". Others will be anonymous in JavaFX.
I propose that this plugin for Inkscape be used. It is based on the work of B.Jamison, S.Neto and J.Clarke for JavaFX Export (javafx-out.h, javafx-out.cpp). My updates to it were posted a few weeks ago. Personally I consider the "FXD/FXZ Content file" format more useful and I am going to use this actively in future projects, which explains my motivation.
Implementation. ---------------------- The implementation is obvious: scan the object's tree and write the corresponding JavaFX constructs. The output has all attributes embedded in line therefore the information about gradients, filters and clip-paths are stored (only pointer information) and then used when actual graphic objects in the scene are built. Embedded images are decoded and external images are copied into the output ZIP archive automatically. Fonts should be handled in the same way (any volunteers!?). Like Illustrator plugin I always try to recognize simple objects (circles, ellipses, rectangles) behind the paths to reduce the output size.
As a zip library implementation I used http://www.nih.at/libzip. Actually I am working with Linux, openSUSE 11.1 distribution, where this library is known as libzip1. It seems that Ubuntu distribution supports it as well. The Windows platform is also supported: http://www.nih.at/listarchive/libzip-discuss/msg00009.html While I might agree that introducing a new dependency into inkscape may not be welcomed, my attempt to use inkscape/src/dom/util/ziptool.[h,cpp] was unhappy: extremally slow! (~ 30 secs on some pictures).
Testing. ----------- It is checked on the following pictures:
http://chrisdesign.wordpress.com/2008/02/14/simple-metal-orb-using-gradients... -- gradients http://howto.nicubunu.ro/shiny_web_buttons_inkscape/ -- gradients, embedded images http://openclipart.org/people/Chrisdesign/Chrisdesign_Golden_mask_Tutanchamu... -- large picture with clip paths
and I have used this simple tutorial to check clipping mask handling
http://www.bestechvideos.com/2008/07/12/screencasters-episode-064-bitmap-mas...
Installation. ---------------- The installation is simple if you are able to build svn version of inkscape on your platform.
1. Make sure you have libzip1 + libzip-devel packages installed in your system. Or you should have this installed from sources. See the reference above for instructions. 2. Get SVN version of inkscape: svn co https://inkscape.svn.sourceforge.net/svnroot/inkscape/inkscape/trunk inkscape 3. Copy 'javafx-fxz.h' and 'javafx-fxz.cpp' from attachment into 'inkscape/src/extension/internal' 4. Create build directory: cd inkscape mkdir build 5. Add 'javafx-fxz....' entries just above 'javafx-out' entries into po/POTFILES.in src/Makefile.in src/extension/internal/Makefile_insert src/extension/internal/CMakeLists.txt src/extension/init.cpp and in the last file (init.cpp) put just before "Internal::JavaFXOutput::init();" line the following... Internal::JavaFXZ::init(); 6. Go back into inkscape (top) directory and do ... ./autogen.sh cd build LIBS="-lzip" ../configure --prefix=/opt/inkscape or CFLAGS="-g -O0" CXXFLAGS="-g -O0" LIBS="-lzip" ../configure --prefix=/opt/inkscape if you want to build inkscape with debug information then make && su -c "make install" 7. Use /opt/inkscape/bin/inkscape executable and enjoy!
Of course, I am interested if some person(s) from development team might review the code and make a decision. Anyway I hope it will be useful.
Cheers, Sergey
On Tue, Jan 27, 2009 at 6:09 PM, Sergey Esenov <sergey.esenov@...400...> wrote:
Hi, all
Last year Sun Microsystems released JavaFX Production Suite (together with JavaFX 1.0) which have Adobe Photoshop CS3 and Adobe Illustrator CS3 plugins for exporting graphical assets into JavaFX format.
....
Cheers, Sergey
Sorry! I've forgotten to provide attachment!
sergey
Hey Sergey,
nice to hear that there is some progress on the JavaFX support. As I am working on Windows I wonder if you have created some builds for Windows? I would like to help you with testing as we also have started with JavaFX programming at our institute.
Cheers, Adam
Sergey Esenov schrieb:
On Tue, Jan 27, 2009 at 6:09 PM, Sergey Esenov <sergey.esenov@...400...> wrote:
Hi, all
Last year Sun Microsystems released JavaFX Production Suite (together with JavaFX 1.0) which have Adobe Photoshop CS3 and Adobe Illustrator CS3 plugins for exporting graphical assets into JavaFX format.
....
Cheers, Sergey
Sorry! I've forgotten to provide attachment!
sergey
Hi Adam,
Not yet. I'm working on improving of FXZ extension at the moment.
Cheers, Sergey
On Thu, Feb 5, 2009 at 10:00 AM, Adam Giemza <adam.giemza@...173...> wrote:
Hey Sergey,
nice to hear that there is some progress on the JavaFX support. As I am working on Windows I wonder if you have created some builds for Windows? I would like to help you with testing as we also have started with JavaFX programming at our institute.
Cheers, Adam
Sergey Esenov schrieb:
On Tue, Jan 27, 2009 at 6:09 PM, Sergey Esenov <sergey.esenov@...400...> wrote:
Hi, all
Last year Sun Microsystems released JavaFX Production Suite (together with JavaFX 1.0) which have Adobe Photoshop CS3 and Adobe Illustrator CS3 plugins for exporting graphical assets into JavaFX format.
....
Cheers, Sergey
Sorry! I've forgotten to provide attachment!
sergey
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM) software. With Adobe AIR, Ajax developers can use existing skills and code to build responsive, highly engaging applications that combine the power of local resources and data with the reach of the web. Download the Adobe AIR SDK and Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
On Tue, 2009-01-27 at 18:20 +0100, Sergey Esenov wrote:
On Tue, Jan 27, 2009 at 6:09 PM, Sergey Esenov <sergey.esenov@...400...> wrote:
Last year Sun Microsystems released JavaFX Production Suite (together with JavaFX 1.0) which have Adobe Photoshop CS3 and Adobe Illustrator CS3 plugins for exporting graphical assets into JavaFX format.
Sorry! I've forgotten to provide attachment!
Could you provide the files and the changes to the other files as a patch and/or DVCS branch somewhere? That'd probably make it easier for people to apply it and test.
Thanks, Ted
On Sat, Feb 7, 2009 at 12:10 PM, Ted Gould <ted@...11...> wrote:
On Tue, 2009-01-27 at 18:20 +0100, Sergey Esenov wrote:
On Tue, Jan 27, 2009 at 6:09 PM, Sergey Esenov <sergey.esenov@...400...> wrote:
Last year Sun Microsystems released JavaFX Production Suite (together with JavaFX 1.0) which have Adobe Photoshop CS3 and Adobe Illustrator CS3 plugins for exporting graphical assets into JavaFX format.
Sorry! I've forgotten to provide attachment!
Could you provide the files and the changes to the other files as a patch and/or DVCS branch somewhere? That'd probably make it easier for people to apply it and test.
Thanks, Ted
Hi all,
Yes, you can find the patch (inkscape_jfx_jfz.patch) in attachment. In this patch I am trying to support both Linux and Windows platforms. Attachment contains ... inkscape_jfx_jfz.patch <--- patch for inkscape config.h <--- config.h file for libzip package for Windows platform libzip.def <--- definition file for libzip library for Windows platform
LINUX. Linux installation is easy if you have already all infrastructure installed, i.e. you are able to build SVN Checkout source of inkscape and you have libzip 0.9 (http://nih.at/libzip/) installed.
I would do this like ...
0. Go to the working directory.
1. svn co https://inkscape.svn.sourceforge.net/svnroot/inkscape/inkscape/trunk inkscape Copy patch in attachment into working directory.
2. cd inkscape patch -p1 < ../inkscape_jfx_jfz.patch
3. ./autogen.sh
4. mkdir build; cd build LIBS=-lzip ../configure --prefix=/opt/inkscape make su -c "make install"
5. /opt/inkscape/bin/inkscape to start running new executable
WINDOWS. I've used instructions from http://wiki.inkscape.org/wiki/index.php/Win32Port, i.e I have mingw (4.2.1) and the last devlibs installed. Additionally I've installed MSYS trying to build libzip for Windows. The configure script doesn't work for me, so I 've built libzip by hands under MSYS (may be this is not optimal way) :
1. Untar libzip-0.9.tar.bz2 Copy config.h from attachment into libzip-0.9 directory. cd libzip-0.9/lib
2. gcc -DHAVE_CONFIG_H -DPIC -DDLL_EXPORT -I. -I.. -I/c/devlibs/include -g -O2 -c *.c
3. ar rcs libzip.a *.o
4. gcc -shared -o libzip.dll -Wl,--out-implib=libzip.dll.a -Wl,--export-all-symbols \ -Wl,--enable-auto-import -Wl,--whole-archive libzip.a \ -Wl,--no-whole-archive -L/c/devlibs/lib -lz 5. strip libzip.dll 6. Copy libzip.def from attachment into /c/devlibs/include Copy libzip.dll into /c/devlibs/bin Copy libzip.dll.a into /c/devlibs/lib 7. Patching fresh checkout of inkscape like .. cd /path/to/inkscape patch -p1 < /location/of/the/inkscape_jfx_jfz.patch
Then I've followed usual procedure for Windows: in 'Command Prompt' window: mingwenv.bat g++ -o btool.exe buildtool.cpp btool inkscape\inkscape.exe
That's it!
A few notes about patch: 1. Windows support is very preliminary. I made some dirty hacks that should be rewritten, like the handling of the fonts ( this is my first experience with Windows platform:) 2. Due to bug (I believe) in JavaFX handling of linear gradient I decided to "proportional: false" attribute setting at least until bug is fixed. 3. Radial gradient handling is just a dirty hack! Any proposals? 4. I did not check return codes in some places that is not good for production version of inkscape 5. May be the code should be cleaned. 6. It is not possible to define (via some sort of configuration panel) how you want to change of this plugin (for example, concerning font embedding into archive). Volunteers?
Good luck!
Sergey
Hi all,
any new progress on here? Or maybe any builds (I have a Mac now, so I could test Mac, Windows and Linux)?
I noticed in the very first exporter that it does not create this fxd packages but direct fx classes. Is there any difference except of the different handling inside JavaFX?
Cheers, Adam
Sergey Esenov schrieb:
On Sat, Feb 7, 2009 at 12:10 PM, Ted Gould <ted@...11...> wrote:
On Tue, 2009-01-27 at 18:20 +0100, Sergey Esenov wrote:
On Tue, Jan 27, 2009 at 6:09 PM, Sergey Esenov <sergey.esenov@...400...> wrote:
Last year Sun Microsystems released JavaFX Production Suite (together with JavaFX 1.0) which have Adobe Photoshop CS3 and Adobe Illustrator CS3 plugins for exporting graphical assets into JavaFX format.
Sorry! I've forgotten to provide attachment!
Could you provide the files and the changes to the other files as a patch and/or DVCS branch somewhere? That'd probably make it easier for people to apply it and test.
Thanks, Ted
Hi all,
Yes, you can find the patch (inkscape_jfx_jfz.patch) in attachment. In this patch I am trying to support both Linux and Windows platforms.
Hi, I guess this is a newbie question, I just installed the JavaFX Production Suite (Windows XP), only to discover that it reads only .fxd or .fxz files, not .fx. Needless to say, I was not impressed. So, not being a developer, how would I view a .fx file if I do not have NetBeans installed?
Alvin
Hi Alvin,
not at all. But this is not the idea of that. You, as a designer, create a fxd file, and we, as developers, implement the logic in the background. Why would you want to look at a fx file?
Cheers, Adam
Alvin Penner schrieb:
Hi, I guess this is a newbie question, I just installed the JavaFX Production Suite (Windows XP), only to discover that it reads only .fxd or .fxz files, not .fx. Needless to say, I was not impressed. So, not being a developer, how would I view a .fx file if I do not have NetBeans installed?
Alvin
but, if I remember correctly, Inkscape is producing an .fx file, not .fxd. So why would Inkscape produce a file that will not be viewable? I am not at my normal machine, so I am just going by memory here.
Alvin
luckily, my memory did not fail me entirely. I am attaching a .fx file created by Inkscape. This file is not viewable on my Windows XP machine because it is an unrecognized file type. If I rename it to be .fxd or .fxz then the Java FX Production Suite attempts to load it but fails.
So my question remains, what do I need to do in order to view or use this .fx file, assuming that I do not have NetBeans installed, but do have Java SDK 6 update 11 installed?
Alternatively, how would I produce a .fxd file, given that Inkscape does not do this?
Alvin
sorry, forgot ... http://www.nabble.com/file/p22213961/circ4590_org.fx circ4590_org.fx
On Wed, Feb 25, 2009 at 11:58 PM, Alvin Penner <penner@...1856...> wrote:
luckily, my memory did not fail me entirely. I am attaching a .fx file created by Inkscape. This file is not viewable on my Windows XP machine because it is an unrecognized file type. If I rename it to be .fxd or .fxz then the Java FX Production Suite attempts to load it but fails.
Hi Alvin,
You have used development version of Inkscape that contains javafx-out.cpp(h) extension supporting so called "Preview version" of JavaFX which was released by the end of July, 2008. After that Sun produced 2 releases: JavaFX 1.0 (December 4th, 2008) and JavaFX 1.1 (Febrary 12th(?), 2009). In both realeases JavaFX language evolved and you can observe incompatibilities even on source level. I've looked on your .fx file and see it was produced by "standard" (current) version of Inkscape and, therefore, can be viewed only by compiling and running by JavaFX Preview development kit, like javafxc.exe circ4590_org.fx javafx circ4590_org of course, if you have JavaFX Preview dev kit installed.
So my question remains, what do I need to do in order to view or use this .fx file, assuming that I do not have NetBeans installed, but do have Java SDK 6 update 11 installed?
Java SDK 6 update 11 is not enough. Check if you have JavaFX dev kit installed and do compiling yourself. No special viewer exists.
Alternatively, how would I produce a .fxd file, given that Inkscape does not do this?
Let me explain you directly. The CURRENT dev version which is in svn repository on mainline cannot produce fxz/fxd file. It can produce .fxz file if the patch I proposed would be applied. If you ask me when it will happen, the answer is: I have no idea,.... may be never. Here I cannot help.
Cheers, Sergey
Alvin
-- View this message in context: http://www.nabble.com/Inkscape-Export-to-%22JavaFX-1.0-FXD-FXZ-Content-file%... Sent from the Inkscape - Dev mailing list archive at Nabble.com.
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
On Mon, Mar 2, 2009 at 12:18 PM, Sergey Esenov <sergey.esenov@...400...> wrote:
Let me explain you directly. The CURRENT dev version which is in svn repository on mainline cannot produce fxz/fxd file. It can produce .fxz file if the patch I proposed would be applied. If you ask me when it will happen, the answer is: I have no idea,.... may be never. Here I cannot help.
Sergey: I anyone knowing what JavaFX is will test your patch and say it is OK, I will commit it and, if you wish, give you commit rights so you can continue working on it.
sounds good to me... sorry to be so picky about this, but it bothers me to see things that are in an 'undefined' or 'indeterminate' state.
Alvin
On Wed, Feb 25, 2009 at 9:51 AM, Adam Giemza <adam.giemza@...173...> wrote:
Hi all,
any new progress on here? Or maybe any builds (I have a Mac now, so I could test Mac, Windows and Linux)?
Hi,
As I see nobody has tested the patch I 've sent before. The patch was getting obsolete because of developments on the main trunk. So I have prepared the new patch with some bug fixes (image file handling, JavaFX 1.1 support). The patch is in attachment.
About builds. Yes, I've made recent builds (r20792) for Windows and Linux: openSUSE 11.1 x86). Have no idea how to upload these builds for you, guys. And I am not sure as well that this is a correct way to distribute inkscape developments from my side. If you have proposals let me know.
I noticed in the very first exporter that it does not create this fxd packages but direct fx classes. Is there any difference except of the different handling inside JavaFX?
First I've tried to keep "no difference" status, and now they are "almost" the same. The difference is: FXZ archive may contain other graphic stuff, like bitmaps and fonts that can be referenced by FXD (SVG translated into JavaFX). But I consider the idea to use FXZ format (and "JavaFX Production Suite" infrastructure) more attractive. It allows clean separation between designer's and developer's work.
Hope I've answered your questions :)
Cheers, Sergey
Cheers, Adam
participants (5)
-
Adam Giemza
-
Alvin Penner
-
bulia byak
-
Sergey Esenov
-
Ted Gould