Log of #ghostscript at irc.freenode.net.

Search:
 <<<Back 1 day (to 2019/06/17)Fwd 1 day (to 2019/06/19) >>>20190618 
Brenku Hey guys. I've been playing with Ghostscript a couple days now. I'm having issue with the PS to PDF conversion. I get these gaps in some of the text. https://i.imgur.com/d4EAk9B.png09:21.27 
  It's not for all text either, which is strange09:21.43 
  one more example09:22.30 
  https://i.imgur.com/duaXHoU.png09:22.30 
  I've created a font directory and dumped a bunch of them in there for it. Seems to find what it needs, but the output is not right. 09:23.06 
kens I think we would need to see the PS file you started with, and the version of Ghostscript you are using, as well as the complete command line09:24.56 
Brenku I can't share the PS..09:25.07 
  but I'm using 9.2709:25.24 
kens Then its going to be pretrty difficutl to help09:25.27 
  That looks to me like font substitution09:25.42 
Brenku and the command line: "C:\Program Files\gs\gs9.27\bin\gswin64c.exe" -sDEVICE=pdfwrite -dPDFFitPage -o out.pdf "C:\Users\user1\Desktop\EF0254.PS"09:25.55 
kens I'd say that a font where the capital I has an entablature has been substituted with Helvetica where its a simple uprigth stroke, but the spacing has been maintained (possibly because each glyph is individually drawn)09:26.22 
Brenku I sort of understand what you are saying..09:26.40 
  and yes I think it is helvetica 09:26.47 
kens So the simple 'I' is drawn within the space used by the largere I09:26.54 
Brenku but I'm not sure how to address the problem09:26.56 
  oh I see what you are saying09:27.07 
  Takes the space, but uses a substitute09:27.15 
kens Yes, exaclty09:27.19 
Brenku So then I don't have the right fonts? or?09:27.27 
kens The back channel outptu shoudl tell you if a font is being substituted09:27.31 
Brenku https://i.imgur.com/1d6IXUx.png09:28.00 
kens As I say it 'looks like' the font is not available to Ghostscript and its using its default substitute font, which is Helvetica09:28.07 
  Well its l;oading a replacement for Arail09:28.34 
  fomr 'OldFonts/_A_______.pfb09:28.46 
Brenku So I should find the proper ArialMT font?09:29.00 
kens Given that ArialMT is a TrueType font I doubt very much rthat a .PFB font is going to be correct09:29.10 
Brenku oh ok09:29.19 
  This is over my head. lol09:29.25 
kens You can either mebed the font in the PostScript program or tell Ghostscript to use a suitabl;e replacement09:29.32 
Brenku Should I be using Windows font folder instead?09:29.35 
  I think option two is better.09:29.46 
  How can I ask ghostscript to use a better replacement09:29.56 
kens To use a replacement you need to modify the fontmap.GS file09:30.05 
  Ordinarily you can't use a TrueType font as a replacement font, becaue PostScript doesn't support TrueType natively.09:30.34 
  However...09:30.38 
  Ghostscript has support for doing this which is pretty succesful.09:30.55 
  Although not guaranteed.09:31.04 
Brenku I am interested :)09:31.11 
  We need consistent outputs09:31.21 
kens The method is documented in the fotnmap.GS file, which will be in ghostpdl/Resource/Init IIRC09:31.26 
Brenku I found the file. Looking inside09:32.10 
kens Since you are on Windows you will be using the ROM file system, which means that, after you modify the file, you will need to tell Ghostscript to use it09:32.11 
  So you will need to add -I<path to fontmap.GS> to the command line09:32.33 
Brenku if I modify the fontmap.gs you mean09:32.48 
kens Note that if the path has spaces you'll need to surround it with ""09:32.51 
Brenku ok thank you for that tip09:32.58 
kens Yes if you modify fontmap.GS it won't get used unless you tell GS to do so.09:33.11 
Brenku if ghostscript doesn't use truetype, what fonts does it?09:33.24 
  This is a new world for me.09:33.55 
