Log of #ghostscript at irc.freenode.net.

Search:
 <<<Back 1 day (to 2018/03/25)20180326 
Rutkay Hi all :handsup: 08:24.55 
  I have a huge throuble08:25.03 
  I'm trying to run "gs -q -dNOPAUSE -sDEVICE=tiffg4 -r204x196 -sOutputFile=$outfile $infile -c quit >/dev/null 2>/dev/null08:25.57 
  My pdf has Arial font and output tiff is rendered very bad, half broken half normal08:26.28 
kens You're almost certainly going to have to share the PDF file08:26.47 
Rutkay I'm uploading in a sec08:27.21 
kens You'll also need to let us know the operating system (presumably either Linux or MacOS) and the version of Ghostscript you are using.08:27.54 
  And where you got the binary from08:28.03 
Rutkay I'm running on Linux 08:28.33 
  https://ufile.io/77k33 08:28.34 
kens (ie a system packager, built fomr source etc)08:28.39 
Rutkay Resulting file is this one08:28.42 
chrisl I can't help but feel that in the act of trying to diagnose a problem, using "-q" isn't a good idea08:28.53 
Rutkay Source is this one https://ufile.io/9njry08:28.59 
kens chrisl and sending the back channel to /dev/null :-)08:29.12 
  Rutkay : did you get those the wrong way round ? The fist link looks like a TIFF file08:29.50 
Rutkay When I use Calibri or TimesNewRoman, it is rendered good08:29.55 
  Yeah I'm trying to render into tiff08:30.19 
chrisl The PDF doesn't "have Arial"08:30.20 
kens In that case you'll get a substitute08:30.46 
chrisl I would guess that some of the messages you're ignoring by sending them to /dev/null and/or using -q are telling you what fonts are actually being used08:31.14 
Rutkay I'm trying to not redirect outputs 08:31.45 
chrisl *And* it's not Arial, but ArialMT08:31.48 
kens OK its using 2 different copies of Arial08:31.57 
Rutkay Hmm 08:32.01 
  How can I substitute if it is ArialMT08:32.08 
kens One is embedded as a TrueType font, the other as a CIDFont with TrueType outliens08:32.12 
Rutkay Which files should I write this one08:32.17 
kens WHich is why you get two different substitutions08:32.24 
  Both are called ArialMT08:32.43 
  The CIDFont is embedded08:32.53 
  The regular fortn is not08:32.57 
chrisl Um, Rutkay what version of Ghostscript are you using?08:33.05 
kens So you will get a substitute font for the missing one.08:33.11 
Rutkay Basically my problem is cannot rendering this file into a good one. How can I do substitution for these 2 fonts? 08:33.23 
  I'm usin 8.70 08:33.26 
kens As chrisl says, the messages you are throwing away will tell you this, and tell you what font is being used instead08:33.27 
  8.70 seriously ?08:33.36 
  You need to upgrade08:33.40 
chrisl Rutkay: It works fine with 9.2108:33.40 
Rutkay Is it too old :d08:33.42 
chrisl And, FWIW, we're just released 9.2308:34.02 
Rutkay In short, you're saying that when I upgrade the gs to 9.23, it would work while not doing anything more than upgrade?08:34.25 
chrisl 8.70 must be about 9-10 years old08:34.25 
kens 8 years old according to Git08:34.36 
Rutkay Omg what am I doing :D08:34.45 
  So, let me ask again, you're saying that when I upgrade the gs to 9.23, it would work while not doing anything more than upgrade?08:35.04 
chrisl Rutkay: I'm saying it works for me with 9.23 as configured on my Ubuntu Linux install08:35.04 
kens : You can probably 'fix' 8.70 by adding a font definition to its fotnmap, but I'd strongly recommend upgrading08:35.21 
  It depends what you mean by 'work'08:35.40 
Rutkay To try that out, how can I add font definitions for these fonts08:35.42 
chrisl Rutkay: The problem is, your file requires a font substitute, and that relies (at least partly) on the configuration08:35.45 
Rutkay To make this pdf rendered good08:35.49 
kens You will still get a substitute font08:35.49 
  The substitution with 9.23 is better than with 8.7008:36.08 
  You can edit fontmap.GS and add a definition for the fotn called ArialMT08:36.32 
chrisl Rutkay: You could try the 9.23 binary from here: https://github.com/ArtifexSoftware/ghostpdl-downloads/releases08:36.44 
Rutkay I agree with you, but for a quick trial how can I make substitution done with this 8.70?08:36.47 
kens Then when a missing font by that name is encountered, Ghostscript will consult the fontmap and use the substitue.08:37.03 
chrisl *but* if your system is old enough to have 8.70, I can't be sure the binary tehre will run08:37.06 
kens fontmap.GS is found in /ghostpdl/Resource/Init IIRC08:37.26 
  But that's probably not quite true for 8.78008:37.35 
  8.7008:37.39 
chrisl It won't be try in a distro installation, either08:37.50 
  s/try/true08:37.56 
Rutkay Is that enough to add this line /Arial (bchr.pfa) ; 08:38.06 
kens You'll have to supply a path for the font too I would think08:38.25 
chrisl It's not Arial, it's ArialMT08:38.36 
kens Good point08:38.43 
Rutkay I got bchr.pfa from another line08:38.51 
  Changing into ArialMT08:38.57 
kens I don't know what bchr.pfa is, I very much doubt its compatible with Arial though08:39.04 
chrisl FWIW, I'm not convinced that will make the file work with 8.7008:39.36 
kens Obviously, if you want to use a version of Arial as the substitute, then you will need a copy of the Arial font somewhere.08:39.43 
Rutkay Omg it is worked08:39.47 
chrisl Oh, well, that's odd....08:39.57 
Rutkay You save my time!08:39.58 
  I love you guyz!08:40.12 
chrisl Anyway, glad it worked08:40.20 
Rutkay I'm absolutely thinking about migration 08:40.24 
chrisl *Please* upgrade your system!08:40.28 
Rutkay Thank you for your suggestions08:40.32 
  Thanks :)08:40.38 
chrisl Nevermind Ghostscript, a system that old must be riddled with security issues08:40.59 
Rutkay_ Hi @kens and @chrisl I wrote about font issue a couple hours ago 09:42.21 
kens Yep09:42.28 
Rutkay_ I forgot asking about how to add ArialMT font instead of creating an alias 09:42.48 
kens Umm, what do you mean by an 'alias' ?09:43.08 
  When you add a font to fontmap.GS you are telling Ghostscript to substitute the requested font with teh one in the fontmap09:43.26 
  That's not an 'alias'09:43.38 
  Its a directive for which substitute to use09:43.46 
  If the original font is missing, tehn you *must* use a substitute.09:44.02 
  Its possible that the substitute is in fact the same font as the ooriginal of course.09:44.16 
Rutkay_ Adding this line into Fontmap.GS /ArialMT (bchr.pfa) ; 09:44.29 
  Actually I want to add ArialMT font in this case09:44.44 
kens Right that substitutes /ArialMT with whatever font is in bchar.pfa09:44.48 
Rutkay_ How to find its pfa 09:44.50 
kens Then you will need a copy of ArialMT09:44.57 
  There is no .pfa file for ArailMT because its a TrueType font (supplied with Windows) not a PostScript font.09:45.17 
Rutkay_ I have looked at fonts documentation but not in detail. Let me ask you which fonts are supported or valid basically and which fonts can I add exclusively?09:46.28 
kens Ghostscritp will support any of Type 1, TYpe 2 (Compact Font Format), type 3 or type 42 fotn outlines. It will support CIDFonts whose outlines are any fo the preceding basic font types.09:47.16 
  For PDF files we support TrueType fonts and for PCL we support the various kinds of downloaded PCL fonts (note that you need a licecnce for a different fotn engine if you want to use Inteelifotns). For XPS we support TrueType09:48.18 
  Additionally (not spec) we support the use of TrueType fonts as substitutes for any of the preceding types.09:48.44 
  This is dependent on heuristics in the code to try and create a reasonable matching fron from the TrueType substitute font.09:49.09 
  This is never guaranteed to be possible09:49.19 
Rutkay_ Thanks for your explanation Kens. I forgot to share my system info : Linux 2.6.32-696.20.1.el6.x86_64 #1 SMP Fri Jan 12 15:07:59 EST 2018 x86_64 x86_64 x86_64 GNU/Linux 09:50.02 
  Is that make any difference in your comments?09:50.19 
kens Nope09:50.23 
  Ghostscript includes all its own font interpreters, it doesn't rely on the OS for any of that.09:50.40 
Rutkay_ As I understand at the first place ArialMT is a TrueType font so it is not supported. I'm wrong I think?09:51.40 
kens TrueType fonts are supported (when embedded) in PDF and XPS files09:51.59 
  Additionally (additional to the specification) Ghostscript cna use TrueType fonts as substitutes for missing fonts in any of the input types it supports (PS, PDF, PCL, PCL-XL, XPS)09:52.43 
  But since there is no specification for this, it is all basically guesswork09:53.18 
  Mostly it works, sometiems it doesn't09:53.27 
Rutkay_ I've shared a file which I used to turn into pdf to tiff. It has 2 fonts in PDF-fontinfo from the Windows Adobe PDF Reader GUI. One of them is embedded and the other one is not from the GUI seem again. The problem is that not embedded one then?09:53.41 
kens When it doesn't work, if people report it we will try to fix it so it does work (withotu breaking anything else)09:53.44 
  It doesn't (precisely) have two fonts,09:53.58 
  its has a Font and a CIDFont09:54.05 
  These are different things09:54.10 
  The CIDFont is embedded, the Font is not09:54.19 
  So Ghostscript is forced to use a substitute fotn for the missing Font.09:54.38 
  As you have (hopefully) noticed, newer versions do a better job09:54.56 
  The only real way for this to be correct is to remake the PDF file with all the fonts embedded.09:55.26 
  *ANY* PDF file which has missing fonts will get font substitution on *every* PDF consumer09:55.43 
  The quality of the substitution depends on many things, not least which fonts are available for the PDF consumer to use as a substitute09:56.11 
  Obviously if you open the PDF file on a Windows machine, where ArialMT is available, then the PDF consumer *may* be able to use that font as a substitute09:56.41 
Rutkay_ I'm going to study about all you said, I'm really appreciated Kens.09:57.20 
kens SO if, for example, I added a line to fontmap.GS hich pointed to a Windows font file, when running on Windows, then I might expect a 'better' substitution. If, however, I tried ot open the file on say an Android device, I woudl not get ArialMT.09:57.43 
Rutkay_ To make it clear, if all the fonts are embedded, we suppose that the the ArialMT is rendered rightly, right?09:58.15 
kens This is why its a *really* good idea to embed fonts in a PDF file :-)09:58.18 
  If the ArialMT Font had been embedded in the PDF file, then Ghostscritp (and any other PDF consumer) would use that font, and the file would render the same (within reason) on every PDF consumer09:58.53 
Rutkay_ Thank you Kens, I'm going to study on all we talked. Have a nice day, I may bother you within a day again :D10:00.08 
kens No problem10:00.19 
  This is a complex area :-)10:00.29 
sebras kens: chrisl: I had shelley OK this: http://git.ghostscript.com/?p=user/sebras/ghostpdl.git;a=commitdiff;h=41d6119463a5f013ecbe5d55d2eb707a47fdd294;hp=af2cf274d086e9140b388b7b1d92ab775310849113:26.41 
  unless you protest I'll go ahead and merge it.13:26.51 
