Re: [Lazarus] PDF generator: please test

2016-04-14 Thread Graeme Geldenhuys
On 2016-04-14 00:04, Ondrej Pokorny wrote: > You've got a bug in the font height functions. They must not be scaled > with ToNatural. Well done Ondrey, you are indeed correct. Amazing, because the example code I posted was tested with four other fonts. Incidently they all had the same

Re: [Lazarus] PDF generator: please test

2016-04-13 Thread Ondrej Pokorny
You've got a bug in the font height functions. They must not be scaled with ToNatural. Try e.g. the Tahoma font from Windows or any other font where FHead.UnitsPerEm<>1000. You'll see wrong results. Your example works because FHead.UnitsPerEm is 1000 for your version of FreeSans. If you use

Re: [Lazarus] PDF generator: please test

2016-04-11 Thread Graeme Geldenhuys
On 2016-04-11 02:17, Dmitry Boyarintsev wrote: > I always assumed it represents text as a sequence of glyphs, rather than > sequence of characters. But it seems like both options are possible. No, your first assumption is correct. When it comes to PDF, there is NO notion of text strings (sequence

Re: [Lazarus] PDF generator: please test

2016-04-11 Thread Graeme Geldenhuys
On 2016-04-10 09:23, Michael Van Canneyt wrote: > Font substitution is a potentially huge subject. > I would not want this in the initial low-level API. Indeed. The *nix libXft.so library with combination of FontConfig does this for general desktop applications, but it is a huge task. Windows

Re: [Lazarus] PDF generator: please test

2016-04-10 Thread Dmitry Boyarintsev
On Sun, Apr 10, 2016 at 4:23 AM, Michael Van Canneyt wrote: > > > 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. I see the issue now. It's in my perception of PDF format.

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

Re: [Lazarus] PDF generator: please test

2016-04-10 Thread Graeme Geldenhuys
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

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

Re: [Lazarus] PDF generator: please test

2016-04-10 Thread Dmitry Boyarintsev
On Sun, Apr 10, 2016 at 3:15 AM, Michael Van Canneyt 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

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

Re: [Lazarus] PDF generator: please test

2016-04-10 Thread Ondrej Pokorny
On 10.04.2016 1:02, Graeme Geldenhuys wrote: P.WriteUTF8Text(25, 20, 'Sample Text'); > >xFontCache := TFPFontCacheList.Create; >try > xFont := TFPFontCacheItem.Create('fonts\FreeSans.ttf'); > xFontCache.Add(xFont); > xWidth := xFont.TextWidth('Sample Text', cFontSize) *

Re: [Lazarus] PDF generator: please test

2016-04-09 Thread Ondrej Pokorny
On 08.04.2016 23:35, Graeme Geldenhuys wrote: As note: If I compile with -Cr, I got a Runerror 201 in unit fpparsettf >on line 810. I made a note of that, thanks. The attached patch fixes the range error. Ondrej Index: fpparsettf.pp

Re: [Lazarus] PDF generator: please test

2016-04-09 Thread Graeme Geldenhuys
On 2016-04-10 00:02, Graeme Geldenhuys wrote: > Here is verbosely commented code that draws a rectangle around the Page > Title text. Apologies, here is the correct code. = { Page title } P.SetFont(FtText1, 23); P.SetColor(clBlack, false);

Re: [Lazarus] PDF generator: please test

2016-04-09 Thread Graeme Geldenhuys
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

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

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

Re: [Lazarus] PDF generator: please test

2016-04-09 Thread Ondrej Pokorny
On 09.04.2016 19:42, 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

Re: [Lazarus] PDF generator: please test

2016-04-09 Thread Graeme Geldenhuys
On 2016-04-09 16:51, Giuliano Colla wrote: > I'd say that Здравствуйте > мир! is to be preferred, because it has a higher number of characters! Good point. :) Regards, - Graeme - -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org

Re: [Lazarus] PDF generator: please test

2016-04-09 Thread Graeme Geldenhuys
On 2016-04-09 18:33, Ondrej Pokorny wrote: > What PDF documentation do you use? (Where can I find information on PDF > creating?) I used the official PDF v1.3 specification document. All 700 pages of it, which I've probably read a 100 times over now. :)

Re: [Lazarus] PDF generator: please test

2016-04-09 Thread Graeme Geldenhuys
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,

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

Re: [Lazarus] PDF generator: please test

2016-04-09 Thread Ondrej Pokorny
On 09.04.2016 19:28, Graeme Geldenhuys wrote: On 2016-04-09 17:27, 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? It's on the todo list, as is Text Compression, Font

Re: [Lazarus] PDF generator: please test

2016-04-09 Thread Graeme Geldenhuys
On 2016-04-09 17:27, 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? It's on the todo list, as is Text Compression, Font Subset Embedding and many more. You are welcome

Re: [Lazarus] PDF generator: please test

2016-04-09 Thread Ondrej Pokorny
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

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

Re: [Lazarus] PDF generator: please test

2016-04-09 Thread wkitty42
On 04/09/2016 10:57 AM, Ondrej Pokorny wrote: On 09.04.2016 15:44, wkitt...@windstream.net wrote: On 04/09/2016 04:30 AM, 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

Re: [Lazarus] PDF generator: please test

2016-04-09 Thread Лагунов Алексей
Correct - Привет мир!16:44, 9 апреля 2016 г., "wkitt...@windstream.net" :On 04/09/2016 04:30 AM, 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

Re: [Lazarus] PDF generator: please test

2016-04-09 Thread Ondrej Pokorny
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? AFAIR SynPDF uses JPEG compression for images. Ondrej -- ___ Lazarus mailing list

Re: [Lazarus] PDF generator: please test

2016-04-09 Thread Giuliano Colla
Il 09/04/2016 16:47, Graeme Geldenhuys ha scritto: On 2016-04-09 14:44, wkitt...@windstream.net wrote: interesting in what determines "correct"... Алло мир! Привет мир! Здравствуйте мир! That's my point exactly. I've seen the same thing in fpGUI's translation files. Many different terms, all

Re: [Lazarus] PDF generator: please test

2016-04-09 Thread Ondrej Pokorny
On 09.04.2016 10:40, Michael Van Canneyt wrote: Fixed in rev. 33456. Thanks :) Ondrej -- ___ 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 Ondrej Pokorny
On 09.04.2016 15:44, wkitt...@windstream.net wrote: On 04/09/2016 04:30 AM, 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

