Hi Jörg,

Thank you very much for this bug report and sorry that it took me so long to 
answer. I try to slowly answer every mail - but it takes time.

I commited a fix where PoDoFo tries to retrieve the filename from FT_Face, this 
fixes embedding if the FT_Face object was created from a filename.

I am still investigating why the delete pMetrics call fails. I am not yet sure 
what is the problem.

Best regards,
        Dom

Am Donnerstag 07 Januar 2010 schrieb Richter, Jörg:
> Hi,
> 
> I am having trouble using a custom FT_Face with PdfFont:
> 
>     ...
>     FT_Face face;
>     FT_New_Face( document.GetFontLibrary(), "DejaVuSans.ttf", 0, &face );
>     font = document.CreateFont( face );
> 
> CreateFont tries to embed the font, but the filename that it tries to open
>  is empty.
> 
> Backtrace of the throw:
> #0  __cxa_throw (obj=0x980d1d0, tinfo=0xf7f7bc60, dest=0xf7e1c09c
>  <~PdfError>) at
>  ../../../../gcc-4.4.1/libstdc++-v3/libsupc++/eh_throw.cc:68 #1  0xf7e717d7
>  in PdfFileInputStream (this=0xffbb7888, pszFilename=0x804df80 "") at
>  podofo/src/PdfInputStream.cpp:37
> #2  0xf7e55021 in PoDoFo::PdfFontTrueType::EmbedFontFile (this=0x98195f0,
>  pDescriptor=0x980c2d8) at podofo/src/PdfFontTrueType.cpp:76
> #3  0xf7e5338b in PoDoFo::PdfFontSimple::Init (this=0x98195f0, bEmbed=true,
>  rssubty...@0xffbb7e54) at podofo/src/PdfFontSimple.cpp:92
> #4  0xf7e54c3b in PdfFontTrueType (this=0x98195f0, pMetrics=0x9819468,
>  pEncoding=0x9817540, pParent=0x9809d28, bEmbed=true) at
>  podofo/src/PdfFontTrueType.cpp:35
> #5  0xf7e51baa in PoDoFo::PdfFontFactory::CreateFontForType
>  (eType=PoDoFo::ePdfFontType_TrueType, pMetrics=0x9819468,
>  pEncoding=0x9817540, bEmbed=true, pParent=0x9809d28) at
>  podofo/src/PdfFontFactory.cpp:105
> #6  0xf7e51950 in PoDoFo::PdfFontFactory::CreateFontObject
>  (pMetrics=0x9819468, nFlags=1, pEncoding=0x9817540, pParent=0x9809d28) at
>  podofo/src/PdfFontFactory.cpp:46
> #7  0xf7e3cbf1 in PoDoFo::PdfFontCache::CreateFontObject (this=0x9809ce4,
>  itSorted= {<__gnu_debug::_Safe_iterator_base> = {_M_sequence = 0x9809cf0,
>  _M_version = 1, _M_prior = 0x0, _M_next = 0xffbb8034}, _M_current =
>  {_M_current = 0x0}}, rveccontain...@0x9809ce4, pMetrics=0x9819468,
>  bEmbedd=true, bBold=false, bItalic=false, pszFontName=0x98193fc
>  "DejaVuSans", pEncoding=0x9817540) at podofo/src/PdfFontCache.cpp:617
> #8  0xf7e3bb77 in PoDoFo::PdfFontCache::GetFont (this=0x9809ce4,
>  face=0x9818b88, bEmbedd=true, pEncoding=0x9817540) at
>  podofo/src/PdfFontCache.cpp:307
> #9  0xf7e0a7e8 in PoDoFo::PdfDocument::CreateFont (this=0x9809ce0,
>  face=0x9818b88, pEncoding=0x9817540, bEmbedd=true) at
>  podofo/src/PdfDocument.cpp:211
> 
> Please note that the error handling seems to be broken.  Continuing after
>  the throw results in a SEGV in PdfFontFactory::CreateFontObject:
> PdfFontFactory:78            delete pMetrics;
> 
> 
> The only option I see is to disable embedding in the call to CreateFont.
> 
> But how can I use a custom FT_Face and embedding together?  I can provide
>  the filename of the font if necessary.
> 
> 
> Thanks,
>    Jörg
> ---------------------------------------------------------------------------
> --- This SF.Net email is sponsored by the Verizon Developer Community
> Take advantage of Verizon's best-in-class app development support
> A streamlined, 14 day to market process makes app distribution fast and
>  easy Join now and get one step closer to millions of Verizon customers
> http://p.sf.net/sfu/verizon-dev2dev
> _______________________________________________
> Podofo-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/podofo-users
> 


-- 
**********************************************************************
Dominik Seichter - [email protected]
KRename  - http://www.krename.net  - Powerful batch renamer for KDE
KBarcode - http://www.kbarcode.net - Barcode and label printing
PoDoFo - http://podofo.sf.net - PDF generation and parsing library
SchafKopf - http://schafkopf.berlios.de - Schafkopf, a card game,  for KDE
Alan - http://alan.sf.net - A Turing Machine in Java
**********************************************************************

Attachment: signature.asc
Description: This is a digitally signed message part.

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Podofo-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to