Re: [fpc-pascal] [Lazarus] PDF generator

2016-03-05 Thread Roberto P.
Great! Are metadata included ? Thanks, R. 2016-03-05 18:27 GMT+01:00 Michael Van Canneyt : > Hi, > > I have committed a PDF generator to FPC Subversion: fcl-pdf. > > Why a new pascal PDF generator ? Mainly because the existing ones written > in Object Pascal suffer from > several disadvantages

Re: [fpc-pascal] PDF generator

2016-03-05 Thread che fou
awesome , many thanks ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] AnsiCompareStr question (again...)

2016-03-05 Thread Tomas Hajny
On Sat, March 5, 2016 23:51, Bart wrote: > On 3/5/16, Jonas Maebe wrote: > >> One probably includes cwstring, while the other one doesn't. >> AnsiCompareStr can be intercepted/replaced by widestring manages such as >> cwstring. > > Sample from above on Linux 32-bit: > [bart@localhost ConsoleProjec

Re: [fpc-pascal] Bitcounting

2016-03-05 Thread Bart
On 3/5/16, Jonas Maebe wrote: > The "compilerproc" modifier does not influence code generation other > than symbol mangling. You can just look at the implementation in the > system unit like for any other routine. Lazarus code-tools didn't get me there ;-) Found it in compilerproc.inc. Thanks.

Re: [fpc-pascal] AnsiCompareStr question (again...)

2016-03-05 Thread Bart
On 3/5/16, Jonas Maebe wrote: > One probably includes cwstring, while the other one doesn't. > AnsiCompareStr can be intercepted/replaced by widestring manages such as > cwstring. Sample from above on Linux 32-bit: [bart@localhost ConsoleProjecten]$ ./test AnsiCompareStr('C-C','C=C') = -16 Same

Re: [fpc-pascal] Bitcounting

2016-03-05 Thread Jonas Maebe
On 05/03/16 23:12, Bart wrote: On 3/5/16, Jonas Maebe wrote: >FPC 3.x has system.popcnt Thanks. I see it's a compilerproc. How can I see how it'simplemented? The "compilerproc" modifier does not influence code generation other than symbol mangling. You can just look at the implementation i

Re: [fpc-pascal] Bitcounting

2016-03-05 Thread Bart
On 3/5/16, Jonas Maebe wrote: > FPC 3.x has system.popcnt Thanks. I see it's a compilerproc. How can I see how it'simplemented? Bart ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-p

Re: [fpc-pascal] How do I test the testfppdf on Windows?

2016-03-05 Thread Michael Van Canneyt
On Sat, 5 Mar 2016, silvioprog wrote: On Sat, Mar 5, 2016 at 5:24 PM, Ralf Quint wrote: On 3/5/2016 12:03 PM, Michael Van Canneyt wrote: This is what I get with the normal test font: http://www.freepascal.org/~michael/test.pdf FYI, Opening up this document with the latest Adobe Reader

Re: [fpc-pascal] TFPTimer wtih timer_create

2016-03-05 Thread Michael Van Canneyt
On Sat, 5 Mar 2016, Fabio Luis Girardi wrote: Lazarus/Freepascal has some config to ignore a signal? No, you must install this yourself using the unix,baseunix units. Michael. 2016-03-05 15:34 GMT-03:00 Michael Van Canneyt : On Sat, 5 Mar 2016, Fabio Luis Girardi wrote: Hi all! I'm

Re: [fpc-pascal] How do I test the testfppdf on Windows?

2016-03-05 Thread silvioprog
On Sat, Mar 5, 2016 at 5:24 PM, Ralf Quint wrote: > On 3/5/2016 12:03 PM, Michael Van Canneyt wrote: > >> >> This is what I get with the normal test font: >> http://www.freepascal.org/~michael/test.pdf >> >> FYI, > > Opening up this document with the latest Adobe Reader DC > (15.10.20059.40980, o

Re: [fpc-pascal] How do I test the testfppdf on Windows?

2016-03-05 Thread silvioprog
On Sat, Mar 5, 2016 at 5:03 PM, Michael Van Canneyt wrote: > > On Sat, 5 Mar 2016, silvioprog wrote: > > Hm. I tried many PDF readers on the file. All unix based (okular, >>> openoffice), but also the Google docs PDF viewer and Firefox PDF reader. >>> All displayed the PDF just fine. >>> >>> >> No

Re: [fpc-pascal] TFPTimer wtih timer_create

2016-03-05 Thread Fabio Luis Girardi
Lazarus/Freepascal has some config to ignore a signal? 2016-03-05 15:34 GMT-03:00 Michael Van Canneyt : > > > On Sat, 5 Mar 2016, Fabio Luis Girardi wrote: > > Hi all! >> >> I'm searching a way to implement a TFPTimer that don't uses threads. On >> Linux and FreeBSD I found the timer_create and f

Re: [fpc-pascal] How do I test the testfppdf on Windows?

2016-03-05 Thread Ralf Quint
On 3/5/2016 12:03 PM, Michael Van Canneyt wrote: This is what I get with the normal test font: http://www.freepascal.org/~michael/test.pdf FYI, Opening up this document with the latest Adobe Reader DC (15.10.20059.40980, on Windows 8.1/64), I get an error message saying "The font 'Times' c

Re: [fpc-pascal] How do I test the testfppdf on Windows?

2016-03-05 Thread Michael Van Canneyt
On Sat, 5 Mar 2016, silvioprog wrote: Hm. I tried many PDF readers on the file. All unix based (okular, openoffice), but also the Google docs PDF viewer and Firefox PDF reader. All displayed the PDF just fine. Now I tried on Google PDF viewer, no errors, but: https://dl.dropboxusercontent.

Re: [fpc-pascal] AnsiCompareStr question (again...)

2016-03-05 Thread Jonas Maebe
On 05/03/16 20:27, Marcou Gilles wrote: this is strange. Using you example I got the value -16. I am using fpc 2.6.4 on a Linux 64 bits machine. I do not get why I got a different value than you. And in my case, the strange behavior is that AnsiCompareStr in the same unit but in two different app

Re: [fpc-pascal] How do I test the testfppdf on Windows?

2016-03-05 Thread silvioprog
On Sat, Mar 5, 2016 at 3:58 PM, Michael Van Canneyt wrote: > On Sat, 5 Mar 2016, silvioprog wrote: > >> On Sat, Mar 5, 2016 at 3:38 PM, silvioprog wrote: >> >>> Hello, >>> >>> I just created the folder "fonts" and copied the >>> "C:\Windows\Fonts\arial.ttf" into that, so I changed the line >>> "

Re: [fpc-pascal] How do I test the testfppdf on Windows?

2016-03-05 Thread silvioprog
On Sat, Mar 5, 2016 at 3:56 PM, Michael Van Canneyt wrote: > > On Sat, 5 Mar 2016, silvioprog wrote: > >> Hello, >> >> I just created the folder "fonts" and copied the >> "C:\Windows\Fonts\arial.ttf" into that, so I changed the line >> "D.AddFont('FreeSans.ttf', 'FreeSans-12' to "D.AddFont('arial.

Re: [fpc-pascal] AnsiCompareStr question (again...)

2016-03-05 Thread Marcou Gilles
Thanks Bart, this is strange. Using you example I got the value -16. I am using fpc 2.6.4 on a Linux 64 bits machine. I do not get why I got a different value than you. And in my case, the strange behavior is that AnsiCompareStr in the same unit but in two different application gave two different

Re: [fpc-pascal] Bitcounting

2016-03-05 Thread Santiago A.
El 05/03/16 a las 19:03, Bart escribió: > Hi, > > Does FreePascal have a routine for counting bits? > So that e.g. BitCount(%100110011) gives 5 (number of bits that are 1)? > > I came up with (extracted from IntToBin()): > > function BitCount(N: Int64): Integer; > var > Q: QWord; > i: Integ

Re: [fpc-pascal] How do I test the testfppdf on Windows?

2016-03-05 Thread Michael Van Canneyt
On Sat, 5 Mar 2016, silvioprog wrote: On Sat, Mar 5, 2016 at 3:38 PM, silvioprog wrote: Hello, I just created the folder "fonts" and copied the "C:\Windows\Fonts\arial.ttf" into that, so I changed the line "D.AddFont('FreeSans.ttf', 'FreeSans-12' to "D.AddFont('arial.ttf', 'Arial", however

Re: [fpc-pascal] How do I test the testfppdf on Windows?

2016-03-05 Thread Michael Van Canneyt
On Sat, 5 Mar 2016, silvioprog wrote: Hello, I just created the folder "fonts" and copied the "C:\Windows\Fonts\arial.ttf" into that, so I changed the line "D.AddFont('FreeSans.ttf', 'FreeSans-12' to "D.AddFont('arial.ttf', 'Arial", however, when I try to run the project, I get a SIGSEGV: #0

Re: [fpc-pascal] How do I test the testfppdf on Windows?

2016-03-05 Thread silvioprog
On Sat, Mar 5, 2016 at 3:38 PM, silvioprog wrote: > Hello, > > I just created the folder "fonts" and copied the > "C:\Windows\Fonts\arial.ttf" into that, so I changed the line > "D.AddFont('FreeSans.ttf', 'FreeSans-12' to "D.AddFont('arial.ttf', > 'Arial", however, when I try to run the project,

[fpc-pascal] How do I test the testfppdf on Windows?

2016-03-05 Thread silvioprog
Hello, I just created the folder "fonts" and copied the "C:\Windows\Fonts\arial.ttf" into that, so I changed the line "D.AddFont('FreeSans.ttf', 'FreeSans-12' to "D.AddFont('arial.ttf', 'Arial", however, when I try to run the project, I get a SIGSEGV: #0 WRPR_$SYSTEM_$$_TINTERFACEDOBJECT_$_IUNKNO

Re: [fpc-pascal] TFPTimer wtih timer_create

2016-03-05 Thread Michael Van Canneyt
On Sat, 5 Mar 2016, Fabio Luis Girardi wrote: Hi all! I'm searching a way to implement a TFPTimer that don't uses threads. On Linux and FreeBSD I found the timer_create and family functions. My question is: What these functions has wrong? Nothing except that they are not cross platform. O

[fpc-pascal] TFPTimer wtih timer_create

2016-03-05 Thread Fabio Luis Girardi
Hi all! I'm searching a way to implement a TFPTimer that don't uses threads. On Linux and FreeBSD I found the timer_create and family functions. My question is: What these functions has wrong? Or the use of these functions should be avoided? Or because simply nobody want to do that? -- The best

Re: [fpc-pascal] Bitcounting

2016-03-05 Thread Jonas Maebe
On 05/03/16 19:03, Bart wrote: Does FreePascal have a routine for counting bits? So that e.g. BitCount(%100110011) gives 5 (number of bits that are 1)? FPC 3.x has system.popcnt Jonas ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org h

Re: [fpc-pascal] Bitcounting

2016-03-05 Thread Jeppe Johansen
The PopCount functions do exactly that. On 03/05/2016 07:03 PM, Bart wrote: Hi, Does FreePascal have a routine for counting bits? So that e.g. BitCount(%100110011) gives 5 (number of bits that are 1)? I came up with (extracted from IntToBin()): function BitCount(N: Int64): Integer; var

Re: [fpc-pascal] Bitcounting

2016-03-05 Thread Martin
On 05/03/2016 18:03, Bart wrote: Hi, Does FreePascal have a routine for counting bits? So that e.g. BitCount(%100110011) gives 5 (number of bits that are 1)? I came up with (extracted from IntToBin()): Have a look at http://stackoverflow.com/questions/3815165/how-to-implement-bitcount-usi

Re: [fpc-pascal] Bitcounting

2016-03-05 Thread Philippe Lévi
sorry ... need change intToStr in my suggestion by something like intToStrBin length( strChange( intToStrBin( N, '0', '')); but it is just for fun! De: fpc-pascal-boun...@lists.freepascal.org em nome de Bart Enviado: sábado, 5 de março de 2016 15:03 Pa

Re: [fpc-pascal] Bitcounting

2016-03-05 Thread Philippe Lévi
pseudocode length( strChange( intToStr( N), '0', '')); De: fpc-pascal-boun...@lists.freepascal.org em nome de Bart Enviado: sábado, 5 de março de 2016 15:03 Para: FPC-Pascal users discussions Assunto: [fpc-pascal] Bitcounting Hi, Does FreePascal have a

[fpc-pascal] Bitcounting

2016-03-05 Thread Bart
Hi, Does FreePascal have a routine for counting bits? So that e.g. BitCount(%100110011) gives 5 (number of bits that are 1)? I came up with (extracted from IntToBin()): function BitCount(N: Int64): Integer; var Q: QWord; i: Integer; begin Result := 0; Q := QWord(N); for i := 0 to (

[fpc-pascal] PDF generator

2016-03-05 Thread Michael Van Canneyt
Hi, I have committed a PDF generator to FPC Subversion: fcl-pdf. Why a new pascal PDF generator ? Mainly because the existing ones written in Object Pascal suffer from several disadvantages: - Font support usually incomplete or downright buggy. - Dependency on a GUI (LCL, VCL, Windows). The l

[fpc-pascal] Trapping distant exceptions

2016-03-05 Thread Mark Morgan Lloyd
I'm sure I should know this, and think it's an FAQ, and I'm pretty sure somebody (Graeme?) was discussing it recently. Assuming that an exception handler at the end of a thread procedure has a reliable way of communicating messages with the outside World, what's the preferred way of recovering

Re: [fpc-pascal] AnsiCompareStr question (again...)

2016-03-05 Thread Bart
On 3/5/16, Marcou Gilles wrote: > I checked the AnsiCompareStr value between these two string and found > that the same unit compiled into one application give the value 16 and > compiled into the other application, it return the value -28. {$apptype console} {$ifdef fpc} {$mode objfpc} {$h+} /

[fpc-pascal] AnsiCompareStr question (again...)

2016-03-05 Thread Marcou Gilles
Hi, in an application, I use a TStringList.Sort to sort a list of these two words "(C-C)" and "(C=C)". When I use the same unit in another project, the Sort function sort those two strings in revert order (on the same computer, same system). I checked the AnsiCompareStr value between these two st