• [gentoo-user] Re: PHP, Haru, Ghostscript, Courier, and Nimbus

    From Grant Edwards@21:1/5 to Matthias Hanft on Mon Nov 7 20:00:01 2022
    On 2022-11-07, Matthias Hanft <mh@hanft.de> wrote:
    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?!

    Nobody said anything about embedding Courier. You said the problem
    happened when the "Nimbus" font was used, so it was suggested you
    embed the "Nimbus" font.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Matthias Hanft@21:1/5 to Grant Edwards on Mon Nov 7 20:20:01 2022
    Grant Edwards wrote:

    Nobody said anything about embedding Courier. You said the problem
    happened when the "Nimbus" font was used, so it was suggested you
    embed the "Nimbus" font.

    But I don't want to use / embed the Nimbus font at all!

    libharu is called by HaruDoc::getFont('Courier', 'WinAnsiEncoding')

    This *does* work - the font *is* Courier when you look at the PDF.

    But -
    - until ghostscript 9.55, in the PDF font properties, the font
    was correctly named "Courier" so that every PDF reader could
    display it;
    - from ghostscript 9.56, in the PDF font properties, the font
    is named "Nimbus" instead of "Courier", and some PDF readers
    have problems to display.

    The only "Nimbus reference" I have found is a line in the file /usr/share/ghostscript/9.56.1/Resource/Init/Fontmap.GS which reads

    /Courier /NimbusMonoPS-Regular ;

    but this line is the same in gs 9.55 and 9.56. So I don't understand
    what/why has changed here.

    BTW, I now have tried to embed truetype fonts. Seems to work
    (although the character outline is thinner, overall more "pale").
    File size increases from 29K to 121K - would be OK for me...

    -Matt

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)