IRC Logs

Log of #ghostscript at irc.freenode.net.

Search:
 <<<Back 1 day (to 2016/04/25)20160426 
sebras kens: morning mr s.07:30.50 
kens Morning sebras07:31.08 
  Was just answering a questoin on comp.lan.postscript, an amusing incorrect optimisatoin by Distiller07:31.47 
chrisl I've given up on comp.lang.postscript.....07:46.59 
kens There's not a lot there mostly07:47.09 
  But that one was kind of interesting07:47.23 
chrisl "Have you ever used save....restore?"..... I mean, really???07:47.43 
kens Yeah you'll notice I haven't bothered commenting on that thread07:47.59 
  At least in part because there's probably no PostScript operstor I've *never* used07:48.18 
chrisl The only ones I can think of are the user path operators - I've never used those07:48.48 
kens I have, but only for investigating a different problem07:49.01 
  ie for debugging07:49.15 
chrisl I don't think I've ever seen them used in a job07:50.03 
kens No, almost certainly not. They don't have a lot of real world use07:50.24 
chrisl I could understand querying those, or strokepath, or glyphshow - but save/restore and setglobal, if you can't see the usefulness of those......07:51.49 
kens He writes seriously odd code..... Apparently for fun07:52.11 
chrisl Well, it takes all sorts, I suppose07:53.35 
squ android background tile should be placed into ‘nodpi’ directory to avoid scaling, I guess that is what tile means12:33.19 
  http://imgur.com/a/P5UHU12:54.12 
t4nk981 hi everybody :)15:03.32 
Robin_Watts_ t4nk981: We're in a meeting, so please excuse our lag.15:04.07 
nemo -c "<</NeverEmbed [/ABCDEE+Century#20Gothic,Bold]>> set distillerparams -f"15:04.36 
  er15:04.39 
  gs -c "<</NeverEmbed [/ABCDEE+Century#20Gothic,Bold]>> setdistillerparams -f" input.pdf output.pdf15:04.49 
  hm. that doesn't look right15:04.55 
nemo rereads gs manpage15:04.59 
  I find working w/ gs commandline to be kinda unintuitive :/15:05.07 
kens Use the HTML help, not man15:05.29 
nemo yeah. found a working line I'm adapting15:05.40 
kens And what you have there will not work15:05.46 
  PostScript does not repsect PDF escapes15:05.54 
nemo gs -c "<</NeverEmbed [/ABCDEE+Century#20Gothic,Bold]>> setdistillerparams -f" input.pdf 15:06.08 
  shoot15:06.13 
kens You will need to use the cvn operator15:06.24 
chrisl Does NeverEmbed work on already embedded fonts?15:06.25 
nemo kens: so the #20 part is no good? just use spaces ?15:06.26 
kens chrisl I'm not at all certain, but I believe not15:06.41 
  Based on my last testing15:06.46 
nemo I also wanna see if gs can do a better job than pdfseparate15:06.54 
  pdfseparate did an awful job on page #2 which was an index. invalid references *and* a file that was same size as the entire doc15:07.14 
Robin_Watts_ nemo: IF you want to extract pages from a document, use mutool clean15:08.27 
nemo m'k15:08.39 
nemo fires up that man page15:08.46 
  mutool clean didn't much fix up the messed up page from pdfseparate15:09.52 
  let's see if I can get it to do a better split too15:10.00 
  Robin_Watts_: I wanted to also try removing fonts, someone earlier had recommended using mutools for that too15:10.15 
chrisl Removing fonts is a *really* bad idea15:10.41 
nemo Robin_Watts_: but the results didn't seem great and couldn't find the pdfclean they'd recommended15:10.46 
  chrisl: it might be. I wanted to see if it mattered15:10.53 
kens Be advised, if you remove a subset font from a PDF file there is an axcellent probablility that the resulting file will display as gibberish15:10.53 
Robin_Watts_ nemo: pdfclean is now mutool clean15:11.08 
nemo kens: oh... I was kinda hoping the glyph values were nice standard unicode codepoints or something15:11.36 
Robin_Watts_ mutool clean -ggg in.pdf out.pdf 1-1015:11.36 
nemo shoot15:11.39 
kens nemo no absolutely not the case15:11.47 
Robin_Watts_ will give you the first 10 pages of in.pdf as out.pdf15:11.58 
  nemo: Anything you might "hope" for with text in PDF files, you do not get.15:12.11 
nemo kens: it was basically just to see if I could save on parsing the internal font in PDF.js when the page was nothing but plain text15:12.16 
  7bit ascii even15:12.23 
  Robin_Watts_: yeah. tried it again on the pdfseparate bad page w/ no improvement in size15:12.50 
  let's see if gs can do something15:12.54 