kens All fonts supported by PostScript; TYpe 1, TYpe 2 (CFF), Type 3, Type 42, CIDFonts with base fonts of any of the previous types09:33.58 
Brenku We have an old system at work which has PS files, and they need to be converted to PDF09:34.11 
kens Type 42 is a TrueType font with additional information required to be usable in PostScript09:34.20 
Brenku Oh ok09:34.27 
kens We can also read OTF fotns and TrueType fonts from PDF files.09:35.09 
  THe remaining members of the GhostPDL family cna also handle TrueType fonts from XPS files and the range of fonts in PCL and PCL-XL09:35.38 
Brenku O_O so many kinds09:35.50 
kens There are a lot of standards for fonts09:36.02 
chrisl Depending on the specific font(s) in question, you might be able to just add -sFONTPATH=<path to windows font directory> to you command line09:36.15 
kens Hmm, didn't think of that one09:36.39 
  Its ArialMT09:36.45 
  I wonder if there's already a substitute or FONTPATH09:37.30 
Brenku We worry about licensing lots of fonts too09:37.47 
kens GS is loading the fonts from gs/gs9.27/Resource/OldFonts09:37.48 
Brenku yeah I set that up in path09:37.56 
kens The $PATH environment variable or soemthing else ?09:38.15 
Brenku because we had a bunch of fonts from other areas, so I've been dumping everything in there. Hoping it can find the one(s) it needs09:38.18 
  Yeah, I read the documentation 09:38.30 
Robin_Watts Brenku: Now you're boasting :)09:39.02 
kens From your back channel output, Arial and Arial MT are being substituted with two fonts from that folder.09:39.05 
Brenku lol, sorry09:39.22 
  I am trying to make a good impression in this job. I've spent a lot of time trying to make this work for them09:39.35 
  https://i.imgur.com/NIvWvNU.png09:39.36 
  There is the path I mean09:39.39 
chrisl It's finding ArialMT and Arial-BoldMT09:39.52 
kens Yes because there's a FONTPATH pointing to the OldFonts folder09:40.06 
Brenku So it's subbing them, for the right ones though? 09:40.23 
kens And apparently there are some PFB files there which claim to be Arial09:40.28 
Brenku oh ho09:40.34 
kens Brenku: yes09:40.35 
Brenku then if they are right, why does it look funky. Because it's PFB and that's not correct?09:40.54 
  I should find the Airal MT and Bold one too I stick them in there I suppose09:41.11 
kens You've put some files in that fodler which alimt to be ArialMT and Arial-BoldMT, so when GS can't find those in its regular path it looks in 'FONTPATH@ and finds those ones, so it uses them09:41.21 
Brenku Hmm ok09:41.36 
kens THey do look (more or less) like the Arial Font should look09:41.55 
  I think you've pretty much exhausted what we can say without looking at the PostScript.09:42.19 
Brenku Ok, yeah. I understand.09:42.37 
kens What you are doing looks correct, perhaps the file is meant to look like that.09:42.37 
Brenku I'd show you, but like I said.. it's company stuff and they are schematics.09:42.55 
kens Your second example is worse, and also has a problem with the O09:43.25 
chrisl It's very possible that the font outlines are the same, but the metrics are different. Or that the Postscript does explicit kerning, and the metrics used to do the kerning differ - all sorts of possibilities09:43.35 
Brenku O_O09:44.01 
kens This is, of course, why its always best to embed fonts :-)09:44.01 
Brenku I'm not sure how these PS files were made in the first place09:44.20 
  I should investigate09:44.23 
kens There may well be nothing you can do about that09:44.45 
  If its legacy stuff09:44.52 
chrisl Brenku: Based on all of that, I would (as kens mentioned earlier) try adding ArialMT family mappings to Fontmap.GS to use the Windows Arial family, and assess the results09:45.29 
kens would these work by setting FONTPATH to the Windows Fonts directory ? I can never remember let me try09:46.19 
chrisl No, because the Windows fonts aren't ArialMT09:46.41 
  The Windows fonts are just Arial09:46.49 
