Hi,

Yes, CreateFontSubset() creates a new type1 font with only the used glyphs and 
embeds this font into the pdf. That’s why it uses the standardencoding.

In a type1 font the 'í' character is (could be) a combination of the dotlessi 
and the accent (seac, 6). That why I mention dotless i.

regards,

Ferdinand





From: Michal Sudolsky 
Sent: Tuesday, June 16, 2020 11:08 AM
To: Ferdinand Oeinck 
Cc: Ferdinand Oeinck ; Dominik Seichter via Podofo-users 
Subject: Re: [Podofo-users] bug in podofo standard encoding vector


  you could start with counting the number of entries in the s_cEncoding array.

  It sums up to 255 instead of 256. The indices are in the comments in hex. 
0xCC is missing!


Yes I noticed that there is one entry missing. This is here from 2010 when 
these encodings were added.

  Otherwise you could save a pdf with a subsetted type1 font and use the 'í'. 
Then look with a debugger at line 626 of PdfFontType1.cpp to see it can not 
find the dotlessi or any other character defined after index 0xCC.

What do you mean by "subsetted"? Is this something with the function 
"CreateFontSubset"?

Here is test case:

PdfMemDocument doc;
PdfPainter p;
p.SetPage(doc.CreatePage({0, 0, 500, 800}));
p.SetFont(doc.CreateFont("Helvetica", false, false, false, 
PdfEncodingFactory::GlobalStandardEncodingInstance()));
p.DrawText(0, 700, (pdf_utf8*)"a\u0131o");
p.FinishPage();
doc.Write("test.pdf");


After patch "dotlessi" can be seen in pdf (<61F56F> Tj) but not without it. 
Seems this is problem only when using "StandardEncoding".

Btw character which you sent does not look like "dotlessi" on my side 
(attachment some_i.png):



This is how it looks in PDF after was standard encoding patched (dotlessi.png):



Svn patch attached.



  On 16-6-2020 03:24, Michal Sudolsky wrote:

    Hi,

    Can you please let me know how exactly I can test this?

    On Mon, Jun 1, 2020 at 3:28 PM Ferdinand Oeinck <f...@bigroses.net> wrote:

      Hi,

      I'm using the podofo source code since some years.

      In my own copy I fixed this bug in PdfEncoding.cpp in 2013.

      Recently I've update my source code to 0.9.6 and found the bug is still
      present on sourceforge.

      Maybe you could fix it in the main repository? Thanks in advance!

      Ferdinand Oeinck,
      Big Roses Software.

      Please look at lines 1605 and 1606 of PdfEncoding.cpp:

      0x00B8, // CB # CEDILLA # cedilla
      0x02DD, // CD # DOUBLE ACUTE ACCENT # hungarumlaut

      I think there is one line missing:
      0x00B8, // CB # CEDILLA # cedilla
      /*--> missing*/ 0x0000, // CC undefined
      0x02DD, // CD # DOUBLE ACUTE ACCENT # hungarumlaut

      When I include this line, subsetted type1 fonts using 'í' will find
      /dotlessi otherwise they would find /.notdef



      _______________________________________________
      Podofo-users mailing list
      Podofo-users@lists.sourceforge.net
      https://lists.sourceforge.net/lists/listinfo/podofo-users
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to