kens Why would you expect any ?15:13.14 
nemo ah. gs did much better15:13.40 
  $ ls -l 2.pdf 2_*.pdf15:14.07 
  -rw-rw-r-- 1 nemo nemo 74062 Apr 26 11:13 2_gs.pdf15:14.08 
  -rw-rw-r-- 1 nemo nemo 3770164 Apr 26 11:11 2_mutools.pdf15:14.08 
  -rw-rw-r-- 1 nemo nemo 3712132 Apr 26 10:59 2.pdf15:14.08 
nemo uploads the gs one15:14.16 
kens THat kind of reductoin in size suggests a problem of some kind15:14.38 
nemo yeah, problem was what I was trying to fix ☺15:43.40 
  just mutools clean wasn't fixing it15:43.54 
tor8 nemo: did you run *both* the killfont.js script and mutool clean to get that 2_mutools.pdf file?15:48.12 
nemo tor8: nope. just clean15:48.34 
  tor8: the font thing is a separate issue15:48.39 
  tor8: was looking into it aside from this one pathological slide15:48.50 
  pdfs$ gs -sDEVICE=pdfwrite -o 2d.pdf -f 2.pdf15:49.07 
  was what I ran15:49.11 
  (then renamed to make name clearer ☺ )15:49.17 
  **** Warning: Link annotation points out of the document page range.15:49.24 
  11 of those15:49.48 
  the 2nd page was an index page and I think pdfseparate tried preserving alll the other pages it was referencing thus the gigantic size15:50.10 
  even tho only 1 page pdf15:50.13 
tor8 nemo: so, 'mutool clean' only rewrites the same file; it doesn't change the contents.15:50.25 
nemo ah15:50.28 
  tor8: well. rewriting by ditching invalid stuff seems a good rewrite ☺15:50.38 
  anyway, fair 'nuff. 15:50.47 
tor8 whereas gs creates a new pdf file from scratch using the graphics drawing operations from the source15:50.49 
nemo tor8: yeah, the nice thing about gs over what I'd tried previously was it preserved text15:51.09 
  as opposed to ps2pdf or pdf prints that I'd tried to strip the garbage15:51.22 
  anyway. is basically fine now. I'd like to try the font thing, but you guys scared me off that 15:51.54 
  will hang on to it for another time15:51.59 
kens The Link annotation warnings are because the Link annotations point to a page that isn't in the document. FOr example its a 1 page PDF and the annotaiotn points to page 215:54.38 
  You'll get 1 warning for each of those15:54.52 
