| <<<Back 1 day (to 2019/10/14) | Fwd 1 day (to 2019/10/16) >>> | 20191015 |
twb | Can you guys remind me, what is the difference between type1 and type1c fonts? | 01:22.02 |
| I tried asking wikipedia but it wouldn't tell me. My memory is type1c are the crap freeware ones that don't have hinting | 01:22.27 |
sebras | twb: if you wait around until european business hours tomorrow there is a greate chance that someone will be around to answer. :) | 03:08.12 |
twb | right | 03:08.39 |
| thanks | 03:08.42 |
| Europe/Berlin Tue Oct 15 05:08:55 2019 CEST | 03:09.02 |
| ...I should be around for another 4 hours I guess | 03:09.10 |
ray_laptop | twb: chrisl or kens are our font experts, but as far as I know, Type 1 and Type 1C support the same functionality. The "C" stands for "compact" which means that the CharStrings which describe the outline are not encoded, nor printable hex. Neither supports TrueType method of hinting. | 03:50.06 |
ray_laptop | waits for chrisl and kens to clarify/correct me :-) | 03:50.24 |
twb | Hrm maybe I'm thinking of type3 or something | 03:53.50 |
| like 3 decades ago, PostScript had fonts in "crap free version" and "good expensive version" | 03:54.10 |
ray_laptop | twb: there are "stem" hints and some "link" hints that are in the T1 font, so it isn't totally devoid, but it is more limited than TrueType | 04:35.41 |
twb | oh yeah sorry I got distracted by work | 04:36.16 |
| the original question is why does pdflatex generate a 1.5 PDF with type1 fonts and 50MB, but running ps2pdfwr on it generates a 1.7 PDF with type1c fonts and only 5MB | 04:36.53 |
ray_laptop | and I'm not sure what FreeType does with the "hints" -- ISTR that we default to their autohinting, but, as I said, chrisl is probably "The Man" about this | 04:36.54 |
twb | Can I do something in my .tex or .sty to make it generate the 5MB file right away? | 04:37.14 |
| I don't know if the type1/type1c different is actually significant | 04:37.43 |
ray_laptop | oh, don't ask us about latex. mvhrel or maybe Robin_Watts may play with latex | 04:37.57 |
twb | yeah granted | 04:38.19 |
ray_laptop | but I seriously doubt T1 vs T1C makes a difference | 04:38.24 |
twb | righto | 04:38.28 |
ray_laptop | as far as the size -- pdflatex may be generating "image" PDF's, not high-level PDF's as ps2pdfwr does | 04:39.35 |
| there is a lot of Font handling in pdfwrite (used by ps2pdfwr). kens is our pdfwrite expert | 04:40.27 |
twb | note that gs is starting from the pdflatex output | 04:40.38 |
ray_laptop | we make every effort to embed subset, high level fonts, rather than bitmaps for fonts | 04:41.01 |
twb | so e.g. if pdflatex was converting fonts to paths, gs would have to undo that | 04:41.01 |
| pdffonts indicates both are using emb subsets | 04:41.14 |
ray_laptop | we wouldn't undo paths, but there may be stuff in the PS that pdflatex puts in to handle PS engines that don't have fonts (PS can check if a font is found, and implement a workaround if not) | 04:42.18 |
| I assumed that pdflatex was emitting a PDF directly (not PS) | 04:42.39 |
| 'cause I don't mess with latex | 04:42.52 |
twb | Right, I was trying to make that clear because the name "ps2pdf" is a bit misleading :-) | 04:43.09 |
ray_laptop | but as I said, mvrhel or Robin_Watts may know more | 04:43.20 |
| ps2pdf can take PDF _or_ PS input | 04:43.35 |
| it doesn't care | 04:43.48 |
twb | Understood | 04:43.56 |
ray_laptop | but if pdflatex is emitting PS -- that seems misleading | 04:44.07 |
twb | It isn't | 04:44.12 |
ray_laptop | how so? | 04:44.23 |
twb | pdflatex is emitting a PDF | 04:44.30 |
| Sorry - I'm not trying to be confusing! | 04:44.47 |
ray_laptop | oh, so you are re-processing the PDF that comes from pdflatex through ps2pdf -- got it | 04:45.14 |
twb | right | 04:45.20 |
| http://ix.io/1YH5 is what I'm seeing | 04:45.59 |
ray_laptop | to see what the different size comes from, you'd have to analyze the two PDF's -- it may just be image downsampling or something that ps2pdf is doing | 04:46.28 |
twb | $boss says the after PDFs don't have clickable cross-references inside the document. The sidebar/metadata ToC is still working. | 04:47.20 |
| Is there an easy way to "diff" the PDFs, or are you suggesting I just use pdfimages and compare the resulting JPEGs? | 04:47.44 |
ray_laptop | all of the default settings for that kind of thing are in out docs: https://www.ghostscript.com/doc/current/VectorDevices.htm#PDFWRITE | 04:47.53 |
| s/out docs/our docs/ | 04:48.08 |
twb | There ARE a lot of screenshots in that document, so if it's doing lossless TIFF -> lossy JPEG, that would explain this difference completely | 04:48.36 |
| ray_laptop: thanks | 04:48.45 |
ray_laptop | you can force lossless (Flate) compression for images | 04:49.01 |
| not sure what clickable cross-references are -- we try to preserve Link annotations | 04:49.51 |
twb | Oh and I just realized pdfinfo/pdffonts/pdfiamges is poppler, not gs | 04:49.54 |
| ray_laptop: like on page 4 of the PDF is a ToC, and you can click on the ToC and it'll take you to pay 12 or 24 or whatever | 04:50.17 |
ray_laptop | twb: well pdfinfo should be pretty agnostic | 04:50.21 |
twb | http://ix.io/1YH7 pdfimages comparison | 04:50.53 |
| Definitely smalelr, e.g. 122K -> 29.5K | 04:51.41 |
| Ah and "enc" changes from "image" to "jpeg" | 04:51.55 |
ray_laptop | like I said -- we _try_ to preserve Link stuff, but it gets pretty "munged" in Ghostscript reading the PDF and invoking its pdfwrite device code -- annotations and stuff go through pdfmark nonsense | 04:52.14 |
| you may need an option like -dPreserveAnnots=true | 04:53.04 |
| twb: from the doc mentioned above: There are a few annotation types which are not preserved, most notably Link and Widget annotations. However, should you wish to revert to the old behaviour, or find that the new behaviour leads to problems, you can set this switch to false which will cause all annotations to be inserted into the page content stream, instead of preserved as annotations. | 04:54.19 |
| not sure if that helps | 04:54.41 |
| because I would have thought "true" would be what you need, but the docs say false. ask kens | 04:55.16 |
| twb: it's midnight here -- pumpkin time. g'nite... | 04:57.57 |
twb | thanks for your help! | 04:58.29 |
| "ps2pdfwr -dCompatibilityLevel=2.0 -dPreserveAnnots=false before.pdf after20.pdf && xpdf after20.pdf" did not seem to change the cross-references (in xpdf) | 04:58.55 |
| i.e. ps2pdfwr is still stripping them out | 04:59.06 |
kens | twb (possibly for the logs) The difference between type 1 an d type1C fonts is purely representational. The font technology is the same. Type1C fotns are CFF (Compact Font Format), the way the font is stored is different (and smaller) but hte actual font data is the same as a type 1 font. Your memory I thin is the difference between type 1 and type 3 fonts. Type 3 fonts are unhinted and large, since they are written in PostScript | 07:02.29 |
twb | kens: cool thanks | 07:02.56 |
kens | The pdfwrite device chooses which filter to use for images by writing several possible results using differen ce encoding filters, and choosing the one which is smallest, when /AutoFilterImages is true (the default) | 07:03.20 |
| So most images end up DCT encoded (JPEG) | 07:03.36 |
| You can select a specific filter by changing the distiller params | 07:03.47 |
| As ray said last night, Link annotations are preserved, so I'd need to see an example of your problem there. | 07:04.16 |
| Possibly your file uses some other annotation with an /Action | 07:04.29 |
twb | sure on sec | 07:04.33 |
| http://cyber.com.au/~twb/tmp/after20.pdf | 07:05.05 |
| http://cyber.com.au/~twb/tmp/after17.pdf | 07:05.07 |
| http://cyber.com.au/~twb/tmp/after.pdf | 07:05.09 |
| http://cyber.com.au/~twb/tmp/before.pdf | 07:05.11 |
| the server's uplink is slow, so it'll take a while | 07:05.21 |
kens | OK give me a minute | 07:05.27 |
twb | no rush | 07:06.00 |
kens | May be several minutes, it really is taking a long time to download | 07:06.19 |
twb | I got my important answer: to make the PDF smaller, convince pdflatex to use JPEGs | 07:06.29 |
kens | Well, as long as you can live with the quality :-) | 07:06.48 |
twb | kens: welcome to australia | 07:06.50 |
| it's annex M, so uplink is twice normal for australia | 07:07.12 |
kens | Yeah, I've seen the reports form the Australian correspondents in teh rgister | 07:07.16 |
twb | should be around 2Mbit/s unless it's raining | 07:07.36 |
kens | Hmm, you're not up North are you ? Proper rain there | 07:08.02 |
twb | nope | 07:08.09 |
kens | Well even Sydney rain was pretty spectacular by our standards | 07:08.28 |
| twb this document says its confidential, and this is a public channel, is that OK ? You will pull these agin ? | 07:11.06 |
twb | pulled | 07:12.52 |
kens | Err, not good, I still hadn't finished them. | 07:13.06 |
twb | 99% sure it's OK for you to look at them, but no need to leave them there | 07:13.08 |
| haha | 07:13.10 |
kens | well, 'after.pdf' at least is still downloading | 07:13.29 |
| So is 'before.pdf' so they may be cached or something | 07:13.53 |
twb | it's just crappy apache2 public_html, so I doubt it | 07:14.16 |
kens | well after.pdf finished | 07:14.29 |
| So did before.pdf now | 07:14.46 |
chrisl | Unix file systems won't completely remove an open file until it's no longer open | 07:14.48 |
kens | So can you give me a clue where to look in these 91 pages ? | 07:15.03 |
twb | OK, I uploaded some much smaller ones to before.pdf and after.pdf | 07:15.41 |
| The cross-references are in the ToC in both cases | 07:15.51 |
kens | Smaller is better, easier to look at | 07:15.59 |
twb | if you hover your mouse over them, you should be able to click on the ToC entry and have it take you to the relevant page in the PDF | 07:16.20 |
| xpdf calls this "[internal link]", I have no idea what it is in PDF language | 07:16.51 |
kens | I'm not sure what you mean by ToC, do you mean the bookmarks ? ie the 'dolor est' ? | 07:17.55 |
twb | kens: under "Contents" is "1 dolor est ......... 1" | 07:18.18 |
| That's saying the first chapter, named "dolor est", is on page 1 | 07:18.32 |
kens | Yes.... | 07:18.39 |
twb | It's a bit *too* minimal, because there only is one page there, but you should be able to hover over it and have the mouse pointer change | 07:18.53 |
kens | OK I think I see the link you mean, its in the content of page 1 | 07:19.08 |
twb | yeah. sorry it's not more obvious | 07:19.26 |
kens | Ah, I bet I know what this is | 07:19.33 |
twb | difference between before.pdf (pdflatex) and after.pdf (pdflatex->ps2pdfwr) is observable inxpdf and evince, at least | 07:19.46 |
kens | You need to set -dPrinted=false on the Ghostscript command line | 07:19.47 |
twb | Ohhhhhh | 07:19.59 |
| confirmed | 07:20.14 |
kens | the default is 'true' and that means 'treat as a printed document. | 07:20.15 |
| Its the PDF itnerpreter that needs to know | 07:20.26 |
| It can only (currently) handle annotations as if they were pritned *or* as if they are not printed (eg a screen reader) | 07:20.47 |
| It can't do both | 07:20.57 |
| One day I mean to do something about that | 07:21.10 |
twb | how do the annotations work if its printed? | 07:21.53 |
| like... you can't click on paper | 07:22.00 |
kens | Well not all annotations are interactive | 07:22.06 |
| But yes, that's why 'link' annotations don't come through when the setting is for Print | 07:22.24 |
| But thinkgs like square, line, squiggle etc can be pritned | 07:22.38 |
twb | they could be like inserting † for a footnote? | 07:22.42 |
kens | Also there's a Print flag in the annotations that says whether this annotation should be sent to a printer or not | 07:22.55 |
| There are also Stamp annotations for things like 'Draft' and such | 07:23.16 |
| Some make sense on print, some make sense on an interactive application, some are good for both | 07:23.39 |
| That's why the PDF interpreter has to know what the target is | 07:23.52 |
twb | yeah OK | 07:24.25 |
kens | It removes ones which maie no sense (like Link for a printer) and checks the /Print flag to see if it should print the annotaiton or not depending on whether its been told the destination is a printer or another type of device | 07:24.33 |
| As I say, one day I'd like to update it so it can be told to handle both for special cases like the PDF outptu device | 07:25.04 |
twb | so like you could have a print-only annotation that write "STOLEN FROM BOSTON LIBRARY" across the page | 07:25.05 |
| And it wouldn't show up in acroread but would on paper | 07:25.15 |
kens | Yes, that wouold be possible (never thought of that) | 07:25.19 |
| Its not exactly secure, because someone who knows what they are doing could defeat it easily, but its an interesting idea | 07:25.51 |
twb | I actually do roughly that inside the cups stack | 07:26.32 |
| except it prints the username, so if the the guards find child porn, it has "PRINTED BY INMATE 1234" watermarked on top | 07:26.58 |
kens | :-) | 07:27.12 |
twb | The judges made me turn it off because they're old and stupid :/ | 07:27.22 |
kens | I'm surprised prisoners are allowed to print anything unsupervised | 07:27.48 |
twb | I think the printer room is locked, but they can print to the printer whenever they want | 07:28.07 |
kens | needs to go do some work now | 07:29.42 |
twb | no worries; thanks | 07:29.52 |
kens | No problem, have a good evening | 07:30.08 |
| <<<Back 1 day (to 2019/10/14) | Forward 1 day (to 2019/10/16)>>> | |