Re: [Lazarus] PDF generator: please test

2016-04-09 Thread Graeme Geldenhuys
On 2016-04-09 14:44, wkitt...@windstream.net wrote: > interesting in what determines "correct"... > > Алло мир! > Привет мир! > Здравствуйте мир! That's my point exactly. I've seen the same thing in fpGUI's translation files. Many different terms, all apparently meaning the same thing. Some

Re: [Lazarus] PDF generator: please test

2016-04-09 Thread wkitty42
On 04/09/2016 04:30 AM, 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.

Re: [Lazarus] PDF generator: please test

2016-04-09 Thread Лагунов Алексей
This text on russian:"Привет мир!"12:05, 9 апреля 2016 г., Graeme Geldenhuys :On 2016-04-09 09:19, Ondrej Pokorny wrote: You should learn how to use Google Translate :)I use it a lot. The page you link here shows you  the typo explicitely just below the original

Re: [Lazarus] PDF generator: please test

2016-04-09 Thread Graeme Geldenhuys
Hi, I'm on my way out, so can't comment on all parts right now. There is still quite a few improvements that need to be made to fpPDF - features and some tweaks to the API. As for WriteText() versus WriteUTF8Text(). These grew from the fact that Standard built-in PDF Fonts were implemented

Re: [Lazarus] PDF generator: please test

2016-04-09 Thread Graeme Geldenhuys
On 2016-04-09 09:19, Ondrej Pokorny wrote: > You should learn how to use Google Translate :) I use it a lot. > The page you link here shows you > the typo explicitely just below the original text... Okay, but clicking on the second link below the one you are referring to, and you still get

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.

Re: [Lazarus] PDF generator: please test

2016-04-09 Thread Ondrej Pokorny
On 09.04.2016 10:09, Ondrej Pokorny wrote: 4. I cannot make TFPFontCacheItem.TextWidth work. (I was able to make "TextWidth" work, though.) That should read: (I was able to make "*TextHeight*" work, though.) Ondrej -- ___ Lazarus mailing list

Re: [Lazarus] PDF generator: please test

2016-04-09 Thread Ondrej Pokorny
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

Re: [Lazarus] PDF generator: please test

2016-04-09 Thread Ondrej Pokorny
On 08.04.2016 23:34, Graeme Geldenhuys wrote: On 2016-04-08 19:55, Ondrej Pokorny wrote: Btw. you have a typo in the Russian "Hello, word". The first word should be "Здравстуйте". Not according to Google Translate. :)

Re: [Lazarus] PDF generator: please test

2016-04-09 Thread Ondrej Pokorny
I started testing. 1. Why does TFPFontCacheItem.GetFontData create and load TTFFileInfo every time it is called? As a result TTFFileInfo is created and loaded every time TextWidth is called - there's no way to go around this. The TTFFileInfo should be cached IMO. Please consider the attached

Re: [Lazarus] PDF generator: please test

2016-04-08 Thread Graeme Geldenhuys
On 2016-04-08 20:22, Michael W. Vogel wrote: > (60mm,100mm) Times-BoldItalic: Big text at absolute position > Languages: English: Hello, World! > Greek: Γειά σου κόσμος If you could copy the text out of the displayed PDF, that means I got the ToUnicode structure correct too. Nice. I forgot to

Re: [Lazarus] PDF generator: please test

2016-04-08 Thread Graeme Geldenhuys
On 2016-04-08 19:55, Ondrej Pokorny wrote: > Btw. you have a typo in the Russian "Hello, word". The first word should > be "Здравстуйте". Not according to Google Translate. :)

Re: [Lazarus] PDF generator: please test

2016-04-08 Thread Ondrej Pokorny
On 08.04.2016 21:29, Graeme Geldenhuys wrote: On 2016-04-08 20:27, Ondrej Pokorny wrote: Correct, when I took the font from Lazarus\components\aggpas as Michael W. Vogel did, everything looks good! Awesome! Just curious. What is your Windows locale set at? Currently Czech (+Windows 10).

Re: [Lazarus] PDF generator: please test

2016-04-08 Thread Graeme Geldenhuys
On 2016-04-08 19:55, Ondrej Pokorny wrote: > (Still it would be fine to provide links where compatible versions of > the fonts can be found.) Our internal SVN repo had such a file - albeit not 100% complete. As Michael mentioned, the unit tests will definitely be dependent on the exact font

Re: [Lazarus] PDF generator: please test

2016-04-08 Thread Graeme Geldenhuys
On 2016-04-08 20:27, Ondrej Pokorny wrote: > Correct, when I took the font from Lazarus\components\aggpas as Michael > W. Vogel did, everything looks good! Awesome! Just curious. What is your Windows locale set at? Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using

Re: [Lazarus] PDF generator: please test

2016-04-08 Thread Graeme Geldenhuys
On 2016-04-08 20:13, Michael Van Canneyt wrote: >> > 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. Sjoe, that first PDF got me worried! :-) It does look like a DejaVu

Re: [Lazarus] PDF generator: please test

2016-04-08 Thread Ondrej Pokorny
On 08.04.2016 21:13, Michael Van Canneyt wrote: 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. Correct, when I took the font from Lazarus\components\aggpas as Michael W. Vogel

Re: [Lazarus] PDF generator: please test

2016-04-08 Thread Michael W. Vogel
Am 08.04.2016 um 20:22 schrieb 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

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

Re: [Lazarus] PDF generator: please test

2016-04-08 Thread Ondrej Pokorny
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

Re: [Lazarus] PDF generator: please test

2016-04-08 Thread Ondrej Pokorny
Sorry, I missed the latest revision. I'll update and report back! Ondrej -- ___ 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 Ondrej Pokorny
On 08.04.2016 20:43, Michael Van Canneyt wrote: The test program to use to generate a PDF, is however "examples/testfppdf.lpi" I should maybe have mentioned that more explicitly. No problem. Thanks :) (Still it would be fine to provide links where compatible versions of the fonts can be

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

Re: [Lazarus] PDF generator: please test

2016-04-08 Thread Ondrej Pokorny
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

[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

Re: [Lazarus] PDF generator, try 2

2016-04-07 Thread Sven Barth
Am 07.04.2016 14:58 schrieb "Martin Schreiber" : > > On Thursday 07 April 2016 13:49:06 Graeme Geldenhuys wrote: > > I was about to mention that. This was discussed before, and there was a > > reason (which eludes me now) why FillChar() will not be changed. > > Because out

Re: [Lazarus] PDF generator, try 2

2016-04-07 Thread Martin Schreiber
On Thursday 07 April 2016 13:49:06 Graeme Geldenhuys wrote: > I was about to mention that. This was discussed before, and there was a > reason (which eludes me now) why FillChar() will not be changed. Because out parameters are finalised on caller side: " Procedure FillChar1(out

Re: [Lazarus] PDF generator, try 2

2016-04-07 Thread Sven Barth
Am 07.04.2016 13:49 schrieb "Graeme Geldenhuys" < mailingli...@geldenhuys.co.uk>: > > On 2016-04-07 12:25, Martok wrote: > > If Move+FillChar would use out instead of var (as they should - they don't read > > the dest value, that's the whole point), that would be fixed once and for all. > > But I

Re: [Lazarus] PDF generator, try 2

2016-04-07 Thread Graeme Geldenhuys
On 2016-04-07 12:25, Martok wrote: > If Move+FillChar would use out instead of var (as they should - they don't > read > the dest value, that's the whole point), that would be fixed once and for all. > But I remember having this discussion before and apparently it was like this > for > some

Re: [Lazarus] PDF generator, try 2

2016-04-07 Thread Martok
>> You will get the hint here then, no ? > > No. Seems the compiler is more lenient with pointer types. That's a bug then, isn't it? After all, it's about the var parameter, not what is passed into it... The variable that is passed into FillChar is not yet initialized, but it could be read

Re: [Lazarus] PDF generator, try 2

2016-04-07 Thread Graeme Geldenhuys
On 2016-04-07 11:37, Michael Van Canneyt wrote: > You will get the hint here then, no ? No. Seems the compiler is more lenient with pointer types. Regards, - Graeme - -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org

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

Re: [Lazarus] PDF generator, try 2

2016-04-07 Thread Graeme Geldenhuys
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

Re: [Lazarus] PDF generator, try 2

2016-04-07 Thread Graeme Geldenhuys
On 2016-04-07 07:36, Michael Van Canneyt wrote: > > This should not exist to begin with, I think. > The UTF8Decode function of the system unit performs the same function. Indeed, you are correct. I'll make the change. Regards, - Graeme - -- ___

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

Re: [Lazarus] PDF generator, try 2

2016-04-06 Thread Sven Barth
Am 07.04.2016 07:43 schrieb "Jesus Reyes A." : > > En Wed, 06 Apr 2016 13:14:49 -0500, Michael Van Canneyt < mich...@freepascal.org> escribió: > >> >> >> On Wed, 6 Apr 2016, silvioprog wrote: >> >>> On Wed, Apr 6, 2016 at 2:14 PM, Michael Van Canneyt < mich...@freepascal.org>

Re: [Lazarus] PDF generator, try 2

2016-04-06 Thread Jesus Reyes A.
En Wed, 06 Apr 2016 13:14:49 -0500, Michael Van Canneyt escribió: On Wed, 6 Apr 2016, silvioprog wrote: On Wed, Apr 6, 2016 at 2:14 PM, Michael Van Canneyt wrote: [...] Why is this patch needed ? It should not be needed at all ?

Re: [Lazarus] PDF generator, try 2

2016-04-06 Thread Jesus Reyes A.
On Wed, 06 Apr 2016 12:23:12 -0500, Graeme Geldenhuys wrote: On 2016-04-01 20:16, Jesus Reyes A. wrote: (it seems currently is not necessary because the matrix is auto-adjusted) and then ... P.WriteUTF8Text(15, 120, 'Languages: English: Hello, World!');

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 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

Re: [Lazarus] PDF generator, try 2

2016-04-06 Thread silvioprog
On Wed, Apr 6, 2016 at 2:14 PM, Michael Van Canneyt 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

Re: [Lazarus] PDF generator, try 2

2016-04-06 Thread Graeme Geldenhuys
On 2016-04-01 02:21, Jesus Reyes A. wrote: >> > // Add your custom page as follows >> > P := TMyPDFPage.Create(Doc); >> > Doc.Pages.Add(P); // global Page Object list >> > lSection.AddPage(P); // which Section our page belongs too >> > > Yes that would suffice, thanks. This change has

Re: [Lazarus] PDF generator, try 2

2016-04-06 Thread Graeme Geldenhuys
On 2016-04-06 18:23, Michael Van Canneyt wrote: > Patch applied. Rev. 33428. Thanks Michael. Regards, - Graeme - -- ___ 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 Graeme Geldenhuys
On 2016-04-06 18:18, Michael Van Canneyt wrote: >>> >> procedure CreateTTFCIDSystemInfo(const {%H-}EmbeddedFontNum: >>> >> integer;{%H-}FontDef: TFontDef);virtual; >>> >> >> > >> > {$HINTS OFF} instead of it? > No, fix the hint (if possible). > As I "hinted" (excuse the pun) at before, any

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.

Re: [Lazarus] PDF generator, try 2

2016-04-06 Thread Graeme Geldenhuys
On 2016-04-01 20:16, Jesus Reyes A. wrote: > (it seems currently is not necessary because the matrix is auto-adjusted) > and then ... > >P.WriteUTF8Text(15, 120, 'Languages: English: Hello, World!'); >P.WriteUTF8Text(40, 130, 'Greek: -FÃåéÜ óïõ êüóìïò'); >P.WriteUTF8Text(40, 140,

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

Re: [Lazarus] PDF generator, try 2

2016-04-06 Thread Graeme Geldenhuys
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. Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using

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 wrote: [...] Greek: Ge?? s?? ??s Polish: Witaj swiecie Portuguese: Ol? mundo Russian:

Re: [Lazarus] PDF generator, try 2

2016-04-06 Thread silvioprog
On Wed, Apr 6, 2016 at 1:57 PM, 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 >>> wrote: >> >> [...] > >> Greek: Ge?? s?? ??s >>> Polish:

Re: [Lazarus] PDF generator, try 2

2016-04-06 Thread silvioprog
On Thu, Mar 31, 2016 at 1:13 PM, Michael Van Canneyt wrote: > > On Thu, Mar 31, 2016 at 11:18 AM, silvioprog wrote: > > [...] > Greek: Ge?? s?? ??s >> Polish: Witaj swiecie >> Portuguese: Ol? mundo >> Russian: ??? >> Vietnamese: Xin

Re: [Lazarus] PDF generator, try 2

2016-04-06 Thread silvioprog
On Thu, Mar 31, 2016 at 1:17 PM, Michael Van Canneyt wrote: [...] > Please, don't do {%H-} etc: > > procedure CreateTTFCIDSystemInfo(const {%H-}EmbeddedFontNum: > integer;{%H-}FontDef: TFontDef);virtual; > {$HINTS OFF} instead of it? > Typecasts like this should also

Re: [Lazarus] PDF generator, try 2

2016-04-06 Thread silvioprog
On Thu, Mar 31, 2016 at 1:26 PM, Graeme Geldenhuys < mailingli...@geldenhuys.co.uk> wrote: [...] > On 2016-03-31 17:13, Michael Van Canneyt wrote: > > I had a look at your PDF. I did not extract the embedded FreeSans font > you have embedded, so don't know the font file version, but based on its

Re: [Lazarus] PDF generator, try 2

2016-04-06 Thread silvioprog
On Thu, Mar 31, 2016 at 1:13 PM, Michael Van Canneyt wrote: [...] > 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 > >

Re: [Lazarus] PDF generator, try 2

2016-04-02 Thread Graeme Geldenhuys
On 2016-04-01 20:16, Jesus Reyes A. wrote: >P.WriteUTF8Text(15, 120, 'Languages: English: Hello, World!'); >P.WriteUTF8Text(40, 130, 'Greek: -FÃåéÜ óïõ êüóìïò'); >P.WriteUTF8Text(40, 140, 'Polish: Witaj -B¶wiecie'); >P.WriteUTF8Text(40, 150, 'Portuguese: Ol-Aá mundo'); > > Of

Re: [Lazarus] PDF generator, try 2

2016-04-01 Thread Jesus Reyes A.
On Thu, 31 Mar 2016 18:16:18 -0600, Graeme Geldenhuys wrote: BTW, out of curiosity, in the sample there is code like this: lPt1 := P.Matrix.Transform(15, 120); P.WriteUTF8Text(lPt1.X, lPt1.Y, 'Languages: English: Hello, World!'); lPt1 :=

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

Re: [Lazarus] PDF generator, try 2

2016-03-31 Thread Ondrej Pokorny
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

Re: [Lazarus] PDF generator, try 2

2016-03-31 Thread Jesus Reyes A.
En Thu, 31 Mar 2016 18:16:18 -0600, Graeme Geldenhuys escribió: On 2016-03-31 22:18, Jesus Reyes A. wrote: TPDFPage has some basic primitives for drawing: lines, rects, ellipses and images. I don't see a way to add our own (except by patches to fpPDF of

Re: [Lazarus] PDF generator, try 2

2016-03-31 Thread Graeme Geldenhuys
On 2016-03-31 22:18, Jesus Reyes A. wrote: > TPDFPage has some basic primitives for drawing: lines, rects, ellipses and > images. I don't see a way to add our own (except by patches to fpPDF of > course) I like the idea of giving developers the ability to extend TPDFPage with more drawing

Re: [Lazarus] PDF generator, try 2

2016-03-31 Thread Jesus Reyes A.
On Thu, 31 Mar 2016 14:58:07 -0600, Michael Van Canneyt wrote: 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

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

Re: [Lazarus] PDF generator, try 2

2016-03-31 Thread Ondrej Pokorny
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;

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;

Re: [Lazarus] PDF generator, try 2

2016-03-31 Thread Ondrej Pokorny
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? Ondrej -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org

Re: [Lazarus] PDF generator, try 2

2016-03-31 Thread Graeme Geldenhuys
On 2016-03-31 17:17, Michael Van Canneyt wrote: > - Arr.AddIntArray(FontDef.FCharWidth); > + Arr.AddIntArray(string(FontDef.FCharWidth)); > > We need to investigate why you think this typecast is needed. Plus the fact that I haven't complete all the code clean-up yet. As far as I can see all

Re: [Lazarus] PDF generator, try 2

2016-03-31 Thread Graeme Geldenhuys
On 2016-03-31 17:13, Michael Van Canneyt wrote: >> 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". I believe the loop is caused by the usage of TCustomApplication (the

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 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

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 wrote: On Thu, Mar 31, 2016 at 11:18 AM, silvioprog wrote: On Thu, Mar 31, 2016 at 11:02 AM, Michael Van Canneyt < mich...@freepascal.org> wrote: Hello In

Re: [Lazarus] PDF generator, try 2

2016-03-31 Thread silvioprog
On Thu, Mar 31, 2016 at 12:45 PM, silvioprog wrote: > On Thu, Mar 31, 2016 at 11:18 AM, silvioprog wrote: > >> On Thu, Mar 31, 2016 at 11:02 AM, Michael Van Canneyt < >> mich...@freepascal.org> wrote: >>> >>> Hello >>> >>> In revision 33401 of FPC

  1   2   >