Hi,

If you _would_ like to add this to PoDoFo, you would have to adapt the 
PdfFontMetrics constructor (that one that gets a PdfObject) so that 
PdfFontMetrics can create a FreeType FT_Face from embedded (or not embedded) 
font data.

Best regards,
        Dom

Am Donnerstag 11 Februar 2010 schrieb Ulrich Simon:
> Am 10.02.2010 00:54, schrieb Leonard Rosenthol:
> > Using a font that already exists in a PDF is NOT a good idea, because
> > in almost all cases the embedded font is NOT complete.
> >
> > It is most likely a subset embed, which means that it doesn't have the
> > full complement of glyphs.  So what happens when you want to use a
> > glyph that isn't in the PDF?
> >
> > Even for fonts that are "fully" embedded - that only means that the
> > glyphs are present, it does NOT mean that all other parts of the font
> > data are embedded.  The PDF producer can (and many do) remove all
> > sorts of other information from the fonts including hinting and layout
> > tables that won't be needed to just render - BUT that you would need
> > to do your layout.
> >
> > This is just one of the many reasons that you can NOT edit a PDF using
> > it's embedded fonts...
> >
> > Leonard
> >
> > On Tue, Feb 9, 2010 at 11:16 AM, Ulrich Simon <[email protected]
> > <mailto:[email protected]>> wrote:
> >
> >     Hi!
> >
> >     We want to add some simple variable data printing (VDP)
> >     functionality into our software and I am
> >     about implementing a method with PoDoFo using PDF Forms.
> >
> >     I have a quite new build from PoDoFo (2010).
> >
> >     My problem:
> >
> >     I want to use the embedded (TrueType) font to create the
> >     AppearanceStream  for a text field.
> >     There is no problem if I load a new font from harddisk. But when I
> >     try to use
> >
> >     PdfFont* PdfFontCache::GetFont( PdfObject* pObject )
> >
> >     I get an PdfObject != NULL, but then
> >
> >     font->SetFontSize(fontSize);
> >
> >     fails. m_face is NULL. It seams it's not implemented yet.
> >
> >     Right?
> >
> >     Without the face I can not calculate the extents of the text.
> >     Is there a special reason, why the function is not implemented?
> >
> >     I don't know if this could work:
> >
> >     PdfFontMetrics::PdfFontMetrics( FT_Library* pLibrary, PdfObject*
> >     pDescriptor ) {
> >         ...
> >         m_bufFontData = PdfRefCountedBuffer( nBufLen );
> >         memcpy( m_bufFontData.GetBuffer(), #pContent#, #nContentLen# );
> >         InitFromBuffer();
> >     }
> 
> Thanks Leonhard!
> 
> Maybe I did not emphasize enough on the fact that we are using AcroForms
> (or XFA Forms as well)
> for this reason. Since every PDF Viewer capable of handling PDF Forms
> depends on a completely
> embedded font and all further information to create the appearance
> stream, there is a way for sure...
> 
> So again my question: How can I create a PdfFont object out of a
> PdfObject of type "font", subtype
> "TrueType" (or other font formats)?
> 
> I hope I do not need to do some "reverse engeneering" in the PoDoFo
> source. Maybe I can get some
> hints what to do or if this feature is planned. Since this is a feature
> needed handling PDF Forms
> PoDoFo should IMO implement this.
> 
> Ulrich
> 


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

------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Podofo-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to