kens Ah....09:46.53 
  Works for me :-)09:47.09 
  If I do /ArialMT findfotn with -sFONTPATH=/c:/Windows/Fonts then it loads ArialMT from arial.ttf09:47.37 
chrisl Oh, maybe they include ArialMT in the name table, then09:47.48 
kens So Brenku I'd be inclined to try nuking GS_FONTPATH, set FONTPATH=c:/windows/Fonts and tehn try running that PostScript file09:48.13 
Brenku Ok, I will try that right now09:48.23 
kens <sigh> More rain :-(09:48.46 
chrisl Ah, the "postcript" entry in the name table for arial.ttf is "ArialMT" - interesting......09:49.05 
kens That should be -sFONTPATH=c:/windows/fonts of course09:49.10 
Brenku Ok i tried that and it doesn't find Arial MT so, I need to find that font.09:50.22 
kens Hmm, you should have a c:/Windows/Fonts/arial.ttf09:50.44 
Brenku I do yes09:50.49 
  let me share the command I used and the output, one moment09:51.01 
kens Then that should work, it does for me09:51.03 
  Of course, I am not running hte same PostScript....09:51.19 
Brenku https://i.imgur.com/exnqKMT.png09:52.05 
kens Try using forward slash instead of backslash for hte path09:52.30 
  Or, possibly, use "" to surround it, but I'd try the '/'09:52.51 
Brenku i tried the slash, same behavior09:53.04 
  I can try "09:53.13 
kens Hmm, try this:09:53.29 
  gswin64c.exe -sFONTPATH=c:/Windows/Fonts09:53.30 
  Then at the GS> prompt09:53.39 
  "/ArialMT findfont"09:54.02 
  But leave off teh "" I had to put those in to pacify IRC09:54.15 
  Oh and to get out of GS, type quit09:54.42 
Brenku https://i.imgur.com/kGAimes.png09:55.33 
kens So that works09:55.48 
  Try it without pdfwrite, so do :09:56.49 
  gswin64c -sFONTPATH=c:/Windows/Fonts "c:\Users\....n\Desktop\EF0254.ps"09:56.50 
  Tha should stick up a window with the rendered result in it09:57.00 
  as well as the usual back channel09:57.15 
  From what I see of the ArialMT capital I, there's way too much space in the PostScript you are rendering. That could mean that the PostScript is simply wrong, or it could mean that the font you are curretnly using as a substitute has incorrect metrics, as chrisl said. I'd guess at the latter.09:59.50 
Brenku still here, investigating and in a meeting at the same time. Still plugging away at this10:01.46 
kens Sounds like one of our staff meetings :-)10:02.02 
Brenku Yeah it gets busy sometimes here!10:02.11 
  You folks still kicking around? I've tried to add some arial fonts of different filetypes, but I can't seem to get Arial MT to work. We discussed using the fontmap.GS file.11:52.58 
  There is an existing line on line 356: /Arial/ArialMT;11:53.05 
  would I change it to: /Arial(Arial MT Std.pfa);11:53.45 
  for example?11:53.48 
  brb.11:54.36 
chrisl Brenku: For your case, you'd want something like: /ArialMT (c:/Windows/Fonts/arial.ttf) ;11:56.46 
Brenku Thank you @chrisl12:24.23 
  Using fontmap.gs and using the -I flag too, still won't accept ArialMT ttf:12:35.24 
  https://i.imgur.com/WF1Jnnx.png12:35.25 
  It only finds 'Arial MT Bold' because I went and downloaded a .pfb which seemed to work12:36.15 
kens You don't include fontmap.GS you include the directory hich contains it, I I remember correctly12:36.15 
Brenku I can't seem to find the same one for just 'Arial MT'. So I'm trying to force the TTF using Fontmap.GS12:36.34 
kens So you want -I"c:\program fiels\gs\gs9.27\Resource\Init"12:36.38 
Brenku Yes, I used that12:36.58 
  ohh12:37.00 
