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)

    Well I am certainly glad I saw Arrival so that I get the wug joke in http://languagelog.ldc.upenn.edu/nll/?p=29480#more-29480

  • (no subject)

    Saw "Arrival". It did have some nontrivial linguistics content, but it still felt kind of wrapped up in a discernible layer of Hollywood Woo. The…

  • (no subject)

    Had some dinner at Aliada with akiva and sasha and K, and afterwards saw Herzog's "Aguirre, the Wrath of God" in Socrates park. Enjoyably bleak.

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded