Recent

Author Topic: I need help to compile fpvectorial examples  (Read 6976 times)

pfergiu

  • New member
  • *
  • Posts: 8
I need help to compile fpvectorial examples
« on: July 14, 2013, 12:14:18 am »
Hi all
I'm new at Lazarus.
I've tried to compile fpvectorial examples, but I had no luck with this. Then, I visited this link:
http://wiki.freepascal.org/fpvectorial

and there, I found this
https://lazarus-ccr.svn.sourceforge.net/svnroot/lazarus-ccr

Later, I got compilation errors until I found this link
https://github.com/alrieckert/lazarus/blob/master/components/fpvectorial/fpvectorial.pas

So, I downloaded this new version and some examples (i.e. fpvviewer) finally started to work. At least some parts of them.
I'm wondering if there is any updated and compilable version of all this. I'm still fighting with some remaining errors.
I'm specially interested in drawing SVG files.
I'm using revision 41613 of Lazarus.

Thanks in advance,

pfergiu
FPC 2.6.2 - Lazarus v1.0.10 - Revision SVN 41613 - i386-win32-win32/win64

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: I need help to compile fpvectorial examples
« Reply #1 on: July 14, 2013, 05:11:06 am »
There's a lot of missing information: what exactly goes wrong,  FPC version used, operating system etc.

See here
http://www.catb.org/~esr/faqs/smart-questions.html#code
and the link in my signature.

That wiki page states fpvectorial code is included in Lazarus. Did you find it?
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

pfergiu

  • New member
  • *
  • Posts: 8
Re: I need help to compile fpvectorial examples
« Reply #2 on: July 14, 2013, 05:43:04 am »
Thanks for your quick answer, BigChimp.

Sorry, I will read the rules before asking.
Here you go the answers to your questions:

FPC 2.6.2
Lazarus v1.0.10
Revision SVN 41613
i386-win32-win32/win64

Ok, I see now what you mentioned about the wiki page. My mistake.
Thanks for your help.

pfergiu
FPC 2.6.2 - Lazarus v1.0.10 - Revision SVN 41613 - i386-win32-win32/win64

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: I need help to compile fpvectorial examples
« Reply #3 on: July 14, 2013, 06:18:08 am »
@Pfergiu: rules, rules... it's more guidelines ;) Thanks for the info.

Hint: you can put your OS, FPC, Laz version in your forum signature so you don't have to remember to specify it :)

Hope you can get fpvectorial working; if not, the forum is there to help...

Thanks,
BigChimp
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3541
Re: I need help to compile fpvectorial examples
« Reply #4 on: July 14, 2013, 01:04:35 pm »
fpvviewer from subversion is compatible with the latest fpvectorial from the lazarus subversion repository (right now it is compatible with revisions above 41000 or something like that, but this is not a rule, if I make changes it might start working only with even newer revisions). You should download all files of the latest fpvectorial, not only fpvectorial.pas

You can download all of lazarus from svn for example, then fpvectorial is in the folder lazarus/components/fpvectorial

Or only download fpvectorial

pfergiu

  • New member
  • *
  • Posts: 8
Re: I need help to compile fpvectorial examples
« Reply #5 on: July 14, 2013, 05:36:27 pm »
Thanks felipemdc and BigChimp for your help.

I think I'm doing better now ;)

I'm working right now with SVG images, generated by inkscape (version 0.48.4 r9939) and trying to figure out why some images work fine with fpvectorial and others don't.
FPC 2.6.2 - Lazarus v1.0.10 - Revision SVN 41613 - i386-win32-win32/win64

pfergiu

  • New member
  • *
  • Posts: 8
Re: I need help to compile fpvectorial examples
« Reply #6 on: July 17, 2013, 05:26:26 am »
Hi again.
I been debugging the code of fpvectorial for understand how it works and I think I found a tiny improvement.
If you are using milimiters in your svg file, the parser work fine, but if you don't, may be you can get random values for width and height.
Is a minor change for function "StringWithUnitToFloat" of svgvectorialreader.

function TvSVGVectorialReader.StringWithUnitToFloat(AStr: string): Single;
var
  UnitStr, ValueStr: string;
  Len: Integer;
begin
  // Check the unit
  Len := Length(AStr);
  UnitStr := Copy(AStr, Len-1, 2);
  if UnitStr = 'mm' then
  begin
    ValueStr := Copy(AStr, 1, Len-2);
    Result := StrToInt(ValueStr);
  end
  else
    Result := StrToInt(AStr);
end;

I hope this can help.
Regards,

pfergiu

FPC 2.6.2 - Lazarus v1.0.10 - Revision SVN 41613 - i386-win32-win32/win64

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3541
Re: I need help to compile fpvectorial examples
« Reply #7 on: July 28, 2013, 08:31:46 am »
Hello, thanks for the change, but always provide changes as patches against the latest lazarus trunk from SVN.

Instructions here: http://wiki.freepascal.org/Creating_A_Patch

Your case shows very well why this rule exists:

1> It is not possible from your pasted code to see what you changed. If it was in a patch format I could easily see this.
2> The code which you mention has already changed a lot, so the provided improvement makes no sense in the latest code. This explains why patches should be made against the latest lazarus from subversion, not against release like our 1.0.10. There is a large difference between fixes releases and the latest trunk even if a fixes release was released today. Because fix releases do not contain all commits in lazarus trunk.

pfergiu

  • New member
  • *
  • Posts: 8
Re: I need help to compile fpvectorial examples
« Reply #8 on: July 28, 2013, 11:50:56 pm »
Understood. Thank you.
FPC 2.6.2 - Lazarus v1.0.10 - Revision SVN 41613 - i386-win32-win32/win64