kens You specified the filename as well12:37.06 
Brenku I used fontmap.gs in there too12:37.08 
  yeah12:37.09 
  ok thanks, let me try again12:37.14 
kens -I menas 'Include' so you specify a directory to search in12:37.21 
Brenku Can't find (or can't open) font file C:\Program Files\gs\gs9.27\Resource/Font/ArialMT. Can't find (or can't open) font file ArialMT. Didn't find this font on the system! Substituting font Helvetica for ArialMT.12:38.03 
  grr!12:38.06 
  oh, that's weird. The slashes are mixed12:38.20 
kens Depending where you have mixed them it should not matter12:38.45 
Brenku Oh, but it seems to be doing that all day12:38.47 
  Hmm. I wonder why it refuses to accept the arial ttf push12:39.02 
  I sincerely appreciate the help btw. A lot!12:39.22 
kens Lets go back to basics again12:42.03 
Brenku xD12:42.17 
  Yeah. I don't seem to get enough of this. I'm trying though :)12:42.34 
  This is a new world for me12:42.40 
kens Try:12:42.47 
  gswin64c -I"C:/Program Files/gs/gs9.27/Resource/Init"12:42.47 
  THen at the GS> prompt type "/ArialMT findfont"12:43.01 
Brenku not found12:43.20 
kens For me that loads ArialMT from c:/windows/fotns/arial.ttf12:43.21 
  OK so it seems like your fontm,ap.GS is not valid12:43.34 
Brenku https://i.imgur.com/BdhSIQb.png12:43.48 
  and this has the entries I added to the fontmap.gs:12:44.13 
  https://i.imgur.com/WF1Jnnx.png12:44.15 
kens I added one line to fotnmap.GS:12:44.37 
  Grr, stupid IRC12:44.42 
  "/ArialMT (c:/windows/fonts/arial.ttf) ;12:44.53 
Brenku It's ok. I have Telegram if that helps12:44.54 
  Hmm, it looks similar to what I have12:45.12 
kens Telegraph won't help me12:45.14 
  Is there a new line after the ; ?12:45.21 
Brenku https://i.imgur.com/X6lRjth.png12:45.42 
  that's what I see12:45.46 
  I added the same for arial and the others. But can remove them too12:46.01 
kens I'd remove everything you added except the one line for ArialMT12:46.19 
Brenku ok, will try now12:46.41 
  so now it looks12:46.56 
  https://i.imgur.com/OjwUhHb.png12:46.57 
  and I will test.12:46.59 
chrisl Perhaps this is a silly question, but does "c:\Windows\Fonts\arial.ttf" actually exist?12:47.40 
kens I think we ascertained that earlier with the FONTPATH12:48.02 
Brenku I believe so:12:48.25 
  https://i.imgur.com/l3aTJdR.png12:48.26 
kens chrisl there's no way to get fontmap to flush some prints is there ? I can't seem to make it do so12:48.39 
chrisl kens: No12:48.52 
kens Brenku: you hsould check teh file on disk, preferebaly from the shell12:49.03 
Brenku https://i.imgur.com/vuRuskD.png12:49.16 
kens The fonts display there doesn't tell you the filename12:49.18 
Brenku looks like it maybe worked12:49.21 
kens Yes that worked.12:49.30 
  type quit to exit12:49.38 
  repeat the exact same command line, but stick the name of the input PostScript on the end so GS processes it12:49.57 
Brenku works, opens that viewer 12:52.10 
  but I can still see that there are gaps with the I12:52.17 
kens The there's no point with going further with that12:52.26 
Brenku I think you might be right.12:52.37 
kens It seems like the font and metrics don't match12:52.40 
Brenku I should try another project file12:52.49 
chrisl Unless it's Arial-BoldMT12:52.53 
kens Without seeing the PostScript file I can't say why, it seems likely that its 'baked into' the PostScript program though12:53.04 
  Ungh could be I guess12:53.13 
  IIRC Arial-BoldMT is arialbd.ttf let me check12:53.31 
  yeah arialbd.ttf for Arial-BoldMT12:54.07 
