[Lazarus] fpPDF: cannot embed DejaVu font

Ondrej Pokorny lazarus at kluug.net
Wed Apr 13 13:43:28 CEST 2016


On 13.04.2016 13:09, 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.

Great, thank you. Please also take a look at the next project that uses 
FreeSansBoldOblique.ttf. If range checking is ON, the project fails with 
a range error in TPDFDocument.CreateFontDescriptor line 
FDict.AddInteger('ItalicAngle',Fonts[EmbeddedFontNum].FTrueTypeFile.ItalicAngle);
(The LongWord ItalicAngle property is out of Integer bounds).

#0 HANDLEERRORADDRFRAME(201, 0x4358ee, 0x15bfd9c) at ..\inc\system.inc:1133
#1 HANDLEERRORADDRFRAMEIND(201, 0x4358ee, 0x15bfd9c) at 
..\inc\system.inc:1152
#2 fpc_rangeerror at ..\inc\system.inc:746
#3 CREATEFONTDESCRIPTOR(0x1881628, 0) at 
..\..\..\..\..\..\..\software\FPC\trunk_src\packages\fcl-pdf\src\fppdf.pp:3415
#4 CREATETTFDESCENDANTFONT(0x1881628, 0) at 
..\..\..\..\..\..\..\software\FPC\trunk_src\packages\fcl-pdf\src\fppdf.pp:3376
#5 CREATETTFFONT(0x1881628, 0) at 
..\..\..\..\..\..\..\software\FPC\trunk_src\packages\fcl-pdf\src\fppdf.pp:3352
#6 CREATEFONTENTRIES(0x1881628) at 
..\..\..\..\..\..\..\software\FPC\trunk_src\packages\fcl-pdf\src\fppdf.pp:3726
#7 SAVETOSTREAM(0x1881628, 0x185c388) at 
..\..\..\..\..\..\..\software\FPC\trunk_src\packages\fcl-pdf\src\fppdf.pp:3750
#8 main at DejaVuFont.lpr:35

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

Ondrej




More information about the Lazarus mailing list