ariya.io About Talks Articles

Curvey landscape

1 min read

Decrypting Bezier curve in WordPerfect Graphics (WPG), for the libwpg project, turned out to be not so easy. First of all, the documentation is rather very brief. The curve is specified in some triplets, where each triplet consist of initial control point, anchor point and terminal control point. This hardly tells anything useful at all. In fact, first I thought this is about quadratic Bezier curve, which was of course wrong, as it is cubic Bezier instead.

The trick was finally quite simple, I should have though about it before. I just need to match each of those three points with the actual nodes and control points, this I got from within Corel Presentation by checking the cursor position when hovering over the corresponding points.

After knowing the meaning of the triplet points, it is quite easy to adjust the WPG-to-SVG conversion tool. As the proof, shown here the screenshot of two wonderful landscape drawings. On the left side is the WPGs inside WordPerfect Office, on the right side is the converted SVGs shown in Karbon. Quite a perfect conversion so far.

♡ this article? Explore more articles and follow me Twitter.

Share this on Twitter Facebook