Brenku Thank you for checking. I went and grabbed a .PFA file12:54.19 
  so just add another entry12:54.28 
  but this time for /ArialBold (c:/windows/fonts/arialbd.ttf) ;12:54.49 
kens I'd be inclined to use teh TTF font in the same way you did for the regular ArialMT font12:54.51 
  Hmmm that should probably be /Arial-BoldMT (....) ;12:55.12 
Brenku Interesting. Well, it worked for the finding of both fonts12:59.17 
  but behavior remains. However, inside the postscript file, it lists the fonts used. 12:59.30 
  during conversion is uses NimbusSans-Regular somewhere12:59.50 
kens That's our font13:00.12 
Brenku I wonder if that could be a reason? Idk13:00.29 
kens No. Its our name for Helvetica. We cna't call it Helvetica for Copyright reasons13:00.47 
Brenku hmm ok13:01.12 
kens All that tells you is something is using Helvetica13:01.14 
Brenku Stupid PS. grr13:01.19 
kens Could be valid, I can't really tell13:01.23 
  More like stupid creator of the program that didn't include the font13:01.36 
Brenku This is from the PS file:13:01.39 
kens and used non-standard ones13:01.42 
Brenku scandvec /Courier /Courier reencode scandvec /ArialMT /ArialMT reencode scandvec /Arial-BoldMT /Arial-BoldMT reencode13:01.43 
kens Ah maybe Nimbus is Courier then13:02.03 
  I could be wrong I don't have all the names memorised13:02.11 
Brenku Maybe I should try forcing courier ttf13:02.16 
kens Anyway, that's just re-encoding the fonts it is using13:02.22 
  I don't hink you;'ll get better results with Courier than you already get. Ours is a perfect replacement for Courier and its a *very* standard font13:03.02 
Brenku You're probably right13:03.12 
kens Have a word with your management, get them to allow you to send us a file privately and we'll look, but really fumbling in the dark like this isn't likely to get much further I don't think.13:04.08 
Brenku I understand13:04.30 
  I will see what I can do13:04.33 
  Distiller does this perfectly13:04.50 
  Sorry if that is sacrilegious. 13:05.06 
  lol13:05.09 
kens Distiller uses the Windows fonts, and teh ones that Adobe (being a font foundry) supplies13:05.18 
  Ghostscript is perfectly capable of using the same fonts as Distiller, but you have to tell it to do so.13:05.43 
Brenku I spent all morning forcing these windows fonts! lol13:05.47 
kens Fiond whoever created the files and make them do it. Then they'll know next time to embed fonts.13:06.12 
Brenku I want it to, and thought we did, but it's not changing behaviour at all13:06.14 
  it's from like.. 200013:06.21 
kens NB he same amntra applies to creating PDF files too, and for the same reason, embed fonts!13:06.29 
Brenku These are old schematics we used to use13:06.31 
  and they need conversion to PDF for archiving13:06.44 
  hence this project :/13:06.53 
kens Well it hardly sounds like they are that sensitive13:06.56 
Brenku Well, our equipment lasts decades.13:07.07 
  :(13:07.11 
  So it is technically still relevant data, just sensitive I guess.13:07.21 
  I will ask about options for that though. 13:07.40 
kens There's a limit to how much support we can give to free users, and a limit to how much we can do wihtout seeing the PostScript program13:08.08 
Brenku I understand13:08.31 
  Honestly, you've helped me understand a lot already. I really appreciate your time and expertise today.13:08.45 
  You are the developer? or?13:08.53 
kens I'm one of them, we all hang out here, but some are in the US13:09.04 
  So not awake yet13:09.07 
Brenku I'm in Europe myself13:09.13 
kens We're in the UK13:09.18 
  Those of us responding that is :-)13:09.27 
