[Lazarus] Code tools error

2016-05-23 Thread Michael Van Canneyt


The lazarus codetools choke on this:

  {$SCOPEDENUMS ON}
  Tsensitivity = (normal,personal,private,confidential);

msgraph.pas(232,35) Error: identifier expected, but private found

Compiler accepts it.

Reported as issue #30172 in mantis.

Michael.


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] HEAPTRACE IFDEF

2016-05-03 Thread Michael Van Canneyt



On Tue, 3 May 2016, Aradeonas wrote:


We do have documentation, you know. Is it so much to ask to
look at it ?



http://www.freepascal.org/docs-html/current/prog/progsu128.html

No it is not but it is not came to my searches and FPC documentation is
not much good for searching at least from google and if I know what I
want I couldn't guess there is such like this ability and one way I will
be left to know about this is that is reading doc for fun everyday like
a book and keep reading it's changelog!


I don't know what you typed in Google, but it definitely shows it:

Google search:

"conditional compilation free pascal"

Entry 4. But entries 1-3 also will lead  you the answer.

And the documentation changes only once per release. 
No-one asks you to read it daily.



UseHeapTrace is a variable in unit heaptrc, which is silently used
when compiling with -gh.

Thanks for the explanation.

$IF DECLARED is not supported by codetools.

Should I report it as a bug or it already reported?


IMHO it is useless to report it for this case.

As I tried to explain: it cannot be done *correct* by the codetools.

It depends, for example, on actual compiler options. 
So, in case of lazarus, it depends on build modes.

It can also depend on @someconfig.cfg compiler options files. etc.

At best, the codetools can make a guess.

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] HEAPTRACE IFDEF

2016-05-03 Thread Michael Van Canneyt



On Tue, 3 May 2016, Aradeonas wrote:


AFAIK, it's because it's not technically possible.

As an amateur can I ask why?

Use {$IF DECLARED(useheaptrace)} in your main project file (just like
lazarus.pp uses it).

Very interesting! I didnt know this ability,Thanks. How it works? what
key names it has?


We do have documentation, you know. Is it so much to ask to look at it ?

http://www.freepascal.org/docs-html/current/prog/progsu128.html



But it has a problem, if you use this define IDE wont color it properly
like you use normal defines, it that case it if define is not true it
will pale.


The IDE cannot do this, since it is known only when the compiler is invoked.

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] How to clear screen in console app

2016-04-23 Thread Michael Van Canneyt



On Sat, 23 Apr 2016, Bo Berglund wrote:


On Sat, 23 Apr 2016 08:10:09 +, Mark Morgan Lloyd
 wrote:


I don't know whether the ClrScr procedure refers to libtinfo, or what
properties libtinfo thinks the debug window has. It could probably be
argued that the debug window should set TERM to indicate that it doesn't
obey commands, but I'd suggest that if the program does a ClrScr then
the programmer wants notification of this and it should probably /not/
wipe earlier debug output. After all, the debug window is there for
debugging, not for normal interaction.



I am comparing to how it works in Delphi (7)...
When I program a console program in Delphi and run it from within the
IDE it creates the console window and the interactions are shown
there.
All Writeln() output shows up as is and the program stops for input on
ReadLn() commands etc.

When I started my program in Lazarus nothing showed up at all so I had
to google for it and then I was directed towards the menu
"View/Debug Windows/Terminal Output" which displays a window titled
"Console".
This is the window I refer to and it does not behave like the real
terminal...


No, it does not. Because it is not a real terminal and does not obey the
ANSI codes to control the terminal.

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] How to clear screen in console app

2016-04-23 Thread Michael Van Canneyt



On Sat, 23 Apr 2016, Mark Morgan Lloyd wrote:


Michael Van Canneyt wrote:

On Sat, 23 Apr 2016, Bo Berglund wrote:


On Sat, 23 Apr 2016 07:32:55 +0200, Bo Berglund
<bo.bergl...@gmail.com> wrote:


I need to make a console app that can run on Linux.
It would be a simple thing I believed, but no...

I cannot get the ClrScr command working, it just puts strange
characters on the screen instead of clearing it.

...

But the console debug window just shows a bunch of control characters
(square with 001B inside) plus [6n [H [m [H [2JEnter command:
And every command I enter results in a new line being displayed rather
than staying on the same line and erasing the previous output.


UPDATE:
It seems to be caused by the Lazarus debug console window!
If I go to the dir where the program resides in my terminal (both
local and via SSH) and execute ~/tmp/project1 then it looks OK.

So my question now changes to:
Why does the debug window show different output than the actual
terminal console?

I am using Lazarus 1.6 release and fpc 3.0.0 both built from svn
sources on a Raspberry Pi3 with Raspbian Jessie if that matters.


The console respects the special terminal control characters.
The debug window does not respect these characters, and just prints them 
out

to screen. I am not sure this can be properly handled. Maybe there is an
option that can be given to xterm to respect the characters.

If you are debugging using SSH, then you probably need to add the -t 
option.


The console window in which the shell and app run might have different 
commands, depending on what's actually being used (i.e. xterm, an SSH session 
from a remote system and so on). The console window will have an associated 
$TERM shell description, and strictly speaking the program that wants to 
clear the screen should refer to this possibly using curses or libtinto.


I don't know whether the ClrScr procedure refers to libtinfo,


No. It just uses ansi escape characters.

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] How to clear screen in console app

2016-04-23 Thread Michael Van Canneyt



On Sat, 23 Apr 2016, Bo Berglund wrote:


On Sat, 23 Apr 2016 07:32:55 +0200, Bo Berglund
 wrote:


I need to make a console app that can run on Linux.
It would be a simple thing I believed, but no...

I cannot get the ClrScr command working, it just puts strange
characters on the screen instead of clearing it.

...

But the console debug window just shows a bunch of control characters
(square with 001B inside) plus [6n [H [m [H [2JEnter command:
And every command I enter results in a new line being displayed rather
than staying on the same line and erasing the previous output.


UPDATE:
It seems to be caused by the Lazarus debug console window!
If I go to the dir where the program resides in my terminal (both
local and via SSH) and execute ~/tmp/project1 then it looks OK.

So my question now changes to:
Why does the debug window show different output than the actual
terminal console?

I am using Lazarus 1.6 release and fpc 3.0.0 both built from svn
sources on a Raspberry Pi3 with Raspbian Jessie if that matters.


The console respects the special terminal control characters.
The debug window does not respect these characters, and just prints them out
to screen. I am not sure this can be properly handled. Maybe there is an
option that can be given to xterm to respect the characters.

If you are debugging using SSH, then you probably need to add the -t option.

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] how to check if the same identifier appear in more than 1 unit of the project?

2016-04-20 Thread Michael Van Canneyt



On Wed, 20 Apr 2016, Graeme Geldenhuys wrote:


On 2016-04-20 08:32, Dennis wrote:

Is there any tool to find out ?


Multiple options:

* Do a "Find in Files" search.

* In Lazarus, place the edit cursor inside the identifier. Right Click
 and select "Find declaration of ". Do that in a few units where
 the identifier is used, and see if the same declaration is shown.


IMHO you can better use the code browser for this.

Set scope to Project,  'with required packages' scans recursively.

after Show Identifiers type the identifier.

It just misses 'whole words only'...

I find it easier than the find in files:
Till project groups finally work and find in files is extended to use
'project group' scope, the code browser seems the best tool.

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] fcl-web or BrookFramework queryfields array

2016-04-15 Thread Michael Van Canneyt



On Fri, 15 Apr 2016, Leonardo M. Ramé wrote:




El 15/04/16 a las 16:22, Michael Van Canneyt escribió:



On Fri, 15 Apr 2016, Leonardo M. Ramé wrote:


Hi, I need to extract the field values of a GET query of type:

http://127.0.0.1/cgi-bin/test.cgi?fields[1]=f1value[2]=f2value

Is there a way to handle this apart from HttpRequest.QueryFields?


What other way would you like ? What is not good about this way ?

Michael.


It works pefectly por param=value&..., but I don't know how to parse array 
type values.


example: ?filters[0]['filter']=name[0]['value']=john


What is the problem ? Everything before a = is the name ?

So:

Name:=Request.QueryFields.values['filters[0][''filter'']'];
Value:=Request.QueryFields.values['filters[0][''value'']'];

It doesn't automatically convert them to arrays, obviously.
For that you need to know how the array (in this case double array) is encoded.

Microsoft uses() in it's query names, like in:

?filters(0,'filter')=name(0,'value')=john

I see no need to provide routines for this.

Michael.--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] fcl-web or BrookFramework queryfields array

2016-04-15 Thread Michael Van Canneyt



On Fri, 15 Apr 2016, Leonardo M. Ramé wrote:


Hi, I need to extract the field values of a GET query of type:

http://127.0.0.1/cgi-bin/test.cgi?fields[1]=f1value[2]=f2value

Is there a way to handle this apart from HttpRequest.QueryFields?


What other way would you like ? What is not good about this way ?

Michael.--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] [FEATURE REQUEST] Source Editor: jump to the marked line by clicking on it

2016-04-14 Thread Michael Van Canneyt



On Thu, 14 Apr 2016, Alan Corey wrote:


It would be nice if these marks could accept clicks, allowing the
programmer to jump to the marked line just by clicking on it.



I thought in Delphi you could double-click on an error message to jump
to the line where it was, but maybe I misremembered.



You can. and in lazarus too. this is about the right gutter of the source
editor.

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] [FEATURE REQUEST] Source Editor: jump to the marked line by clicking on it

2016-04-14 Thread Michael Van Canneyt



On Thu, 14 Apr 2016, Ondrej Pokorny wrote:


On 14.04.2016 17:22, silvioprog wrote:
The new Source Editor shows small marks as illustrated in the attached 
picture. These marks are put in the exactly source line when it has 
warning, hints, errors, notes etc. However, in the current trunk version, 
you need to roll the scrollbar to go to the marked line.


It would be nice if these marks could accept clicks, allowing the 
programmer to jump to the marked line just by clicking on it.


Is anybody interested in this feature too? If so, I can issue it at 
bugtracker.


Looks like a nice enhancement. You are welcome to take initiative :)


Absolutely. I was surprised to find it wasn't so to begin with :-)

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] fpPDF: cannot embed DejaVu font

2016-04-13 Thread Michael Van Canneyt



On Wed, 13 Apr 2016, Ondrej Pokorny wrote:


On 13.04.2016 18:06, Michael Van Canneyt wrote:



On Wed, 13 Apr 2016, Ondrej Pokorny wrote:


On 13.04.2016 17:52, Michael Van Canneyt wrote:


I prefer more options, it gives more fine-grained control.

We can make a
  CompressAll = [poCompressText, poCompressFonts, poCompressImages];
constant if you want, which will be kept up-to-date with all compression
options.


No, not needed. As I said, it's not that important.

Still could you please use poUseRawJPEG by default in TPDFDocument.Create? 
IMO poUseRawJPEG is very useful - it reduces both processing time because 
JPEG images don't have to be resampled by fpPDF and also keeps the 
exported PDF small.


I prefer not to, because of several reasons:
- it depends on 3.1 features.


No. In 3.1 the size detection is just faster/better.


Yes. 
So in 3.0 there is no time gain. You read the image anyway.

The detection works by reading the whole image, because it needs the size.




- It forces the examination of all added images.
  Examining is a waste of time for me, since I do not use JPEG, only PNG.


No. The only check it does more is "Handler.InheritsFrom(TFPReaderJPEG)". I 
don't think it is that time-consuming.


If you know you will have JPEG, you can use the JPEG function.




In each case, for an advanced user as you, I would expect that the first
thing you do is create a TOndrejPDFDocument subclass (or whatever the 
name). You can set all options there to defaults that you like. (I subclass 
all components I use for exactly such reasons)


Of course enabling it for myself isn't a problem. The problem is that I don't 
see any advantage disabling poUseRawJPEG and enabling poCompressImages by 
default - there is no :)


