Skip to main content
Participant
May 23, 2020
Question

Self-written program cannot convert Truetype to Type 42 fonts

  • May 23, 2020
  • 1 reply
  • 220 views

I wrote a C program these days to convert a Truetype font into Type 42 format (without doing any tests). The ps2pdf program (in GPL Ghostscript) generates an "invalidfont" error.

Error: /invalidfont in definefont
Operand stack:
   FZSSK--GBK1-0   --dict:10/11(L)--   Font
Execution stack:
   %interp_exit   .runexec2   --nostringval--   definefont   --nostringval--   2   %stopped_push   --nostringval--   definefont   definefont   false   1   %stopped_push   2077   1   3   %oparray_pop   2076   1   3   %oparray_pop   2057   1   3   %oparray_pop   1916   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   definefont   --nostringval--   2   %stopped_push   --nostringval--   2005   2   3   %oparray_pop
Dictionary stack:
   --dict:966/1684(ro)(G)--   --dict:0/20(G)--   --dict:80/200(L)--
Current allocation mode is local
Current file position is 20175127
GPL Ghostscript 9.26: Unrecoverable error, exit code 1

The postscript file generated can be found at

https://drive.google.com/file/d/1u184Si4c8Ja7KQ0heMuUB_-3goCUN6Z9/view?usp=sharing.

This topic has been closed for replies.

1 reply

Participant
May 24, 2020

Fixed by changing the output into binary format.