Brenku So if we bought a license or something.. you could help us figure out why this doesn't work? or?13:09.30 
kens We don't really license Ghostscript that way13:09.42 
Brenku The problem now is that it's working with Distiller. But that requires a user being logged into the system and distiller running all the time. We want it to be able to monitor a watched folder and convert what gets dumped there13:10.05 
kens Its note licensed to end users, only for people wanting to build it into produicts, or for web services or similar reasonably large things. We do offer some support contracts for big companies that want support13:10.27 
Brenku Can you tell me more?13:10.40 
  We don't use it in a product per se13:10.53 
  It's more that, when someone needs an old schematic, this system is in place to convert it to a better format 13:11.07 
kens I think that'sprobably as far as I can go :-) Our commercial people don't like it when engineers start talking about commercial stuff, it makes them nervous13:11.11 
Brenku but again, we use distiller and want to dump it.13:11.16 
chrisl Brenku: FWIW, there is a bug with font scaling in 9.27, so might be worth trying 9.26 - the bug really ought to only affect very high resolutions, but you never know......13:11.35 
Brenku It's like a small internal tool which converts.13:11.36 
  Ok, I can try 9.2613:11.53 
kens Brenku: from what you;ve said it sounds consistent with AGPL usage, or I would have said something earlier13:12.06 
Brenku Ok13:12.20 
chrisl Brenku: Just be aware that's a l..o..n..g shot13:12.24 
Brenku lol, that's ok13:12.29 
  Just want it to work. 13:12.36 
  bah13:12.44 
kens I don't really know what our policy on support contracts is. If you want to know more you could fill in our 'contact us' form (really short) on the Artifex.com website. Or mail info@artifex.com13:13.01 
Brenku Ok, I will look into that too13:17.18 
  also I was reading this and it sounded similar:13:17.25 
  https://superuser.com/questions/285684/pdf-has-an-extra-blank-in-all-words-after-running-through-ghostscript13:17.26 
kens well, that's from 8 years ago13:18.01 
  Seems its not rendering, its copy/paste from teh PDF file13:19.39 
chrisl (Just in case) You can get 9.26 here https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/tag/gs92613:20.06 
Brenku I was just wondering13:20.40 
  thanks Chris13:20.42 
kens Also, reading the bug report, pipitas claims its fixed in version 9.08 anyway13:21.58 
  So it can't be related13:22.01 
Brenku So that link to 9.2613:23.03 
  which one is for gswin64?13:23.09 
chrisl gs926aw64.exe13:23.18 
Brenku aw13:23.24 
  ah-ha, thanks13:23.31 
chrisl I need to head out for a half hour or so....13:23.45 
Brenku It's ok, I'm leaving work in half hour myself.13:24.20 
  Still, some progress today.13:24.26 
  Appreciate it gentlemen. 13:24.31 
  :)13:24.33 
  also, should I be 'Generating cidfmaps for Windows CJK TT Fonts?'13:25.08 
kens CJK = Chinese, Japanese, Korean13:25.28 
Brenku Got it. Nope then.13:25.35 
kens I'm assumign you don't need to use those languages13:25.40 
Brenku I don't believe so13:25.47 
kens Those would also be CIDFonts, not Fotns13:26.01 
Brenku Weird. Same behavior in 9.2613:27.12 
kens Can't say I'm hugely surprised13:27.23 
Brenku Me either xD13:27.28 
kens It seems its related to the fact that the fotns are not present, 9.26 and 9,.27 have the same substitution strategy13:27.49 
Brenku yeah13:28.53 
  I should head out. Thanks again everyone. Sincerely thankful for the help. 13:34.40 
  Hope you have a nice evening/day. ;)13:34.47 
  * :)13:34.50 
kens NP bye13:34.50 
 <<<Back 1 day (to 2019/06/17)Forward 1 day (to 2019/06/19)>>> 
ghostscript.com #mupdf
Search: