My blog has been moved to ariya.ofilabs.com.

Monday, July 31, 2006

English lesson

Teacher: Susie, make a sentence starting with the letter I.

Susie: "I is ..."

Teacher: "No, no, no, don't say I is, you say I am.

Susie: OK, "I am the ninth letter of the alphabet."

(from jokes4all.net)

wpg2odg, now with colors

As I wrote before, finally I manage to correctly handle the stroke and fill in wpg2odg. The result can be witnessed in the following screenshot:

The two landscape pictures opened inside OpenOffice.org are in OpenDocument Graphics (ODG) format, converted from the corresponding WPGs (which are shown in Corel Presentation on the left side).

There are still bugs on some corner cases. When I clean this up, then I'll commit everything so that it's ready for public testing.

Friday, July 28, 2006

The ultimate poll

This pool poll at kde-look is very hilarious! As I write this, the result (from the most voted one) is like this:

  1. The X11 Files
  2. Desperate Hackers
  3. Linux and the City
  4. The 404 (not found)
  5. 24/7 (and still running)
  6. The Torvalds (reality soap)
  7. Emergency Root
  8. The L Word (the one that really matters)
  9. 6 Files Under
  10. Scripts (Newbies learning shell script)

Interesting suggestions from the comments are:

  • Everybody Loves (Eric S.) Raymond
  • Geek's Anatomy

So, cast your vote!

Jambi and Java

Jambi is the next Qt technology for integrating Qt and Java. When I saw the name for the first time, I couldn't stop wondering. Why is it Jambi? For those who do not know yet, it's also the name of a province in Indonesia, but that province is in Sumatra, not Java.

There are still good places in Java which may make a good name (Jakarta is already taken by Apache), for example Jepara, Jogya (old spelling), Jombang, Jember and perhaps couple of more that I couldn't remember.

At least, it's not Jampi :-)

wpg2odg, wpg viewer, vs microsoft

I hope I don't bore the readers with another Whiskey-Papa-Golf goodies.

So far, at least I make some steady progress with the wpg2odg. Yes, this is a command-line tool which will convert WordPerfect Graphics into OpenDocument Graphics. From perfection to openness, so to speak. The corresponding UNO service (for seamless import from within OpenOffice.org) is planned, but I can't say when I could finish it.

As style handling in ODG is more complicated than SVG, my work with respect to stroke and fill properties of the objects isn't very fast. However, at least the outlines/paths are already imported properly. Shown in the screenshot below is OpenOffice.org opening eiffel.odg, which is the result of running "wpg2odg eiffel.wpg eiffel.odg". Compare it to the rendering in Corel Presentation and Inkscape as in my previous blog entry. So, it's like Eiffel in wireframe mode.

Of course, it's rather boring. But given couple of more days, I hope all the wonderful colors will be there.

Since libwpg is designed to be portable, I checked its status in non-Linux environment. So far I have tried to compile it on Win32 (not necessarily as dynamic library, lack of knowledge from my side) and it works well. At least with Microsoft, Borland, and GCC (Mingw) compilers. I am going to give it a try with Digital Mars and OpenWatcom later on, but I don't foresee any serious problem with the code.

I used the chance also to verify Perfectspot, another toy of mine which uses libwpg to show WPG files. So basically it's a stand-alone WPG viewer. I'll perhaps release it when it's fully polished, not sure yet whether there is a demand for such tool. Perfectspot is Qt4-based and using Arthur to render the graphics onto the screen. Screenshot can be seen below. The beautiful Earth is drawn by Marcelo Staudt (available in from Open Clip Art library). I just imported his SVG file into Corel Presentation X3 and then save it as WPG. Perfectspot opens and displays the WPG file just fine. Note how smooth is Perfectspot's rendering due to the antialiasing feature in Qt4, compared to that of Presentation's.

Since this blog got anothers hits from someone at microsoft.com with respect to WPG stuff, I decided to find out how good is the support for WPG in Microsoft Office. I inserted my favorite windmill picture (see the entry on gradient support) in PowerPoint 2002 and this is what I got:

Seems that the importer and/or PowerPoint has problem with compound polygons or grouped objects. Look at the blade in the middle (which consists of some sub paths), it should be transparent just like the other blades. Compare it to what our wonderful Karbon14 renders:

Also notice the lack of antialiasing in PowerPoint. Strangely enough, this is only for imported pictures. When I clicked and converted the inserted picture into Office drawing, then it was smoothly painted.

Alas, I saw another problem with the gradients. Instead of creating polygon with gradient fill, the import filter of PowerPoint splits the polygon into smaller polygon and fills it with solid color, as can be seen below (I select couple of those polygons to show that they are many many small objects indeed). You can quickly spot it if your eyes have native Sobel filter :-)

Is it only the case with Microsoft Office 2002? To verify it, I gave Office 2007 Beta a try. Despite its brand new user interface, it is just the same case: one blade is not transparent and gradient is converted to color bands:

Conclusion: when I am finally finished with all this endeavour, it is likely that applications like OpenOffice.org, Karbon14, and Inkscape can handle WPG files better than Microsoft Office. Or should we ask Microsoft to just use libwpg?

Tuesday, July 25, 2006

Eiffel in perfection

After few failed attempts, finally I managed to implement full support of the so called compound polygon for libwpg (see also the previous progress). This is WordPerfect Graphics' term for "grouped objects". Without proper compound polygon support, often some objects are shifted, i.e. not placed in correct position due to the wrong transformation.

As always, the obligatory click-to-enlarge screenshot follows. And as usual, Corel Presentation is on the left side, opening a picture from the clip-art. On the right side, Inkscape (before I showed only Karbon14) is showing the converted SVG.

Coming soon: from WPG to ODG. Yes, that's OpenDocument Graphics...

q.o.t.n

<ariya> the good old fanless 486 ......
<tstaerk> I am a fan of it!
<ariya> you're really old fashion !
<ariya> but I also really love that chap, always works like charm
<tstaerk> and beyond it was a play on words ;)

Sunday, July 09, 2006

Beauty is in the smoothness of the colors

In the recent days (see also the last progress), I have implemented support for two important things for libwpg: object transformation and gradient.

Object transformation is necessary to have rotated or scaled objects. And most important is for translated objects. In Corel Presentations, when you copy an object and move the copy, the two still shares the same data but have different transformation matrix. Thus, in order to have all objects in proper location, transformation support is necessary.

Another interesting bit is gradient fill. This presents some challenge as the documentation does not say anything except the data structure, and the gradient concept in WPG does not actually fit into SVG model. After wasting many sheets of paper and scribbling lots of (mostly wrong) equations, I found the solution which may match WPG's gradient with SVG. So far it works with linear gradient.

In the screenshot below (click for larger version), you can see the perfect conversion of the gradients. Left side: WordPerfect Office (inside emulator) shows windmill.wpg. Right side: Karbon14 opens windmill.svg, which is windmill.wpg converted to SVG using libwpg's wpg2svg.

Note 1: there are still rendering problem as I have not yet coded proper evenodd fill rule with grouped polygons.

Note 2: Karbon here is just for illustration purpose. Inkscape (or other vector drawing programs which support SVG) works also flawlessly.

Saturday, July 08, 2006

Look ma, no extension!

Unlike Firefox which needs an extension (as mentioned by ThomasZ just now), KDE's Konqueror users can happily and easily view OpenDocument files thanks to the integration between KOffice and the rest of KDE. A simple click on the ODF file is all that is needed.

Left side: Browse the document folder with Konqueror, and the click on the file.
Right side: OO.o Calc is used to create the test file.

Friday, July 07, 2006

Frequence Trois

Lately I was asked about my favorite Internet radio. Well, without doubt it's definitely Frequence3. I'm using it already for years and it really pleases me!

Thursday, July 06, 2006

Microsoft and WordPerfect

Microsoft trying to improve support for WordPerfect graphics? (just like what I'm doing now for libwpg):

Referring Link: http://www.google.com/search?hl=en&lr=&q=sample wpg files

Looking at that log, at least their Google search had landed in this blog :-)