[NTG-pdftex] [PATCH] pdftex - Add new \pdfpkscalable primitive

Pali Rohár pali.rohar at gmail.com
Sun Apr 2 02:11:20 CEST 2017

On Saturday 01 April 2017 09:47:56 Akira Kakuto wrote:
> Dear Pali,
> Karl said that scalable PK fonts must be 100% unused, and
> he does not want to introduce a new primitive in pdfTeX.
> Thus I installed your patch with a little modification (r43667):
> Changes in pdftex.web are minimal with no new primitive.
> PK fonts are always non-scalable, even if they are written
> in font-map file. Installed changes are in an attached
> pdftex.diff.  Please review the changes.
> Best,
> Akira

Hi! Patch is OK, now all PK and PGC fonts are always non-scalable. 
Tested and it is working. So thanks! Will you update also documentation 
to reflect these changes?

Anyway, now I did some checks of generated PDF files from pdftex against 
PDF specification PDF32000_2008.pdf and found one problem: /ToUnicode 
object must be in /Font object, not in /Encoding object. This probably 
comes from my ToUnicode patch which I sent in Jun 2016. Despite this 
problem, my PDF viewer (okular) was able to parse PDF and do correct 
Unicode mapping of text, so I have not caught this problem before. Below 
is correction, /ToUnicode object reference is written before calling 
pdfenddict() for /Font object.

--- writet3.c
+++ writet3.c
@@ -362,6 +362,8 @@
     cptr = pdfnewobjnum();
     pdf_printf("/Widths %i 0 R\n/Encoding %i 0 R\n/CharProcs %i 0 R\n",
                (int) wptr, (int) eptr, (int) cptr);
+    if (tounicode_objnum != 0)
+        pdf_printf("/ToUnicode %i 0 R\n", (int) tounicode_objnum);
     pdfbeginobj(wptr, 1);       /* chars width array */
@@ -406,8 +408,6 @@
-    if (tounicode_objnum != 0)
-        pdf_printf("/ToUnicode %i 0 R\n", (int) tounicode_objnum);
     pdfbegindict(cptr, 1);      /* CharProcs dictionary */
     for (i = first_char; i <= last_char; i++)

Pali Rohár
pali.rohar at gmail.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mailman.ntg.nl/pipermail/ntg-pdftex/attachments/20170402/6a37cb73/attachment.sig>

More information about the ntg-pdftex mailing list