Jason (jcreed) wrote,

Man, I might as well be using test tubes and caustic acids, this is so much an experimental science.

New data: xpdf chokes on the pdf file I generate if it refers to an external TTF file, but likes it just fine if the font is embedded. Hitting the pdf with embedded font with the function (pdf2ps o ps2pdf) produces a pdf file that all three viewers display correctly... but it turns the embedded font into pure graphics commands. Not likely to be very compact if there is a lot of text. However! The function (pdf2ps o pstopdf) — note the subtle difference that I am using xpdf's pstopdf (with a "to") instead of ghostscript's ps2pdf (with a "2") — leaves embedded fonts intact through the round trip, and what I get is a pdf that even acrobat displays right. Now I probably just have to understand the diff between that pdf and the one I output to figure out what I'm doing wrong.


Got it! I was omitting the "Length1" field. Because of course, when you look at the documentation for a "Stream Object Dictionary" and it lists all the possible keys that might appear in said dictionary, that list is a lie. In fact, buried in the documentation on embedding fonts, it says "oh, by the way, here are some more required keys for the special case of when your stream object happens to be an embedded font."
Tags: fonts, pdf, programming

  • (no subject)

    Some further progress cleaning up the https://xkcd.com/1360/ -esque augean stables that is my hard drive. Tomato chicken I made a couple days ago…

  • (no subject)

    Did some personal archaeology. Helped a little with laundry. Threw some chicken, onions, tomato, stock, peppers in the slow cooker and hopefully…

  • (no subject)

    Dinner with akiva and dannel at nuevo portal in carroll gardens. Ate a pile of chicken stew and rice and beans and maduros, good times. I do miss…

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded