| <<<Back 1 day (to 2016/04/25) | 20160426 |
sebras | kens: morning mr s. | 07:30.50 |
kens | Morning sebras | 07:31.08 |
| Was just answering a questoin on comp.lan.postscript, an amusing incorrect optimisatoin by Distiller | 07:31.47 |
chrisl | I've given up on comp.lang.postscript..... | 07:46.59 |
kens | There's not a lot there mostly | 07:47.09 |
| But that one was kind of interesting | 07: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 thread | 07:47.59 |
| At least in part because there's probably no PostScript operstor I've *never* used | 07:48.18 |
chrisl | The only ones I can think of are the user path operators - I've never used those | 07:48.48 |
kens | I have, but only for investigating a different problem | 07:49.01 |
| ie for debugging | 07:49.15 |
chrisl | I don't think I've ever seen them used in a job | 07:50.03 |
kens | No, almost certainly not. They don't have a lot of real world use | 07: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 fun | 07:52.11 |
chrisl | Well, it takes all sorts, I suppose | 07:53.35 |
squ | android background tile should be placed into ânodpiâ directory to avoid scaling, I guess that is what tile means | 12:33.19 |
| http://imgur.com/a/P5UHU | 12: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 |
| er | 15:04.39 |
| gs -c "<</NeverEmbed [/ABCDEE+Century#20Gothic,Bold]>> setdistillerparams -f" input.pdf output.pdf | 15:04.49 |
| hm. that doesn't look right | 15:04.55 |
nemo | rereads gs manpage | 15:04.59 |
| I find working w/ gs commandline to be kinda unintuitive :/ | 15:05.07 |
kens | Use the HTML help, not man | 15:05.29 |
nemo | yeah. found a working line I'm adapting | 15:05.40 |
kens | And what you have there will not work | 15:05.46 |
| PostScript does not repsect PDF escapes | 15:05.54 |
nemo | gs -c "<</NeverEmbed [/ABCDEE+Century#20Gothic,Bold]>> setdistillerparams -f" input.pdf | 15:06.08 |
| shoot | 15:06.13 |
kens | You will need to use the cvn operator | 15: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 not | 15:06.41 |
| Based on my last testing | 15:06.46 |
nemo | I also wanna see if gs can do a better job than pdfseparate | 15: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 doc | 15:07.14 |
Robin_Watts_ | nemo: IF you want to extract pages from a document, use mutool clean | 15:08.27 |
nemo | m'k | 15:08.39 |
nemo | fires up that man page | 15:08.46 |
| mutool clean didn't much fix up the messed up page from pdfseparate | 15:09.52 |
| let's see if I can get it to do a better split too | 15:10.00 |
| Robin_Watts_: I wanted to also try removing fonts, someone earlier had recommended using mutools for that too | 15:10.15 |
chrisl | Removing fonts is a *really* bad idea | 15:10.41 |
nemo | Robin_Watts_: but the results didn't seem great and couldn't find the pdfclean they'd recommended | 15:10.46 |
| chrisl: it might be. I wanted to see if it mattered | 15: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 gibberish | 15:10.53 |
Robin_Watts_ | nemo: pdfclean is now mutool clean | 15:11.08 |
nemo | kens: oh... I was kinda hoping the glyph values were nice standard unicode codepoints or something | 15:11.36 |
Robin_Watts_ | mutool clean -ggg in.pdf out.pdf 1-10 | 15:11.36 |
nemo | shoot | 15:11.39 |
kens | nemo no absolutely not the case | 15:11.47 |
Robin_Watts_ | will give you the first 10 pages of in.pdf as out.pdf | 15: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 text | 15:12.16 |
| 7bit ascii even | 15:12.23 |
| Robin_Watts_: yeah. tried it again on the pdfseparate bad page w/ no improvement in size | 15:12.50 |
| let's see if gs can do something | 15:12.54 |
kens | Why would you expect any ? | 15:13.14 |
nemo | ah. gs did much better | 15:13.40 |
| $ ls -l 2.pdf 2_*.pdf | 15:14.07 |
| -rw-rw-r-- 1 nemo nemo 74062 Apr 26 11:13 2_gs.pdf | 15:14.08 |
| -rw-rw-r-- 1 nemo nemo 3770164 Apr 26 11:11 2_mutools.pdf | 15:14.08 |
| -rw-rw-r-- 1 nemo nemo 3712132 Apr 26 10:59 2.pdf | 15:14.08 |
nemo | uploads the gs one | 15:14.16 |
kens | THat kind of reductoin in size suggests a problem of some kind | 15:14.38 |
nemo | yeah, problem was what I was trying to fix ⺠| 15:43.40 |
| just mutools clean wasn't fixing it | 15: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 clean | 15:48.34 |
| tor8: the font thing is a separate issue | 15:48.39 |
| tor8: was looking into it aside from this one pathological slide | 15:48.50 |
| pdfs$ gs -sDEVICE=pdfwrite -o 2d.pdf -f 2.pdf | 15:49.07 |
| was what I ran | 15: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 those | 15: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 size | 15:50.10 |
| even tho only 1 page pdf | 15:50.13 |
tor8 | nemo: so, 'mutool clean' only rewrites the same file; it doesn't change the contents. | 15:50.25 |
nemo | ah | 15: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 source | 15:50.49 |
nemo | tor8: yeah, the nice thing about gs over what I'd tried previously was it preserved text | 15:51.09 |
| as opposed to ps2pdf or pdf prints that I'd tried to strip the garbage | 15: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 time | 15: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 2 | 15:54.38 |
| You'll get 1 warning for each of those | 15:54.52 |
nemo | kens: yeah. I figured | 15:57.10 |
kens | I'm still suspicous about a 50:1 reduction in size though | 15: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 performance | 16:01.36 |
| and so long as it rendered roughly same, a new version of page... whatever | 16: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 strip | 16: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 it | 16:02.14 |
| I did say, use the cvn operator | 16:02.30 |
nemo | kens: I'm not sure this embedded font is being used anyway | 16:02.34 |
| kens: yeah. had no idea what you meant so filed that away for more manual reading | 16:02.42 |
kens | Make the name a string instead of a name and then apply cvn | 16:02.45 |
nemo | but since it seemed possibly harmless | 16:02.47 |
| *harmful | 16:03.02 |
| what's cvn | 16: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 used | 16:03.05 |
nemo | oh. hm | 16:03.12 |
nemo | looks at page 2 then | 16:03.15 |
kens | cvn = convert to name its a PostScript operator | 16:03.17 |
nemo | ah. yeh. totally clueless as to pdf/ps/ttf internal scripting | 16:03.34 |
kens | (Ths is a name) cvn will turn a string containing spaces into a name containing spaces | 16: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 fonts | 16:04.04 |
| What about hte '+' ? | 16:04.12 |
nemo | kens: my understanding was the TTF langauge was derived from PS | 16:04.18 |
| kens: does that need escaping too | 16:04.26 |
kens | You can't use space because that's a token separator in PostScript, any non-separting character is fine | 16: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 %20 | 16:05.03 |
kens | nemo I'm afaid there is no TTF 'language' and TrueType is quite defintely not derived form PostScript | 16:05.03 |
nemo | so was just wondering | 16:05.05 |
kens | It isn't in PostScript | 16:05.18 |
| Note that the initial '/' introdcues a name | 16:05.36 |
nemo | https://en.wikipedia.org/wiki/TrueType#Hinting_language | 16:05.41 |
| was referring to this language | 16:05.45 |
| thought it was derived from postscript's language | 16:05.51 |
| would have to check history | 16:05.54 |
kens | OK first that isn't a language | 16:05.54 |
nemo | ?? | 16:06.01 |
| the hinting stuff is totally a language | 16:06.09 |
kens | Second TrueType hinting is radically different from PostScript type 1 font hinting | 16:06.10 |
| TT hinting is not a complete language | 16:06.23 |
| Its very very limited | 16: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 PostScript | 16: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 input | 16: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't | 16: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 conclusions | 16:08.34 |
kens | Not even similar in design | 16:08.43 |
nemo | both stack based says one site | 16:08.49 |
| *shrug* | 16:08.51 |
| that's not a huge similarity ⺠| 16:08.56 |
| but yeah, I don't know either language | 16:09.03 |
kens | Being stack based hardly makes them the same, or based one off another | 16:09.06 |
nemo | kens: and fonts don't need IO to introduce vulnerabilities | 16:09.16 |
| just need a flaw in the VM | 16:09.19 |
| kens: didn't say that, no... | 16:09.32 |
kens | No, I meant the hinting language has no I/O capability | 16:09.35 |
nemo | kens: I know what you meant | 16:09.42 |
kens | SO its not really a functionally useful language, even though you can write a Turing machine | 16: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 why | 16:10.21 |
| kens: but vulnerabilities was a bit more worrying | 16: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 web | 16:10.30 |
kens | Anyway, the entire philosophy behind PostScript and TrueType 'hinting' is totally different | 16:10.40 |
nemo | chrisl: well, it was also more the origins | 16: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/svg | 16:11.20 |
| less of ttf | 16: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 fonts | 16:11.46 |
kens | No offence, but we don't really care much about browsers here | 16:11.56 |
nemo | that and the (unrelated to hinting) vulnerabilities in their kernel font parsing | 16:11.59 |
chrisl | nemo: much more sensible to just disable the hinting, then | 16:12.00 |
nemo | kens: I was just responding to chris is all | 16:12.16 |
| chrisl: yeah, I imagine | 16:12.48 |
| chrisl: not that that prevents all vulnerabilities | 16:12.54 |
| chrisl: presumably HDPI monitors will obsolete the hinting anyway | 16:13.40 |
kens | No | 16:13.51 |
nemo | oh? | 16:14.00 |
| shoot. that one I was hoping for | 16: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 | ugh | 16:14.32 |
| example? | 16:14.40 |
kens | Can't remember | 16:14.46 |
nemo | only "effect" I know of is ligature fanciness which doesn't require hinting | 16:14.58 |
chrisl | nemo: look in the freetype sources for "tricky" fonts | 16: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 outlines | 16:16.15 |
nemo | chrisl: heh. | 16:16.41 |
| chrisl: and then computered mandelbrot no wait | 16:16.47 |
| *computed | 16:16.50 |
| but wild | 16:16.51 |
| chrisl: wonder if that often broke rendering | 16:17.04 |
chrisl | nemo: probably | 16: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)>>> | |