kens I can't comment really13:27.24 
chrisl Me neither - happy to go with Shelly's judgment13:27.54 
sebras great, I was more looking for something like "no, not now! because the git is in release state lockdown" or something. :)13:28.35 
kens Oh we've finished the release13:28.46 
chrisl We also don't lock down git for releases13:28.57 
kens And we don't lock it anyway since we switched to Git13:29.03 
sebras chrisl: I like that. :)13:29.05 
  chrisl: who is mr cloos and why is he excluded from receiving mail from my bugzilla? (he's not the reporter or the assignee)13:31.20 
kens James Cloos, how do you know he's excluded ?13:31.39 
  I wasn't even aware that was possible13:31.46 
sebras kens: bugzilla told me when setting to RESOVLED FIXED.13:32.00 
kens Really ? I've never seen that, which bug report ?13:32.13 
chrisl sebras: He's an interested by-stander for Ghostscript development13:32.26 
sebras kens: 699142.13:32.31 
kens Oh its a security bug13:32.42 
sebras chrisl: ok, so perhaps because this is a security bug?13:32.44 
  chrisl: bug otherwise he receives all gs bug reports?13:32.57 
kens Only members of the security group can get those13:32.58 
chrisl Almost certainly13:33.03 
sebras aha.13:33.11 
chrisl James used to be fairly active in testing and (I think) occasional contributions13:33.49 
sebras he reported an issue about a document for mupdf in 2010 on jbig2-devel. no one responded and the PDF is not gone from the web. maybe I ought to e-mail him and see if he has a local copy of the PDF (it presumably involved JBIG2 bistreams, hence my interest)13:34.00 
chrisl sebras: Do you have the name of the PDF?13:34.29 
kens No harm in asking, certainly13:34.31 
sebras chrisl: https://ghostscript.com/pipermail/jbig2-dev/2010-January/000119.html13:39.20 
chrisl sebras: I'd definitely ask - James has always been helpful when I've asked him for help13:40.08 
sebras I also noticed that someone sent a fix for the testsuite (similar to the one I pushed the other day) back in 2012, but no one looked, oops. :)13:40.14 
kens Oh God, we've got a style critic13:44.52 
chrisl Well, he's showing impressive copy'n'paste skills from whatever static analysis tool he's running13:46.47 
kens Indeed.....13:46.54 
  I've passe don the halftone one because that *does* look like a typo13:47.07 
  I expect I'll close the ohter13:47.12 
  After I've read it properly13:47.21 
sebras seems to be cppcheck.13:47.53 
chrisl I think the gstype42.c is a fair point - in code we almost certainly never use13:48.13 
kens Hmm, actually, reading that, it does look suspicious13:50.28 
  But I still don't want him raising every cppcheck message individually13:50.46 
chrisl I'll fix the gstype42.c13:52.03 
kens Anyone got an opinion they'd like to share on gsdevice.c line 198 ?13:52.18 
chrisl Basically, same issue13:52.55 
kens I must have missed these when I went through the cppcheck errors13:52.58 
  But there are so many.....13:53.05 
  Yeah it looks like a simple typo13:53.16 
chrisl So, the gs_newpath() bit is right, the rest look iffy13:53.39 
kens OK so I'll change gsdevice.c13:53.42 
chrisl Oh, actually gs_newpath and gs_moveto look okay13:54.09 
kens :-) Was just writing that13:54.18 
  gs_fill also looks OK13:54.26 
  Seems to be just gs_setgray13:54.34 
  I really don't like that kind of if statement, but well, not going to go through GS and change them all13:55.15 
  Of course, since we never build the halftone generator, I'll never have seen the warnigns from the build13:58.34 
  chrisl spams the cluster :-)14:46.56 
chrisl I warned you I have a bunch of warning fixes I'd done during the release process14:47.25 
kens Anyone might think you were tor8 :-)14:47.41 
chrisl It's not quite *that* many commits!14:47.55 
sebras chrisl: ha! mr cloos had the old file from 2010! :)16:16.08 
chrisl sebras: I'm not surprised!16:17.00 
sebras chrisl: I'm surprised his drives hasn't been lost or reformatted in 8 years...16:17.24 
 Forward 1 day (to 2018/03/27)>>> 
ghostscript.com #mupdf
Search: