This MWE works in 2.22.1 but fails in 2.23.14 (running via Frescobaldi 3.1.1 on up-to-date Windows 10):

   \version "2.22.1"
   \markup {
      \postscript #"
        /Helvetica-Bold findfont
        4 scalefont setfont
        (Hello, World!) show
        "
   }

In 2.22 you successfully get "Hello, World!" at top of page.

In 2.23 you get a warning that gs failed, along with a red herring about (let ((book-handler ... yada yada.  See attachment Helvetica-error-Frescobaldi.txt.

To see why gs failed, I used a cygwin window to run the gs that is packaged with 2.23.14 ('/c/Program Files/LilyPond/lilypond-2.23.14/libexec/gs.exe') and added the -dDEBUG option to the options that lilypond supplied.

The specific gs failure is

   Error: /invalidfont in findfont
   Operand stack:
       Helvetica-Bold

See attachment Helvetical-error-Ghostscript.txt for the full gs command and its output.

Interestingly, saving the postscript intermediate file from 2.22.1 (where Helvetica works) and running the gs from 2.23.14 also failed with the same gs error.

Following advice from the NR on Fonts, I ran font-config-display-fonts in both 2.22.1 and 2.23.14 and neither output mentioned Helvetica. So that isn't how Helvetica was found in 2.22.1.

And Helvetica is not a system font in Window 10 (not in C:\Windows\Fonts) so I can't follow the NR to do #(ly:font-config-add-font "path/to/font-file").

The only way that Helvetica was found in 2.21.1 must be that it was supplied in the ghostscript.

Indeed, even the ghostscript docs (https://ghostscript.readthedocs.io/en/latest/Fonts.html) say it includes "Times, Helvetica, Courier, Symbol, etc."

So, the gs packaged with 2.21.1 includes Helvetica but the gs packaged with 2.23.14 apparently does not.

Wikipedia says that font "Nimbus Sans L" is a metrical equivalent to Helvetica-Bold (per https://en.wikipedia.org/wiki/Nimbus_Sans#Nimbus_Sans_L) and is also included in Ghostscript:

   "Although the characters are not exactly the same, Nimbus Sans L has
   metrics almost identical to Helvetica and Arial. Nimbus Sans L is
   one of the Ghostscript fonts, a set of free alternatives to the 35
   basic PostScript fonts (which include Helvetica)."

And Nimbus Sans L is also listed in our NY as part of our "sans" family.

But I have not found a way to specify Nimbus Sans L (or other Nimbus San variations) in my postscript findfont in my MWE.

Can someone explain (a) why Helvetical is no longer in 2.23.14's gs and (b) the syntax for specifying Nimbus Sans L properly in my MWE?

Thanks for wading through all this with me.  I've been on a very big lilypond project for 6 years now, and it is so big I have to use the 64-bit version in 2.23 due to memory usage.  But the project also contains 2500+ lines of postscript code for essential diagrams (like guitar fretboards and piano keyboards) so right now I'm still stuck.  Really need Helvetica-Bold or its metrical equivalent to work in 2.23

Jeff
\version "2.23.14"
\markup {
  \postscript #"
    /Helvetica-Bold findfont
    4 scalefont setfont
    (Hello, World!) show
    "
}
Starting lilypond.exe 2.23.14 [MWE-Helvetica.ly]...
Processing `M:/music/postscript/MWE-Helvetica.ly'
Parsing...
Finding the ideal number of pages...
Fitting music on 1 page...
Drawing systems...
Converting to `MWE-Helvetica.pdf'...
warning: `(gs -q -dNODISPLAY -dNOSAFER -dNOPAUSE -dBATCH 
-dAutoRotatePages=/None -dPrinted=false ./lilypond-tmp-6034027)' failed (1)

C:/Program 
Files/LilyPond/lilypond-2.23.14/share/lilypond/2.23.14/ly/init.ly:65:2: error: 
Guile signaled an error for the expression beginning here
#
 (let ((book-handler (if (defined? 'default-toplevel-book-handler)
Throw to key `ly-file-failed' with args `()'.
Exited with return code 1.
$ '/c/Program Files/LilyPond/lilypond-2.23.14/libexec/gs.exe' -dDEBUG -q 
-dNODISPLAY -dNOSAFER -dNOPAUSE -dBATCH -dAutoRotatePages=/None -dPrinted=false 
./lilypond-tmp-6034027
START 0 1470560 172535 1310592 29508 true 575 3 <0>
END PROCS 2 1519392 220962 1330792 35420 true 684 3 <0>
END FONTDIR/ENCS 3 1548024 250403 1330792 37900 true 694 3 <0>
END DEVS 4 1549952 255551 1330792 37900 true 698 3 <0>
END STATD 5 1570152 271911 1330792 40780 true 703 3 <0>
END GS_FONTS 7 1620504 333597 1330792 40780 true 732 3 <0>
END BASIC COLOR 8 1669336 358866 1330792 40780 true 748 3 <0>
END IMAGE 10 1669336 366518 1330792 40780 true 753 3 <0>
BEGIN RESOURCES 14 2451856 1108435 1435896 146580 true 774 4 <0>
END CATEGORY 17 2451856 1112362 1435896 146868 true 775 5 <0>
END GENERIC 18 2482008 1136102 1435896 146868 true 777 4 <0>
END FIXED 19 2502208 1153328 1435896 146868 true 777 4 <0>
END MISC 20 2502208 1164912 1435896 146868 true 777 4 <0>
END ENCODING 22 2522408 1183946 1435896 150498 true 777 4 <0>
Extend MacRomanEncodingForTrueType for TrueType: insert /apple @ 240
Extend MacRomanEncodingForTrueType for TrueType: insert /approxequal @ 197
Extend MacRomanEncodingForTrueType for TrueType: insert /radical @ 195
Extend MacRomanEncodingForTrueType for TrueType: insert /lozenge @ 215
Extend MacRomanEncodingForTrueType for TrueType: insert /Omega @ 189
Extend MacRomanEncodingForTrueType for TrueType: insert /pi @ 185
Extend MacRomanEncodingForTrueType for TrueType: insert /summation @ 183
Extend MacRomanEncodingForTrueType for TrueType: insert /partialdiff @ 182
Extend MacRomanEncodingForTrueType for TrueType: insert /greaterequal @ 179
Extend MacRomanEncodingForTrueType for TrueType: insert /Delta @ 198
Extend MacRomanEncodingForTrueType for TrueType: insert /lessequal @ 178
Extend MacRomanEncodingForTrueType for TrueType: insert /product @ 184
Extend MacRomanEncodingForTrueType for TrueType: insert /integral @ 186
Extend MacRomanEncodingForTrueType for TrueType: cannot insert /Euro @ 219 used 
for /currency
Extend MacRomanEncodingForTrueType for TrueType: insert /infinity @ 176
Extend MacRomanEncodingForTrueType for TrueType: insert /notequal @ 173
END INITFILES 59 3844104 2469020 1435896 153296 true 1013 4 <0>
%rom%Resource/Init/Fontmap 62 3844104 2474392 1456096 158566 true 1014 4 <1>
%rom%lib/Fontmap 64 3904704 2516340 1456096 158566 true 1014 4 <1>
END FONTS 66 3924904 2529777 1456096 158566 true 1013 4 <0>
END DEVICE 73 4349104 2919881 1454168 156638 true 1012 4 <0>
END CONFIG 75 4349104 2920147 1454168 156638 true 1012 4 <0>
END INIT 77 4409704 2988293 1920792 632742 true 1024 4 <0>
END GLOBAL 78 4409704 2992337 1920792 635054 false 1023 4 <0>
END GC 84 4101784 2431047 1924064 624378 false 767 3 <0>
runEPS: Not DSC
runEPS: Normal DSC
**** DSC comment: /Header
<< /DSC_struct -dsc_data_struct- /EPSF 0 >>
**** DSC comment: /Creator
<< /DSC_struct -dsc_data_struct- /Creator (LilyPond 2.23.14) >>
**** DSC comment: /Pages
<< /DSC_struct -dsc_data_struct- /NumPages 1 >>
**** DSC comment: /Orientation
<< /DSC_struct -dsc_data_struct- /Orientation 0 >>

FAPIhook C059-Roman
Trying to render the font Font C059-Roman with FAPI...
Font C059-Roman is being rendered with FAPI=FreeType
**** DSC comment: /Page
<< /PageNum 1 /DSC_struct -dsc_data_struct- >>
resmp FindResource beg Helvetica-Bold
resmp ResourceStatus beg /Helvetica-Bold
resmp ResourceStatus end
Error: /invalidfont in findfont
Operand stack:
   Helvetica-Bold
Execution stack:
   %interp_exit   .runexec2   --nostringval--   .findfontop   --nostringval--   
2   %stopped_push   --nostringval--   .findfontop   .findfontop   fals
e   1   %stopped_push   1974   1   3   %oparray_pop   1973   1   3   
%oparray_pop   1961   1   3   %oparray_pop   1817   1   3   %oparray_pop   
--nost
ringval--   %errorexec_pop   .runexec2   --nostringval--   .findfontop   
--nostringval--   2   %stopped_push   --nostringval--   1974   1   3   %oparr
ay_pop   1973   1   3   %oparray_pop   1961   1   3   %oparray_pop   1817   1   
3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --no
stringval--   .findfontop   --nostringval--   2   %stopped_push   
--nostringval--   1909   1   3   %oparray_pop
Dictionary stack:
   --dict:767/1123(ro)(G)--   --dict:0/20(G)--   --dict:105/200(L)--
Current allocation mode is local
Last OS error: No such file or directory
Current file position is 80386
GPL Ghostscript 9.56.1: Unrecoverable error, exit code 1

Reply via email to