nemo kens: yeah. I figured15:57.10 
kens I'm still suspicous about a 50:1 reduction in size though15:57.40 
  Note that GS+pdfwrite is quite capable of 'bursting' a PDF all by itself, just put %d in the OutputFile. But be aware (as I've mentioned before) that ths is not a simple decomposition of the file, its a full reinterpretation of each page.15:58.45 
nemo kens: yeah. just that pdfseparate is much much much easier to use ☺16:01.23 
  I only was looking at gs due to wanting to see if stripping that font won me anything on performance16:01.36 
  and so long as it rendered roughly same, a new version of page... whatever16:01.48 
  but since I don't even know how to invoke the font strip based on that weird character thing...16:02.07 
  wish gs could glob that strip16:02.11 
kens Its almost inconceivable that it woul benefit performance at all, since in the absence of an embedded font a consumer will have to use a default to try and match it16:02.14 
  I did say, use the cvn operator16:02.30 
nemo kens: I'm not sure this embedded font is being used anyway16:02.34 
  kens: yeah. had no idea what you meant so filed that away for more manual reading16:02.42 
kens Make the name a string instead of a name and then apply cvn16:02.45 
nemo but since it seemed possibly harmless16:02.47 
  *harmful16:03.02 
  what's cvn16:03.03 
kens If the font is not used then running thhe original through pdfwrite will remove it, we only embed fonts if they are used16:03.05 
nemo oh. hm16:03.12 
nemo looks at page 2 then16:03.15 
kens cvn = convert to name its a PostScript operator16:03.17 
nemo ah. yeh. totally clueless as to pdf/ps/ttf internal scripting16:03.34 
kens (Ths is a name) cvn will turn a string containing spaces into a name containing spaces16:03.46 
nemo so the #20 is a space. what about the + ?16:04.01 
kens Its not fonts, its PostScript whcih is a language in its own right, nothing to do with fonts16:04.04 
  What about hte '+' ?16:04.12 
nemo kens: my understanding was the TTF langauge was derived from PS16:04.18 
  kens: does that need escaping too16:04.26 
kens You can't use space because that's a token separator in PostScript, any non-separting character is fine16:04.35 
nemo 11:06 < nemo> gs -c "<</NeverEmbed [/ABCDEE+Century#20Gothic,Bold]>> setdistillerparams -f" input.pdf 16:04.53 
  the + in, well, urls, would be a space as would %2016:05.03 
kens nemo I'm afaid there is no TTF 'language' and TrueType is quite defintely not derived form PostScript16:05.03 
nemo so was just wondering16:05.05 
kens It isn't in PostScript16:05.18 
  Note that the initial '/' introdcues a name16:05.36 
nemo https://en.wikipedia.org/wiki/TrueType#Hinting_language16:05.41 
  was referring to this language16:05.45 
  thought it was derived from postscript's language16:05.51 
  would have to check history16:05.54 
kens OK first that isn't a language16:05.54 
nemo ??16:06.01 
  the hinting stuff is totally a language16:06.09 
kens Second TrueType hinting is radically different from PostScript type 1 font hinting16:06.10 
  TT hinting is not a complete language16:06.23 
  Its very very limited16:06.30 
nemo is limited, yes, but it is turing complete 16:06.57 
kens Its been a while since I looked at it, so I'm not certain.16:07.43 
  However, it is absolutely no way anythgin to do with PostScript16:07.57 
nemo it's one of the objections to putting TTF on web, that it's hard to sanitise, besides tools not having developed to parse remote possibly malicious font input16:08.11 
chrisl byte code isn't something I think of as a "language"16:08.11 
kens It almost is, if it could have any kind of I/O which it can't16:08.30 
nemo kens: could be. wasn't too familiar, I might have read somewhere that they were both similar in design and jumped to conclusions16:08.34 
kens Not even similar in design16:08.43 
nemo both stack based says one site16:08.49 
  *shrug*16:08.51 
  that's not a huge similarity ☺16:08.56 
  but yeah, I don't know either language16:09.03 
kens Being stack based hardly makes them the same, or based one off another16:09.06 
nemo kens: and fonts don't need IO to introduce vulnerabilities16:09.16 
  just need a flaw in the VM16:09.19 
  kens: didn't say that, no...16:09.32 
kens No, I meant the hinting language has no I/O capability16:09.35 
nemo kens: I know what you meant16:09.42 
kens SO its not really a functionally useful language, even though you can write a Turing machine16:09.53 
nemo kens: well, you could, I guess, harness your site's users to perform computation by polling glyphs generated ☺16:10.17 
  god knows why16:10.21 
  kens: but vulnerabilities was a bit more worrying16:10.27 
chrisl If that prevents putting TTFs on the web, it's hard to see how you can put any scalable fonts on the web16:10.30 
kens Anyway, the entire philosophy behind PostScript and TrueType 'hinting' is totally different16:10.40 
nemo chrisl: well, it was also more the origins16:10.52 
  chrisl: https://hackademix.net/2010/03/24/why-noscript-blocks-web-fonts/16:11.08 
  chrisl: lot of time has been spent examining parsing/rendering of html/css/svg16:11.20 
  less of ttf16:11.23 
  chrisl: in fact, browsers do strip remote fonts as much as possible.16:11.34 
  IE might do this less, which could explain why their "secure" mode blocks web fonts16:11.46 
kens No offence, but we don't really care much about browsers here16:11.56 
nemo that and the (unrelated to hinting) vulnerabilities in their kernel font parsing16:11.59 
chrisl nemo: much more sensible to just disable the hinting, then16:12.00 
nemo kens: I was just responding to chris is all16:12.16 
  chrisl: yeah, I imagine16:12.48 
  chrisl: not that that prevents all vulnerabilities16:12.54 
  chrisl: presumably HDPI monitors will obsolete the hinting anyway16:13.40 
kens No16:13.51 
nemo oh?16:14.00 
  shoot. that one I was hoping for16:14.04 
kens There are fonts which use 'hinting' for special effects in TrueType and do not render at all correctly unless you run the 'hints'16:14.24 
nemo ugh16:14.32 
  example?16:14.40 
kens Can't remember16:14.46 
nemo only "effect" I know of is ligature fanciness which doesn't require hinting16:14.58 
chrisl nemo: look in the freetype sources for "tricky" fonts16:15.02 
nemo but I guess breaking some fonts abusing the hinting would be a small price to pay 😝16:15.11 
chrisl nemo: years ago I had to debug a TTF font that put all the glyphs points at (0,0), and then used the "hinting" byte code to move them to make the real outlines16:16.15 
nemo chrisl: heh.16:16.41 
  chrisl: and then computered mandelbrot no wait16:16.47 
  *computed16:16.50 
  but wild16:16.51 
  chrisl: wonder if that often broke rendering16:17.04 
chrisl nemo: probably16:17.46 
fredross-perry With some periodicity, I am getting “ChanServ: [#ghostscript]” messages. Any way to opt out of those? 20:21.30 
 Forward 1 day (to 2016/04/27)>>> 
ghostscript.com
Search: