Times-Roman is not loaded

17 views
Skip to first unread message

Jeff Damens

unread,
May 29, 2022, 2:55:47 AM5/29/22
to PMW_Music
I've been using pmw for many years and I've been very happy with it. I convert pmw source into postscript, then convert it to pdf with ps2pdf (part of ghostscript).

Today, suddenly, when trying to convert or display pmw output I receive the error "Times-Roman is not loaded".

This appears to come from PSheader:

  /inf{dup dup findfont 3 1 roll FontDirectory exch known {pop}{(**** Font ")print
100 string cvs print (" is not loaded ****\r\n)print stop}ifelse

When I remove the test, changing these two lines to

/inf{dup dup findfont 3 1 roll FontDirectory exch known pop pop

It appears to work correctly.

I'd like to understand why. What is this test for, and what could have changed on my system to make it behave differently (it's worked previously for years)? I haven't upgraded ghostscript, although I did re-install it when the error began (reinstalling didn't seem to make any difference).

Thanks!

Regards,

Jeff

Philip Hazel

unread,
May 29, 2022, 3:30:42 AM5/29/22
to PMW_Music
Glad to learn of another satisfied customer! It seems very odd for that error to pop up without anything changing. It's a long time since I made any changes to PSheader. Which releases of PMW and GhostScript are you using? I haven't time to look at this in detail now but will try to get back to it later today.

Philip

Philip Hazel

unread,
May 29, 2022, 12:29:33 PM5/29/22
to PMW_Music
I've done some research on this, and it seems to be a mystery. That particular snippet in PSheader has been there since at least 2003. I don't have easy access to anything earlier. My GUESS is that I originally tested for a font's existence by checking in FontDirectory, but discovered that "findfont" could also search externally and load fonts on the fly. Quite why I retained the FontDIrectory check I don't know, because as far as I can tell, if "findfont" doesn't find a font, it either bombs out with an invalidfont error, or sets up a substitute font. Thus, if it gets that far, the FontDirectory check should always succeed. Why it failed in your case, even though the font was found, is another mystery. Anyway, my belief is that the test is useless and can be removed. The two lines you identified can be replaced with the single line "/inf{findfont".

I am currently doing some work on PMW and will make this change to PSheader for the next release.

A way of checking on what GhostScript is doing with your fonts is to use the "gs" command on the .ps file. This gives a cruder page image than gv, but writes comments about font loading to the standard output.

When I was checking out what might be happening, I discovered that Adobe are stopping support for Type 1 PostScript fonts next January. Hopefully GhostScript will carry on, but after I have put out the next release of PMW I will investigate potential alternative formats the PMW-Music font. So thank you for bringing this up!

Philip

Jeff Damens

unread,
May 30, 2022, 4:19:20 PM5/30/22
to pmw_...@googlegroups.com
Thank you for the quick response!

I am very happy with it. I've been using it mostly for transcription,.as it's neater and faster then writing in paper for me. 

I have been using version 4.28 l. When I ran into the problem I downloaded version 5.02 which seems to have the same line on PSheader.

Thank you for the fix; I thought there might be a simpler way. It is a mystery, as it happily loaded the font (and when I reversed the condition as an experiment it failed on the PMW Music font, which is also certainly loaded). It's unsatisfying but I'm happy to live with the mystery as long as it works. At this point I have a large library of music I've written out with pmw, and losing the ability to render it to anything would be a disaster.

> When I was checking out what might be happening, I discovered that Adobe are stopping support for Type 1 PostScript fonts next January. Hopefully GhostScript will carry on, but after I have put out the next release of PMW I will investigate potential alternative formats the PMW-Music font. So thank you for bringing this up!

I'm happy that you're on top of it! Ghostscript always seemed brittle to me (although it's always worked). When I was poking around yesterday I discovered that it now seems to have commercial support. I hope that doesn't mean that the free version will wither away. I don't know of another postscript renderer for Linux.

Anyway thank you for your response, and for providing pmw!

Regards,

Jeff





On Sun, May 29, 2022, 3:30 AM Philip Hazel <philip...@gmail.com> wrote:
Glad to learn of another satisfied customer! It seems very odd for that error to pop up without anything changing. It's a long time since I made any changes to PSheader. Which releases of PMW and GhostScript are you using? I haven't time to look at this in detail now but will try to get back to it later today.

Philip

On Sunday, 29 May 2022 at 07:55:47 UTC+1 jda...@gmail.com wrote:
I've been using pmw for many years and I've been very happy with it. I convert pmw source into postscript, then convert it to pdf with ps2pdf (part of ghostscript).

Today, suddenly, when trying to convert or display pmw output I receive the error "Times-Roman is not loaded".

This appears to come from PSheader:

  /inf{dup dup findfont 3 1 roll FontDirectory exch known {pop}{(**** Font ")print
100 string cvs print (" is not loaded ****\r\n)print stop}ifelse

When I remove the test, changing these two lines to

/inf{dup dup findfont 3 1 roll FontDirectory exch known pop pop

It appears to work correctly.

I'd like to understand why. What is this test for, and what could have changed on my system to make it behave differently (it's worked previously for years)? I haven't upgraded ghostscript, although I did re-install it when the error began (reinstalling didn't seem to make any difference).

Thanks!

Regards,

Jeff

--
You received this message because you are subscribed to a topic in the Google Groups "PMW_Music" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pmw_music/pE25rjNBzbY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pmw_music+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/pmw_music/487a832d-f865-4980-a62a-2bf0aa8f66f4n%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "PMW_Music" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pmw_music+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/pmw_music/b10a6d0f-790c-4fb0-8f0c-8ced9ee94461n%40googlegroups.com.

Philip Hazel

unread,
May 31, 2022, 4:42:51 AM5/31/22
to pmw_...@googlegroups.com

I have been using version 4.28 l. When I ran into the problem I downloaded version 5.02 which seems to have the same line on PSheader.

The contents of PSheader haven't changed for many years. I've been thinking about this a bit more. When I first started on what became PMW, back in the late 1980s, I was generating PostScript for a real PostScript printer (Apple LaserWriter). This needed to have all fonts loaded before you tried to print anything. The test on FonDirectory was probably me trying to get a respectable error message for missing fonts. Then later there came printers that had hard discs and could load fonts from them on the fly, so I made it call "findfont" unconditionally. Leaving in a subsequent test now looks silly because "findfont" either bombs out or uses a substitute font when it can't find what's asked for. Looks like I didn't think it through, though until now it has done no harm. 

My version of GhostScript is 9.56.1. If you have a later version, it may be that the internals have changed somehow so that the use of FontDirectory is different. I think GhostScript has had some commercial support for some years. I believe it is used internally by CUPS, the printing system, to render PS and PDF. I agree that it seems to have the monopoly on PS rendering. I did find a reference to something called dpsexec, but it appears obsolete. There is a library I have installed that renders PostScript which might be independent of GhostScript:

extra/libspectre 0.2.10-1 [installed]
    Small library for rendering Postscript documents

This may be what evince (and others) use. I don't know. I also found this, but haven't tried it:

community/xreader 3.3.0-1 (x-apps)
    Document viewer for files like PDF and Postscript. X-Apps Project.


But I don't know if either of these are truly independent of GhostScript.

Philip

Reply all
Reply to author
Forward
0 new messages