Michael wrote:
> 
> If your customers do not have Nimbus fonts available on their OS/PDF viewer, 
> the viewer application will proceed using font substitution.  It will use 
> whichever font family it thinks is the closest match, I would assume 
> Helvetica.  Their application appears to get confused and substitute the 
> Nimbus fonts with something else.  In any case, the solution to this is to 
> embed the Nimbus fonts in the PDF file.

How would I do that?  It seems to be impossible for "Courier" because this
is a built-in font "and all viewers can display them", as stated at
https://durak.org/sean/pubs/software/php-7.0.0/haru.builtin.fonts.html
So it won't make much sense to embed Courier into the PDF anyway?!

It's just that >=ghostscript-gpl-9.56 won't write the requested font name
           $myFont=$myPdf->getFont('Courier', 'WinAnsiEncoding');
into the PDF, but the substituted font name "Nimbus" (which seems to
confuse some PDF readers).  Why did they change it from 9.55 to 9.56?
This is strange...

To be completely independent from any PDF display software, I could imagine
that the following could help:

- install media-fonts/corefonts
- load the ttf font with embed=true:
  https://durak.org/sean/pubs/software/php-7.0.0/harudoc.loadttf.html
  for example,
  $myFontName=$myPdf->loadTTF('/usr/share/fonts/corefonts/cour.ttf', TRUE);
  $myFont=$myPdf->getFont($myFontName, 'WinAnsiEncoding');

but I guess it will blow up my nice little PDF files (29 K only!) to a
multiple size... :-(

Anyway, I'll give it a try.

-Matt

Reply via email to