robert.campbell has asked for the wisdom of the Perl Monks concerning the following question:

I have a developer group creating PDFs via 5.8.8/PDF/Reuse.pm using "\'Times-Roman\'". No errors during generation, but when they open the PDF in Acrobat Reader in Windows, the "actual" Font used is TimesNewRomanPSMT and their formatting is thrown off.

This is, of course, a systems problem. :\

My perlfu is insufficient to support them in embedding the Times-Roman font in the PDF so that the missing font is not supplanted by something that someone else has decided is "close enough" because it's in the same font family.

AFAICT, the Times-Roman font is being supplied by:
PDF::API2::CoreFont::timesroman
and not actually installed on the system otherwise (Solaris 10/Sparc).

Can that CoreFont be embedded? Do I need to locate and actual timesroman.ttf?

Any insights are much appreciated.

  • Comment on 5.8.8/PDF/Reuse.pm & Times-Roman versus Times New Roman

Replies are listed 'Best First'.
Re: 5.8.8/PDF/Reuse.pm & Times-Roman versus Times New Roman
by vr (Curate) on Oct 27, 2017 at 19:20 UTC

    Times-Roman is one of 14 Adobe "Standard Type 1 (i.e. Postscript, not TrueType) Fonts", its metrics are known to every PDF viewing application. Even if these fonts are not embedded or present (way too often), the available substitution fonts are source of glyph shapes only. Metrics, i.e. character widths, i.e. character displacements while advancing forward when text is rendered, -- are those of original Times-Roman, not "Times New Roman" (if on Windows). Differences between T-R and TNR are tiny. Plus, there are millions of documents with 14 core fonts not-embedded. I'd be very interested to have a look at a case when "formatting is thrown off".

    That's said, if you are intent on embedding, your option is to embed TTF, not original Type 1 font: prTTFont (but that's POD for the very module you are using...). As I see, this function was added in version 0.34, and CPAN testers say additional required modules are OK with 5.8.8

      The reply I got was:

      "Character width is fixed in Times-Roman be its I or W , take same width where as in times new Roman it’s different

      When we write more text in pdf it make lots of difference "

      and:

      "/.../CompuSet/Txt-PDF/Txt_PDF.sh , is used for converting compuset text file to PDF.
      Txt_PDF.sh able to convert and make use of the Times-Bold/Roman font.
      /.../CompuSet/perl_xml/xml_processing-1.6.pl, is used to convert XML to PDF.
      xml_processing-1.6.pl able to create PDF but since font Times-Bold/Roman is NOT available, its using available font (Times-New-Roman)."

      Thanks, and I'll check out prTTFont.