Lazarus

Programming => Packages and Libraries => FPvectorial => Topic started by: huberte on May 01, 2012, 09:34:47 pm

Title: fpvectorial example : fpvectorial converter error
Post by: huberte on May 01, 2012, 09:34:47 pm
Either the programm returns an unsupported graphic format for pdf or eps with visualize

or

http://tof.canardpc.com/view/3494fad6-9d89-4e31-991c-8d07c1290886.jpg
Title: Re: fpvectorial example : fpvectorial converter error
Post by: felipemdc on May 05, 2012, 04:44:53 pm
Hello, I haven't seen before this post as it is in the general section, I normally follow mostly more specific sections like "Android" or "FPSpreadsheet". Please attach your EPS file here or in a bug report.

Also, the best for testing is using "fpvviewer", which is located in the Lazarus-CCR/applications/fpvviewer as written here: http://wiki.lazarus.freepascal.org/fpvectorial#fpvviewer

Although indeed fpvectorialconvertor should be ok too for testing.
Title: Re: fpvectorial example : fpvectorial converter error
Post by: huberte on May 05, 2012, 06:54:16 pm
Pretty much kike the error mentioned in the first post (did u see the logscreen ?)

Here another one for fpviewer : http://tof.canardpc.com/view/e3806820-7d9e-41f4-a8e8-2e19525469c5.jpg

and a blank inkscape test file in attachment
Title: Re: fpvectorial example : fpvectorial converter error
Post by: felipemdc on May 06, 2012, 10:02:13 am
Hello, please try with lazarus rev 37184 or superior. I implemented the missing operations but I still had an error in the useless final part of the file, so there I added a work around to give up parsing the useless end of the file from Inkscape.
Title: Re: fpvectorial example : fpvectorial converter error
Post by: huberte on May 06, 2012, 05:10:59 pm
OK, works with a blanck file. Dont work with a libre office draw eps wich I send you through pm.

Screenshot :

http://tof.canardpc.com/view/7b27c67d-3a7e-4b2b-8fde-aa7336bb76d8.jpg

Thks
Title: Re: fpvectorial example : fpvectorial converter error
Post by: felipemdc on May 06, 2012, 06:30:50 pm
I took a look at the file now, and I added support for many things which it uses and were missing: CurrentTransformationMatrix, matrix operations, more arithmetic operations, arrays, etc

But it still gets and error in line 57 in "tm", somehow it failled to mark "tm" to the dictionary. In line 55 there is:

/tm matrix currentmatrix def

But AFAIK this is wrong, it should be:

/tm {matrix currentmatrix} def

It would be nice if someone who knows PostScript very well could explain how "def" can work like that. It looks a really nasty syntax, as it lacks the {} for grouping the commands.

If I make this correction it still crashes in the very end in a loop in a very similar fashion to how it was crashing in the blank file. Well, I guess that this final looping will require some real attention. Just ignoring the problem won't be possible since this file here has the final loops before the comment %%Trailer
Title: Re: fpvectorial example : fpvectorial converter error
Post by: felipemdc on May 06, 2012, 06:38:19 pm
The problems in the end of the file also seam to be related to the syntax issue of:

/tm matrix currentmatrix def
Title: Re: fpvectorial example : fpvectorial converter error
Post by: felipemdc on May 06, 2012, 06:40:45 pm
Aha! I think I figured it out!

With this syntax:

/tm matrix currentmatrix def

It should execute matrix and currentmatrix and then run def against whatever is the result of those operations. With:

/tm {matrix currentmatrix} def

The procedure is stored ... I'll see if I can implement it like this.
Title: Re: fpvectorial example : fpvectorial converter error
Post by: ludob on May 06, 2012, 06:54:13 pm
Aha! I think I figured it out!

With this syntax:

/tm matrix currentmatrix def

It should execute matrix and currentmatrix and then run def against whatever is the result of those operations. With:

/tm {matrix currentmatrix} def

The procedure is stored ... I'll see if I can implement it like this.
Yep, the first defines tm as a matrix representing the current transformation. The second defines a procedure.
Title: Re: fpvectorial example : fpvectorial converter error
Post by: felipemdc on May 06, 2012, 07:29:34 pm
Going through the code my implementation was already doing everything related to "def" correctly, I guess I simply forgot how it worked =)

I only failed in the case of arrays, because I needed to add some extra code for the case of arrays which is a new type of element which I just added...

But even after fixing that it gets stuck elsewhere now...

Maybe you could try another application to generate the EPS. I am adding an example file which renders correctly, that radat.eps, into the example_files folder of fpvviewer and that one was made with OCAD

Another issue is that I don't know if LCL-CustomDrawn will be able to render the complexity of EPS 100% correctly, although we can always try. I checked here and rendering the EPS file freezes LCL-Carbon. In LCL-Qt it works more or less, although not 100%. From what I remember it works 100% correctly in LCL-Win32 and LCL-Gtk2
Title: Re: fpvectorial example : fpvectorial converter error
Post by: felipemdc on May 06, 2012, 07:36:07 pm
@huberte

Can I add that file to the examples folder for fpvviewer? Even if it doesn't render yet, it is always useful to have more tests.
Title: Re: fpvectorial example : fpvectorial converter error
Post by: huberte on May 07, 2012, 02:47:23 am
Yes, well, OK, but only because it's you....  ;D

You think I can load an eps file in an android app with this ? But an eps that would be in the apk ?


Edit : I do have the latest trunk files for lazarus and lazarus-lcr

def_test.eps is crashing : division by zero when pressing visualise
ink-test.eps is crashing : [TvEPSVectorial.ProcessExrpressionToken] Unknown Postscript Command "0" in Line 72
You right. def test is rendering. i will wait for rendering eps on android till I find a solution.