|
12
|
Hello,
I just created the folder "fonts" and copied the "C:\Windows\Fonts\arial.ttf" into that, so I changed the line "D.AddFont('FreeSans.ttf', 'FreeSans-12' to "D.AddFont('arial.ttf', 'Arial", however, when I try to run the project, I get a SIGSEGV:
#0 WRPR_$SYSTEM_$$_TINTERFACEDOBJECT_$_IUNKNOWN_$_2_$_SYSTEM$_$TINTERFACEDOBJECT_$__$$__RELEASE$$LONGINT at :0 #1 ?? at :0 #2 ?? at :0 #3 ?? at :0 #4 WRPR_$SYSTEM_$$_TINTERFACEDOBJECT_$_IUNKNOWN_$_2_$_SYSTEM$_$TINTERFACEDOBJECT_$__$$__RELEASE$$LONGINT at :0 #5 ?? at :0
I also get some warnings and hints in the compilation:
Compile Project, Target: testfppdf.exe: Success, Warnings: 5, Hints: 10 fpparsettf.pp(768,45) Hint: Converting the operands to "Int64" before doing the subtract could prevent overflow errors. fpparsettf.pp(846,25) Hint: Local variable "N" does not seem to be initialized fpparsettf.pp(858,21) Hint: Converting the operands to "Int64" before doing the add could prevent overflow errors. fpparsettf.pp(866,19) Warning: Implicit string type conversion with potential data loss from "WideString" to "AnsiString" fpparsettf.pp(831,3) Note: Local variable "FMT" is assigned but never used fppdf.pp(1003,28) Hint: Local variable "Buffer" does not seem to be initialized fppdf.pp(982,3) Note: Local variable "I" not used fppdf.pp(2008,3) Note: Local variable "cs" not used fppdf.pp(2054,44) Warning: Implicit string type conversion with potential data loss from "UnicodeString" to "AnsiString" fppdf.pp(2641,3) Note: Local variable "lFontIndex" not used fppdf.pp(3001,5) Note: User defined: The 1000 value is a work-around until I can figure out the character spacing problem. fppdf.pp(3006,31) Warning: Implicit string type conversion from "AnsiString" to "WideString" fppdf.pp(3007,35) Warning: Implicit string type conversion from "AnsiString" to "WideString" fppdf.pp(3092,37) Warning: Implicit string type conversion with potential data loss from "WideString" to "AnsiString" testfppdf.lpr(46,11) Hint: Local proc "EmptyPage" is not used
Lazarus 1.7 rUnknown FPC 3.1.1 i386-win32-win32/win64
--
_______________________________________________
fpc-pascal maillist - [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
|
|
On Sat, 5 Mar 2016, silvioprog wrote:
> Hello,
>
> I just created the folder "fonts" and copied the
> "C:\Windows\Fonts\arial.ttf" into that, so I changed the line
> "D.AddFont('FreeSans.ttf', 'FreeSans-12' to "D.AddFont('arial.ttf',
> 'Arial", however, when I try to run the project, I get a SIGSEGV:
>
> #0
> WRPR_$SYSTEM_$$_TINTERFACEDOBJECT_$_IUNKNOWN_$_2_$_SYSTEM$_$TINTERFACEDOBJECT_$__$$__RELEASE$$LONGINT
> at :0
> #1 ?? at :0
> #2 ?? at :0
> #3 ?? at :0
> #4
> WRPR_$SYSTEM_$$_TINTERFACEDOBJECT_$_IUNKNOWN_$_2_$_SYSTEM$_$TINTERFACEDOBJECT_$__$$__RELEASE$$LONGINT
> at :0
> #5 ?? at :0
>
> I also get some warnings and hints in the compilation:
Hm. This is strange, the code does not use interfaces at all.
The compilation hints/warnings do not really present me with a hint as to
what could be wrong.
Any chance to get a better stack backtrace ?
Michael.
_______________________________________________
fpc-pascal maillist - [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
|
|
On Sat, 5 Mar 2016, silvioprog wrote:
> On Sat, Mar 5, 2016 at 3:38 PM, silvioprog < [hidden email]> wrote:
>
>> Hello,
>>
>> I just created the folder "fonts" and copied the
>> "C:\Windows\Fonts\arial.ttf" into that, so I changed the line
>> "D.AddFont('FreeSans.ttf', 'FreeSans-12' to "D.AddFont('arial.ttf',
>> 'Arial", however, when I try to run the project, I get a SIGSEGV:
>>
>
> To fix the SIGSEGV, I just disabled the heap (-gh) unit.
Hehe =-)
>
> Now I put all freetype binaries into my example folder, and after run the
> test, I got a "test.pdf" file about 654KB, but I can't open it on my Adobe
> Reader XI (latest version):
>
> "An error exists on this page. Acrobat may not display the page correctly.
> Please contact the person who created the PDF document to correct the
> problem."
>
> And got five empty pages.
Hm. I tried many PDF readers on the file. All unix based (okular,
openoffice), but also the Google docs PDF viewer and Firefox PDF reader.
All displayed the PDF just fine.
Can you send me the PDF you got ?
Michael
_______________________________________________
fpc-pascal maillist - [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
|
|
On Sat, 05 Mar 2016 14:03:49 -0600, Michael Van Canneyt
< [hidden email]> wrote:
>
> This is what I get with the normal test font:
> http://www.freepascal.org/~michael/test.pdf>
> Can you please try with the original font too, please ?
> (freesans is freely available)
>
> If that works, it would mean there is something wrong with the Arial
> font handling.
>
> Michael.
your file looks like the one I produced here when using "Visor de
documentos" which happen to be evince, this is what it looks
http://ctrlv.in/722669 the only change I did was adding JRAXX at the end
of every P.WriteText'd string where XX is the index of each instance.
Seems only latin text is working.
Later I will try with other readers.
Jesus Reyes A.
_______________________________________________
fpc-pascal maillist - [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
|
|
On Sat, 5 Mar 2016, silvioprog wrote:
> On Sat, Mar 5, 2016 at 5:24 PM, Ralf Quint < [hidden email]> wrote:
>
>> On 3/5/2016 12:03 PM, Michael Van Canneyt wrote:
>>
>>>
>>> This is what I get with the normal test font:
>>> http://www.freepascal.org/~michael/test.pdf>>>
>>> FYI,
>>
>> Opening up this document with the latest Adobe Reader DC
>> (15.10.20059.40980, on Windows 8.1/64), I get an error message saying
>>
>> "The font 'Times' contains a bad /BBox"...
>
>
> Same problem here too. :-/
Hmh. I can reproduce this error, but the file displays using Adobe Acrobat Reader 9.
OK, some more debugging/validation seems in order :/
Michael.
_______________________________________________
fpc-pascal maillist - [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
|
|
On 05/03/2016 20:30, silvioprog wrote:
> "The font 'Times' contains a bad /BBox."
>
> Can you please try with the original font too, please ?
> (freesans is freely available)
>
>
> Yes. Do you downloaded it from
> http://ftp.gnu.org/gnu/freefont/freefont-ttf.zip ?
>
> If so, even using this file above I get same problem (Windows 7 64
> bits). :-/
I don't have the code with me so can't check now. But if the issue is
with Times related text, then FreeFont-ttf.zip should have nothing to do
with the issue you are experiencing. From memory, the FreeFont font is
used for the Unicode text only.
I'll take a look on my return in a week's time (if Michael doesn't beat
me to it). I'll retest with the latest Adobe Reader - clearly it is more
strict than older Adobe Reader versions.
If anybody knows of a online PDF validator (not a PDF Achive format
validator), that would help a huge amount.
Regards,
Graeme
_______________________________________________
fpc-pascal maillist - [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
|
|
On Sat, 5 Mar 2016, Jesus Reyes A. wrote:
> On Sat, 05 Mar 2016 14:03:49 -0600, Michael Van Canneyt
> < [hidden email]> wrote:
>
>>
>> This is what I get with the normal test font:
>> http://www.freepascal.org/~michael/test.pdf>>
>> Can you please try with the original font too, please ?
>> (freesans is freely available)
>>
>> If that works, it would mean there is something wrong with the Arial font
>> handling.
>>
>> Michael.
>
> your file looks like the one I produced here when using "Visor de documentos"
> which happen to be evince, this is what it looks http://ctrlv.in/722669 the
> only change I did was adding JRAXX at the end of every P.WriteText'd string
> where XX is the index of each instance. Seems only latin text is working.
Strange, because if I recall correctly it was tested with Cyrillic, and that worked ?
> Later I will try with other readers.
Please do, I'd welcome any hints as to what could be wrong !
(evince is one of the readers that was used to test, BTW)
Michael.
_______________________________________________
fpc-pascal maillist - [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
|
|
El 06/03/16 a les 10:15, Michael Van Canneyt ha escrit:
> Strange, because if I recall correctly it was tested with Cyrillic, and
> that worked ?
>
>> Later I will try with other readers.
>
> Please do, I'd welcome any hints as to what could be wrong !
>
> (evince is one of the readers that was used to test, BTW)
With okular I see this at the bottom of the first page
http://ctrlv.in/722862These are the details of my okular:
versió 0.23.2
S'utilitza la «KDE Development Platform» 4.14.15
Bye
--
Luca
_______________________________________________
fpc-pascal maillist - [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
|
|
On Sun, 6 Mar 2016, Graeme Geldenhuys wrote:
> On 05/03/2016 19:30, silvioprog wrote:
>> Attached patch to fix warns/hints. (need to test it with FPC 2.6, I
>> tested only in 3.0)
>
> Incidently, fppdf was only developed and tested with FPC 2.6.4 (FPC 3.0 was
> never used).
I did some fixes for 3.0 prior to committing, and the test suites ran fine after that.
Michael.
_______________________________________________
fpc-pascal maillist - [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
|
|
On Sat, 5 Mar 2016, silvioprog wrote:
>>
>> Hm. This is strange, the code does not use interfaces at all.
>> The compilation hints/warnings do not really present me with a hint as to
>> what could be wrong.
>>
>
> Attached patch to fix warns/hints. (need to test it with FPC 2.6, I tested
> only in 3.0)
Applied in rev. 33176.
I added a fix for 2.6 compilation: no Default() intrinsic.
Thanks for the patch.
Michael.
_______________________________________________
fpc-pascal maillist - [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
|
|
On Sun, 06 Mar 2016 03:15:06 -0600, Michael Van Canneyt
< [hidden email]> wrote:
>
>
> On Sat, 5 Mar 2016, Jesus Reyes A. wrote:
>
>> On Sat, 05 Mar 2016 14:03:49 -0600, Michael Van Canneyt
>> < [hidden email]> wrote:
>>
>>> This is what I get with the normal test font:
>>> http://www.freepascal.org/~michael/test.pdf>>> Can you please try with the original font too, please ?
>>> (freesans is freely available)
>>> If that works, it would mean there is something wrong with the Arial
>>> font handling.
>>> Michael.
>>
>> your file looks like the one I produced here when using "Visor de
>> documentos" which happen to be evince, this is what it looks
>> http://ctrlv.in/722669 the only change I did was adding JRAXX at the
>> end of every P.WriteText'd string where XX is the index of each
>> instance. Seems only latin text is working.
>
> Strange, because if I recall correctly it was tested with Cyrillic, and
> that worked ?
>
>> Later I will try with other readers.
>
> Please do, I'd welcome any hints as to what could be wrong !
>
> (evince is one of the readers that was used to test, BTW)
>
> Michael.
The problem of evince not showing some texts it's because the compressed
font file stream size is written with an incorrect value. There is an
option to enable font file compression (poCompressFonts) but in the code,
compression is always enabled, the compressed stream size is returned in
the function that writes down the compressed stream, too late because the
/length item was already written using the uncompressed size. The attached
patch addresses both problems and makes sure length1 item is not written
down if not needed.
This however doesn't fix the Cyrillic and other texts :(
Jesus Reyes A. _______________________________________________
fpc-pascal maillist - [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
|
12
|