Hi Nenad,

Thank you.

I ran a few tests and it does seem to work as you said. Unfortunately, there is 
still a regression when you add text to an existing PDF file. The freshly added 
text is displayed correctly but it looks like all the already embedded fonts 
become corrupted. Acrobat shows garbage instead of the text and it complains 
that it cannot find the fonts. The same code works fine without the patch. Any 
idea what could cause this?

I am personally not aware of a need to cast PdfFontMetrics objects (I’m just a 
random guy with commit privileges, and I only am familiar with a small subset 
of PoDoFo’s features), but don’t hesitate to submit any patch that you feel 
would improve the library.

Regards,

-- 
Palmer Zent

On October 24, 2015 at 5:31:50 AM, Nenad Novak ([email protected]) wrote:


Here are patches based on revision 1686.  

Please try them.  

There is a little change inside PdfFontCID class. Generation of Widths and  
ToUnicode tables is delayed until EmbedFont is called. I do not see a reason to 
 
do generate them twice.  
If this tables are created first in constructor, they will be huge as all chars 
 
must be included. Later, they will be reduced any way to used subset characters 
 
only.  

BTW, a do not like a dynamic cast's which are some times required, as there in  
no other way to get a real FontMetrics implementation from FontMetrics object.  
Did you think about extending that class with a two virtual methods which can 
be  
overridden in implementation?  

PfdFontMetricsFreetype* PdfFontMetrics::GetPdfFontMetricsFreetype();  
PfdFontMetricsBase14* PdfFontMetrics::GetPdfFontMetricsBase14();  

or  

PdfFontMetrics*  
PdfFontMetrics::GetPdfFontMetricsImplementation(PdfFontMetrics::Freetype |  
PdfFontMetrics::Base14)  


Another thing which is missing, is ability te get actual font face index  
selected when GetFontFromCollection is used. Later if we try to embed this font 
 
then the same logic should be applied again or wrong font might be included  
(regular vs italic or bold). But this problem is introduced before.  


23.10.2015. u 23:22, Palmer Zent wrote:  
> Hi,  
>  
> Sorry for the delay. I’m having issues with your patch file. Can you  
> regenerate it using "svndiff” based on the latest HEAD?  
>  
> I’ll have time in the next few days to run a few tests and commit it.  
>  
> Thanks  
>  



------------------------------------------------------------------------------
_______________________________________________
Podofo-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to