docbook-apps

  • 1.  embedding fonts in generated pdf

    Posted 07-16-2012 14:56
    Hello,

    this is not strictly a DocBook question, but I hope that the question is
    common enough in this community that someone may actually be able to help.

    For an IEEE paper submission I need to embed the used fonts into the
    pdf. I'm using fop, and `pdffonts paper.pdf` reports

    name type emb sub uni object ID
    --------------------- ----------------- --- --- --- ---------
    Helvetica Type 1 no no no 181 0
    Times-Roman Type 1 no no no 182 0
    Times-BoldItalic Type 1 no no no 183 0
    Courier Type 1 no no no 184 0
    Times-Italic Type 1 no no no 185 0
    Times-Bold Type 1 no no no 186 0

    http://www.sagehill.net/docbookxsl/AddFont.html suggests that I need to
    generate a font metrics file for the fonts I'd like to embed. So I'm
    looking for the above fonts on my system (Fedora 17).

    I have found a "urw-fonts" package, apparently containing "...good
    quality versions of the 35 standard PostScript(TM) fonts...". However,
    the font names don't match the above.

    Any suggestion as to how to embed the standard (default) fonts when
    generating pdf from DocBook ?

    Thanks,
    Stefan


    --

    ...ich hab' noch einen Koffer in Berlin...




  • 2.  Re: [docbook-apps] embedding fonts in generated pdf

    Posted 07-16-2012 15:08
    Is this any use on creating the font metrics - from the MML2SVG
    documentation./

    These font metrics files are created with ttfreader tool that
    comes with FOP. To fully support a font, you need to create four XML
    font metrics files with FOP ttfreader.
    The first file, named MyFont.xml, contains the normal style font
    metrics, from MyFont.ttf
    for example. The second font metrics file, named MyFont-Italic.xml,
    contains all metrics information
    about the italic font, from MyFontItalic.ttf for example. The third
    file, called My-
    Font-Bold.xml, contains all information about the bold font, from
    MyFontBol.ttf. And the last
    file, named MyFont-Bold-Italic.xml contains all metrics information
    about the bold italic font,
    from MyFontBolIta.ttf for example.

    On 16-Jul-12 9:55 AM, Stefan Seefeld wrote:
    > Hello,
    >
    > this is not strictly a DocBook question, but I hope that the question is
    > common enough in this community that someone may actually be able to help.
    >
    > For an IEEE paper submission I need to embed the used fonts into the
    > pdf. I'm using fop, and `pdffonts paper.pdf` reports
    >
    > name type emb sub uni object ID
    > --------------------- ----------------- --- --- --- ---------
    > Helvetica Type 1 no no no 181 0
    > Times-Roman Type 1 no no no 182 0
    > Times-BoldItalic Type 1 no no no 183 0
    > Courier Type 1 no no no 184 0
    > Times-Italic Type 1 no no no 185 0
    > Times-Bold Type 1 no no no 186 0
    >
    > http://www.sagehill.net/docbookxsl/AddFont.html suggests that I need to
    > generate a font metrics file for the fonts I'd like to embed. So I'm
    > looking for the above fonts on my system (Fedora 17).
    >
    > I have found a "urw-fonts" package, apparently containing "...good
    > quality versions of the 35 standard PostScript(TM) fonts...". However,
    > the font names don't match the above.
    >
    > Any suggestion as to how to embed the standard (default) fonts when
    > generating pdf from DocBook ?
    >
    > Thanks,
    > Stefan
    >
    >


    --
    ron@catterall.net





  • 3.  Re: [docbook-apps] embedding fonts in generated pdf

    Posted 07-16-2012 16:08
    On 2012-07-16 11:08, Ron Catterall wrote:
    > Is this any use on creating the font metrics - from the MML2SVG
    > documentation./
    >
    > These font metrics files are created with ttfreader tool that
    > comes with FOP.

    Ron,

    thanks for the suggestion. I'm pretty illiterate as far as fonts and
    font management is concerned. FOP is referencing Type 1 fonts, so how
    would embedding TrueType fonts help here ? Don't I need to make sure the
    very Type 1 fonts that are being referenced are embedded ?
    Alternatively, I'd need to tell FOP to use different fonts (and font
    types). But again, I have no idea how to do that.

    Thanks,
    Stefan


    --

    ...ich hab' noch einen Koffer in Berlin...




  • 4.  Re: [docbook-apps] embedding fonts in generated pdf

    Posted 07-16-2012 16:59
    Not as illiterate about fonts as I am. But see Tom's contribution.
    Personally I use the Gentium Plus font and embed subsets as required
    rather than the entire font set. (I need some 'strange' symbols fairly
    regularly.) Gentium Plus is only in regular and italic at present, but
    bold and bold-italic will be with us shortly.
    http://scripts.sil.org/Gentium
    Ron
    On 16-Jul-12 11:07 AM, Stefan Seefeld wrote:
    > On 2012-07-16 11:08, Ron Catterall wrote:
    >> Is this any use on creating the font metrics - from the MML2SVG
    >> documentation./
    >>
    >> These font metrics files are created with ttfreader tool that
    >> comes with FOP.
    > Ron,
    >
    > thanks for the suggestion. I'm pretty illiterate as far as fonts and
    > font management is concerned. FOP is referencing Type 1 fonts, so how
    > would embedding TrueType fonts help here ? Don't I need to make sure the
    > very Type 1 fonts that are being referenced are embedded ?
    > Alternatively, I'd need to tell FOP to use different fonts (and font
    > types). But again, I have no idea how to do that.
    >
    > Thanks,
    > Stefan
    >
    >


    --
    ron@catterall.net





  • 5.  Re: [docbook-apps] embedding fonts in generated pdf

    Posted 07-16-2012 16:26
    Hi Stefan,

    Am Montag, 16. Juli 2012, 10:55:48 schrieb Stefan Seefeld:
    >
    > [...] I hope that the question is
    > common enough in this community that someone may actually be able to help.

    But it's related to DocBook. ;-)


    > For an IEEE paper submission I need to embed the used fonts into the
    > pdf. I'm using fop, and `pdffonts paper.pdf` reports
    >
    > name type emb sub uni object ID
    > --------------------- ----------------- --- --- --- ---------
    > Helvetica Type 1 no no no 181 0
    > Times-Roman Type 1 no no no 182 0
    > Times-BoldItalic Type 1 no no no 183 0
    > Courier Type 1 no no no 184 0
    > Times-Italic Type 1 no no no 185 0
    > Times-Bold Type 1 no no no 186 0
    >
    > http://www.sagehill.net/docbookxsl/AddFont.html suggests that I need to
    > generate a font metrics file for the fonts I'd like to embed. So I'm
    > looking for the above fonts on my system (Fedora 17).

    I don't think you need the font metric files anymore. FOP can automatically
    detect any font, see [1]. You just need to tell FOP what directory it needs to
    be searched:

    <renderers>
    <renderer mime="application/pdf">
    <fonts>

    <directory>/usr/share/fonts/truetype</directory>


    <auto-detect/>
    </fonts>
    </renderer>
    </renderers>


    > Any suggestion as to how to embed the standard (default) fonts when
    > generating pdf from DocBook ?

    Does it really need to be the "standard" fonts? There are so many fonts out
    there that are more legible and aesthetically more pleasant than these boring
    "standard" fonts.

    I've collected a small, but incomplete list in my book's project[2].
    Unfortunately, the topic isn't finished yet and contains some FIXMEs and TBDs.
    :) Maybe you find some fonts which is for your needs.

    If you have found some, make sure to set the font parameters in [3]. Set at
    least body.font.family, sans.font.family, and monospace.font.family.


    Have fun!


    ------ References
    [1] http://xmlgraphics.apache.org/fop/trunk/fonts.html
    [2] http://doccookbook.sf.net/html/en/dbc.common.fonts.html
    [3] http://docbook.sourceforge.net/release/xsl/current/doc/fo/fonts.html

    --
    Gruß/Regards
    Thomas Schraitle