1 |
On Monday, 7 November 2022 11:56:34 GMT Matthias Hanft wrote: |
2 |
> Hi, |
3 |
> |
4 |
> since many years, I'm using PHP (currently 7.4) and the (self- |
5 |
> compiled) Haru extension to produce PDF invoices on my server. |
6 |
> |
7 |
> Internally, Haru seems to use Ghostscript, because: |
8 |
> |
9 |
> - up to app-text/ghostscript-gpl-9.55.0-r2, when you look at the |
10 |
> PDF "properties" and then the "fonts" tab, there is "Courier", |
11 |
> "Helvetica" and "Helvetica-BoldOblique" - just as requested in |
12 |
> my PHP script like |
13 |
> $myPdf=new HaruDoc(); |
14 |
> [...some page settings...] |
15 |
> $myFont=$myPdf->getFont('Courier', 'WinAnsiEncoding'); |
16 |
> |
17 |
> - from app-text/ghostscript-gpl-9.56.1-r3 on, everything looks like |
18 |
> before, but in the "properties/fonts" tab of the resulting PDF, |
19 |
> the fonts are now "NimbusMonoPS-Regular", "NimbusSands-BoldItalic" |
20 |
> and "NimbusSans-Regular". |
21 |
> |
22 |
> I have already found this "translation" in the file |
23 |
> /usr/share/ghostscript/9.56.1/Resource/Init/Fontmap.GS but there is |
24 |
> obviously no relevant difference in that file between 9.55 and 9.56. |
25 |
> |
26 |
> Some of my customers now seem to have trouble if the fonts in the |
27 |
> PDF properties are named "Nimbus" instead of "Courier" - they just |
28 |
> see some hieroglyphics when displaying the PDF. |
29 |
> |
30 |
> Any idea that's going wrong here? |
31 |
> |
32 |
> Thanks in advance, |
33 |
> |
34 |
> -Matt |
35 |
|
36 |
If your customers do not have Nimbus fonts available on their OS/PDF viewer, |
37 |
the viewer application will proceed using font substitution. It will use |
38 |
whichever font family it thinks is the closest match, I would assume |
39 |
Helvetica. Their application appears to get confused and substitute the |
40 |
Nimbus fonts with something else. In any case, the solution to this is to |
41 |
embed the Nimbus fonts in the PDF file. |