Code Comments
Programming Forum and web based access to our favorite programming groups.Hi, I'm using Ghostscript 8.62 on Fedora Core 6 Linux. I have this font on my computer ... /usr/share/fonts/msttcorefonts/georgia.ttf But when I run this command ... gs -I/usr/share/fonts/default/Type1/:/usr/share/libwmf/fonts/:/usr/ share/fonts/msttcorefonts/ -dNOPAUSE -dBATCH -dTextAlphaBits=4 - dJPEGQ=100 -sDEVICE=jpeg -r75.27 -sOutputFile=ViralCopy%d.jpg ViralCopy.pdf -c -quit I get Page 3 Substituting font Times-Roman for Georgia Why is there a substitution being made when I included the font directory in my include path? Thanks, - Dave
Post Follow-up to this messageOn Fri, 21 Mar 2008 19:31:03 -0700 (PDT), laredotornado wrote: > I'm using Ghostscript 8.62 on Fedora Core 6 Linux. I have this font > on my computer ... > > /usr/share/fonts/msttcorefonts/georgia.ttf > > But when I run this command ... > > gs -I/usr/share/fonts/default/Type1/:/usr/share/libwmf/fonts/:/usr/ > share/fonts/msttcorefonts/ -dNOPAUSE -dBATCH -dTextAlphaBits=4 - > dJPEGQ=100 -sDEVICE=jpeg -r75.27 -sOutputFile=ViralCopy%d.jpg > ViralCopy.pdf -c -quit > > I get > > Page 3 > Substituting font Times-Roman for Georgia > > Why is there a substitution being made when I included the font > directory in my include path? You likely need a Fontmap file in that directory: /AndaleMono (./andalemo.ttf); /ArialMT (./arial.ttf); /Arial-BoldMT (./arialbd.ttf); /Arial-BoldItalicMT (./arialbi.ttf); /Arial-ItalicMT (./ariali.ttf); /Arial-Black (./ariblk.ttf); /ComicSansMS (./comic.ttf); /ComicSansMS-Bold (./comicbd.ttf); /CourierNewPSMT (./cour.ttf); /CourierNewPS-BoldMT (./courbd.ttf); /CourierNewPS-BoldItalicMT (./courbi.ttf); /CourierNewPS-ItalicMT (./couri.ttf); /Georgia (./georgia.ttf); /Georgia-Bold (./georgiab.ttf); /Georgia-Italic (./georgiai.ttf); /Georgia-BoldItalic (./georgiaz.ttf); /Impact (./impact.ttf); /AndaleMono (./monotype.ttf); /TimesNewRomanPSMT (./times.ttf); /TimesNewRomanPS-BoldMT (./timesbd.ttf); /TimesNewRomanPS-BoldItalicMT (./timesbi.ttf); /TimesNewRomanPS-ItalicMT (./timesi.ttf); /TrebuchetMS (./trebuc.ttf); /TrebuchetMS-Bold (./trebucbd.ttf); /Trebuchet-BoldItalic (./trebucbi.ttf); /TrebuchetMS-Italic (./trebucit.ttf); /Verdana (./verdana.ttf); /Verdana-Bold (./verdanab.ttf); /Verdana-Italic (./verdanai.ttf); /Verdana-BoldItalic (./verdanaz.ttf); /Webdings (./webdings.ttf);
Post Follow-up to this messageOn Mar 22, 8:05=A0am, Bob Tennent <B...@cs.queensu.ca> wrote: > On Fri, 21 Mar 2008 19:31:03 -0700 (PDT),laredotornadowrote: > > =A0> I'm using Ghostscript 8.62 on Fedora Core 6 Linux. =A0I have this fon=[/color ] t > =A0> on my computer ... > =A0> > =A0> /usr/share/fonts/msttcorefonts/georgia.ttf > =A0> > =A0> But when I run this command ... > =A0> > =A0> gs -I/usr/share/fonts/default/Type1/:/usr/share/libwmf/fonts/:/usr/ > =A0> share/fonts/msttcorefonts/ -dNOPAUSE -dBATCH -dTextAlphaBits=3D4 =A0-=[/color ] > =A0> dJPEGQ=3D100 -sDEVICE=3Djpeg -r75.27 -sOutputFile=3DViralCopy%d.jpg > =A0> ViralCopy.pdf -c -quit > =A0> > =A0> I get > =A0> > =A0> Page 3 > =A0> Substituting font Times-Roman for Georgia > =A0> > =A0> Why is there a substitution being made when I included the font > =A0> directory in my include path? > > You likely need a Fontmap file in that directory: > > /AndaleMono (./andalemo.ttf); > /ArialMT (./arial.ttf); > /Arial-BoldMT (./arialbd.ttf); > /Arial-BoldItalicMT (./arialbi.ttf); > /Arial-ItalicMT (./ariali.ttf); > /Arial-Black (./ariblk.ttf); > /ComicSansMS (./comic.ttf); > /ComicSansMS-Bold (./comicbd.ttf); > /CourierNewPSMT (./cour.ttf); > /CourierNewPS-BoldMT (./courbd.ttf); > /CourierNewPS-BoldItalicMT (./courbi.ttf); > /CourierNewPS-ItalicMT (./couri.ttf); > /Georgia (./georgia.ttf); > /Georgia-Bold (./georgiab.ttf); > /Georgia-Italic (./georgiai.ttf); > /Georgia-BoldItalic (./georgiaz.ttf); > /Impact (./impact.ttf); > /AndaleMono (./monotype.ttf); > /TimesNewRomanPSMT (./times.ttf); > /TimesNewRomanPS-BoldMT (./timesbd.ttf); > /TimesNewRomanPS-BoldItalicMT (./timesbi.ttf); > /TimesNewRomanPS-ItalicMT (./timesi.ttf); > /TrebuchetMS (./trebuc.ttf); > /TrebuchetMS-Bold (./trebucbd.ttf); > /Trebuchet-BoldItalic (./trebucbi.ttf); > /TrebuchetMS-Italic (./trebucit.ttf); > /Verdana (./verdana.ttf); > /Verdana-Bold (./verdanab.ttf); > /Verdana-Italic (./verdanai.ttf); > /Verdana-BoldItalic (./verdanaz.ttf); > /Webdings (./webdings.ttf); Thanks for this info, Bob. Am I supposed to name that file "fontmap.map"? Probably not because I created a file by cut and pasting what you had and named it "fontmap.map" in the mstcorefonts directory. I was root when I created the file and gave it perms 755. But disappointingly, I still get the Substituting font Times-Roman for Georgia. when I re-ran my conversion script. - Dave
Post Follow-up to this messageOn Sat, 22 Mar 2008 15:37:53 -0700 (PDT), laredotornado wrote: > On Mar 22, 8:05_am, Bob Tennent <B...@cs.queensu.ca> wrote: > > Thanks for this info, Bob. Am I supposed to name that file > "fontmap.map"? Just "Fontmap". But also check that that directory is in the ghostscript Search path: $ gs -h Bob T.
Post Follow-up to this messageOn Mar 22, 9:46=A0pm, Bob Tennent <B...@cs.queensu.ca> wrote: > On Sat, 22 Mar 2008 15:37:53 -0700 (PDT),laredotornadowrote: > > =A0> On Mar 22, 8:05=A0am, Bob Tennent <B...@cs.queensu.ca> wrote: > =A0> > =A0> Thanks for this info, Bob. =A0Am I supposed to name that file > =A0> "fontmap.map"? =A0 > > Just "Fontmap". But also check that that directory is in the ghostscript > Search path: > > =A0$ gs -h > > Bob T. Hi, Thanks for that clarification. A couple of follow-ups. Can I use the "-I" directive to include different fontpaths to search? Anyway, when I changed to "Fontmap" now my output has this ... Loading Georgia font from /usr/share/fonts/msttcorefonts/ georgia.ttf... 2616100 1278473 12599848 11200983 3 done. Substituting font Times-Roman for Georgia. Why is it still substituting even though it says it loaded that font? - Dave
Post Follow-up to this messageOn Mon, 24 Mar 2008 11:39:40 -0700 (PDT), laredotornado wrote: > > Hi, Thanks for that clarification. A couple of follow-ups. Can I use > the "-I" directive to include different fontpaths to search? $ man gs: -Idirectories Adds the designated list of directories at the head of the search path for library files. But note that ghostscript distinguishes between the library path and the font path. > Anyway, when I changed to "Fontmap" now my output has this ... > > Loading Georgia font from /usr/share/fonts/msttcorefonts/ > georgia.ttf... 2616100 1278473 12599848 11200983 3 done. > Substituting font Times-Roman for Georgia. > > Why is it still substituting even though it says it loaded that font? You'll have to read the details of how ghostscript looks for fonts. Look for Use.htm in the documentation and the section "How Ghostscript finds files". But can you not fix the Postscript-generating application to *embed all fonts* (or least those not in the Base 14)? You'll save yourself a lot of suffering. Bob T.
Post Follow-up to this messageOn Mar 24, 3:55=A0pm, Bob Tennent <B...@cs.queensu.ca> wrote: > On Mon, 24 Mar 2008 11:39:40 -0700 (PDT),laredotornadowrote: > > =A0>> Just "Fontmap". But also check that that directory is in the ghostsc=[/color ] ript > =A0>> Search path: > =A0>> > =A0>> =A0$ gs -h > =A0> > =A0> Hi, Thanks for that clarification. =A0A couple of follow-ups. =A0Can =[/color ] I use > =A0> the "-I" directive to include different fontpaths to search? > > $ man gs: > > =A0-Idirectories > =A0 =A0 =A0 =A0 =A0 =A0 =A0 Adds the designated list of directories at the=[/color ] head of the > =A0 =A0 =A0 =A0 =A0 =A0 =A0 search path for library files. > > But note that ghostscript distinguishes between the library path and > the font path. =A0 > > =A0> Anyway, when I changed to "Fontmap" now my output has this ... > =A0> > =A0> LoadingGeorgiafont from /usr/share/fonts/msttcorefonts/ > =A0>georgia.ttf... 2616100 1278473 12599848 11200983 3 done. > =A0> Substituting font Times-Roman forGeorgia. > =A0> > =A0> Why is it still substituting even though it says it loaded that font?=[/color ] > > You'll have to read the details of how ghostscript looks for fonts. Look > for Use.htm in the documentation and the section "How Ghostscript finds > files". > > But can you not fix the Postscript-generating application to *embed all > fonts* (or least those not in the Base 14)? You'll save yourself a lot > of suffering. > > Bob T. Sadly in the given application, I do not have control over what PDF files are uploaded, else I'd do what you said above. After reading Use.htm (http://pages.cs.wisc.edu/~ghost/doc/AFPL/6.01/ Use.htm#Font_lookup), I discovered the "-sFONTPATH=3D" switch, and tried it out, to no avail [me@mymachine]~% gs -I/usr/share/fonts/default/Type1/:/usr/share/ libwmf/fonts/:/usr/share/fonts/msttcorefonts/ -sFONTPATH=3D/usr/share/ fonts/default/Type1/:/usr/share/libwmf/fonts/:/usr/share/fonts/ msttcorefonts/ -dNOPAUSE -dBATCH -dTextAlphaBits=3D4 -dJPEGQ=3D100 - sDEVICE=3Djpeg -r75.27 -sOutputFile=3DViralCopy%d.jpg ViralCopy.pdf -c - quit GPL Ghostscript 8.62 (2008-02-29) Copyright (C) 2008 Artifex Software, Inc. All rights reserved. This software comes with NO WARRANTY: see the file PUBLIC for details. Processing pages 1 through 30. Page 1 Page 2 Page 3 Loading Georgia font from /usr/share/fonts/msttcorefonts/ georgia.ttf... 2646036 1294066 12599848 11200983 3 done. Substituting font Times-Roman for Georgia. I'd prefer not to alter environment variables because when I run this application in the production hosting environment, I may not have control over those. But if that's the only way, so be it. Thoughts? - Dave
Post Follow-up to this messageOn Wed, 26 Mar 2008 15:47:48 -0700 (PDT), laredotornado wrote: > Loading Georgia font from /usr/share/fonts/msttcorefonts/ > georgia.ttf... 2646036 1294066 12599848 11200983 3 done. > Substituting font Times-Roman for Georgia. What seems strange to me is that ghostscript finds georgia.ttf, loads it, but then substitutes Time-Roman. Are you sure your ghostscript is compiled with ttf support? What I would do is look at the source code to see what circumstances lead to a "Substituting font XXX for YYY" message. Or there may be a way to turn on verbose logging while it runs. Bob T.
Post Follow-up to this messagelaredotornado <laredotornado@zipmail.com> wrote: >I'd prefer not to alter environment variables because when I run this >application in the production hosting environment, I may not have >control over those. But if that's the only way, so be it. I don't understand your objection. You can run a shell script which sets the required environment variables and calls GhostScript. This will have no effect on anything else. ---------------------------------------- Aandi Inston Please support usenet! Post replies and follow-ups, don't e-mail them.
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.