in reply to PDF::Create Fonts

Thing is that there are a certain number of base fonts, which don't need to be embedded in the PDF file, because they can be assumed to be available everywhere, with any viewer or printer. Helvetica is one of them. The reason that PDF::Create doesn't support non-base fonts is simply that it doesn't have the code to embed them... Embedding a font would mean creating the appropriate PDF objects that hold the font description, its glyphs, character widths, etc., so it can be referenced from other places in the document.

Unfortunately, this is just a tad too involved for a quick patch to PDF::Create, although in theory it could be done, of course.  OTOH, before doing so, I'd evaluate whether it's worth it. Maybe the overall task can be solved more easily using an alternative PDF module which does provide font embedding capabilities.  Also, do you absolutely need that specific font?

(BTW, "Sans Serif" usually isn't an actual font name, but rather the name of a font family, to which Helvetica belongs, for example...)

Replies are listed 'Best First'.
Re^2: PDF::Create Fonts
by bradcathey (Prior) on Apr 10, 2009 at 22:43 UTC
    (BTW, "Sans Serif" usually isn't an actual font name, but rather the name of a font family, to which Helvetica belongs, for example...)

    Good point about "sans-serif", however, typographically speaking, Helvetica is not the "font," but the "face." The typeface is the name of the family, e.g., Helvetica, Georgia, Arial; but the font is the attribute, or variation of a particular typeface, e.g., bold, condensed, italic.

    —Brad
    "The important work of moving the world forward does not wait to be done by perfect men." George Eliot
      Helvetica is not the "font," but the "face."

      I know what you mean... but in the case of Helvetica, it's actually both a face and a font name, because the "regular" version is simply named Helvetica, not Helvetica-Regular (as is the naming convention with some other faces). More precisely, the four Helvetica variants included in the "Base 14" font set (defined by Adobe) are named:

      Helvetica
      Helvetica-Bold
      Helvetica-BoldOblique
      Helvetica-Oblique

      Anyhow, all I wanted to point out is that the term "sans serif" merely refers to the family of typefaces having "no serifs"...

        Points well taken. And you are right. Sorry, I didn't mean to a.r. about it, it's just that as a graphic designer by trade, I have to put in my two cents.

        —Brad
        "The important work of moving the world forward does not wait to be done by perfect men." George Eliot
Re^2: PDF::Create Fonts
by Porculus (Hermit) on Apr 10, 2009 at 23:39 UTC
    The reason that PDF::Create doesn't support non-base fonts is simply that it doesn't have the code to embed them...

    But there's no requirement that non-base fonts be embedded, is there? Surely you can specify any font you like, and if it's not available, your PDF reader will simply substitute something else. This would be perfectly adequate for many purposes -- particularly when PDFs are going to be used within a corporate network where it's known which fonts will be available, or where the desired font is an extremely common one that's overwhelmingly likely to be available (e.g. one of the Microsoft web fonts).

    It's also what Adobe Acrobat itself does rather readily when creating PDFs, if the number of documents I get to read in glorious Adobe Serif is anything to go by ... ;)

      But there's no requirement that non-base fonts be embedded, is there?

      Yes and no.  For one, there's substitution by name, e.g. Arial <-> Helvetica, etc. However, unless their visual appearance, and in particular the individual character widths are quite similar, the results may be poor.

      Then, there's font emulation. For example, Adobe Reader comes with two Multiple Master fonts (Adobe Sans, Adobe Serif), which are used to emulate fonts whose glyphs aren't available. However, as the technique essentially uses linear interpolation (without any info about the original font except basic data like character widths, boldness, slant, etc.), it's never really the typeface originally intended, although the results can look pretty decent.  Moreover, in order to get decent results with this technique, at least the font description and the character widths for the non-base font would have to be embedded, which PDF::Create doesn't do either...

      In short, if you want precise results, there's no way around embedding the font including the appropriate glyph subset.

      Other than those technical details, I was under the impression the OP wanted a very specific font. If s/he had been happy with some substitute for whatever sans-serif font, s/he might just as well have left Helvetica as it was (which already is sans-serif). But maybe I've misread the intentions...