LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-23-2014, 06:31 AM   #1
adrianmariano
Member
 
Registered: Dec 2004
Distribution: Ubuntu Yakkety
Posts: 188

Rep: Reputation: 15
how can I add a type1 font to ghostscript?


I've been using Bera Sans for years and I've been adding it to ghostscript by copying files into the ghostscript directory and hacking a Fontmap file. I upgraded to Ubuntu 14.04, which has Ghostscript 9.10, and this process is not working the same as before.

I found /usr/share/ghostscript/9.10/Resrouce/Init/Fontmap.GS and I added

Code:
/BeraSansMono-Bold       (fvmb8a.pfb) ;
/BeraSansMono-BoldOb     (fvmbo8a.pfb)  ;
/BeraSansMono-Roman     (fvmr8a.pfb)    ;
/BeraSansMono-Oblique   (fvmro8a.pfb)   ;
/BeraSans-Bold  (fvsb8a.pfb)    ;
/BeraSans-BoldOblique   (fvsbo8a.pfb)   ;
/BeraSans-Roman         (fvsr8a.pfb)    ;
/BeraSans-Oblique       (fvsro8a.pfb)   ;
/BeraSerif-Roman        (fver8a.pfb)    ;
/BeraSerif-Bold         (fveb8a.pfb)    ;
to it but when I invoke ghostscript I get

Code:
Loading NimbusMonL-Bold font from /usr/share/fonts/type1/gsfonts/n022004l.pfb... 3751484 2310262 3934520 2576164 1 done.
Can't find (or can't open) font file fvmr8a.pfb.
Can't find (or can't open) font file /usr/share/ghostscript/9.10/Resource/Font/BeraSansMono-Roman.
Can't find (or can't open) font file BeraSansMono-Roman.
Querying operating system for font files...
The file it's looking for, fvmr8a.pfb, is located at
/usr/share/fonts/type1/gsfonts/fvmr8a.pfb, the same place it finds NimbusMonL_Bold. I don't know what the other font file it's trying to find is, the "BeraSansMono-Roman" file.

It says "Querying operating system for font files" but it doesn't actually succeed. It actually hangs my system for a while and then I get

Code:
Querying operating system for font files...
Error: /typecheck in /findfont
Operand stack:
   fontdict   BeraSansMono-Roman
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1916   1   3   %oparray_pop   1915   1   3   %oparray_pop   1899   1   3   %oparray_pop   1787   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   1868   2   3   %oparray_pop
Dictionary stack:
   --dict:1171/1684(ro)(G)--   --dict:0/20(G)--   --dict:110/200(L)--
Current allocation mode is local
Current file position is 10743
GPL Ghostscript 9.10: Unrecoverable error, exit code 1
Now having to copy files into the directory structure of ghostscript is obviously a hack. It's annoying to have to do this every time ghostscript upgrades. Can anybody tell me if there is a good way to make the font available to ghostscript?

Failing that, can anybody tell me how to copy the files with this new version of ghostscript so that it can find them?
 
Old 04-26-2014, 03:00 PM   #2
adrianmariano
Member
 
Registered: Dec 2004
Distribution: Ubuntu Yakkety
Posts: 188

Original Poster
Rep: Reputation: 15
I've discovered that if I use full paths in the Fontmap file then ghostscript is able to find the files. It's a little mystifying since the files are in the same place as the Nimbus font, which gets found, as you can see in my original post. This seems to work OK to display to the screen, but when I try to print the logs for the printing software shows:

Code:
GPL Ghostscript 9.10 (2013-08-30)
Copyright (C) 2013 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Loading NimbusMonL-Bold font from /usr/share/fonts/type1/gsfonts/n022004l.pfb... 3824332 2333011 1908776 436694 1 done.
Error: /invalidfileaccess in /findfont
Operand stack:
   fontdict   BeraSansMono-Roman
I also have come to the conclusion that the Bera font is the same as the Vera font which is the same as DejaVu, and actually DejaVu is best because it has been extended to include more glyphs. The Vera and DejaVu fonts are installed and recognized by fontconfig. So for example:

Code:
adrian> fc-list | grep DejaVuSansMono
/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf: DejaVu Sans Mono:style=Book
/usr/share/fonts/truetype/dejavu/DejaVuSansMono-Oblique.ttf: DejaVu Sans Mono:style=Oblique
/usr/share/fonts/truetype/dejavu/DejaVuSansMono-BoldOblique.ttf: DejaVu Sans Mono:style=Bold Oblique
/usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono-Bold.ttf: DejaVu Sans Mono:style=Bold
/usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono-BoldOblique.ttf: DejaVu Sans Mono:style=Bold Oblique
/usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono-Oblique.ttf: DejaVu Sans Mono:style=Oblique
/usr/share/fonts/truetype/dejavu/DejaVuSansMono-Bold.ttf: DejaVu Sans Mono:style=Bold
/usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono.ttf: DejaVu Sans Mono:style=Book
One might imagine that this would mean the fonts would be available in ghostscript, but apparently not.

Code:
Can't find (or can't open) font file /usr/share/ghostscript/9.10/Resource/Font/DejaVuSansMono.
Can't find (or can't open) font file DejaVuSansMono.
Querying operating system for font files...
Error: /typecheck in /findfont
Operand stack:
   DejaVuSansMono   DejaVuSansMono
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   %loop_continue   --nostringval--   --nostringval--   false   1   %stopped_push   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   1868   2   3   %oparray_pop
Dictionary stack:
   --dict:1171/1684(ro)(G)--   --dict:0/20(G)--   --dict:96/200(L)--
Current allocation mode is local
Current file position is 23
Now on my second system, which is running Ubuntu 13.10 I also have the DejaVu fonts. The ghostscript version is the same (9.10), but it works there. Ghostscript says:
Code:
Can't find (or can't open) font file /usr/share/ghostscript/9.10/Resource/Font/DejaVuSansMono.
Can't find (or can't open) font file DejaVuSansMono.
Querying operating system for font files...
Loading DejaVuSansMono font from /usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono.ttf... 3807100 2356003 10091316 3678042 1 done.
So what is going on? Why does ghostscript find the DejaVu font on one system but not the other? (What determines whether it will find it?)
 
Old 04-26-2014, 08:37 PM   #3
adrianmariano
Member
 
Registered: Dec 2004
Distribution: Ubuntu Yakkety
Posts: 188

Original Poster
Rep: Reputation: 15
It turns out that there is a ghostscript bug.

http://bugs.ghostscript.com/show_bug.cgi?id=695031
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Install new Font HelveticaNeue-LightExt for ghostscript Mann_engg Linux - Newbie 6 08-28-2013 02:58 PM
Ghostscript , font problem? J_Szucs Linux - Software 3 09-02-2010 08:35 AM
Why do I need to add the option -dEPSFitPage to ghostscript? (Is my math wrong?) senseproof Linux - Software 1 06-02-2009 05:57 PM
Xorg.conf type1 module slackernewb Slackware 2 06-05-2006 08:25 PM
Type1(postscript) fonts sharapchi Slackware 4 11-14-2005 07:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:58 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration