Jason (jcreed) wrote,
Jason
jcreed

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
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 5 comments