Sure. When 3.0.4 is out, then we can switch the default.

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] fpPDF: cannot embed DejaVu font

2016-04-13 Thread Michael Van Canneyt



On Wed, 13 Apr 2016, Ondrej Pokorny wrote:


On 13.04.2016 17:52, Michael Van Canneyt wrote:


I prefer more options, it gives more fine-grained control.

We can make a
  CompressAll = [poCompressText, poCompressFonts, poCompressImages];
constant if you want, which will be kept up-to-date with all compression
options.


No, not needed. As I said, it's not that important.

Still could you please use poUseRawJPEG by default in TPDFDocument.Create? 
IMO poUseRawJPEG is very useful - it reduces both processing time because 
JPEG images don't have to be resampled by fpPDF and also keeps the exported 
PDF small.


I prefer not to, because of several reasons:
- it depends on 3.1 features.
- It forces the examination of all added images.
  Examining is a waste of time for me, since I do not use JPEG, only PNG.
- I want the user to know and understand what he is doing.
  You do, but most will not (or so I think at first sight).
  By forcing them to enable some options, they will at least think about it.
  (or so I hope ;) )

In each case, for an advanced user as you, I would expect that the first
thing you do is create a TOndrejPDFDocument subclass (or whatever the name). 
You can set all options there to defaults that you like. 
(I subclass all components I use for exactly such reasons)


Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] fpPDF: cannot embed DejaVu font

2016-04-13 Thread Michael Van Canneyt



On Wed, 13 Apr 2016, Ondrej Pokorny wrote:


On 13.04.2016 13:42, Michael Van Canneyt wrote:

The support for compressed images and embedding of raw JPEG is in SVN too,
sample program adapted to demonstrate this (-i -j command line options).


Thank you very much!

Just 2 points:

1.) Is the "Writeln('Compressing : ',poCompressImages in Owner.Options);" 
line wanted/necessary? Maybe you forgot {$ifdef gdebug}?


I will look at it ASAP.



2.) Don't we have too much TPDFOptions for compressing? In the future raw PNG 
embedding may be added and thus poUseRawPNG will be added (?). Maybe 
poUseRawJPEG can be omitted and replaced by poCompressImages?


No, they do different things.

Also 3 options for compressing "poCompressText, poCompressFonts, 
poCompressImages" seem to be useless for me. I either want to compress 
everything to get a small file or compress nothing to get a fast file.


I prefer more options, it gives more fine-grained control.

We can make a
  CompressAll = [poCompressText, poCompressFonts, poCompressImages];
constant if you want, which will be kept up-to-date with all compression
options.

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] fpPDF: cannot embed DejaVu font

2016-04-13 Thread Michael Van Canneyt



On Wed, 13 Apr 2016, José Mejuto wrote:


El 13/04/2016 a las 13:42, Michael Van Canneyt escribió:


The support for compressed images and embedding of raw JPEG is in SVN too,
sample program adapted to demonstrate this (-i -j command line options).



Hello,

Does the library detect the same image used multiple times ?


You must add images manually in a list.
Drawing an image means: "draw image N here at (X,Y)"
It is up to you to add an image only once and re-use that.

In the past I 
was using a pdf generator for a report that has an image as background 
watermark. The report could be more than 100 pages and the pdf was 
multi-megabyte because the library adds each page watermark as a new graphic 
object, instead reuse the same object.


The fpreport engine will add the image only once and will reuse it.

Michael.--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] FLC-PDF and LazReport

2016-04-13 Thread Michael Van Canneyt



On Wed, 13 Apr 2016, Michael W. Vogel wrote:


Am 08.04.2016 um 23:40 schrieb Graeme Geldenhuys:


I've written a PDF export filter, using fcl-pdf, for the fpReport (Free
Pascal Reporting) project that will be released some time this year.
fpReport still needs to bake a bit longer. ;-)  There are more features
coming in fpPDF too.

Regards,
   - Graeme -

Very interesting!

Could you say something about fpReport? Is it a choice for LazReport or what 
is it for? Does it becomes part of FPC?


It becomes part of FPC. It is a banded reporting engine that does not depend
on any GUI widgetset. It needs to be usable in a headless webserver.

The feature set is roughly the one of Lazreport, but of course other 
enhancements
are planned. 
The fact that it is unit tested should already be an enhancement by itself :)


It will use a JSON file as input (or you can build it in code entirely), 
and will create various kinds of output, where initially we will make a 
PDF output engine.


We have already succesfully created test PDFs based on the engine, but we are
waiting to commit this to FPC till the first production reports are ready.

Currently there is no GUI designer yet, but this is planned; I think that
creating a designer should not be a big problem given the RTTI controls that
exist in Lazarus.

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] fpPDF: cannot embed DejaVu font

2016-04-13 Thread Michael Van Canneyt



On Wed, 13 Apr 2016, Graeme Geldenhuys wrote:


On 2016-04-13 10:54, Ondrej Pokorny wrote:

Am I doing something wrong or is this a bug in fpPDF?


It's a bug. The BaseFont, FontName and FontFamily names (in fact any
PDFName elemens) may not contain spaces and should be escaped (or
encoded). I've fixed it locally, and the patch should be in FPC
hopefully some time today.

Thanks for reporting the issue.


Patch is in FPC svn: rev 33495.

The support for compressed images and embedding of raw JPEG is in SVN too,
sample program adapted to demonstrate this (-i -j command line options).

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] fpPDF: set clip rect for text

2016-04-13 Thread Michael Van Canneyt



On Wed, 13 Apr 2016, Graeme Geldenhuys wrote:


On 2016-04-13 12:07, Michael Van Canneyt wrote:

If the PDF format does not support some form of clipping natively,
then it should not go in fpPDF.



PDF supports native clipping on all graphic elements. Glyphs are part of
the graphic elements.


Excellent, no problem then :-)

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] fpPDF: set clip rect for text

2016-04-13 Thread Michael Van Canneyt



On Wed, 13 Apr 2016, Graeme Geldenhuys wrote:


On 2016-04-12 20:25, Ondrej Pokorny wrote:

I need to clip text (e.g. in a table column). Is this already supported?


No, I haven't done any work on using the clipping operators yet. In
fpReport, text is rather wrapped than clipped.

Contributions in this regard are obviously very welcome. I would imagine
if the clipping operators are to be implemented, then graphics state
(save & restore) would probably go hand-in-hand with the clipping too.



A small remark:

If the PDF format does not support some form of clipping natively, then it 
should not go in fpPDF.

But it should instead be implemented in a layer on top of fppdf, such as the 
planned TPDFCanvas.

Keep your designs orthogonal, please.

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] PDF generator: please test

2016-04-10 Thread Michael Van Canneyt



On Sun, 10 Apr 2016, Graeme Geldenhuys wrote:


On 2016-04-10 08:15, Michael Van Canneyt wrote:

Wow, let me interfere here before we go in a wrong direction:

The public API should not depend on the selected font.


I know. The current implementation gravitated towards the situation we
have now, but that is definitely not how it is going to end up. Like I
mentioned in one of my earlier replies, we will end up with overloaded
WriteText() calls only, and internally the fpPDF code will sort out what
font code to generate. Up to now, one of my high priority was figuring
out font embedding and handling of ASCII and Unicode text - this task
seems complete (except for the Unicode range above BMP which still needs
some minor attention).

These should all be addressed in the next round of updates.


OK, seems we are of the same mind, I just wanted to make sure of that :-)

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] PDF generator: please test

2016-04-10 Thread Michael Van Canneyt



On Sun, 10 Apr 2016, Dmitry Boyarintsev wrote:


On Sun, Apr 10, 2016 at 3:15 AM, Michael Van Canneyt <mich...@freepascal.org

wrote:


It feels like, these two paragraphs:



The user of the API should not have to care what font is used.
the API should do whatever is necessary to emit correct PDF for the
current font.

If internally there are different calls needed for different fonts, then
that is OK, but they should not be exposed to the user, at the best they
should be made protected.
(if need be, we can expose them later)



contradict to:



If the currently used font does not contain the necessary glyphs to
represent
the text, we will not check it, that is the responsability of the user.


No, why ? One is about encoding of the supplied text.

The other about whether the current font has the necessary glyphs to render
the text.


The APIs should either do the font-substitution  (with whatever level  of
control from the user side). (something what graphic APIs are doing for
text rendering)
or should not do them at all (leaving full font-substitution to the user)


The latter. KISS (keep it simple, stupid) is my motto.

Font substitution is a potentially huge subject. 
I would not want this in the initial low-level API.


But I agree with you that additional apis for this can be very useful and
should be put on the todo list.

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] PDF generator: please test

2016-04-10 Thread Michael Van Canneyt



On Sun, 10 Apr 2016, Graeme Geldenhuys wrote:


On 2016-04-09 09:09, Ondrej Pokorny wrote:

   P.WriteText(25, 0, 'Sample Text'); // DOESN'T WORK !!!


Indeed. As I mentioned, the Write*Text() names are a bit inaccurate and
will be improved. At the moment WriteText() is meant for the Standard
PDF Fonts, and WriteUTF8Text() for any TTF fonts used.


Wow, let me interfere here before we go in a wrong direction:

The public API should not depend on the selected font.

WriteText() is meant for Ansi text - whatever the current font.
WriteUTF8Text() is meant for UTF8 encoded unicode text, whatever the current 
font.

The user of the API should not have to care what font is used.
the API should do whatever is necessary to emit correct PDF for the current 
font.

If internally there are different calls needed for different fonts, then
that is OK, but they should not be exposed to the user, at the best they should 
be made protected.
(if need be, we can expose them later)

If the currently used font does not contain the necessary glyphs to represent
the text, we will not check it, that is the responsability of the user.

Michael.


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] PDF generator: please test

2016-04-09 Thread Michael Van Canneyt



On Sat, 9 Apr 2016, Graeme Geldenhuys wrote:


On 2016-04-09 18:27, Ondrej Pokorny wrote:

As is the
text width function (for right/center alignment support).


That is already implemented in fpReport (Standard PDF built-in fonts and
TTF fonts). What I haven't implemented yet is Font Kerning to make the
width calculation even more accurate, but the width difference will be
very minor. I can take a look and see if it makes sense to move that
code to fpPDF. I'm pretty sure it shouldn't be a problem.


Graeme,

If that can be moved to unit fpttf instead of fppdf, then that would be even 
better.

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] PDF generator: please test

2016-04-09 Thread Michael Van Canneyt



On Sat, 9 Apr 2016, Ondrej Pokorny wrote:


I think I'll develop a TPDFDocument->TCanvas renderer for
previewing created PDF documents.

Great. I should then be able to plug that into fpReport too. I want to
implement a PDF & fpReport -> AggPas renderer too.


We should then try to omit unnecessary double work. I see that AggPas should 
be able to render TTF fonts already. Why do you need fpTTF and fpParseTTF 
then?


Because one of the requirements is not to depend on external libraries.
AggPas uses the freetype library to render TTF.

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] PDF generator: please test

2016-04-09 Thread Michael Van Canneyt



On Sat, 9 Apr 2016, Ondrej Pokorny wrote:


On 09.04.2016 19:00, Michael Van Canneyt wrote:

On Sat, 9 Apr 2016, Ondrej Pokorny wrote:

I see that the PDF generator doesn't support image compression. This is a 
no-go in my eyes. Is anybody working on that or should I try to study it?


We are not yet working on this, it was on the TODO list, but not very high
priority.



AFAIR SynPDF uses JPEG compression for images.


Patches will gladly be accepted.


Great, I'll take a look into it. It is high priority for me. As is the text 
width function (for right/center alignment support).


Maybe Graeme can comment on the latter, as far as I know, that should work ?



If there is a possibility to render text with custom TTF font in Lazarus (I 
found easylazfreetype, but I couldn't make it work with my first attempts), I 
think I'll develop a TPDFDocument->TCanvas renderer for previewing created 
PDF documents.


That would be really awesome !

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] PDF generator: please test

2016-04-09 Thread Michael Van Canneyt



On Sat, 9 Apr 2016, Ondrej Pokorny wrote:

I see that the PDF generator doesn't support image compression. This is a 
no-go in my eyes. Is anybody working on that or should I try to study it?


We are not yet working on this, it was on the TODO list, but not very high
priority.



AFAIR SynPDF uses JPEG compression for images.


Patches will gladly be accepted.

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


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

2016-04-09 Thread Michael Van Canneyt



On Sat, 9 Apr 2016, silvioprog wrote:


On Fri, Apr 8, 2016 at 3:22 PM, Michael Van Canneyt <mich...@freepascal.org>
wrote:
[...]


Graeme has fixed a number of errors that should hopefully solve the
problems with
codepages;  Changes have been tested on windows/linux/bsd but on Windows
only
with a system that has an english locale.



After this update, it worked fine here on my PC (Windows 7 pt-BR), I just
changed the demo to using arial.ttf instead of freessans.

The demo should have an IFDEF to using Arial instead of FreeSans on
Windows, this would avoid problems for beginners. :-)

The generated PDF after the changes:
https://dl.dropboxusercontent.com/u/135304375/test.pdf.



Glad to hear it; 
We'll change the demo with the IFDEF, we should be kind to beginners :-)


Other demo apps are of course welcome. Please keep in mind they must compile
without LCL etc. if they are to be included in FPC itself.

Well, at least after an initial false start, we can now actually start 
improving the API.
Suggestions always welcome.

Thanks to everyone for testing !

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] PDF generator: please test

2016-04-09 Thread Michael Van Canneyt



On Sat, 9 Apr 2016, Ondrej Pokorny wrote:


Please don't take it as an offence, there is no.
I just first opened the PDF, saw the typo and then I had to check in the 
source code if it is really a typo or the library picks up the wrong 
character for the PDF. It is a typo, so everything is OK.

It would be still great if you corrected it ;)
Correct is "Здравствуйте" (I missed a character in the first email as 
well :D)


Well, I thought so too, but I am not a native Russian speaker, so it is not my 
place
to make comments :-)

Fixed in rev. 33456.

Michael.--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] PDF generator: please test

2016-04-08 Thread Michael Van Canneyt



On Fri, 8 Apr 2016, Ondrej Pokorny wrote:


On 08.04.2016 20:57, Ondrej Pokorny wrote:

Sorry, I missed the latest revision. I'll update and report back!


I updated and now SetMultiByteConversionCodePage(CP_UTF8) isn't needed. The 
files are exactly the same (=the same byte contents) as before with 
SetMultiByteConversionCodePage(CP_UTF8).


https://drive.google.com/open?id=0Bx-flYubOTroemdJWG5Pb0xCcWc


Good to hear that, this is what we were aiming for :-)



Some Vietnamese characters and box drawing characters aren't rendered on my 
system.


That probably depends on the font, Graeme will be able to say more about it.

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] PDF generator: please test

2016-04-08 Thread Michael Van Canneyt



On Fri, 8 Apr 2016, Ondrej Pokorny wrote:


On 08.04.2016 20:22, Michael Van Canneyt wrote:
We would appreciate it if someone could test the PDF generating demo on a 
Windows with non-english locale, and report whether the first page of the 
generated PDF looks OK.


I am now testing it. The unittests_console.lpr test fails with:

#0 fpc_raiseexception(0x1a099a4, 0x1, 0x19f6ae0) at 
P:\software\FPC\trunk_src\rtl\inc\except.inc:158
#1 TASSERT__FAIL(0x1a099a4 '"Failed on Numtables" expected: <19> but was: 
<18>', 0x433990, 0x5beea4) at .\fcl-fpcunit\src\fpcunit.pp:564
#2 TASSERT__ASSERTTRUE(0x1a099a4 '"Failed on Numtables" expected: <19> but 
was: <18>', false, 0x433990, 0x5beea4) at .\fcl-fpcunit\src\fpcunit.pp:591
#3 TASSERT__ASSERTEQUALS(0x5c15dc 'Failed on Numtables', 19, 18, 
0x5beea4) at .\fcl-fpcunit\src\fpcunit.pp:675
#4 TTESTLIBERATIONFONT__TESTDIRECTORY_NUMTABLES() at 
fpparsettf_test.pas:421
#5 TTESTCASE__RUNTEST() at 
.\fcl-fpcunit\src\fpcunit.pp:1039
#6 TTESTCASE__RUNBARE() at 
.\fcl-fpcunit\src\fpcunit.pp:1006

#7 PROTECTTEST(0x198ab70, 0x19f9fd8) at .\fcl-fpcunit\src\fpcunit.pp:1453
#8 TTESTRESULT__RUNPROTECTED(0x198ab70, 0x4456e0 , reading variable>) at .\fcl-fpcunit\src\fpcunit.pp:1471
#9 TTESTRESULT__RUN(0x198ab70, ) at 
.\fcl-fpcunit\src\fpcunit.pp:1462
#10 TTESTCASE__RUN(0x19f9fd8, ) at 
.\fcl-fpcunit\src\fpcunit.pp:996
#11 TTESTSUITE__RUNTEST(0x198ab70, 0x19f9fd8, ) at 
.\fcl-fpcunit\src\fpcunit.pp:1318
#12 TTESTSUITE__RUN(0x19f9fd8, ) at 
.\fcl-fpcunit\src\fpcunit.pp:1308
#13 TTESTSUITE__RUNTEST(0x196aa28, 0x19f9fd8, ) at 
.\fcl-fpcunit\src\fpcunit.pp:1318
#14 TTESTSUITE__RUN(0x19f9fd8, ) at 
.\fcl-fpcunit\src\fpcunit.pp:1308
#15 TTESTRUNNER__DOTESTRUN(0x196a6c8, ) at 
.\fcl-fpcunit\src\consoletestrunner.pas:179
#16 TTESTRUNNER__DORUN() at 
.\fcl-fpcunit\src\consoletestrunner.pas:429
#17 TCUSTOMAPPLICATION__RUN() at 
.\fcl-base\src\custapp.pp:343

#18 main at unittests_console.lpr:28

I downloaded all needed fonts. What am I doing wrong?


Probably the version of the font differs from what Graeme is using.
(I also have several errors because of too much font files etc, these are
known)

But those are the unit tests.

The test program to use to generate a PDF, is however "examples/testfppdf.lpi"

I should maybe have mentioned that more explicitly.

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] PDF generator: please test

2016-04-08 Thread Michael Van Canneyt


Hello,

Graeme has fixed a number of errors that should hopefully solve the problems 
with
codepages;  Changes have been tested on windows/linux/bsd but on Windows only
with a system that has an english locale.

These changes have been committed to FPC svn. (rev 33453)

We would appreciate it if someone could test the PDF generating demo 
on a Windows with non-english locale, and report whether the first page of

the generated PDF looks OK.

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Suggestion for TRadioGroup documentation

2016-04-08 Thread Michael Van Canneyt



On Fri, 8 Apr 2016, Graeme Geldenhuys wrote:


On 2016-04-08 15:54, Michael Thompson wrote:

To be fair, a TGroupBox gets things dropped in it, and both nomenclature
and look/feel are similar.


I fully agree. As far as I can remember, even in my Delphi days I've
made that mistake of dropping radiobutton controls on a TRadioGroup.
Bart, it's not as obvious as you think. It's learning by error, and then
getting used to that fact.


Or maybe read the documentation ? At least in the case of early Delphis that
would have helped. (can't comment on current Lazarus)

Thinking that you start without reading any form of documentation is an 
attitude which I highly condemn.


Unfortunately, this attitude seems typical for IT.

If NASA or Airbus or Boeing engineers would use that approach, 
I guess a lot of rockets, planes and whatnot would fall on our heads.


I am glad they do not seem to have this attitude.

Even cars come with a manual: usually located in the glove box, because
your average citizen manages to open that without "Quick start guide".

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] German umlauts in component names

2016-04-08 Thread Michael Van Canneyt



On Fri, 8 Apr 2016, Zeljko wrote:




On 04/08/2016 12:24 PM, Vojtěch Čihák wrote:

Why sometimes come these empty mails from jel...@misticnabica.hr?

Is it regular member or some bot?


I think it's hacked machine...I'll inform that ppl that they are sending 
spam. btw. I don't see such empty emails. Where do they come ? To your 
email or to list ?


I get them too, they come through the list AFAICS.

Michael.--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Extend unit path

2016-04-07 Thread Michael Van Canneyt


Hi,

When adding unit files from disk to a package, the IDE asks to extend the
unit path with '.'.

I understand why it needs to ask to extend the unit path, 
but for '.' this is not necessary, I think.


I always click no, and I didn't get in trouble yet :)

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Cant compile the IDE with the most recent fpc (3.1.1)

2016-04-07 Thread Michael Van Canneyt



On Thu, 7 Apr 2016, Michael Schnell wrote:


On 04/07/2016 04:19 PM, Mattias Gaertner wrote:

What -Fu paths do you have in your fpc.cfg?

I did suppose something like this.

Am I supposed to manually edit this file even for the unmodified svn d/l ?


Normally not.

I have this in my fpc.cfg, it is 2 lines long:

-Fu/usr/local/lib/fpc/$fpcversion/units/$fpctarget/*
-Fu/usr/local/lib/fpc/$fpcversion/units/$fpctarget/httpd22

That is all. (on windows the path will look somewhat different)
It has not been changed in years and I use it to compile everything.

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Cant compile the IDE with the most recent fpc (3.1.1)

2016-04-07 Thread Michael Van Canneyt



On Thu, 7 Apr 2016, Michael Schnell wrote:


On 04/06/2016 09:47 AM, Michael Schnell wrote:

It happened to me (again) :(.

I resolved a lot of unit referenced to fpc RTL units by defining links for 
the files in /usr/lib/fpc/3.1.1/units/i386-linux/rtl


(I suppose I should not do that this way, but I don't know another :( )

But later in the make process LCL units and resource files are requested. I 
could resolve a lot of references creating links in some LCL directory, but 
at some point this stopped working.


Is it even possible to compile Lazarus with fpc 3.1.1 ?


I do it almost daily.

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Search dialog scope

2016-04-07 Thread Michael Van Canneyt



On Thu, 7 Apr 2016, Ondrej Pokorny wrote:


I fixed it in r52143. But the behavior is not like it was before. It's now:
 scope: selected text,
*origin: from beginning.*
for search on selection.
(it was
 scope: selected text,
 origin: from cursor.
before).

Please test, it should fulfill your and my needs ;) Thanks for reporting!


Yay !

It works correctly now, thank you very much for the quick fix !!

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] PDF generator, try 2

2016-04-07 Thread Michael Van Canneyt



On Thu, 7 Apr 2016, Graeme Geldenhuys wrote:


On 2016-03-31 16:48, silvioprog wrote:

+{$IFDEF VER3}
+  Buffer := Default(TBuffer)
+{$ELSE}
+  FillChar(Buffer,SizeOf(TBuffer),0)
+{$ENDIF};



Just thought I would mention, I've seen the above code listed a few
times now to remove the famous "Local variable does not seem to be
initialized" compiler hint.

Well, it might work on FPC 3.0 (not test), but it does nothing for FPC
2.6.4 - the hint is always there. I know it is a harmless hint, if the
code was correct to start work.

Either way, I found a solution for that, which I used in fpGUI's DocView
help viewer application too.

Implement the following:

procedure FillMem(Dest: pointer; Size: longint; Data: Byte );
begin
 FillChar(Dest^, Size, Data);
end;


You will get the hint here then, no  ?

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Search dialog scope

2016-04-07 Thread Michael Van Canneyt



On Thu, 7 Apr 2016, Martok wrote:


Hello,


Since some time, I must alwas set the scope to "selection", and the origin to
'beginning' manually. No matter where my cursor is.

I am pretty sure that before, if there is a nonempty selection, the dialog
would set these settings correct for me.

I can confirm this behaviour, and also that it confused the hell out of me when
it first appeared, but I just thought I was being stupid.

Just did a bit of testing, and it seems everything works fine (sets From
Start/Selected) if the selection is on a single line only. Have more than one
line selected, and From Cursor/Global is set.


Phew !!

I thought I was being stupid too, but I am not alone :)

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Search dialog scope

2016-04-07 Thread Michael Van Canneyt



On Thu, 7 Apr 2016, Ondrej Pokorny wrote:


On 07.04.2016 9:34, Michael Van Canneyt wrote:

Did something change in the search() dialog scope handling ?


I changed it a little bit to match Delphi's behavior. The reason is described 
here: http://mantis.freepascal.org/view.php?id=27039



Since some time, I must alwas set the scope to "selection", and the origin 
to

'beginning' manually. No matter where my cursor is.


Strange.


I am pretty sure that before, if there is a nonempty selection, the dialog
would set these settings correct for me.


Yes, I remember that I changed the behavior so that scope is "selection" and 
origin "from the beginning" if there is a selection in the editor.

So exactly what you want to achieve.


But the dialog's behaviour has always been 'as in delphi' (or at least as long 
as I remember)
so I don't understand what you changed or why you thought it was necessary ?



Did something change in this regard ? What is the 'rule' that is followed 
by the dialog ?


If something changed, can we please get the old behaviour back somehow ?


Hmmm, for me it works exactly what you want to have (I changed to this 
desired behavior).


Well. You definitely broke it, from my point of view. It used to work correct :)



Can you be more specific about what you are doing and what the IDE does?


- Select 5 lines. (it could be 10) (shift-down, 5 times)
- Press ctrl-q a (classic shortcut for search & replace.)
- Dialog opens.
  Scope: global
  Origin: from cursor.
Just tested (again).

Tried again, but select five lines with shift-up.
So the cursor is at the start of the selection.
Same result.

I undid your revision, and then it works correct:

Dialog opens,
  scope: selected text,
  origin: from cursor.

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Search dialog scope

2016-04-07 Thread Michael Van Canneyt


Hello,

Did something change in the search() dialog scope handling ?

Since some time, I must alwas set the scope to "selection", and the origin to
'beginning' manually. No matter where my cursor is.

I am pretty sure that before, if there is a nonempty selection, the dialog
would set these settings correct for me.

Did something change in this regard ? 
What is the 'rule' that is followed by the dialog ?


If something changed, can we please get the old behaviour back somehow ?

(this is since some time, but I verified with yesterday's version)

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] PDF generator, try 2

2016-04-07 Thread Michael Van Canneyt



On Thu, 7 Apr 2016, Sven Barth wrote:



the SetMultiByteConversionCodePage(CP_UTF8) call makes

DefaultSystemCodePage=CP_UTF8 which matches UTF8String and so in
fpc_ansistr_to_ansistr no conversion is performed.


And so that is why SetMultiByteConversionCodePage(CP_UTF8) is needed when

compiling in windows

:)


UTF8ToUTF16 should best take a UTF8String then. It would fit the purpose of
the function better anyway...


This should not exist to begin with, I think. 
The UTF8Decode function of the system unit performs the same function.


Jesus, thank you for looking into this, we'll get to work with it !

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] PDF generator, try 2

2016-04-06 Thread Michael Van Canneyt



On Wed, 6 Apr 2016, silvioprog wrote:


On Wed, Apr 6, 2016 at 2:14 PM, Michael Van Canneyt <mich...@freepascal.org>
wrote:
[...]


Why is this patch needed ? It should not be needed at all ?



Sorry, I sent a wrong patch, please consider this new one in attachment.

My patch just fix wrong chars in the generated PDF, eg, before the apply
it, I got:


I see. I don't understand why this patch fixes it for you.

Because it means that somewhere a conversion happens that should not happen.


ps. about the hints/warnings, see the compiler log below:

Compile Project, Target: testfppdf.exe: Success, Warnings: 3, Hints: 4
fppdf.pp(1049,28) Hint: Local variable "Buffer" does not seem to be
initialized
fppdf.pp(1028,3) Note: Local variable "I" not used
fppdf.pp(3194,31) Warning: Implicit string type conversion from
"AnsiString" to "WideString"
fppdf.pp(3195,35) Warning: Implicit string type conversion from
"AnsiString" to "WideString"
fppdf.pp(808,44) Hint: Parameter "EmbeddedFontNum" not used
fppdf.pp(808,70) Hint: Parameter "FontDef" not used
fppdf.pp(3308,37) Warning: Implicit string type conversion with potential
data loss from "WideString" to "AnsiString"


Maybe one of these string conversion warnings are the cause of the error.
I suspect the last one, actually, line 3308.

The other ones will be fixed too, of course.

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] PDF generator, try 2

2016-04-06 Thread Michael Van Canneyt



On Wed, 6 Apr 2016, Graeme Geldenhuys wrote:


On 2016-04-06 17:57, silvioprog wrote:

This attached patch definitely fixes this error on Windows. :-)


This was already fixed (plus other changes). I simply forgot to send
Michael the email yesterday to update FPC.


Patch applied. Rev. 33428.

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] PDF generator, try 2

2016-04-06 Thread Michael Van Canneyt



On Wed, 6 Apr 2016, silvioprog wrote:


On Thu, Mar 31, 2016 at 1:17 PM, Michael Van Canneyt <mich...@freepascal.org

wrote:

[...]


Please, don't do {%H-} etc:

procedure CreateTTFCIDSystemInfo(const {%H-}EmbeddedFontNum:
integer;{%H-}FontDef: TFontDef);virtual;



{$HINTS OFF} instead of it?


No, fix the hint (if possible).


Typecasts like this should also not be done:

+FontDef.FDiffs := WideString(lFontDef.Diffs);
+FontDef.FCharWidth := WideString(lFontDef.CharWidths);



Because the FontDef.FCharWidth is a WideString.



-  Arr.AddIntArray(FontDef.FCharWidth);
+  Arr.AddIntArray(string(FontDef.FCharWidth));



Because Arr.AddIntArray() is AnsiString (string) and FontDef.FCharWidth
WideString.






We need to investigate why you think this typecast is needed.



It just stop hints/warnings from compiler.


The correct thing to do is to make sure the types are compatible. 
What you do is hide the real issue.


But we will look at it.

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] PDF generator, try 2

2016-04-06 Thread Michael Van Canneyt



On Wed, 6 Apr 2016, silvioprog wrote:


On Thu, Mar 31, 2016 at 1:13 PM, Michael Van Canneyt <mich...@freepascal.org

wrote:

On Thu, Mar 31, 2016 at 11:18 AM, silvioprog <silviop...@gmail.com> wrote:

[...]



Greek: Ge?? s?? ??s

Polish: Witaj swiecie
Portuguese: Ol? mundo
Russian:  ???
Vietnamese: Xin ch?o th? gi?i




This attached patch definitely fixes this error on Windows. :-)


Why is this patch needed ? It should not be needed at all ?

In each case it will not be applied, since it assumes use of lazarus, 
and that is not acceptable in the FCL.


Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TDataset result 1e2 instead of 100

2016-04-05 Thread Michael Van Canneyt



On Tue, 5 Apr 2016, John Landmesser wrote:


if i execute fo example a query with a oracle Database: 
 
Select 100 from dual;
 
Result will be 1e2 ( scientific notation )
 
as i learned from this:
 
https://sourceforge.net/p/zeoslib/tickets/22/
 
it's probably caused  by TDataset?
 
Is there any reason for the result > 99 displayed in scientific notation?
 
Ok, i can do a CAST(...) in my SQL-Code, but thats extra work for nothing!
 
Thanks for hints.


The person who answered the ticket is wrong.

TBufDataset is a TDataset descendent like any other, with no special
handling of float fields.

There are a bazillion ways to retrieve a field value; Without more detailed
knowledge of how the 1e2 was produced, it is impossible to help further:

Assuming it is a float field:
How a float field is formatted depends entirely on the format settings in
DefaultFormatSettings. If you are satisfied with the default settings, you
can use .AsString. If you are not, you must specify formatting yourself.

But another possibility is that it is retrieved as a currency field by the
DB layer etc.

In short: without more details, there is little we can say.

Michael.--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] German umlauts in component names

2016-04-02 Thread Michael Van Canneyt



On Sat, 2 Apr 2016, Martin Schreiber wrote:


On Saturday 02 April 2016 10:30:51 Mattias Gaertner wrote:


We have many Delphi Programs with German Umlauts in component names and
would like to go to Lazarus with them.
Any hints?


This is not supported by FPC yet.


Not supported *yet*?
Shudder.


Delphi compatibility
In the unicode RTL, that should be possible. 
Together with unicode identifiers, obviously.


Although I am absolutely not in favour of this 'feature'.

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] German umlauts in component names

2016-04-02 Thread Michael Van Canneyt



On Sat, 2 Apr 2016, Special wrote:

How can I use names with German Umlauts and 'ß' in the Name Field of 
TButton components? For instance, I try to set MyButton.Name to 
"Schließenbutton" and get an error message "Komponentenname 
Schließenbutton ist kein gültiger Bezeichner".


This happens with Lazarus 1.6 and FPC 3.0.0 under Win 10 (64) and under 
Raspian on a Pi3.
We have many Delphi Programs with German Umlauts in component names and 
would like to go to Lazarus with them.


You cannot at this moment.

Michael.--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Xamarin becomes free and open-source

2016-04-02 Thread Michael Van Canneyt



On Sat, 2 Apr 2016, Marco van de Voort wrote:


On Fri, Apr 01, 2016 at 08:58:14AM +0200, Michael Van Canneyt wrote:

they've learned to love on Linux.


I seriously doubt this will have any effect.

Most (if not all) of their admin tools are GUI based.
That makes scripting them impossibile. Which is the point of scripting.


Most of those are based on COM/WMI and can be scripted very confortably and
OO in powershell.


That's no good to you in bash.

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] The return of the dreaded "The IDE is still building"

2016-04-01 Thread Michael Van Canneyt



On Fri, 1 Apr 2016, Dmitry Boyarintsev wrote:


On Fri, Apr 1, 2016 at 4:52 AM, Michael Van Canneyt <mich...@freepascal.org>
wrote:



See attachment.

The IDE main window caption does not say 'building', and it is not
building.



The messages window shows the package compilation is in progress.
I typically get this message when trying to run a compilation while
something else compiles.

It feels like IDE doesn't distinguish between IDE and a package building.


Package compilation was long finished. But there was an error in the
sources. It seems the IDE didn't detect this.

After aborting the 'compile', I recompiled, and then it showed me the error.

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Xamarin becomes free and open-source

2016-04-01 Thread Michael Van Canneyt



On Fri, 1 Apr 2016, Santiago A. wrote:



I agree that is not easy. Windows has created his own set of services,
uses a strange jargon and nomenclature for services and stuff that has
been there for years in unix world. But that's its strategy: Make unix
admins a little more comfortable with windows concepts, jargon and
products. Maybe next time a unix admin faces a windows product, he won't
push for only-unix solution so hard.


Yes, they are a wolf in sheepskin...

I cannot understand that Canonical agreed to cooperate on this.
It's called shooting in your own foot...


And don't deceive yourself. Scripts are the most powerful solution, but
a GUI need less knowledge and expertise, so they may be cheaper in the
long run.


You therewith assert that microsoft advocates ignorance and stupidity ? :-)

All very nice till you hit a really hard problem and then you need to call 
an expert anyway, who charges you astronomical amounts of money for deleting a

registry key or so. It's a nice deceit...

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] The return of the dreaded "The IDE is still building"

2016-04-01 Thread Michael Van Canneyt


Hi,

See attachment.

The IDE main window caption does not say 'building', and it is not building.

It happens very seldom these days, but still. Sigh... :(

Michael.--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Xamarin becomes free and open-source

2016-04-01 Thread Michael Van Canneyt



On Fri, 1 Apr 2016, Michael Schnell wrote:


On 04/01/2016 09:53 AM, Michael Van Canneyt wrote:

"Windows IOT" is a misnomer. Windows = GUI. The name kind of gives it away.
Of course language-wise you are right, but politically of course M$ needs to 
stick to the "Windows" name, even if stripping off any sense of that.


This kind of reasoning only can come from marketeers.
It's a bit like BMW with their huge version of the 'mini'. 
Someone should explain to them what 'mini' actually means...


Luckily, Douglas Adams had good ideas about what to do with such people :-)

Anyway, we are diverting.

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Xamarin becomes free and open-source

2016-04-01 Thread Michael Van Canneyt



On Fri, 1 Apr 2016, Michael Schnell wrote:


On 04/01/2016 08:58 AM, Michael Van Canneyt wrote:


Some years ago they announced that the sever could run "without GUI".


In fact "Windows IOT" is windows 10 without the GUI API (i.e. you can run 
Aervicesm but you can't run applications).


So this is viable/sensible/possible in the end.


"Windows IOT" is a misnomer. Windows = GUI. 
The name kind of gives it away.


Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Xamarin becomes free and open-source

2016-04-01 Thread Michael Van Canneyt



On Thu, 31 Mar 2016, vfclists . wrote:


On 31 March 2016 at 21:56, Denis Kozlov  wrote:


On 31/03/2016 21:31, vfclists . wrote:


They are going all out against Apple and Redhat.



You meant Apple and Google maybe? They target Windows, Mac/iOS and Android.

A wide selection of supported platforms is where FPC and Lazarus defiantly
have an edge.

Denis


They are going after the whole Linux.Unix system. They want Linux admins and
developers to realize that they can have good GUI development and
server-management
tools available on Windows and still have all the command line goodies
they've learned to love on Linux.


I seriously doubt this will have any effect.

Most (if not all) of their admin tools are GUI based. 
That makes scripting them impossibile. Which is the point of scripting.


Some years ago they announced that the sever could run "without GUI".
I think it was windows server 2012. Till you need to run an installer to
install some software... And all windows software installers are GUI based.

We threw out windows servers, and the admin crew is all the more happy for
it, because now they can script literally everything.

More importantly, windows is still a black box. Something happens, you get
completely stuck. I still need to encounter the problem I cannot solve with
the use of strace on linux.

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] PDF generator, try 2

2016-04-01 Thread Michael Van Canneyt



On Fri, 1 Apr 2016, Ondrej Pokorny wrote:


On 31.03.2016 22:58, Michael Van Canneyt wrote:

I suspect this can be easily implemented.

Synopse pdf is the reason I started fppdf. Synopse is heavily Windows
centric, but otherwise quite capable.


Yes, correct. I was who implemented exact drawing to Synopse PDF (i.e. 
rendering to exact rect) because the font sizes on Canvas and PDF were quite 
different. IIRC you compare the actual text width with the wanted text width 
and you scale the text box with a transformation.


Coordinate transformations are explicitly part of the PDF generator design.

I also implemented underline text and did more enhancements, I don't remember 
exactly any more. It was years ago.


Now I stay before a choice to use Synopse PDF (and to have PDF export 
Windows-only) or create a new bindings to fppdf.


Well, obviously I cannot make this choice for you. 
For me there was no choice: my software runs on headless linux servers. 
So maybe you will profit from my lack of choice :-)



Fppdf is a young library (although it required many months of work)
I am sure many improvements will be made as the reporting library develops.

A canvas descendant that renders to pdf is planned, but not very high
priority.

Patches and suggestions are definitely welcome. The library is intended for
production, so quality is important.


I have to take a look at fppdf. I'll need a PDF export in the next months. If 
I decide for fppdf you can be sure that I'll make you busy with sending 
patches :)


No worries there, they will be very welcome :)

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] PDF generator, try 2

2016-03-31 Thread Michael Van Canneyt



On Thu, 31 Mar 2016, Ondrej Pokorny wrote:


On 31.03.2016 20:39, Michael Van Canneyt wrote:

On Thu, 31 Mar 2016, Ondrej Pokorny wrote:

A quick question (sorry I haven't tested): is word breaking supported and 
is it possible to get the target rect of multiline and singleline text?


It is possible to get a target rect of a single line; unit fpttf:

function TextWidth(AStr: string; APointSize: single): single;

Word breaking is left to the calling application.
A reporting tool is in the make (well, made, but not released yet)
which will handle this.


Great, thank you!

And is it possible the other way round? I.e. I know the target rect and I 
have to export a single line exactly into that rect? (The text has to be 
scaled to fill the rect.)


I suspect this can be easily implemented.



Why I ask: I need to print my PDFs directly from a Lazarus application. I 
have to render the page on a canvas (monitor for preview, printer for 
printing) and create a PDF from the same source. All three targets (monitor, 
printer, PDF) have to be exactly equal.
I achieved this in Delphi with Synopse PDF. Now I'd like to port my reporting 
solution to Lazarus.



Synopse pdf is the reason I started fppdf. Synopse is heavily Windows
centric, but otherwise quite capable.

Fppdf is a young library (although it required many months of work)
I am sure many improvements will be made as the reporting library develops.

A canvas descendant that renders to pdf is planned, but not very high
priority.

Patches and suggestions are definitely welcome. The library is intended for
production, so quality is important.

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Xamarin becomes free and open-source

2016-03-31 Thread Michael Van Canneyt



On Thu, 31 Mar 2016, Maciej Izak wrote:


2016-03-31 20:30 GMT+02:00 Anthony Walter :


I thought this was newsworthy and of interest to us:

https://blog.xamarin.com/xamarin-for-all/



kind of inspiration for better Lazarus and FreePascal


I fail to see how ?

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] PDF generator, try 2

2016-03-31 Thread Michael Van Canneyt



On Thu, 31 Mar 2016, Ondrej Pokorny wrote:

A quick question (sorry I haven't tested): is word breaking supported and is 
it possible to get the target rect of multiline and singleline text?


It is possible to get a target rect of a single line; unit fpttf:

function TextWidth(AStr: string; APointSize: single): single;

Word breaking is left to the calling application.
A reporting tool is in the make (well, made, but not released yet)
which will handle this.

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] PDF generator, try 2

2016-03-31 Thread Michael Van Canneyt



On Thu, 31 Mar 2016, silvioprog wrote:


On Thu, Mar 31, 2016 at 11:18 AM, silvioprog <silviop...@gmail.com> wrote:


On Thu, Mar 31, 2016 at 11:02 AM, Michael Van Canneyt <
mich...@freepascal.org> wrote:


Hello

In revision 33401 of FPC subversion, a lot of fixes have been committed
for Font
handling in the PDF generator: e.g. Unicode fonts should now render
correctly.


[...]

Great news! :-)

I'm going to re-test it ...



Finally the PDF was succefully generated on Windows! \o/

I have some observations:

. The demo print a lot of lines if the font is not found:

Exception at 0041F4B7: EFOpenError:
Unable to open file "fonts\FreeSans.ttf".
Exception at 0041F4B7: EFOpenError:
Unable to open file "fonts\FreeSans.ttf".
Exception at 0041F4B7: EFOpenError:
Unable to open file "fonts\FreeSans.ttf".
Exception at 0041F4B7: EFOpenError:
Unable to open file "fonts\FreeSans.ttf".
... infinitely ...

. The PDF was generated with some wrong chars (you can download it here:
https://dl.dropboxusercontent.com/u/135304375/test.pdf):


That is logical, if it cannot find the file which it tries to embed ??



Greek: Ge?? s?? ??s
Polish: Witaj swiecie
Portuguese: Ol? mundo
Russian:  ???
Vietnamese: Xin ch?o th? gi?i

In the previous fppdf version, the PDF was generated about ~650KB, after
update it I get a PDF ~381KB. Is it OK?


No, I have one of ~1Mb. But probably logical if the file is not there ?

It's not quite clear what to think of your report ?

For me

"PDF was succefully generated"

does not compute with

"Unable to open file "fonts\FreeSans.ttf".

:-)


Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] PDF generator, try 2

2016-03-31 Thread Michael Van Canneyt



On Thu, 31 Mar 2016, silvioprog wrote:


On Thu, Mar 31, 2016 at 12:45 PM, silvioprog <silviop...@gmail.com> wrote:


On Thu, Mar 31, 2016 at 11:18 AM, silvioprog <silviop...@gmail.com> wrote:


On Thu, Mar 31, 2016 at 11:02 AM, Michael Van Canneyt <
mich...@freepascal.org> wrote:


Hello

In revision 33401 of FPC subversion, a lot of fixes have been committed
for Font
handling in the PDF generator: e.g. Unicode fonts should now render
correctly.


[...]

Great news! :-)

I'm going to re-test it ...



Finally the PDF was succefully generated on Windows! \o/



The attached patch remove some compile hints/warnings.


Please, don't do {%H-} etc:

procedure CreateTTFCIDSystemInfo(const {%H-}EmbeddedFontNum: 
integer;{%H-}FontDef: TFontDef);virtual;

Typecasts like this should also not be done:

+FontDef.FDiffs := WideString(lFontDef.Diffs);
+FontDef.FCharWidth := WideString(lFontDef.CharWidths);

-  Arr.AddIntArray(FontDef.FCharWidth);
+  Arr.AddIntArray(string(FontDef.FCharWidth));

We need to investigate why you think this typecast is needed.

The buffer initialization is good, though.

I will not apply this patch, this needs deeper investigation.

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] System variables visibility

2016-03-31 Thread Michael Van Canneyt



On Thu, 31 Mar 2016, John Landmesser wrote:


Hi,

i developed an application ( Linux ) that need to know where $ORACLE_HOME 
points to.


The only way was to start my app with a shell-script, defining:

#! /bin/bash
export ORACLE_HOME=/usr/lib/oracle/

# run my app
Lazarus_Oracle_app

Had no success defining this variable in bashrc or profile.


That should work. Obviously you need to log in again.



But why do i have to define this in my start-script?


That should not be necessary.
I have similar variables defined for Firebird, in my .login file.

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] PDF generator, try 2

2016-03-31 Thread Michael Van Canneyt


Hello

In revision 33401 of FPC subversion, a lot of fixes have been committed for Font
handling in the PDF generator: e.g. Unicode fonts should now render correctly.

The test program generates the following PDF:

http://www.freepascal.org/~michael/test.pdf

Page 1 looks as follows on my system:

http://www.freepascal.org/~michael/pdftest.png

The output has been tested for correct rendering in the following applications:

  Firefox native viewer (Linux)
  Acrobat Reader 10 (Windows)
  Foxit Reader (Windows)
  Xpdf (FreeBSD)
  Evince (FreeBSD)
  The GIMP (FreeBSD)
  Google Drive viewer
  LibreOffice Draw (linux)
  Okular (linux)

The file was also generated on various platforms to make sure all platforms
handle the generating correctly (locales, code pages etc.).

If you find any more errors (let's hope not), please let me know.

Enjoy,

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Using libjpeg

2016-03-31 Thread Michael Van Canneyt



On Wed, 30 Mar 2016, Aradeonas wrote:


Hi,

I want use libjpeg and I found pasjpeg package in fpc that contains
jpeglib.pas unit but I coudnt find a working demo to know how load a
jpeg file and show it.
Can anyone point me to a better direction?


pasjpeg is very low-level. Why not use tfpimage ? 
use the fpimage unit, see the example converter program.


Michael.--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Testing Rapberry Pi 3 performance

2016-03-29 Thread Michael Van Canneyt



On Tue, 29 Mar 2016, Michael Schnell wrote:


On 03/25/2016 12:17 PM, Graeme Geldenhuys wrote:
A word of caution, there is a major bug in FPC 3.0 regarding floating point 
values (see the FPC mailing list), so I wouldn't recommend anybody upgrade 
to FPC 3.0 at this point - at least until 3.0.2 is out. This issue has been 
fixed in FPC Trunk already though.

They say: "This happens only on Win64 with FPC 3.0 "


No, it will also happen on 64-bit arm.

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Having multiple Lazarus like GetLazarus version

2016-03-24 Thread Michael Van Canneyt



On Thu, 24 Mar 2016, Aradeonas wrote:


How do you know that it works ?

What do mean from that? If you mean GetLaarus version I have one
installed and if you mean I have another old Lazarus that I tried
using cfg.


I understood your remark as 
"getlazarus offers this functionality already".


Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Having multiple Lazarus like GetLazarus version

2016-03-24 Thread Michael Van Canneyt



On Thu, 24 Mar 2016, Aradeonas wrote:


Of course it looses all the settings, because you just told it to look
in a different directory. Copy your original settings from their
default location over to the new one and you should be good to go.

Ichecked and there is not any old cfg file.

Be careful. When copying all settings between too-different versions
it may call for trouble. editoroptions.xml is ok. fpcdefines.xml,
codetoolsoptions.xml and environmentoptions.xml could lead to issues
since they contain absolute paths of the original installation. package-
related files (packagefiles.xml, miscellaneousoptions.xml and
staticpackages.inc) can cause trouble if the new installation does not
support all required features of the old one.

Yes I tried that and  you are right.

It is interesting that how GetLazarus version works.


How do you know that it works ?

Michael.--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TPQConnection and float

2016-03-22 Thread Michael Van Canneyt



On Mon, 21 Mar 2016, Björn Lundin wrote:


Hi !
I'm new to Lazarus (since Saturday)
but in the 90:ies id wrote some Turbo Pascal for school and liked it.
However, the last 15 years, I've worked with a system written in Ada
so that is the language I'm fluid in.
But it is close to Pascal.

So - I started to write a form with a tree widget and a graph,
and started go get data from a database to fill the graph with,
depending on the selected node in the tree.
But the values are off with a factor 1.


This is a known bug which is fixed in trunk.
See e.g. http://bugs.freepascal.org/view.php?id=29760

Michael.--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] LCL exports CC-licensed icons to every LCL application

2016-03-21 Thread Michael Van Canneyt



On Mon, 21 Mar 2016, Juha Manninen wrote:


Ok, I should read the dev-list discussion more carefully.
My head does not work well with licensing details. For free and open
source stuff it feels like a useless extra complication. I understand
it is only me and the reality is more complex. I happily leave this
issue for others to solve.


Don't worry, you're not alone. 
I never understood the need for all these licensing details either.


Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] LCL exports CC-licensed icons to every LCL application

2016-03-21 Thread Michael Van Canneyt



On Mon, 21 Mar 2016, Ondrej Pokorny wrote:


On 21.03.2016 10:49, Michael Van Canneyt wrote:

Yes, but that does not tell me which of these icons are silk icons ?

Yes, this is also a problem.


Or are they all silk icons ?


No, they are not all form silk. Lazarus developers haven't been strict about 
icon usage both in LCL and Lazarus IDE and so there is no information about 
the source of every particular icon.


I can say for sure that there are buttons from Silk. E.g. button icons 
(subdir buttons) are from the Silk package.
The cursor icons seem to be copied from Delphi (at least cur_21.cur) - I 
don't know how these are licensed.
I don't know the source of the dialog icons (subdir dialogs) - maybe Tango 
(?).


=> Now there is no information about the source of every single LCL icon. So 
there may be more license problems.


I probably will remove all the icons from the LCL with a conditional IFDEF 
and the icons will be added back only if license information about them is 
known and documented in the LCL sources and matches the LCL license.


? Will this not cripple the GUI ?

I don't want to end up with an empty button when I update my lazarus :)

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] LCL exports CC-licensed icons to every LCL application

2016-03-21 Thread Michael Van Canneyt



On Mon, 21 Mar 2016, Ondrej Pokorny wrote:


On 21.03.2016 10:05, Michael Van Canneyt wrote:
Can you please be a bit more specific ? Which silk icons are exported 
exactly ?


It depends what units you use in your LCL application. Please see the 
"lcl/images" folder. All icons that are used by the LCL are located there.


See e.g.
lcl\images\lcl_grid_images.bat => lcl\lcl_grid_images.res => linked into the 
LCL in Grids.pas with {$R lcl_grid_images.res}.

lcl\images\buttons\build.bat => btn_icons.res => buttons.pp
etc etc.

You can also check the final executable with a resource viewer what icons are 
exported into your application.


Yes, but that does not tell me which of these icons are silk icons ?
Or are they all silk icons ?

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] LCL exports CC-licensed icons to every LCL application

2016-03-21 Thread Michael Van Canneyt



On Mon, 21 Mar 2016, Ondrej Pokorny wrote:


Corresponding issue report: http://mantis.freepascal.org/view.php?id=29869

Every LCL application includes icons (at least) from the famfamfam (Silk icon 
set) that are licensed under Creative Commons Attribution 2.5/3.0 license.
As a result every LCL application that does not acknowledge them, breaks the 
CC license.
LCL is advertised as "(L)GPL licensed with static linking exception", which 
is not true because the LCL includes CC-licensed icons.


The Lazarus team will solve the issue for 1.6.2. We'll try to get a license 
exception for LCL applications. If we don't get this exception all 
CC-licensed icons will be removed from the LCL and will be replaced by 
public-domain icons.


For now, please take into consideration that your LCL application must 
acknowledge the Silk Icon Set http://www.famfamfam.com/lab/icons/silk/ .


Can you please be a bit more specific ? 
Which silk icons are exported exactly ?


Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] ActiveX in Lazarus and classic ASP

2016-03-19 Thread Michael Van Canneyt



On Thu, 17 Mar 2016, Marcos Douglas wrote:


Hi,

I would like to know if is possible to made an ActiveX component using
FPC/Lazarus. This component will be used integrated with a classic ASP
web application.


As far as I know, the only thing you need to do is create a class that
implements IDispatch. You hardly need a wizard for that, I think ?


I make these components using Delphi 7 but I would like to use Lazarus.

I installed the LazActiveX package, but I did'nt see an option to use
something like "New>ActiveX..."


The activeX package registers a type library import item under tools,
and adds a component TActiveXContainer to the component palette.
This is to create visual controls that can be used using ActiveX.


Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] ActiveX in Lazarus and classic ASP

2016-03-18 Thread Michael Van Canneyt



On Fri, 18 Mar 2016, Marcos Douglas wrote:


Hi Michael,

On Fri, Mar 18, 2016 at 6:00 AM, Michael Van Canneyt
<mich...@freepascal.org> wrote:


As far as I know, the only thing you need to do is create a class that
implements IDispatch. You hardly need a wizard for that, I think ?


Well, using Delphi 7 I click in 'New'>'ActiveX'>'Active Server Object'.
After type the "CoClass Name" -- TFooClass for example -- and choose
some parameters, the IDE creates:
1. An unit contents a pre-implementation of my class:
uses
 ComObj, ActiveX, AspTlb, Project1_TLB, StdVcl;
type
 TFooClass = class(TASPObject, IFooClass)
 protected
   procedure OnEndPage; safecall;
   procedure OnStartPage(const AScriptingContext: IUnknown); safecall;
 end;

2. A file like "project_TLB.pas" that have, between others things:
 IFooClass = interface;
 IFooClassDisp = dispinterface;
...
 CoFooClass = class
   class function Create: IFooClass;
   class function CreateRemote(const MachineName: string): IFooClass;
 end;
...
class function CoFooClass.Create: IFooClass;
begin
 Result := CreateComObject(CLASS_FooClass) as IFooClass;
end;

class function CoFooClass.CreateRemote(const MachineName: string): IFooClass;
begin
 Result := CreateRemoteComObject(MachineName, CLASS_FooClass) as IFooClass;
end;

3. An "wizard" to insert new methods to simplify, I think, and a
"Text" is created on demand like that:
FooClass = coclass(IFooClass [default] )
 [ uuid '{E984E6AF-C43A-4B34-BF96-E03B43AC6A3E}',
   version 1.0,
   helpstring 'FooClass Object' ];

But I don't know if is relevant... anyway.


So, how an new FPC programer should know these things to make a ActiveX?


By studying ActiveX maybe ?


I could be wrong, but I don't think just implement IDispatch is enough, do you?


Maybe I was a bit short on details in my reply :-)

Yes, you can of course write a wizard that does all this. 
It's just generating text, after all.


Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] CMS in Pascal ?

2016-03-14 Thread Michael Van Canneyt



On Mon, 14 Mar 2016, Graeme Geldenhuys wrote:


On 2016-03-12 09:25, Michael Van Canneyt wrote:

Is there one written in Object Pascal ?


Yes, PWU (aka Powtils) included one. I used it to run a small wiki on my
server some years ago. The content was in a plain text file, and the
SCMS (aka wiki.cgi) inject a menu, header and footer.

It came as part of the PWU examples. I have the SCMS project files I
used. I can archive it and email you a copy (or make it available for
download on my server) if you want.


AFAICS It's on Github:
https://github.com/z505/powtils/

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] CMS in Pascal ?

2016-03-12 Thread Michael Van Canneyt


Hi,

I'm looking for a minimalist flat-file CMS. There are many floating around,
I found a list on e.g.

http://www.hongkiat.com/blog/flat-cms/

Is there one written in Object Pascal ?

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Desktops ?

2016-03-11 Thread Michael Van Canneyt



On Fri, 11 Mar 2016, Ondrej Pokorny wrote:

The OI gets correctly hidden if you load the desktop after the start of the 
IDE. So the problem is in IDE startup procedure that forces the OI to show.


I can confirm this behaviour, yes.

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Bug in FPC 3.0 discovered

2016-03-11 Thread Michael Van Canneyt



On Fri, 11 Mar 2016, Mattias Gaertner wrote:


On Fri, 11 Mar 2016 14:12:41 +0100 (CET)
Michael Van Canneyt <mich...@freepascal.org> wrote:




On Fri, 11 Mar 2016, Mattias Gaertner wrote:


On Fri, 11 Mar 2016 13:57:02 +0100
LacaK <la...@zoznam.sk> wrote:


[...]
There was discovered bug in FPC 3.0 (already fixed in trunk) when
currency and double data types are involved in mathematical operations
like addition or multiplication.


Is this bug http://bugs.freepascal.org/view.php?id=29760 ?


Yes.


Is it already fixed in 3.0.1 and 3.1.1?


3.1.1, yes.

3.0.1, I don't think so.

IMHO we should release a 3.0.2 ASAP.

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Desktops ?

2016-03-11 Thread Michael Van Canneyt


Hi,

Is the current desktops functionality supposed to restore windows that were 
hidden ?

I have 1 desktop defined, "Default".
I layouted my windows, closed the object inspector window, and used 'Save 
current desktop' to save it as default.
I quit lazarus and restarted it. 
It shows a default empty project, and shows the object inspector.

I loaded a (non-gui) project.
The object inspector is still shown.

Is this supposed to be so ? I would expect the object inspector to remain
hidden.

My plan was to have 2 desktops: one for GUI projects, one for non-GUI
projects, where the object inspector is useless and hence can remain
hidden...

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Bug in FPC 3.0 discovered

2016-03-11 Thread Michael Van Canneyt



On Fri, 11 Mar 2016, Mattias Gaertner wrote:


On Fri, 11 Mar 2016 13:57:02 +0100
LacaK  wrote:


[...]
There was discovered bug in FPC 3.0 (already fixed in trunk) when
currency and double data types are involved in mathematical operations
like addition or multiplication.


Is this bug http://bugs.freepascal.org/view.php?id=29760 ?


Yes.

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Is there aTDBLabel?

2016-03-10 Thread Michael Van Canneyt



On Thu, 10 Mar 2016, LacaK wrote:





It works. But still I wonder, is there a another way? I've tried TDBText 
but that shows th field value, not the DisplayLabel.


There is no standard control for it. But it should in fact be easy to add 
to

the LCL.



I have used DB-aware version of TLabeledEdit.
It is often the case that you use Label + Edit together.
May be that having it in LCL will be also useful.


The advantage of a separate label is that you can use it for any control:
dbcombobox etc.

But the TDBLabeledEdit is obviously also useful, both approaches should be
used :)

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] PDF generator

2016-03-09 Thread Michael Van Canneyt



On Wed, 9 Mar 2016, leledumbo wrote:


I have committed a PDF generator to FPC Subversion: fcl-pdf


The package must be excluded from build for msdos target because its
dependencies are not available for msdos, otherwise full build will fail.
There are already embedded and win16 in the exclude list.


Done, rev. 33212. Thanks for testing.

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Is there aTDBLabel?

2016-03-09 Thread Michael Van Canneyt



On Wed, 9 Mar 2016, Frans wrote:


Hi

I use Lazarus 1.6 on Windows 7.
I've used lazdatadesktop to change the Displaylabel of the DB fields. In a 
DBGrid that new names popup as the column names. But in a form with TDBEdit 
fields I can't use a TDBLabel that automatically takes the name from the 
associated Control as the caption. Instead, I placed TLabel components and 
made the following method:


procedure TMyForm.FormShow(Sender: TObject);
var
 l: TLabel;
begin
 for TComponent(l) in Self do
 begin
   if (l is TLabel) and (l.FocusControl is TDBEdit) then
 l.Caption := TDBEdit(l.FocusControl).Field.DisplayLabel;
   if (l is TLabel) and (l.FocusControl is TDBLookupComboBox) then
 l.Caption := TDBLookupComboBox(l.FocusControl).Field.DisplayLabel;
 end;
end;

It works. But still I wonder, is there a another way? I've tried TDBText but 
that shows th field value, not the DisplayLabel.


There is no standard control for it. But it should in fact be easy to add to
the LCL.

I have a very large application in which I do the same, but I had to develop
my own TLabel subclass for this. (It also switches color when the field is
required etc.)

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Windows API calls and german Umlauts

2016-03-09 Thread Michael Van Canneyt



On Wed, 9 Mar 2016, John Landmesser wrote:


Hi,
 
if i call a windows API function for special folder, like:
 

uses 
...

shlobj;
 
var
  AppDataPath: Array[0..MaxPathLen] of Char;
begin

  SHGetSpecialFolderPath(0,AppDataPath,CSIDL_STARTUP,false);
end;
 
I get on a german localized Windows XP a path containing  "\Startmenü\", but the "ü" is 
"?" in the resulting string.
 
Howto convert  the chars in AppDataPath to get the "Umlauts" correct?


Use the W variant of the call, and user widechar.

 var
   AppDataPath: Array[0..MaxPathLen] of WideChar;
 begin
   SHGetSpecialFolderPathW(0,AppDataPath,CSIDL_STARTUP,false);

Then convert to UTF8 using UTF8Encode() if you want to display it in a LCL
application.

Michael.--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Ann: class code creation

2016-03-08 Thread Michael Van Canneyt



On Tue, 8 Mar 2016, Reimar Grabowski wrote:


On Tue, 8 Mar 2016 14:15:23 +0100 (CET)
Michael Van Canneyt <mich...@freepascal.org> wrote:


Well. You take yourself as a reference I think.

When you called it very confusing...
... you were speaking on behalf of humanity?
... you stated an objective fact?
... you stated your personal opinion and only forgot to make clear that it is 
an opinion?




Reread my mail and you will see it's clearly all my opinion, who shall be the 
reference if not me.
The only fact is that 'long click' is a well known concept which you just 
happen to not know.


Sure, my apologies if I sounded offensive, that was not the intention.



Reread your mail and it reads more like it's a fact that it's confusing. Hence 
why I added the 'for me'.

I just wanted to show that it's not confusing for everybody (like your
mail sounded), that there are people who would actually prefer Jesus'
implementation idea over more short-cuts and that Jesus' did not come up
with something strange but with something that's very similar to a concept
on a different platform and there known and used by a lot of people.


I understand completely.




I don't own a smartphone, so 'long click' is not a known concept to me.

See, learned something new today.


Luckily, I do almost every day :-)

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Ann: class code creation

2016-03-08 Thread Michael Van Canneyt



On Tue, 8 Mar 2016, Ondrej Pokorny wrote:


On 08.03.2016 15:51, Michael Van Canneyt wrote:
I introduced the ctrl+shift+x shortcut for the "interactive Code 
Completion" (class code create).


Aha. This was not clear to me ?


Just read the very first email from this thread :)



So would it be correct to say that
  ctrl-shift-x = ctrl-shift-c but with dialog if a dialog exists ?


Yes, correct! This is the new policy. (That will also mean that ctrl+shift+c 
on method completion won't show a dialog any more, but place the method to 
the public section.)


Great. No more wishes from me then. Good job ! :-)

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Ann: class code creation

2016-03-08 Thread Michael Van Canneyt



On Tue, 8 Mar 2016, Ondrej Pokorny wrote:


On 08.03.2016 15:07, Mattias Gaertner wrote:

ctrl-shift-x -> ctrl-shift-alt-x
>ctrl-shift-space -> ctrl-shift-alt-space
>etc.
>
>(btw those are some ugly short-cuts)

Code completion is ctrl+shift+c. I thought Michael's X was a typo or
placeholder.


I introduced the ctrl+shift+x shortcut for the "interactive Code Completion" 
(class code create).


Aha. This was not clear to me ?

So would it be correct to say that
  ctrl-shift-x = ctrl-shift-c 
but with dialog if a dialog exists ?


Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Ann: class code creation

2016-03-08 Thread Michael Van Canneyt



On Tue, 8 Mar 2016, Reimar Grabowski wrote:


On Tue, 8 Mar 2016 10:13:22 +0100
Mattias Gaertner <nc-gaert...@netcologne.de> wrote:


On Tue, 8 Mar 2016 09:49:45 +0100 (CET)
Michael Van Canneyt <mich...@freepascal.org> wrote:


[...]
No, this kind of behaviour is very confusing

for me.

See, fixed that for you.
Because at least I and Jesus do not think so. It is common behavior on touch 
devices ('long click').
Give some visual clue (a little (animated) icon on the identifier when the key 
combination is held for example), document it and you are good to go.
On this and the fpc list it is often said that lazarus/fpc are tools for 
programmers and a little more can be expected of them than of the general user.
'Long click' is a well known and often used UI concept, so you should be able 
to transfer your knowledge of the virtual keyboard of your phone to the real 
keyboard in front of your monitor.


Well. You take yourself as a reference I think.

I don't own a smartphone, so 'long click' is not a known concept to me.
I have never met it on a PC.

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Microsoft SQL Server coming to Linux

2016-03-08 Thread Michael Van Canneyt



On Tue, 8 Mar 2016, vfclists . wrote:



The cloud is getting dominated by Linux and if Microsoft doesn't have an
offering there it is bound to be left out. The idea is to let customers who
may be tempted switch to Linux  know that SQL Server will be available for
them if they do..


I'm sure they have their reasons. 
I don't want to dissuade other people of using their favourite product.


The point was simply to react on the 'good news all round':
One man's good news is another man's bad tidings :)

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Microsoft SQL Server coming to Linux

2016-03-08 Thread Michael Van Canneyt



On Tue, 8 Mar 2016, Anthony Walter wrote:


For those of you using Linux with interest in database development here is
some news for you:

Microsoft SQL Server will soon be officially supported on Linux.

https://blogs.microsoft.com/blog/2016/03/07/announcing-sql-server-on-linux/

Microsoft Executive Vide President Scott Gu has been coordinating with Mark
Shuttleworth (Ubuntu owner and head of Canonical) to make this happen.

For me this is great news. Microsoft SQL Server is a robust RMDB system
with superior performance capable of great scale. Transact SQL (the
Microsoft SQL Server dialect) also has many powerful and useful features.
Good news all around.


Well, that depends highly on your point of view :)
My point of view is that the sooner Microsoft is bancrupted the better...

And I beg to differ on a second account:
E.g. PostGreSQL is a way better/faster database than SQL Server.
Not to mention it costs you nothing.

Just to say that these are highly subjective views...

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Ann: class code creation

2016-03-08 Thread Michael Van Canneyt



On Mon, 7 Mar 2016, Jesus Reyes A. wrote:

En Mon, 07 Mar 2016 21:21:03 -0600, Ondrej Pokorny  
escribió:



I don't think this is possible or reasonable.

On 08.03.2016 2:39, Dmitry Boyarintsev wrote:

procedure TClass.Test(y: integer);
begin
 x private|:= y;
end;


One problem is that CodeTools need valid syntax in front of y to evaluate 
the type of y correctly (the type that x gets).



Eventually people will know the dialog well, so selecting the needed item 
in the dialog might be painful.


Then we should do some kind of fast select possibility in the dialog.  From 
my point of view, typing "x private" is more paintful than writing just "x" 
and then selecting the section with key up/down from the dialog. If you add 
only private variables, you can make it the default choice (in 
Options->Code tools->Code creation) and then the dialog doesn't pop-up.


Ondrej


Some crazy idea:

Detect the shortcut being pressed and then start a timer, if the user 
releases the shortcut before the timer triggers, then the user wants to use 
the previous selection (in this case the private section for example) and 
then no dialog is needed, if there is no previous selection or the timer 
triggers then show the dialog. The timer interval would need to be a setting 
so it can be adjusted by the end user. :)


No, this kind of behaviour is very confusing. Then better 2 shortcut keys:
ctrl-shift-X = create using default set in options.
ctrl-alt-X or ctrl-shift-alt-X = create and force dialog.
Or something similar.

Michael.--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Ann: class code creation

2016-03-07 Thread Michael Van Canneyt



On Mon, 7 Mar 2016, Ondrej Pokorny wrote:

I implemented "class code creation" in r51851. I was already tired of 
creating/copying object variables by hand. The idea is the same as with code 
creation (ctrl+shift+c), but the variable is created in one of the class 
section:


Nice, that will come in handy !

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] PDF generator

2016-03-05 Thread Michael Van Canneyt



On Sat, 5 Mar 2016, Martok wrote:


Nice work! Certainly comes just in time as I'm looking at PDF libraries for the
next work-related project.


- On windows (possibly mac), allow to use native font mechanisms for extracting 
info from TTF files.

Would using freetype/freetype2 make more sense? There are native implementations
in the CCR and the freetype2 library interface is surprisingly simple as well.


Well, I didn't want to use external libraries.

I have no idea of the state of Freetype in CCR. 
Last time I checked it, it was totally incomprehensible and hopelessly outdated code.

But I certainly may be wrong there, although a quick look at e.g. ttfile.pas
is not exactly encouraging.

But nothing prevents the use of these libraries: since we need to 'abstract'
out the relevant functionality anyway for the Windows OS, a kind of
manager/driver approach such as used in other parts of the RTL is a definite 
possibility.

(On windows, the OS itself provides these functions, the situation is different 
there)

Contributions in this area are definitely welcome.

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] PDF generator

2016-03-05 Thread Michael Van Canneyt



On Sat, 5 Mar 2016, silvioprog wrote:


On Sat, Mar 5, 2016 at 2:27 PM, Michael Van Canneyt <mich...@freepascal.org>
wrote:
[...]


Optionally:
- PDF Forms ?
- Archive format ?
- Signatures ?



- File attachments? [1]

[1] https://github.com/libharu/libharu/blob/master/demo/attach.c


I have added it to the list in the readme file :-)

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] 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 latter is important because the PDFs must be generated on a headless (no
display) webserver.

So, the fcl-pdf package contains a PDF generating unit fppdf that does not 
depend
on any external libraries or GUI system.

The PDF generator has the following features:
- Support for basic shapes.
- Support for basic line styles.
- Dictionary support.
- Multi-page PDF.
- Image support.
- TTF Font support.
- Font embedding.
- Unicode font support.
- Stream Compression.
- Image embedding.
- Several paper types.
- Portrait/Landscape.
- Support for multiple measurement units.
- Rotation matrix system.
- PDF creator information.
- The generated PDF passes several PDF validators.

The library is based on a library that came with FPGUI, with a feature set
which came closest to what I desired. It was completed for the company I
work for by Graeme Geldenhuys, and is heavily unit tested.

It is not yet feature-complete, but the above should be ample for most
applications.

In the near future, I expect to commit a reporting engine which, likewise, 
does not need a GUI (but can use one) and uses the PDF generator as one 
possible backend.


Todo:
- Implement TFPCustomCanvas descendent (TPDFCanvas) that draws on a PDF.
  (should allow easy integration in LCL) 
- Partial embedding of (unicode) fonts (only used glyphs) for smaller PDFs.

- On windows (possibly mac), allow to use native font mechanisms for extracting 
info from TTF files.
- Reduce memory usage by streaming finished pages to file.

Optionally:
- PDF Forms ?
- Archive format ?
- Signatures ?

Enjoy,

I would welcome additional tests/demos, suggestions, bugreports, improvements 
or patches.

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] How to automatically free classes/objects?

2016-03-01 Thread Michael Van Canneyt



On Tue, 1 Mar 2016, Aradeonas wrote:


Subject say what I want and as discussed here there are couple of ways to do 
this and one of them is a custom garbage collector :
http://stackoverflow.com/questions/415958/how-to-automatically-free-classes-objects

I want to know is there any better way in Lazarus or what should I do?


There is no better way (yet).

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Raspberry Pi 3 Now Available

2016-02-29 Thread Michael Van Canneyt



On Mon, 29 Feb 2016, Anthony Walter wrote:


This is just a heads up to Lazrus/FPC users who are interested in the
Raspberry Pi.

Raspberry Pi is now available. New features include integrated wireless
bluetooth, and a quad-core 64-bit ARM Cortex A53 clocked at 1.2 GHz.

https://www.raspberrypi.org/blog/raspberry-pi-3-on-sale



Damn, I just bought a Raspberry Pi 2 :-/

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] [ANN] Eye Candy Controls 0.9.4

2016-02-29 Thread Michael Van Canneyt



On Sun, 28 Feb 2016, Vojtěch Čihák wrote:


 
Hello,
 
I released new version of EC-Controls. Announcement is on the forum: 
http://forum.lazarus.freepascal.org/index.php/topic,31734.0.html
 
The main thing is the new tab-control alternative with support for tab stacking 
and multiple rows.


Impressive job !

Michael.--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Easy to use memory dataset and TMemDataset problems

2016-02-26 Thread Michael Van Canneyt



On Fri, 26 Feb 2016, Aradeonas wrote:


Hi,

I want a memory dataset like VirtualTable [1]and really I cant
understand what are these bufdataset and memdataset and wiki[2] page as
I cant make bufdataset works without a file.


Why not ? It should perfectly work without file.

Michael.
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


  1   2   3   4   5   6   7   8   9   10   >